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

:root {
    --color-primary:   #0f2d5e;
    --color-secondary: #1a4480;
    --color-accent:    #e8630a;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f0f4f8;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1a2535;
}

/* ── Login card ── */
.card {
    background: #ffffff;
    border: 1px solid #d0dae6;
    border-radius: 12px;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 8px 32px rgba(15,45,94,0.10);
}
.logo { text-align: center; margin-bottom: 2rem; }
.logo h1 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: -0.01em;
}
.logo p { font-size: 0.85rem; color: #5a6a7e; margin-top: 0.3rem; }
.logo-img { max-width: 180px; height: auto; margin-bottom: 1rem; }

h2 { font-size: 1.1rem; font-weight: 600; color: var(--color-primary); margin-bottom: 1.5rem; }

label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-secondary);
    margin-bottom: 0.4rem;
    margin-top: 1rem;
}
input[type=email], input[type=password], input[type=text] {
    width: 100%;
    padding: 0.65rem 0.9rem;
    background: #f8fbff;
    border: 1px solid #d0dae6;
    border-radius: 8px;
    color: #1a2535;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(232,99,10,0.12);
}

/* ── Buttons ── */
.btn {
    display: block;
    width: 100%;
    padding: 0.75rem;
    margin-top: 1.5rem;
    background: var(--color-accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.2s;
    text-align: center;
    text-decoration: none;
}
.btn:hover { filter: brightness(0.88); }
.btn-secondary {
    background: transparent;
    border: 1px solid #d0dae6;
    color: #5a6a7e;
    margin-top: 0.75rem;
    transition: border-color 0.2s, color 0.2s;
}
.btn-secondary:hover { border-color: var(--color-secondary); color: var(--color-primary); background: #f0f4f8; filter: none; }
.btn-danger { background: #c8240a; }
.btn-danger:hover { background: #a81c08; filter: none; }

/* ── Alerts ── */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}
.alert-error   { background: #fff4f2; border: 1px solid #f5b7ae; color: #8c1a0e; }
.alert-success { background: #f0faf4; border: 1px solid #a3d9b5; color: #145c30; }
.alert-info    { background: #f0f6ff; border: 1px solid #a3c0ed; color: var(--color-primary); }

/* ── Misc ── */
.checkbox-row { display: flex; align-items: center; gap: 0.5rem; margin-top: 1.25rem; }
.checkbox-row input { width: auto; accent-color: var(--color-accent); }
.checkbox-row label { margin: 0; font-size: 0.85rem; color: #5a6a7e; font-weight: 400; }
.link { color: var(--color-accent); text-decoration: none; font-size: 0.85rem; }
.link:hover { text-decoration: underline; filter: brightness(0.88); }
.text-center { text-align: center; }
.mt-1 { margin-top: 1rem; }

.qr-wrap { text-align: center; margin: 1.5rem 0; }
.qr-wrap img {
    border: 4px solid var(--color-primary);
    border-radius: 8px;
    max-width: 200px;
}

.backup-codes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin: 1rem 0;
    font-family: monospace;
    font-size: 0.9rem;
}
.backup-code {
    background: #f0f4f8;
    border: 1px solid #d0dae6;
    border-radius: 6px;
    padding: 0.5rem;
    text-align: center;
    letter-spacing: 0.15em;
    color: var(--color-primary);
    font-weight: 600;
}

.policy-list { list-style: none; margin-top: 0.5rem; }
.policy-list li { font-size: 0.8rem; color: #5a6a7e; padding: 0.15rem 0; }
.policy-list li::before { content: '• '; color: var(--color-accent); }

/* ── Utility: unauthenticated pages ── */
.hint { font-size: 0.85rem; color: #5a6a7e; margin-bottom: 1rem; }
.hint-xs { font-size: 0.75rem; color: #64748b; text-align: center; margin-bottom: 1rem; }
.code-muted { color: #94a3b8; }
.input-upper { text-transform: uppercase; letter-spacing: 0.15em; }
.link-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    color: #5a6a7e;
    padding: 0;
}
.form-inline { display: inline; }
