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

:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #eef2ff;
    --danger: #ef4444;
    --success: #22c55e;
    --info: #3b82f6;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --bg: #f8fafc;
    --white: #ffffff;
    --radius: 12px;
    --shadow: 0 4px 24px rgba(0,0,0,.08);
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* ── Navbar ─────────────────────────────────────────────── */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    height: 60px;
    background: var(--white);
    border-bottom: 1px solid var(--border);
}
.navbar-brand { font-weight: 700; font-size: 1.1rem; color: var(--primary); }
.navbar-actions { display: flex; align-items: center; gap: 1rem; }
.navbar-user { font-size: .875rem; color: var(--text-muted); }

/* ── Auth card ───────────────────────────────────────────── */
.auth-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem 1rem;
}
.auth-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2.5rem;
    width: 100%;
    max-width: 440px;
}
.auth-card h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: .5rem;
}
.auth-card .subtitle {
    color: var(--text-muted);
    font-size: .9rem;
    margin-bottom: 1.75rem;
}

/* ── Form ────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.1rem; }
.form-group label {
    display: block;
    font-size: .875rem;
    font-weight: 500;
    margin-bottom: .4rem;
}
.form-control {
    width: 100%;
    padding: .625rem .875rem;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: .9rem;
    font-family: inherit;
    transition: border-color .15s;
    background: var(--white);
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}
.field-validation-error {
    display: block;
    color: var(--danger);
    font-size: .8rem;
    margin-top: .3rem;
}
.validation-summary-errors ul {
    list-style: none;
    padding: .75rem 1rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: .875rem;
    color: var(--danger);
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .65rem 1.25rem;
    border-radius: 8px;
    font-size: .9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: background .15s, transform .1s;
    text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: var(--white); width: 100%; padding: .75rem; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text);
    padding: .45rem .9rem;
    font-size: .8rem;
}
.btn-outline:hover { background: var(--bg); }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: .4rem .8rem; font-size: .8rem; }

/* ── Social buttons ──────────────────────────────────────── */
.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    width: 100%;
    padding: .65rem 1rem;
    border-radius: 8px;
    border: 1.5px solid var(--border);
    background: var(--white);
    font-size: .9rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    margin-bottom: .75rem;
    transition: background .15s, border-color .15s;
}
.social-btn:hover { background: var(--bg); border-color: #cbd5e1; }
.social-btn svg { width: 20px; height: 20px; flex-shrink: 0; }

/* ── Divider ─────────────────────────────────────────────── */
.divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.25rem 0;
    color: var(--text-muted);
    font-size: .8rem;
}
.divider::before, .divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ── Links / helpers ─────────────────────────────────────── */
.form-footer { margin-top: 1.25rem; text-align: center; font-size: .875rem; color: var(--text-muted); }
.form-footer a { color: var(--primary); text-decoration: none; font-weight: 500; }
.form-footer a:hover { text-decoration: underline; }
.form-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.1rem; }
.checkbox-label { display: flex; align-items: center; gap: .5rem; font-size: .875rem; cursor: pointer; }
.checkbox-label input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--primary); }
.forgot-link { font-size: .875rem; color: var(--primary); text-decoration: none; font-weight: 500; }
.forgot-link:hover { text-decoration: underline; }

/* ── Alerts ──────────────────────────────────────────────── */
.alert {
    max-width: 900px;
    margin: 1rem auto;
    padding: .875rem 1.25rem;
    border-radius: 8px;
    font-size: .875rem;
}
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.alert-info    { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }
.alert-error   { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }

/* ── Dashboard ───────────────────────────────────────────── */
.dashboard {
    max-width: 860px;
    margin: 3rem auto;
    padding: 0 1rem;
}
.dashboard h1 { font-size: 1.75rem; margin-bottom: 1.5rem; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.dash-card {
    background: var(--white);
    border-radius: var(--radius);
    border: 1.5px solid var(--border);
    padding: 1.5rem;
}
.dash-card h3 { font-size: 1rem; margin-bottom: .5rem; }
.dash-card p  { font-size: .875rem; color: var(--text-muted); margin-bottom: 1rem; }
.badge {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .25rem .6rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
}
.badge-on  { background: #dcfce7; color: #166534; }
.badge-off { background: #fee2e2; color: #991b1b; }

/* ── MFA Setup ───────────────────────────────────────────── */
.qr-container {
    text-align: center;
    margin: 1.5rem 0;
}
.qr-container img { border-radius: 8px; border: 1px solid var(--border); }
.secret-key {
    font-family: monospace;
    font-size: .8rem;
    letter-spacing: 2px;
    color: var(--text-muted);
    word-break: break-all;
    background: var(--bg);
    padding: .5rem .75rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    margin-top: .5rem;
    display: block;
}
.code-input {
    text-align: center;
    font-size: 1.5rem;
    letter-spacing: 8px;
    font-weight: 600;
}
