:root {
    color-scheme: dark;
    --background: #0e151b;
    --surface: #172129;
    --input: #111a21;
    --line: #34414b;
    --text: #f4f4ee;
    --muted: #a5b0b8;
    --accent: #f3d34f;
    --error: #ffc2b7;
    font: 15px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--background); color: var(--text); }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
h1, p { margin: 0; }

.login-layout {
    display: grid;
    place-items: center;
    min-height: 100svh;
    padding: 48px 24px;
    background: radial-gradient(ellipse at 50% 0, #202e394d, transparent 66%);
}
.login-wrap { width: min(100%, 440px); }
.brand { display: flex; align-items: center; gap: 13px; margin: 0 0 30px 4px; }
.brand > div { display: grid; gap: 1px; }
.brand strong { font-size: 20px; letter-spacing: -.045em; line-height: 1.25; font-weight: 750; }
.brand div > span { color: var(--muted); font-size: 12px; letter-spacing: .035em; }
.brand-mark { position: relative; display: block; width: 33px; height: 41px; background: var(--accent); clip-path: polygon(50% 0, 100% 42%, 50% 100%, 0 42%); }
.brand-mark::before { content: ""; position: absolute; inset: 0 auto 0 50%; width: 1px; background: #675c2a66; }
.brand-mark::after { content: ""; position: absolute; inset: 42% 0 auto; height: 1px; background: #675c2a66; }
.access-card { padding: 32px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 20px 70px #00000026; }
.card-heading { margin-bottom: 27px; }
.eyebrow { margin-bottom: 11px; color: var(--accent); font-size: 11px; letter-spacing: .11em; line-height: 1.4; font-weight: 650; text-transform: uppercase; }
h1 { font-size: clamp(27px, 6vw, 32px); letter-spacing: -.055em; line-height: 1.12; font-weight: 650; text-wrap: balance; }
.description { color: var(--muted); font-size: 14px; margin-top: 12px; line-height: 1.6; text-wrap: pretty; }
form { display: grid; gap: 20px; }
.field { display: grid; gap: 8px; }
label { font-size: 13px; font-weight: 600; }
input { width: 100%; height: 48px; padding: 11px 13px; background: var(--input); border: 1px solid var(--line); border-radius: 8px; color: var(--text); transition: border-color .15s; }
input:hover { border-color: #62707a; }
input:focus { border-color: var(--accent); outline: 2px solid #f3d34f22; outline-offset: 1px; }
input:disabled { opacity: .7; }
input::placeholder { color: #65737f; opacity: 1; }
.field-hint { font-size: 12px; line-height: 1.5; color: var(--muted); }
.button { width: 100%; min-height: 48px; padding: 12px 15px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid transparent; border-radius: 8px; font-size: 13px; font-weight: 700; transition: background .15s, opacity .15s; }
.button.primary { color: #202019; background: var(--accent); }
.button.primary:hover { background: #ffe477; }
.button.secondary { color: var(--text); background: #23303a; border-color: var(--line); justify-content: center; }
.button:disabled { opacity: .5; }
.button:disabled:hover { background: var(--accent); }
.button.secondary:disabled:hover { background: #23303a; }
.button > span { font-size: 19px; font-weight: 400; line-height: 1; }
.text-button { display: block; margin: 19px auto 0; padding: 3px 5px; border: 0; background: transparent; color: var(--muted); font-size: 12px; text-underline-offset: 4px; }
.text-button:hover { color: var(--text); text-decoration: underline; }
.text-button:disabled { opacity: .5; }
.error-message { margin: -7px 0 22px; padding: 12px 13px; color: var(--error); background: #ffc2b70b; border: 1px solid #ffc2b72b; border-radius: 8px; font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; }
.loading-view { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; color: var(--muted); font-size: 13px; }
.loading-dot { flex: 0 0 6px; width: 6px; height: 6px; background: var(--accent); border-radius: 50%; }
.loading-view .button { margin-top: 10px; }
.code-input { height: 58px; padding-left: 20px; font-size: 25px; font-weight: 500; letter-spacing: .42em; font-variant-numeric: tabular-nums; text-align: center; }
.enrollment { display: grid; justify-items: center; gap: 14px; margin: -2px 0 25px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.qr-code { display: block; width: 200px; height: 200px; max-width: 100%; object-fit: contain; border: 10px solid #fff; border-radius: 9px; background: #fff; }
.manual-entry { width: 100%; text-align: center; font-size: 12px; color: var(--muted); }
.manual-entry summary { cursor: pointer; width: fit-content; margin: 0 auto; text-underline-offset: 4px; }
.manual-entry summary:hover { color: var(--text); }
.totp-secret { display: block; margin-top: 12px; padding: 11px; border: 1px solid var(--line); border-radius: 6px; background: var(--input); color: var(--text); font-size: 12px; line-height: 1.8; letter-spacing: .1em; overflow-wrap: anywhere; user-select: all; }
.enrollment-note { font-size: 11px; color: var(--muted); text-align: center; }
.challenge-expiry { margin-top: 20px; font-size: 11px; line-height: 1.5; text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; }
.page-footer { margin: 22px 0 0; text-align: center; color: #788791; font-size: 11px; }
.noscript-message { margin-top: 20px; color: var(--error); font-size: 13px; text-align: center; }

@media (max-width: 480px) {
    .login-layout { padding: 32px 20px; }
    .brand { margin-bottom: 25px; }
    .access-card { padding: 26px 23px; border-radius: 15px; }
    .code-input { letter-spacing: .35em; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; }
}
