:root {
    color-scheme: light;
    --ink: #102033;
    --muted: #607086;
    --line: #dce4ed;
    --surface: rgba(255, 255, 255, 0.92);
    --blue: #1268e8;
    --blue-dark: #0a4fae;
    --orange: #f59b35;
    --background: #eef3f8;
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at 80% 8%, rgba(18, 104, 232, 0.12), transparent 26rem),
        radial-gradient(circle at 8% 85%, rgba(245, 155, 53, 0.1), transparent 22rem),
        var(--background);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.auth-page {
    display: grid;
    place-items: center;
    padding: 1.5rem;
}

.auth-card {
    width: min(100%, 28rem);
    padding: 2.5rem;
    border: 1px solid var(--line);
    border-radius: 1.5rem;
    background: var(--surface);
    box-shadow: 0 1.5rem 4rem rgba(33, 54, 80, 0.12);
    backdrop-filter: blur(1.25rem);
}

.mfa-card {
    width: min(100%, 34rem);
}

.mfa-card h1 {
    font-size: clamp(1.8rem, 5vw, 2.7rem);
}

.mfa-qr {
    display: block;
    width: min(15rem, 100%);
    height: auto;
    margin: 1.5rem auto;
    border: 0.75rem solid #fff;
    border-radius: 1rem;
}

details {
    margin: 1rem 0;
    padding: 0.9rem 1rem;
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    background: #f7f9fc;
}

summary {
    cursor: pointer;
    font-weight: 700;
}

.secret-code {
    display: block;
    overflow-wrap: anywhere;
    padding: 0.8rem;
    border-radius: 0.6rem;
    background: #eaf0f7;
    color: var(--ink);
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    user-select: all;
}

.brand-mark {
    display: grid;
    width: 3rem;
    height: 3rem;
    place-items: center;
    margin-bottom: 1.5rem;
    border-radius: 0.9rem;
    color: #fff;
    background: linear-gradient(135deg, var(--blue), var(--blue-dark));
    font-size: 1.4rem;
    font-weight: 800;
}

.eyebrow {
    margin: 0 0 0.7rem;
    color: var(--blue);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.15em;
}

h1 {
    margin: 0;
    font-size: clamp(2rem, 6vw, 3.6rem);
    letter-spacing: -0.045em;
}

h2 {
    margin: 0.75rem 0 0.5rem;
}

.muted,
.lead,
.module-card p {
    color: var(--muted);
}

.lead {
    max-width: 52rem;
    font-size: 1.15rem;
    line-height: 1.65;
}

label {
    display: block;
    margin: 1.25rem 0 0.45rem;
    font-size: 0.85rem;
    font-weight: 700;
}

input {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 1px solid #c9d5e2;
    border-radius: 0.75rem;
    background: #fff;
    color: var(--ink);
    font: inherit;
}

input:focus {
    border-color: var(--blue);
    outline: 0.2rem solid rgba(18, 104, 232, 0.12);
}

:where(a, button, input, select, textarea, summary):focus-visible {
    outline: 0.2rem solid rgba(18, 104, 232, 0.42);
    outline-offset: 0.15rem;
}

button,
.button-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 0.75rem;
    font: inherit;
    font-weight: 750;
    text-decoration: none;
    cursor: pointer;
}

.full-width {
    width: 100%;
    margin-top: 0.75rem;
}

form > button {
    width: 100%;
    margin-top: 1.5rem;
    padding: 0.95rem;
    color: #fff;
    background: var(--blue);
}

button:not(.button-secondary):not(.danger-button):not(:disabled):hover {
    background: var(--blue-dark);
}

.button-secondary {
    width: auto;
    margin: 0;
    padding: 0.6rem 0.85rem;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line);
}

.button-secondary:hover {
    border-color: #b9c8d8;
    color: var(--blue-dark);
    background: #f3f7fb;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

.alert {
    padding: 0.8rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.9rem;
}

.alert-error {
    color: #8a1731;
    background: #ffe9ef;
}

.alert-success {
    color: #12613e;
    background: #e6f8ef;
}

.alert-warning {
    color: #7a4b00;
    background: #fff3d6;
}

.alert-info {
    color: #174f7a;
    background: #e8f4ff;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem clamp(1.25rem, 4vw, 4rem);
    border-bottom: 1px solid rgba(201, 213, 226, 0.78);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(1.25rem);
}

.topbar strong {
    margin-right: 0.75rem;
}

.topbar span {
    color: var(--muted);
}

.topbar form {
    margin: 0;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.topbar form > button {
    margin: 0;
}

.shell {
    width: min(100% - 2rem, 74rem);
    margin: 0 auto;
    padding: clamp(3rem, 8vw, 7rem) 0;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: 1rem;
    margin-top: 3rem;
}

.module-card {
    min-height: 15rem;
    padding: 1.5rem;
    border: 1px solid var(--line);
    border-radius: 1.25rem;
    background: var(--surface);
    box-shadow: 0 1rem 3rem rgba(42, 63, 88, 0.07);
}

.module-card > span {
    color: var(--orange);
    font-size: 0.8rem;
    font-weight: 800;
}

.module-card p {
    min-height: 4.5rem;
    line-height: 1.5;
}

.module-card small {
    color: #8390a0;
}

.module-card a {
    color: var(--blue);
    font-weight: 750;
}

@media (max-width: 38rem) {
    .auth-card {
        padding: 1.5rem;
    }

    .topbar span {
        display: none;
    }

    .topbar {
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .topbar-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .topbar-actions .button-secondary,
    .topbar-actions form {
        flex: 1 1 auto;
    }

    .topbar-actions form > button {
        width: 100%;
    }
}
.auth-card-wide {
    max-width: 38rem;
}

.auth-alternative {
    margin-top: 1rem;
}

.auth-alternative summary {
    cursor: pointer;
    color: var(--muted, #536071);
}

.recovery-code-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    margin: 1.5rem 0;
}

.recovery-code-grid code {
    padding: 0.75rem;
    border: 1px solid rgba(25, 53, 85, 0.15);
    border-radius: 0.65rem;
    background: #f6f9fc;
    text-align: center;
    letter-spacing: 0.08em;
}

@media (max-width: 520px) {
    .recovery-code-grid {
        grid-template-columns: 1fr;
    }
}
