/* Public auth pages. Shared controls and notices keep their theme styles. */
.public-auth {
    --btn-radius: var(--r-7);
    --form-control-radius: var(--r-7);
    --card-radius: var(--r-8);
}

.public-auth [hidden] { display: none !important; }
.public-auth :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- layout ---------- */
.auth-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    min-height: 100vh;
    min-height: 100dvh;
}

.auth-main {
    display: flex;
    min-width: 0;
    min-height: 100vh;
    min-height: 100dvh;
    flex-direction: column;
    padding: 20px clamp(20px, 5vw, 64px) var(--sp-16);
}

.auth-top { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-12); }
.auth-brand { display: flex; align-items: center; gap: var(--sp-10); color: var(--fg-0); text-decoration: none; }
.auth-brand img { width: 34px; height: 34px; object-fit: contain; }
.auth-brand strong { display: block; font-size: var(--text-14); line-height: 1.1; }
.auth-brand small {
    display: block;
    margin-top: 3px;
    color: var(--fg-3, var(--fg-2));
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* Theme toggle: sun in dark mode, moon in light mode. */
.theme-toggle .icon { width: 1.15rem; height: 1.15rem; font-size: 1.15rem; }
.theme-toggle__light { display: none !important; }
[data-theme="light"] .theme-toggle__dark { display: none !important; }
[data-theme="light"] .theme-toggle__light { display: inline-block !important; }

.auth-card {
    display: flex;
    width: 100%;
    max-width: 420px;
    flex-direction: column;
    gap: var(--sp-14);
    margin: auto;
    padding-block: 20px;
}

.auth-foot { color: var(--fg-3, var(--fg-2)); font-size: var(--text-11); }

/* ---------- heading: icon beside the title ---------- */
.auth-head__title { display: flex; align-items: center; gap: var(--sp-12); margin-bottom: 6px; }

.auth-head .auth-icon {
    display: inline-flex;
    width: 38px;
    height: 38px;
    flex: none;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 10px;
    color: var(--accent);
    background: var(--accent-soft);
    font-size: 1.15rem;
}

.auth-head h1 {
    margin: 0;
    color: var(--fg-0);
    font-size: 23px;
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.auth-head p { margin: 0; color: var(--fg-2); font-size: 13px; line-height: 1.5; }

/* ---------- forms ---------- */
.auth-form, .auth-actions { display: flex; flex-direction: column; gap: var(--sp-12); }
.auth-form .form-grid--2 { gap: var(--sp-12); }
.auth-form .btn, .auth-actions .btn { width: 100%; justify-content: center; }
.auth-form .btn-lg, .auth-actions .btn-lg { padding-block: var(--sp-10); }
.auth-form [aria-invalid="true"] { border-color: var(--danger); }
.auth-form .form-label { margin-bottom: 5px; }
.auth-row { display: flex; justify-content: flex-end; margin-top: -4px; font-size: var(--text-12); }
.auth-row a { color: var(--accent); }
.auth-code { font-family: var(--font-mono); letter-spacing: 0.4em; text-align: center; font-size: var(--text-16); }
.turnstile-slot { min-height: 65px; }

/* ---------- providers: side by side when there are several ---------- */
.auth-provider-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: var(--sp-8);
}
.provider-btn {
    width: 100%;
    justify-content: center;
    padding: var(--sp-8) var(--sp-10);
    font-size: var(--text-12-5, 12.5px);
    white-space: nowrap;
}
.provider-btn .icon { font-size: 1.05rem; }

.auth-divider {
    display: flex;
    align-items: center;
    gap: var(--sp-12);
    color: var(--fg-3, var(--fg-2));
    font-size: var(--text-11);
    letter-spacing: 0.04em;
}
.auth-divider::before, .auth-divider::after { height: 1px; flex: 1; background: var(--line-strong, var(--line)); content: ""; }

.auth-alt { margin: 0; color: var(--fg-2); font-size: var(--text-12-5); text-align: center; }
.auth-alt a { color: var(--accent); }
.auth-alt a:hover, .auth-row a:hover { text-decoration: underline; }
.auth-alt--muted { margin-top: calc(var(--sp-8) * -1); font-size: var(--text-12); }

/* ---------- brand panel: pinned to the viewport ---------- */
.auth-panel {
    position: sticky;
    top: 12px;
    display: flex;
    height: calc(100vh - 24px);
    height: calc(100dvh - 24px);
    align-items: flex-end;
    margin: 12px;
    padding: clamp(28px, 4vw, 52px);
    overflow: hidden;
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 20px;
    background:
        radial-gradient(circle at 85% 12%, var(--accent-glow, rgba(59, 130, 246, 0.28)), transparent 32%),
        radial-gradient(circle at 8% 92%, rgba(139, 92, 246, 0.2), transparent 40%),
        linear-gradient(135deg, var(--accent-soft), var(--violet-soft, rgba(139, 92, 246, 0.08))),
        var(--bg-1);
}

.auth-panel::before {
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(0deg, transparent, transparent 31px, rgba(148, 163, 184, 0.05) 31px, rgba(148, 163, 184, 0.05) 32px),
        repeating-linear-gradient(90deg, transparent, transparent 31px, rgba(148, 163, 184, 0.05) 31px, rgba(148, 163, 184, 0.05) 32px);
    content: "";
    -webkit-mask-image: linear-gradient(180deg, transparent, #000 70%);
    mask-image: linear-gradient(180deg, transparent, #000 70%);
}

.auth-panel__inner { position: relative; width: 100%; max-width: 480px; }
.auth-panel__eyebrow {
    color: var(--accent);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.auth-panel h2 { margin: var(--sp-8) 0 20px; color: var(--fg-0); font-size: 26px; letter-spacing: -0.03em; line-height: 1.15; }

.auth-points { display: flex; flex-direction: column; gap: var(--sp-14); margin: 0; padding: 0; list-style: none; }
.auth-points li { display: flex; align-items: flex-start; gap: var(--sp-12); }
.auth-points__icon {
    display: inline-flex;
    width: 36px;
    height: 36px;
    flex: none;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--accent);
    background: var(--bg-1);
    box-shadow: var(--shadow-sm, none);
    font-size: 1.05rem;
}
.auth-points strong { display: block; color: var(--fg-0); font-size: 13.5px; }
.auth-points small { display: block; margin-top: 2px; color: var(--fg-2); font-size: var(--text-12); line-height: 1.5; }

/* Purchase intent */
.auth-intent {
    display: flex;
    align-items: center;
    gap: var(--sp-12);
    padding: var(--sp-16);
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--bg-1);
    box-shadow: var(--shadow-sm, none);
}
.auth-intent__copy { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.auth-intent__copy small { color: var(--fg-2); font-size: var(--text-11); letter-spacing: 0.04em; text-transform: uppercase; }
.auth-intent__copy strong { color: var(--fg-0); font-size: var(--text-16); overflow-wrap: anywhere; }
.auth-intent__price { margin-top: 4px; color: var(--accent); font-weight: 600; }
.auth-panel__note { margin: var(--sp-14) 0 0; color: var(--fg-2); font-size: var(--text-12); line-height: 1.5; }

/* Staff variant */
.auth-layout--staff .auth-panel {
    border-color: var(--line);
    background:
        radial-gradient(circle at 85% 12%, rgba(148, 163, 184, 0.14), transparent 34%),
        linear-gradient(160deg, var(--bg-2), var(--bg-1));
}
.auth-layout--staff .auth-panel__eyebrow,
.auth-layout--staff .auth-points__icon { color: var(--fg-1, var(--fg-0)); }

/* ---------- misc ---------- */
.auth-skip { position: absolute; left: 12px; top: -100px; z-index: 20; padding: 12px; background: var(--bg-1); color: var(--accent); }
.auth-skip:focus { top: 12px; }

@media (max-width: 991.98px) {
    .auth-layout { grid-template-columns: minmax(0, 1fr); }
    .auth-panel { display: none; }
}
@media (max-width: 480px) {
    .auth-main { padding: var(--sp-16); }
    .auth-form .form-grid--2 { grid-template-columns: minmax(0, 1fr); }
}