﻿*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --navy: #1a2540;
    --navy2: #243152;
    --navy3: #0f1929;
    --gold: #b5862b;
    --gold2: #d4a43a;
    --gold3: #e8c56d;
    --white: #ffffff;
    --bg: #f4f5f7;
    --border: #e2e5eb;
    --border2: #c8cdd8;
    --text: #1a2540;
    --text2: #4a5568;
    --text3: #8a94a6;
    --red: #dc2626;
    --red-lt: #fef2f2;
    --indigo: #3d52a0;
    --indigo-lt: #eef1fa;
    --green: #16a34a;
    --green-lt: #f0fdf4;
    --shadow: 0 4px 24px rgba(26,37,64,0.10);
    --shadow2: 0 8px 40px rgba(26,37,64,0.18);
}

html, body {
    height: 100%;
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow: hidden;
}

/* ─── PAGE: fills full viewport ─── */
.page {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* ─── LEFT PANEL ─── */
.left {
    width: 440px;
    flex-shrink: 0;
    background: var(--navy);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

    /* geometric background pattern */
    .left::before {
        content: '';
        position: absolute;
        inset: 0;
        background-image: radial-gradient(circle at 20% 20%, rgba(181,134,43,0.12) 0%, transparent 50%), radial-gradient(circle at 80% 80%, rgba(61,82,160,0.18) 0%, transparent 50%), radial-gradient(circle at 60% 10%, rgba(181,134,43,0.06) 0%, transparent 40%);
        pointer-events: none;
    }

    /* grid lines overlay */
    .left::after {
        content: '';
        position: absolute;
        inset: 0;
        background-image: linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
        background-size: 48px 48px;
        pointer-events: none;
    }

.left-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 40px;
}

/* Logo */
.logo-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    animation: fadeUp 0.5s ease both;
}

.logo-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--gold), var(--gold2));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 14px rgba(181,134,43,0.45);
    flex-shrink: 0;
}

.logo-text {
    font-family: 'Playfair Display', serif;
    font-size: 24px;
    color: #fff;
    letter-spacing: -0.3px;
}

.logo-sub {
    font-size: 10px;
    color: rgba(255,255,255,0.35);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-top: 2px;
}

/* Hero text */
.hero {
    margin-top: auto;
    margin-bottom: 32px;
    animation: fadeUp 0.6s 0.1s ease both;
}

.hero-eyebrow {
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--gold3);
    font-weight: 600;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

    .hero-eyebrow::before {
        content: '';
        display: inline-block;
        width: 24px;
        height: 2px;
        background: linear-gradient(90deg, var(--gold), var(--gold3));
        border-radius: 2px;
    }

.hero-title {
    font-family: 'Playfair Display', serif;
    font-size: 34px;
    line-height: 1.15;
    color: #fff;
    margin-bottom: 14px;
    letter-spacing: -0.5px;
}

    .hero-title em {
        color: var(--gold3);
        font-style: italic;
    }

.hero-desc {
    font-size: 13px;
    color: rgba(255,255,255,0.5);
    line-height: 1.7;
    max-width: 320px;
}

/* Feature chips */
.feature-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 22px;
    animation: fadeUp 0.6s 0.2s ease both;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 5px 11px;
    font-size: 11px;
    color: rgba(255,255,255,0.6);
    font-weight: 500;
}

.chip-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--gold3);
    flex-shrink: 0;
}

/* Compliance strip */
.compliance-strip {
    margin-top: 24px;
    padding-top: 22px;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    gap: 24px;
    animation: fadeUp 0.6s 0.3s ease both;
}

.cs-item {
    text-align: center;
}

.cs-val {
    font-family: 'JetBrains Mono', monospace;
    font-size: 18px;
    font-weight: 500;
    color: var(--gold3);
}

.cs-lbl {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: rgba(255,255,255,0.3);
    margin-top: 2px;
}

/* ─── RIGHT PANEL ─── */
.right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
    overflow-y: auto;
    background: var(--bg);
    position: relative;
    overflow: hidden;
    min-width: 0;
}

    .right::before {
        content: '';
        position: absolute;
        top: -60px;
        right: -60px;
        width: 300px;
        height: 300px;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(61,82,160,0.06) 0%, transparent 70%);
        pointer-events: none;
    }

    .right::after {
        content: '';
        position: absolute;
        bottom: -40px;
        left: -40px;
        width: 200px;
        height: 200px;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(181,134,43,0.06) 0%, transparent 70%);
        pointer-events: none;
    }

.form-card {
    width: 100%;
    max-width: 400px;
    position: relative;
    z-index: 1;
    animation: fadeUp 0.55s 0.05s ease both;
    min-width: 0;
}

.form-header {
    margin-bottom: 26px;
}

.form-welcome {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.8px;
    color: var(--text3);
    font-weight: 600;
    margin-bottom: 8px;
}

.form-title {
    font-family: 'Playfair Display', serif;
    font-size: 27px;
    font-weight: 700;
    color: var(--navy);
    letter-spacing: -0.4px;
    line-height: 1.2;
    margin-bottom: 6px;
}

.form-subtitle {
    font-size: 13px;
    color: var(--text3);
    line-height: 1.5;
}

/* Session badge */
.session-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--green-lt);
    border: 1px solid #bbf7d0;
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--green);
    margin-bottom: 22px;
}

.session-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
    animation: pulse 2s ease infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.6;
        transform: scale(1.2);
    }
}

/* Form groups */
.form-group {
    margin-bottom: 15px;
}

.form-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text3);
    margin-bottom: 6px;
}

.input-wrap {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    opacity: 0.4;
    pointer-events: none;
    transition: opacity 0.2s;
}

.form-input {
    width: 100%;
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: 9px;
    padding: 11px 13px 11px 40px;
    font-size: 13.5px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: 0 1px 3px rgba(26,37,64,0.05);
}

    .form-input:focus {
        border-color: var(--indigo);
        box-shadow: 0 0 0 3px rgba(61,82,160,0.10);
    }

        .form-input:focus + .input-icon,
        .input-wrap:focus-within .input-icon {
            opacity: 0.7;
        }

    .form-input.error {
        border-color: var(--red);
    }

        .form-input.error:focus {
            box-shadow: 0 0 0 3px rgba(220,38,38,0.10);
        }

/* Password toggle */
.pwd-toggle {
    position: absolute;
    right: 13px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 14px;
    opacity: 0.35;
    transition: opacity 0.2s;
    user-select: none;
}

    .pwd-toggle:hover {
        opacity: 0.7;
    }

.form-error {
    display: flex;
    margin-top: 6px;
    font-size: 12px;
    color: var(--red);
    align-items: center;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

    .form-error.show {
        opacity: 1;
    }

/* Remember + Forgot */
.form-row-opt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    margin-top: -2px;
}

.remember {
    display: flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    user-select: none;
}

.remember-cb {
    width: 15px;
    height: 15px;
    border: 1.5px solid var(--border2);
    border-radius: 4px;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    color: #fff;
    flex-shrink: 0;
    transition: all 0.15s;
    cursor: pointer;
}

    .remember-cb.checked {
        background: var(--navy);
        border-color: var(--navy);
    }

.remember-label {
    font-size: 12.5px;
    color: var(--text2);
}

.forgot-link {
    font-size: 12.5px;
    color: var(--indigo);
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

    .forgot-link:hover {
        text-decoration: underline;
    }

/* Sign-in button */
.btn-signin {
    width: 100%;
    padding: 13px;
    background: var(--navy);
    color: #fff;
    border: none;
    border-radius: 9px;
    font-size: 13.5px;
    font-weight: 700;
    font-family: 'Plus Jakarta Sans', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 16px rgba(26,37,64,0.28);
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.2px;
}

    .btn-signin::before {
        content: '';
        position: absolute;
        inset: 0;
        background: linear-gradient(135deg, rgba(255,255,255,0.06), transparent);
        pointer-events: none;
    }

    .btn-signin:hover {
        background: var(--navy2);
        box-shadow: 0 6px 24px rgba(26,37,64,0.36);
        transform: translateY(-1px);
    }

    .btn-signin:active {
        transform: translateY(0);
    }

    .btn-signin.loading {
        pointer-events: none;
        opacity: 0.85;
    }

.spinner {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    animation: spin 0.7s linear infinite;
    display: none;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.btn-signin.loading .spinner {
    display: block;
}

.btn-signin.loading .btn-text {
    opacity: 0.7;
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 18px 0;
    color: var(--text3);
    font-size: 11.5px;
}

    .divider::before, .divider::after {
        content: '';
        flex: 1;
        height: 1px;
        background: var(--border);
    }

/* SSO Button */
.btn-sso {
    width: 100%;
    padding: 11px;
    background: var(--white);
    color: var(--text2);
    border: 1.5px solid var(--border);
    border-radius: 9px;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Plus Jakarta Sans', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.15s;
    box-shadow: 0 1px 3px rgba(26,37,64,0.06);
}

    .btn-sso:hover {
        border-color: var(--border2);
        box-shadow: 0 3px 10px rgba(26,37,64,0.10);
        background: var(--bg);
    }

.ad-logo {
    width: 18px;
    height: 18px;
    border-radius: 3px;
    background: linear-gradient(135deg, #0072c6, #00a4ef);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #fff;
    font-weight: 800;
    flex-shrink: 0;
}

/* Role selector */
.role-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 15px;
}

.role-btn {
    padding: 8px 10px;
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: var(--text3);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 7px;
    transition: all 0.15s;
}

    .role-btn:hover {
        border-color: var(--border2);
        color: var(--text);
    }

    .role-btn.active {
        border-color: var(--navy);
        background: var(--navy);
        color: #fff;
    }

.role-icon {
    font-size: 13px;
    flex-shrink: 0;
}

/* Security notice */
.security-notice {
    margin-top: 18px;
    padding: 11px 13px;
    background: var(--indigo-lt);
    border: 1px solid rgba(61,82,160,0.15);
    border-radius: 8px;
    display: flex;
    align-items: flex-start;
    gap: 9px;
}

.notice-icon {
    font-size: 13px;
    flex-shrink: 0;
    margin-top: 1px;
}

.notice-text {
    font-size: 11px;
    color: var(--indigo);
    line-height: 1.5;
}

/* Footer */
.form-footer {
    margin-top: 16px;
    text-align: center;
    font-size: 11px;
    color: var(--text3);
}

    .form-footer a {
        color: var(--indigo);
        font-weight: 600;
        text-decoration: none;
    }

        .form-footer a:hover {
            text-decoration: underline;
        }

/* Success state */
.success-overlay {
    display: none;
    position: absolute;
    inset: 0;
    background: var(--white);
    border-radius: 16px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px;
    z-index: 10;
    animation: fadeIn 0.3s ease;
}

    .success-overlay.show {
        display: flex;
    }

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.success-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--green-lt);
    border: 2px solid var(--green);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin-bottom: 14px;
    animation: popIn 0.4s cubic-bezier(0.34,1.56,0.64,1) both;
}

@keyframes popIn {
    from {
        transform: scale(0.4);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.success-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--navy);
    margin-bottom: 5px;
}

.success-sub {
    font-size: 12.5px;
    color: var(--text3);
    margin-bottom: 18px;
}

.progress-login {
    width: 180px;
    height: 4px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.progress-login-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--navy), var(--indigo));
    border-radius: 4px;
    width: 0%;
    transition: width 2s linear;
}

/* Animations */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* MFA state */
.mfa-view {
    display: none;
}

    .mfa-view.show {
        display: block;
    }

.main-view.hide {
    display: none;
}

.mfa-digits {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 20px 0;
}

.mfa-digit {
    width: 48px;
    height: 56px;
    border: 1.5px solid var(--border);
    border-radius: 9px;
    background: var(--white);
    font-size: 22px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    color: var(--navy);
    text-align: center;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: 0 1px 3px rgba(26,37,64,0.06);
}

    .mfa-digit:focus {
        border-color: var(--indigo);
        box-shadow: 0 0 0 3px rgba(61,82,160,0.10);
    }

.mfa-resend {
    font-size: 12.5px;
    color: var(--text3);
    text-align: center;
    margin-bottom: 18px;
}

    .mfa-resend a {
        color: var(--indigo);
        font-weight: 600;
        cursor: pointer;
    }

/* ─── Responsive ─── */
@media (max-width: 700px) {
    .left {
        display: none;
    }

    .right {
        overflow: hidden;
    }

    .page {
        height: auto;
        min-height: 100vh;
        overflow: auto;
    }
}
