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

:root {
    --bg:      #0f172a;
    --card:    #1e293b;
    --border:  #334155;
    --pri:     #6366f1;
    --text:    #e2e8f0;
    --muted:   #94a3b8;
    --red:     #ef4444;
    --radius:  14px;
}

html, body {
    height: 100%;
    background: var(--bg);
    font-family: 'Nunito', system-ui, sans-serif;
    color: var(--text);
}

.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.login-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.25rem 2rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,.4);
}

.login-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.logo-img {
    height: 36px;
    width: auto;
}

.login-title {
    font-size: 1.3rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: .35rem;
}

.login-sub {
    font-size: .875rem;
    color: var(--muted);
    text-align: center;
    margin-bottom: 1.75rem;
}

.fgroup {
    margin-bottom: 1rem;
}

.flabel {
    display: block;
    font-size: .8rem;
    font-weight: 700;
    color: var(--muted);
    margin-bottom: .35rem;
}

.finput {
    display: block;
    width: 100%;
    padding: .65rem .9rem;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: 9px;
    color: var(--text);
    font-size: .95rem;
    font-family: inherit;
    outline: none;
    transition: border-color .15s;
}

.finput:focus {
    border-color: var(--pri);
    box-shadow: 0 0 0 3px rgba(99,102,241,.2);
}

.finput-code {
    text-align: center;
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: .35em;
}

.err {
    font-size: .82rem;
    color: #fca5a5;
    min-height: 1.2rem;
    margin-bottom: .5rem;
}

.btn {
    display: block;
    width: 100%;
    padding: .75rem;
    border: none;
    border-radius: 9px;
    font-size: .95rem;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
    transition: opacity .15s, transform .1s;
}

.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary {
    background: var(--pri);
    color: #fff;
    margin-top: .25rem;
}
.btn-primary:hover:not(:disabled) { background: #4f46e5; }

.btn-link {
    background: none;
    color: var(--muted);
    font-size: .82rem;
    font-weight: 600;
    margin-top: .5rem;
    padding: .5rem;
}
.btn-link:hover { color: var(--text); }

.totp-hint {
    background: rgba(99,102,241,.08);
    border-left: 3px solid var(--pri);
    border-radius: 0 8px 8px 0;
    padding: .65rem .9rem;
    font-size: .82rem;
    color: #a5b4fc;
    margin-bottom: 1.25rem;
}

.hidden { display: none; }

/* ── MFA Setup Panel ──────────────────────────────────── */
.setup-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: .75rem;
}
.setup-desc {
    font-size: .82rem;
    color: var(--muted);
    margin-bottom: 1rem;
    line-height: 1.5;
}
.qr-wrap {
    display: flex;
    justify-content: center;
    margin: 1.25rem 0;
    padding: 1rem;
    background: #fff;
    border-radius: 12px;
}
.qr-wrap svg {
    max-width: 200px;
    max-height: 200px;
}
.setup-manual {
    background: rgba(99,102,241,.06);
    border: 1px solid rgba(99,102,241,.15);
    border-radius: 10px;
    padding: .75rem 1rem;
    margin-bottom: 1rem;
}
.setup-manual-label {
    font-size: .75rem;
    color: var(--muted);
    margin-bottom: .4rem;
}
.setup-manual-key {
    font-family: 'Courier New', monospace;
    font-size: .85rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: .12em;
    word-break: break-all;
    user-select: all;
}

/* ── SSO Button ───────────────────────────────────────────── */
.sso-divider {
    display: flex;
    align-items: center;
    margin: 1rem 0;
    gap: .75rem;
}
.sso-divider::before, .sso-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(148,163,184,.3);
}
.sso-divider-text {
    font-size: .78rem;
    font-weight: 600;
    color: rgba(148,163,184,.6);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.btn-sso {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    width: 100%;
    padding: .7rem 1rem;
    border: 1px solid rgba(148,163,184,.25);
    border-radius: 8px;
    background: rgba(255,255,255,.05);
    color: #e2e8f0;
    font-size: .88rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background .15s, border-color .15s, transform .1s;
}
.btn-sso:hover {
    background: rgba(255,255,255,.1);
    border-color: rgba(148,163,184,.4);
    transform: translateY(-1px);
}
.btn-sso:active {
    transform: translateY(0);
}
.btn-sso:disabled {
    opacity: .6;
    cursor: wait;
}
.btn-sso svg {
    flex-shrink: 0;
}
