:root {
    --auth-background: oklch(0.17 0.018 258);
    --auth-foreground: oklch(0.96 0.004 250);
    --auth-surface: oklch(0.2 0.018 258);
    --auth-surface-2: oklch(0.235 0.018 258);
    --auth-primary: oklch(0.82 0.16 158);
    --auth-primary-foreground: oklch(0.19 0.03 165);
    --auth-muted: oklch(0.68 0.014 254);
    --auth-info: oklch(0.79 0.1 253);
    --auth-success: oklch(0.82 0.16 158);
    --auth-danger: oklch(0.66 0.19 22);
    --auth-border: oklch(0.3 0.016 258);
    --auth-border-strong: oklch(0.38 0.018 258);
    --auth-radius: 7px;
}

* { box-sizing: border-box; min-width: 0; }
html, body { margin: 0; min-height: 100%; }
body.lb-auth { overflow-x: hidden; background: var(--auth-background); color: var(--auth-foreground); font-family: "Inter Tight", "Inter", ui-sans-serif, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
a { color: inherit; text-decoration: none; }
:where(a, button, input):focus-visible { outline: 2px solid color-mix(in oklab, var(--auth-info) 75%, transparent); outline-offset: 2px; }

.auth-shell { display: flex; min-height: 100dvh; flex-direction: column; background-image: linear-gradient(color-mix(in oklab, var(--auth-border) 18%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in oklab, var(--auth-border) 18%, transparent) 1px, transparent 1px); background-size: 28px 28px; }
.auth-topbar { display: flex; height: 56px; flex: 0 0 56px; align-items: center; padding: 0 24px; }
.auth-wordmark { display: inline-flex; max-width: 220px; align-items: center; gap: 8px; border-radius: 4px; }
.auth-wordmark .brand-logo { display: block; width: auto; max-width: 200px; height: auto; max-height: 34px; object-fit: contain; }
.auth-wordmark .brand-mark { display: grid; width: 28px; height: 28px; place-items: center; border: 1px solid color-mix(in oklab, var(--auth-primary) 30%, transparent); border-radius: 6px; background: color-mix(in oklab, var(--auth-primary) 12%, transparent); color: var(--auth-primary); font-weight: 700; }
.auth-wordmark .brand-text { font-size: 0.9375rem; font-weight: 600; }
.auth-main { display: flex; flex: 1 1 auto; align-items: center; justify-content: center; padding: 0 16px 48px; }
.auth-container { width: 100%; max-width: 400px; }
.auth-panel { overflow: hidden; border: 1px solid var(--auth-border); border-radius: 8px; background: var(--auth-surface); box-shadow: 0 1px 0 oklch(1 0 0 / 4%) inset, 0 12px 32px -18px oklch(0 0 0 / 85%); }
.auth-panel__head { padding: 16px 20px; border-bottom: 1px solid var(--auth-border); }
.auth-eyebrow { margin: 0; color: var(--auth-muted); font-size: 0.6875rem; font-weight: 600; line-height: 1; letter-spacing: .09em; text-transform: uppercase; }
.auth-panel__head h1 { margin: 6px 0 0; color: var(--auth-foreground); font-size: 1.0625rem; font-weight: 600; line-height: 1.25; letter-spacing: -.015em; }
.auth-panel__head > p:last-child { margin: 4px 0 0; color: var(--auth-muted); font-size: .8125rem; line-height: 1.45; }
.auth-panel__body { padding: 20px; }
.auth-form { display: grid; gap: 16px; }
.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-field > span:first-child { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; color: var(--auth-foreground); font-size: .75rem; font-weight: 500; }
.auth-field small { color: var(--auth-muted); font-size: .6875rem; font-weight: 400; }
.auth-field a, .auth-footer a, .auth-text-button { color: var(--auth-info); }
.auth-field a:hover, .auth-footer a:hover, .auth-text-button:hover { text-decoration: underline; }
.auth-field input { width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--auth-border); border-radius: var(--auth-radius); outline: 0; background: color-mix(in oklab, var(--auth-background) 65%, var(--auth-surface)); color: var(--auth-foreground); font-size: .875rem; transition: border-color 150ms; }
.auth-field input::placeholder { color: color-mix(in oklab, var(--auth-muted) 65%, transparent); }
.auth-field input:hover { border-color: var(--auth-border-strong); }
.auth-field input:focus { border-color: var(--auth-info); }
.password-control { position: relative; display: block; }
.password-control input { padding-right: 40px; }
.password-control button { position: absolute; top: 2px; right: 2px; display: grid; width: 32px; height: 32px; place-items: center; padding: 0; border: 0; border-radius: 5px; background: transparent; color: var(--auth-muted); cursor: pointer; }
.password-control button:hover { background: var(--auth-surface-2); color: var(--auth-foreground); }
.password-control svg { width: 15px; height: 15px; }
.auth-button { display: inline-flex; width: 100%; height: 40px; align-items: center; justify-content: center; gap: 6px; padding: 0 16px; border: 1px solid var(--auth-border); border-radius: var(--auth-radius); background: var(--auth-surface-2); color: var(--auth-foreground); font-size: .8125rem; font-weight: 500; line-height: 1; cursor: pointer; transition: background-color 150ms, border-color 150ms; }
.auth-button:hover { border-color: var(--auth-border-strong); background: color-mix(in oklab, var(--auth-surface-2) 75%, white); }
.auth-button--primary { border-color: transparent; background: var(--auth-primary); color: var(--auth-primary-foreground); }
.auth-button--primary:hover { border-color: transparent; background: color-mix(in oklab, var(--auth-primary) 88%, white); }
.auth-button:active { transform: translateY(1px); }
.auth-button:disabled { pointer-events: none; opacity: .45; }
.auth-footer { margin: 16px 0 0; color: var(--auth-muted); font-size: .8125rem; text-align: center; }
.auth-form-note { margin: -2px 0 0; color: var(--auth-muted); font-size: .6875rem; line-height: 1.55; text-align: center; }
.auth-notice { display: grid; grid-template-columns: 18px minmax(0,1fr); gap: 10px; padding: 14px 20px; border-top: 1px solid var(--auth-border); background: color-mix(in oklab, var(--auth-info) 7%, transparent); }
.auth-notice svg { width: 16px; height: 16px; color: var(--auth-info); }
.auth-notice strong { display: block; font-size: .75rem; font-weight: 500; }
.auth-notice p { margin: 3px 0 0; color: var(--auth-muted); font-size: .6875rem; }
.auth-turnstile { width: 100%; min-height: 65px; overflow: hidden; }
.auth-link-state { display: flex; align-items: center; gap: 8px; overflow: hidden; color: var(--auth-muted); font: 400 .6875rem/1 "JetBrains Mono", monospace; }
.auth-link-state > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-chip { display: inline-flex; min-height: 20px; align-items: center; padding: 2px 6px; border: 1px solid var(--auth-border); border-radius: 4px; background: var(--auth-surface-2); font: 400 .6875rem/1rem "JetBrains Mono", monospace; white-space: nowrap; }
.auth-chip--info { border-color: color-mix(in oklab, var(--auth-info) 35%, transparent); background: color-mix(in oklab, var(--auth-info) 12%, transparent); color: var(--auth-info); }

.password-policy { padding: 10px; border: 1px solid var(--auth-border); border-radius: 6px; background: color-mix(in oklab, var(--auth-surface-2) 55%, transparent); }
.password-policy__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .6875rem; }
.password-policy__head span { color: var(--auth-muted); }
.password-policy__head strong { color: var(--auth-danger); font: 500 .6875rem/1 "JetBrains Mono", monospace; }
.password-policy[data-strength="fair"] .password-policy__head strong { color: var(--auth-info); }
.password-policy[data-strength="strong"] .password-policy__head strong { color: var(--auth-success); }
.password-policy ul { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 10px; margin: 9px 0 0; padding: 0; list-style: none; }
.password-policy li { position: relative; padding-left: 13px; color: var(--auth-muted); font-size: .6875rem; }
.password-policy li::before { position: absolute; left: 0; top: .42em; width: 5px; height: 5px; border-radius: 50%; background: var(--auth-border-strong); content: ""; }
.password-policy li.is-met { color: var(--auth-success); }
.password-policy li.is-met::before { background: var(--auth-success); }
.auth-state { display: grid; gap: 14px; text-align: center; }
.auth-state p { margin: 0; color: var(--auth-muted); font-size: .8125rem; line-height: 1.55; }
.auth-state__email { overflow-wrap: anywhere; color: var(--auth-info); font: 500 .75rem/1.4 "JetBrains Mono", monospace; }
.auth-state__icon { display: grid; width: 40px; height: 40px; margin: 0 auto 2px; place-items: center; border: 1px solid color-mix(in oklab, var(--auth-info) 35%, transparent); border-radius: 8px; background: color-mix(in oklab, var(--auth-info) 12%, transparent); color: var(--auth-info); }
.auth-state__icon.is-success { border-color: color-mix(in oklab, var(--auth-success) 35%, transparent); background: color-mix(in oklab, var(--auth-success) 12%, transparent); color: var(--auth-success); }
.auth-state__icon.is-error { border-color: color-mix(in oklab, var(--auth-danger) 35%, transparent); background: color-mix(in oklab, var(--auth-danger) 12%, transparent); color: var(--auth-danger); }
.auth-state__icon svg { width: 20px; height: 20px; }
.auth-secondary-form { margin-top: 14px; text-align: center; }
.auth-text-button { padding: 3px 6px; border: 0; background: transparent; font-size: .75rem; cursor: pointer; }

.toast-stack { position: fixed; z-index: 100; top: 16px; right: 16px; width: min(360px, calc(100vw - 32px)); }
.toast { position: relative; display: grid; grid-template-columns: 20px minmax(0,1fr); align-items: center; gap: 10px; padding: 12px 38px 12px 12px; border: 1px solid var(--auth-border); border-radius: 8px; background: var(--auth-surface-2); box-shadow: 0 24px 60px -24px oklch(0 0 0 / 80%); }
.toast + .toast { margin-top: 8px; }
.toast__icon { color: var(--auth-success); }
.flash-error .toast__icon { color: var(--auth-danger); }
.toast__title { display: block; font-size: .8125rem; font-weight: 500; line-height: 1.4; }
.toast__close { position: absolute; top: 8px; right: 8px; display: grid; width: 24px; height: 24px; place-items: center; padding: 0; border: 0; border-radius: 4px; background: transparent; color: var(--auth-muted); cursor: pointer; }
.toast__close:hover { background: var(--auth-border); color: var(--auth-foreground); }

@media (max-width: 639px) {
    .auth-topbar { padding: 0 16px; }
    .auth-main { align-items: flex-start; padding-top: 16px; }
    .password-policy ul { grid-template-columns: 1fr; }
}
