*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    min-height: 100vh;
    overflow: hidden;
    background: #0f172a;
}

/* ── Background ── */
.login-bg {
    position: fixed; inset: 0; z-index: 0;
}
.login-bg::before {
    content: ""; position: absolute; inset: -20px;
    background-image: url("../img/bg_login.jpg");
    background-size: cover; background-position: center;
    filter: blur(6px) brightness(0.5); transform: scale(1.05);
}
.login-bg::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(15,23,42,0.7) 0%, rgba(30,58,138,0.5) 50%, rgba(127,29,29,0.4) 100%);
}

/* ── Floating particles ── */
.particles {
    position: fixed; inset: 0; z-index: 1; pointer-events: none; overflow: hidden;
}
.particle {
    position: absolute; border-radius: 50%;
    background: rgba(255,255,255,0.06);
    animation: float linear infinite;
}
@keyframes float {
    0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-10vh) rotate(720deg); opacity: 0; }
}

/* ── Layout ── */
.login-container {
    position: relative; z-index: 2;
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    padding: 20px;
}

.login-wrapper {
    display: flex; width: min(920px, 95vw); min-height: 520px;
    border-radius: 20px; overflow: hidden;
    box-shadow: 0 25px 60px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.08);
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Left Panel — Brand ── */
.brand-panel {
    flex: 0 0 380px; position: relative;
    background: linear-gradient(160deg, #1e3a8a 0%, #1e40af 40%, #991b1b 100%);
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    padding: 40px 36px; text-align: center; overflow: hidden;
}
.brand-panel::before {
    content: ""; position: absolute; inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0L60 30L30 60L0 30Z' fill='rgba(255,255,255,0.03)'/%3E%3C/svg%3E");
    background-size: 60px 60px;
}
.brand-panel::after {
    content: ""; position: absolute; top: -40%; right: -30%;
    width: 300px; height: 300px; border-radius: 50%;
    background: rgba(255,255,255,0.04);
}
.brand-logo {
    width: 90px; height: 90px; border-radius: 20px;
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(12px);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 24px; position: relative;
    border: 1px solid rgba(255,255,255,0.15);
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    animation: logoPulse 3s ease-in-out infinite;
}
@keyframes logoPulse {
    0%, 100% { box-shadow: 0 8px 32px rgba(0,0,0,0.2); }
    50% { box-shadow: 0 8px 32px rgba(0,0,0,0.2), 0 0 24px rgba(255,255,255,0.1); }
}
.brand-logo img { width: 58px; height: auto; filter: brightness(1.1) drop-shadow(0 2px 4px rgba(0,0,0,0.2)); }

.brand-title {
    font-size: 2rem; font-weight: 800; color: #fff;
    letter-spacing: 3px; margin-bottom: 6px; position: relative;
}
.brand-subtitle {
    font-size: 0.82rem; color: rgba(255,255,255,0.75);
    font-weight: 400; line-height: 1.6; max-width: 260px; position: relative;
}
.brand-divider {
    width: 48px; height: 3px; border-radius: 4px;
    background: linear-gradient(90deg, rgba(255,255,255,0.6), rgba(255,255,255,0.1));
    margin: 18px auto;
}
.brand-tagline {
    font-size: 0.72rem; color: rgba(255,255,255,0.45);
    font-weight: 300; letter-spacing: 2px; text-transform: uppercase;
    position: relative; margin-top: 4px;
}

/* Blood drop decoration */
.blood-drops {
    position: absolute; bottom: 30px; left: 50%;
    transform: translateX(-50%); display: flex; gap: 6px;
}
.blood-drop {
    width: 6px; height: 6px; border-radius: 50%;
    background: rgba(239,68,68,0.5);
    animation: dropPulse 2s ease-in-out infinite;
}
.blood-drop:nth-child(2) { animation-delay: 0.3s; background: rgba(239,68,68,0.35); }
.blood-drop:nth-child(3) { animation-delay: 0.6s; background: rgba(239,68,68,0.2); }
@keyframes dropPulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.5); opacity: 1; }
}

/* ── Right Panel — Form ── */
.form-panel {
    flex: 1; background: #fff;
    display: flex; flex-direction: column; justify-content: center;
    padding: 48px 44px;
}

.form-greeting {
    font-size: 1.4rem; font-weight: 700; color: #0f172a;
    margin-bottom: 4px;
}
.form-greeting-sub {
    font-size: 0.85rem; color: #64748b; margin-bottom: 28px; font-weight: 400;
}

/* Alert */
.alert-login {
    border: none; border-radius: 10px; font-size: 0.8rem;
    padding: 10px 14px; margin-bottom: 16px;
    background: #fef2f2; color: #991b1b;
    border-left: 3px solid #ef4444;
}

/* Input Group */
.input-group-login { margin-bottom: 18px; }
.input-group-login label {
    display: block; font-size: 0.78rem; font-weight: 600;
    color: #334155; margin-bottom: 6px; letter-spacing: 0.3px;
}
.input-wrap {
    position: relative; display: flex; align-items: center;
}
.input-icon {
    position: absolute; left: 14px; z-index: 2;
    color: #94a3b8; font-size: 16px; transition: color 0.2s;
}
.input-wrap input {
    width: 100%; padding: 12px 14px 12px 42px;
    border: 1.5px solid #e2e8f0; border-radius: 10px;
    font-size: 0.88rem; font-family: inherit;
    color: #0f172a; background: #f8fafc;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}
.input-wrap input:focus {
    border-color: #3b82f6; background: #fff;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}
.input-wrap input:focus ~ .input-icon,
.input-wrap input:focus + .input-icon { color: #3b82f6; }
.input-wrap input::placeholder { color: #94a3b8; font-weight: 400; }

.toggle-pass {
    position: absolute; right: 14px; z-index: 2;
    background: none; border: none; cursor: pointer;
    color: #94a3b8; font-size: 16px; padding: 4px;
    transition: color 0.2s;
}
.toggle-pass:hover { color: #64748b; }

/* Remember */
.remember-row {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 24px;
}
.remember-check {
    display: flex; align-items: center; gap: 8px; cursor: pointer;
}
.remember-check input[type="checkbox"] {
    width: 16px; height: 16px; border-radius: 4px;
    border: 1.5px solid #cbd5e1; accent-color: #3b82f6; cursor: pointer;
}
.remember-check span { font-size: 0.8rem; color: #64748b; }

/* Button */
.btn-login {
    width: 100%; padding: 13px; border: none; border-radius: 10px;
    font-family: inherit; font-size: 0.9rem; font-weight: 600;
    color: #fff; cursor: pointer; position: relative; overflow: hidden;
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #1e40af 100%);
    background-size: 200% 200%;
    box-shadow: 0 4px 16px rgba(59,130,246,0.3);
    transition: all 0.3s ease;
    letter-spacing: 0.3px;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-login:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(59,130,246,0.4);
    background-position: right center;
}
.btn-login:active:not(:disabled) { transform: translateY(0); }
.btn-login:disabled {
    opacity: 0.7; cursor: not-allowed;
    background: #64748b; box-shadow: none;
}

.btn-login-sso {
    background: linear-gradient(135deg, #991b1b 0%, #dc2626 50%, #991b1b 100%);
    background-size: 200% 200%;
    box-shadow: 0 4px 16px rgba(220,38,38,0.3);
}
.btn-login-sso:hover {
    box-shadow: 0 8px 25px rgba(220,38,38,0.4);
}

.or-divider {
    display: flex; align-items: center; gap: 12px;
    margin: 16px 0; color: #94a3b8; font-size: 0.75rem;
}
.or-divider::before, .or-divider::after {
    content: ""; flex: 1; height: 1px; background: #e2e8f0;
}

/* Footer */
.login-footer {
    text-align: center; margin-top: 28px;
    font-size: 0.7rem; color: #94a3b8; letter-spacing: 0.2px;
}

/* ── SSO Section ── */
.sso-section { text-align: center; }
.sso-desc {
    font-size: 0.85rem; color: #64748b; margin-bottom: 20px; line-height: 1.5;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .brand-panel { display: none; }
    .login-wrapper { max-width: 440px; min-height: auto; border-radius: 16px; }
    .form-panel { padding: 36px 28px; }

    /* Show compact mobile header */
    .mobile-brand { display: flex !important; }
}

.mobile-brand {
    display: none; align-items: center; gap: 14px;
    margin-bottom: 24px; padding-bottom: 20px;
    border-bottom: 1px solid #f1f5f9;
}
.mobile-brand img { width: 42px; height: auto; }
.mobile-brand-text h3 { font-size: 1rem; font-weight: 700; color: #dc2626; margin: 0; letter-spacing: 1px; }
.mobile-brand-text p { font-size: 0.7rem; color: #64748b; margin: 0; }

/* ── SVG Icons (inline) ── */
.icon-user, .icon-lock, .icon-eye, .icon-eye-off { width: 18px; height: 18px; }

/* Loader SVG Animation */
.spinner-svg {
    animation: rotate 2s linear infinite;
    width: 18px; height: 18px; display: none;
}
.spinner-svg circle {
    stroke: #ffffff;
    stroke-width: 3;
    stroke-dasharray: 1, 200;
    stroke-dashoffset: 0;
    animation: dash 1.5s ease-in-out infinite;
    stroke-linecap: round;
}
@keyframes rotate { 100% { transform: rotate(360deg); } }
@keyframes dash {
    0% { stroke-dasharray: 1, 200; stroke-dashoffset: 0; }
    50% { stroke-dasharray: 90, 200; stroke-dashoffset: -35px; }
    100% { stroke-dasharray: 90, 200; stroke-dashoffset: -124px; }
}
