/**
 * Auth surface — Login / Register / Forgot password
 * Redesigned following AGENTS.md §27 Design Strategy System
 *
 * Design Brief:
 * - ACTOR: Mixed professional (business user + developer)
 * - ACTION: Authenticate to access AI tool workspace
 * - CONTEXT: Desktop focused work, occasional use
 * - DATA SHAPE: Linear form flow with optional OAuth
 * - FREQUENCY: Regular (weekly)
 * - POLE: B (Clean Light Product) - approachable, professional, generous spacing
 * - SKELETON: Modified split-screen with enhanced visual hierarchy
 * - DENSITY: Medium (52-56px row height, 16-20px padding)
 *
 * All tokens follow AGENTS.md §9: only --tn-* names, no hex, no inline styles.
 */

/* ─── Layout shell ────────────────────────────────────────────────────── */

body[data-shell-surface="auth"] {
    margin: 0;
    min-height: 100svh;
    font-family: var(--tn-font-body), system-ui, sans-serif;
    background: var(--tn-color-paper);
    color: var(--tn-color-ink);
    -webkit-font-smoothing: antialiased;

    --tn-auth-canvas: var(--tn-color-paper);
    --tn-auth-canvas-soft: var(--tn-color-cream);
    --tn-auth-panel: var(--tn-color-paper-warm);
    --tn-auth-input: var(--tn-color-paper);
    --tn-auth-border: rgb(var(--tn-color-ink-rgb) / 0.14);
    --tn-auth-border-strong: rgb(var(--tn-color-ink-rgb) / 0.34);
    --tn-auth-visual-start: color-mix(in srgb, var(--tn-color-cream) 72%, var(--tn-color-teal-soft));
    --tn-auth-visual-end: color-mix(in srgb, var(--tn-color-paper) 58%, var(--tn-color-pink-soft));
    --tn-auth-visual-accent: color-mix(in srgb, var(--tn-color-pink) 72%, var(--tn-color-teal));

    --tn-surface-canvas: var(--tn-auth-canvas);
    --tn-surface-overlay: var(--tn-auth-input);
    --tn-surface-subtle: var(--tn-auth-canvas-soft);
    --tn-surface-inset: var(--tn-color-cream);
    --tn-surface-panel: var(--tn-auth-input);
    --tn-surface-panel-muted: var(--tn-auth-canvas-soft);
    --tn-surface-elevated: var(--tn-auth-panel);
    --tn-border-default: var(--tn-auth-border);
    --tn-border-muted: rgb(var(--tn-color-ink-rgb) / 0.10);
    --tn-border-subtle: rgb(var(--tn-color-ink-rgb) / 0.10);
    --tn-border-strong: var(--tn-auth-border-strong);
    --tn-text-default: var(--tn-color-ink);
    --tn-text-muted: var(--tn-color-muted);
    --tn-text-soft: var(--tn-color-soft);
    --tn-accent-primary: var(--tn-color-pink);
    --tn-accent-primary-strong: var(--tn-color-pink-strong);
    --tn-focus-ring: rgb(var(--tn-color-pink-rgb) / 0.32);
}

.auth-shell {
    display: grid;
    grid-template-columns: 1fr;
    min-height: 100svh;
    background: var(--tn-surface-canvas);
    color: var(--tn-text-default);
}

.auth-shell *,
.auth-shell *::before,
.auth-shell *::after {
    box-sizing: border-box;
}

.auth-visual {
    display: none;
    background:
        linear-gradient(135deg, var(--tn-auth-visual-start) 0%, var(--tn-auth-visual-end) 100%);
    position: relative;
    overflow: hidden;
    min-height: 100svh;
    padding: clamp(3rem, 8vw, 6rem);
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.auth-visual::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, color-mix(in srgb, var(--tn-color-ink) 9%, transparent) 1px, transparent 1px),
        linear-gradient(to bottom, color-mix(in srgb, var(--tn-color-ink) 9%, transparent) 1px, transparent 1px);
    background-size: 72px 72px;
    pointer-events: none;
    opacity: 0.42;
}

.auth-visual::after {
    content: "";
    position: absolute;
    inset: auto 14% clamp(2rem, 7vw, 5rem);
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        color-mix(in srgb, var(--tn-color-teal) 52%, transparent),
        color-mix(in srgb, var(--tn-auth-visual-accent) 64%, transparent),
        transparent
    );
    pointer-events: none;
}

.auth-visual__content {
    position: relative;
    z-index: 1;
    max-width: 31rem;
    text-align: center;
}

.auth-visual__brand {
    width: 4.25rem;
    height: 4.25rem;
    border-radius: 1.125rem;
    background: color-mix(in srgb, var(--tn-color-paper) 88%, var(--tn-auth-visual-accent));
    border: 1px solid color-mix(in srgb, var(--tn-color-paper) 68%, transparent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2.25rem;
    box-shadow: 0 18px 48px color-mix(in srgb, var(--tn-color-ink) 16%, transparent);
}

.auth-visual__brand img {
    width: 40px;
    height: 40px;
    display: block;
}

.auth-visual__heading {
    font-size: clamp(2rem, 4vw, 3.25rem);
    line-height: 1.05;
    font-weight: 700;
    color: var(--tn-color-ink);
    letter-spacing: 0;
    margin: 0 0 1.125rem 0;
}

.auth-visual__lede {
    font-size: 1.0625rem;
    line-height: 1.65;
    color: var(--tn-color-muted);
    margin: 0 0 2.5rem 0;
}

.auth-visual__avatars {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    background: color-mix(in srgb, var(--tn-color-paper) 78%, transparent);
    border: 1px solid color-mix(in srgb, var(--tn-color-ink) 12%, transparent);
    border-radius: 999px;
    backdrop-filter: blur(12px);
}

.auth-visual__avatar-stack {
    display: flex;
    margin-right: 0.25rem;
}

.auth-visual__avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    border: 2px solid var(--tn-color-paper);
    background: color-mix(in srgb, var(--tn-auth-visual-accent) 72%, var(--tn-color-paper));
    color: var(--tn-color-ink);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: -0.5rem;
}

.auth-visual__avatar:first-child { margin-left: 0; }

.auth-visual__caption {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--tn-color-muted);
}

/* ─── Form column ─────────────────────────────────────────────────────── */

.auth-form-column {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100svh;
    background:
        linear-gradient(180deg, var(--tn-color-paper) 0%, var(--tn-color-cream) 100%);
    padding: clamp(2rem, 5vh, 4rem) clamp(1.25rem, 5vw, 4rem);
    animation: auth-fade-in 500ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes auth-fade-in {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-form-wrap {
    width: 100%;
    max-width: 29rem;
}

@media (max-width: 480px) {
    .auth-form-column { padding: 1.25rem 1rem; }
    body[data-shell-surface="auth"] .auth-form-wrap { padding: var(--tn-space-4); }
}

.auth-mobile-brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    margin: 0 auto 2rem;
}
.auth-mobile-brand img {
    width: 3rem;
    height: 3rem;
    display: block;
}

.auth-heading {
    text-align: center;
    margin-bottom: 1.75rem;
}

.auth-heading__title {
    font-size: clamp(2rem, 3vw, 2.5rem);
    font-weight: 700;
    color: var(--tn-text-default);
    letter-spacing: 0;
    margin: 0 0 0.5rem 0;
}

.auth-heading__subtitle {
    font-size: 1rem;
    line-height: 1.5;
    color: var(--tn-text-muted);
    margin: 0;
}

/* ─── Social buttons ──────────────────────────────────────────────────── */

.auth-social-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 0 0 1.5rem 0;
}

.auth-social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    height: 2.75rem;
    padding: 0 1rem;
    border: 1.5px solid var(--tn-border-default);
    background: var(--tn-surface-panel);
    color: var(--tn-text-default);
    font-size: 0.9375rem;
    font-weight: 500;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 180ms cubic-bezier(0.16, 1, 0.3, 1);
}
.auth-social-btn:hover {
    background: var(--tn-surface-elevated);
    border-color: var(--tn-border-strong);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px -2px color-mix(in srgb, var(--tn-text-default) 8%, transparent);
}
.auth-social-btn:active {
    transform: translateY(0);
}
.auth-social-btn:focus-visible {
    outline: 2px solid var(--tn-accent-primary);
    outline-offset: 2px;
}
.auth-social-btn svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* ─── Divider ─────────────────────────────────────────────────────────── */

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.75rem 0;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--tn-text-muted);
}
.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid var(--tn-border-subtle);
}
.auth-divider::before { margin-right: 1.25rem; }
.auth-divider::after { margin-left: 1.25rem; }

/* ─── Form fields ─────────────────────────────────────────────────────── */

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
}

.auth-field__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.auth-field__label {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--tn-text-default);
    margin: 0;
}

.auth-field__hint-link {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--tn-accent-text);
    text-decoration: none;
    transition: color 150ms ease;
}
.auth-field__hint-link:hover {
    color: var(--tn-accent-primary-strong);
    text-decoration: underline;
}
.auth-field__hint-link:focus-visible {
    outline: 2px solid var(--tn-accent-primary);
    outline-offset: 2px;
    border-radius: 3px;
}

.auth-input {
    width: 100%;
    height: 3.25rem;
    padding: 0 1rem;
    background: var(--tn-surface-panel);
    border: 1px solid var(--tn-border-default);
    border-radius: 0.625rem;
    color: var(--tn-text-default);
    font-size: 1rem;
    font-family: inherit;
    transition: all 180ms cubic-bezier(0.16, 1, 0.3, 1);
}
.auth-input::placeholder {
    color: color-mix(in srgb, var(--tn-text-muted) 72%, transparent);
}
.auth-input:hover {
    border-color: var(--tn-border-strong);
}
.auth-input:focus {
    outline: none;
    border-color: var(--tn-accent-primary);
    box-shadow: 0 0 0 3px var(--tn-focus-ring);
    background: var(--tn-surface-elevated);
}
.auth-input--with-affix { padding-right: 3.25rem; }

.auth-field__affix {
    position: absolute;
    right: 0.625rem;
    top: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: 0;
    background: transparent;
    color: var(--tn-text-muted);
    cursor: pointer;
    border-radius: 0.5rem;
    transition: all 150ms ease;
}
.auth-field__affix:hover {
    color: var(--tn-text-default);
    background: var(--tn-surface-inset);
}
.auth-field__affix:focus-visible {
    outline: 2px solid var(--tn-accent-primary);
    outline-offset: 1px;
}
.auth-field__affix .material-symbols-outlined {
    font-size: 1.25rem;
}
.auth-field__affix-icon {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}
.auth-field__affix[aria-pressed="false"] .auth-field__affix-icon--hide { display: none; }
.auth-field__affix[aria-pressed="true"] .auth-field__affix-icon--show { display: none; }

.auth-field__error {
    color: var(--tn-error);
    font-size: 0.8125rem;
    margin: 0;
    min-height: 1em;
}

/* ─── Validation summary ──────────────────────────────────────────────── */

.auth-validation-summary {
    padding: 0.875rem 1rem;
    border: 1.5px solid var(--tn-error);
    border-radius: 0.5rem;
    background: var(--tn-error-soft);
    color: var(--tn-error);
    font-size: 0.875rem;
}
.auth-validation-summary ul {
    margin: 0;
    padding-left: 1.25rem;
    list-style: disc;
}
.auth-validation-summary ul li { margin: 0.25rem 0; }

/* ─── Primary submit ──────────────────────────────────────────────────── */

.auth-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    height: 3.25rem;
    border: 0;
    border-radius: 0.625rem;
    background: var(--tn-accent-primary);
    color: var(--tn-color-paper);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 0.25rem;
    transition: all 180ms cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 1px 2px color-mix(in srgb, var(--tn-text-default) 8%, transparent);
}
.auth-submit:hover {
    background: var(--tn-accent-primary-strong);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px -2px color-mix(in srgb, var(--tn-accent-primary) 40%, transparent);
}
.auth-submit:active {
    transform: translateY(0);
}
.auth-submit:focus-visible {
    outline: 2px solid var(--tn-accent-primary);
    outline-offset: 2px;
}
.auth-submit[aria-busy="true"] {
    cursor: wait;
    opacity: 0.8;
}
.auth-submit__spinner {
    width: 1rem;
    height: 1rem;
    border: 2px solid color-mix(in srgb, var(--tn-color-paper) 50%, transparent);
    border-top-color: var(--tn-color-paper);
    border-radius: 50%;
    animation: auth-spin 600ms linear infinite;
    display: none;
}
.auth-submit[aria-busy="true"] .auth-submit__spinner { display: inline-block; }
.auth-submit[aria-busy="true"] .auth-submit__label { opacity: 0.7; }

@keyframes auth-spin {
    to { transform: rotate(360deg); }
}

/*
 * ── Auth cooldown state ──────────────────────────────────────────────
 *
 * Shared visual state used by `auth-cooldown.js` to communicate that a
 * rate-limited auth action (Resend verification, Send reset link) is
 * temporarily unavailable while the matching server-side window
 * (`ResendVerificationWindow` / `ForgotPasswordRateLimitWindow` —
 * both 60 s in `AuthController`) elapses.
 *
 * The script sets `.is-auth-cooldown-active` on the participating
 * submit button, swaps its label to a "Resend in 42s"-style template,
 * and re-toggles `disabled` + `aria-disabled`. The selector below
 * matches both vanilla buttons (e.g. the inline Resend link on
 * VerifyEmail) and the design-system `.auth-submit` button, so the
 * affordance is consistent across all three auth surfaces that
 * participate in the cooldown contract.
 */
.is-auth-cooldown-active {
    cursor: not-allowed;
    opacity: 0.7;
}
.is-auth-cooldown-active:hover {
    /* Suppress the hover state — the button is inert during cooldown. */
    background: inherit;
}
.auth-submit.is-auth-cooldown-active:hover {
    background: var(--tn-accent-primary);
}

/* ─── Resend verification disclosure ──────────────────────────────────── */

.auth-resend {
    margin-top: 1.5rem;
    border: 1.5px solid var(--tn-border-subtle);
    border-radius: 0.5rem;
    background: var(--tn-surface-panel);
    transition: border-color 150ms ease;
}
.auth-resend[open] {
    border-color: var(--tn-border-default);
}
.auth-resend__summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1rem;
    font-size: 0.9375rem;
    color: var(--tn-text-muted);
    cursor: pointer;
    list-style: none;
    user-select: none;
    transition: color 150ms ease;
}
.auth-resend__summary::-webkit-details-marker {
    display: none;
}
.auth-resend__summary:hover {
    color: var(--tn-text-default);
}
.auth-resend__summary:focus-visible {
    outline: 2px solid var(--tn-accent-primary);
    outline-offset: 2px;
    border-radius: 3px;
}
.auth-resend__cta {
    font-weight: 600;
    color: var(--tn-accent-text);
    transition: color 150ms ease;
}
.auth-resend__summary:hover .auth-resend__cta {
    color: var(--tn-accent-primary-strong);
}
.auth-resend__form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0 1rem 1rem;
    border-top: 1px solid var(--tn-border-subtle);
    margin-top: 0.5rem;
    padding-top: 1rem;
}
.auth-resend__hint {
    margin: 0;
    font-size: 0.875rem;
    color: var(--tn-text-muted);
    line-height: 1.5;
}

/* ─── Cross-link footer ───────────────────────────────────────────────── */

.auth-footer {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.9375rem;
    color: var(--tn-text-muted);
}
.auth-footer__link {
    font-weight: 600;
    color: var(--tn-accent-text);
    text-decoration: none;
    transition: color 150ms ease;
}
.auth-footer__link:hover {
    color: var(--tn-accent-primary-strong);
    text-decoration: underline;
}
.auth-footer__link:focus-visible {
    outline: 2px solid var(--tn-accent-primary);
    outline-offset: 2px;
    border-radius: 3px;
}

/* ─── Breakpoints ─────────────────────────────────────────────────────── */

@media (min-width: 1024px) {
    .auth-shell { grid-template-columns: minmax(30rem, 0.95fr) minmax(32rem, 1.05fr); }
    .auth-visual { display: flex; }
    .auth-mobile-brand { display: none; }
    .auth-heading { text-align: left; }
    .auth-form-column { padding: clamp(2.5rem, 6vh, 4.5rem) clamp(3rem, 7vw, 6rem); }
    .auth-form-wrap { max-width: 31rem; }
}

@media (min-width: 1280px) {
    .auth-form-wrap { max-width: 32rem; }
}

/* ─── OTP Input ───────────────────────────────────────────────────────── */

.auth-otp-container {
    display: flex;
    justify-content: center;
    gap: 0.625rem;
    margin-top: 0.75rem;
}

.auth-otp-box {
    width: 3rem;
    height: 3.5rem;
    text-align: center;
    font-size: 1.375rem;
    font-weight: 600;
    background: var(--tn-surface-panel);
    border: 1.5px solid var(--tn-border-default);
    color: var(--tn-text-default);
    border-radius: 0.5rem;
    transition: all 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-otp-box:hover {
    border-color: var(--tn-border-strong);
}

.auth-otp-box:focus {
    outline: none;
    border-color: var(--tn-accent-primary);
    box-shadow: 0 0 0 3px var(--tn-focus-ring);
    background: var(--tn-surface-elevated);
}

.auth-otp-separator {
    color: var(--tn-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    padding: 0 0.25rem;
}

/* ─── Banners & Alerts ────────────────────────────────────────────────── */

.auth-banner {
    margin-bottom: 1.5rem;
    padding: 1rem;
    border-radius: 0.5rem;
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    font-size: 0.875rem;
    line-height: 1.6;
}

.auth-banner--info {
    background: var(--tn-info-soft);
    border: 1.5px solid var(--tn-info);
    color: var(--tn-text-default);
}

.auth-banner--error {
    background: var(--tn-error-soft);
    border: 1.5px solid var(--tn-error);
    color: var(--tn-text-default);
}

.auth-banner__icon {
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 0.125rem;
}
svg.auth-banner__icon {
    width: 20px;
    height: 20px;
}

.auth-banner--info .auth-banner__icon {
    color: var(--tn-info);
}

.auth-banner--error .auth-banner__icon {
    color: var(--tn-error);
}

/* ─── Inline Links ────────────────────────────────────────────────────── */

.auth-inline-link {
    font-weight: 600;
    color: var(--tn-accent-primary);
    text-decoration: none;
    transition: color 150ms ease;
}

.auth-inline-link:hover {
    color: var(--tn-accent-primary-strong);
    text-decoration: underline;
}

.auth-inline-link--button {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    font-size: inherit;
    font-family: inherit;
}

.auth-inline-link--button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

/* ─── Helper Text ─────────────────────────────────────────────────────── */

.auth-helper-text {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--tn-text-muted);
    line-height: 1.5;
}

.auth-helper-text + .auth-helper-text {
    margin-top: 0.75rem;
}

/* ─── Checkbox & Radio ────────────────────────────────────────────────── */

.auth-field-row {
    flex-direction: row;
    align-items: center;
    gap: 0.625rem;
}

.auth-checkbox-inline {
    width: 1.125rem;
    height: 1.125rem;
    border: 1.5px solid var(--tn-border-default);
    border-radius: 0.25rem;
    background: var(--tn-surface-panel);
    cursor: pointer;
    transition: all 150ms ease;
    margin: 0;
}

.auth-checkbox-inline:hover {
    border-color: var(--tn-border-strong);
}

.auth-checkbox-inline:checked {
    background: var(--tn-accent-primary);
    border-color: var(--tn-accent-primary);
}

.auth-checkbox-inline:focus-visible {
    outline: 2px solid var(--tn-accent-primary);
    outline-offset: 2px;
}

.auth-label-inline {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--tn-text-default);
    margin: 0;
    cursor: pointer;
    user-select: none;
}

/* ─── Password Strength Meter ─────────────────────────────────────────── */

.auth-password-strength {
    margin-top: 0.625rem;
    opacity: 0;
    transition: opacity 200ms ease;
}

.auth-password-strength--visible {
    opacity: 1;
}

.auth-password-strength__track {
    height: 4px;
    background: var(--tn-border-subtle);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.auth-password-strength__bar {
    height: 100%;
    width: 0;
    transition: width 300ms cubic-bezier(0.16, 1, 0.3, 1),
                background-color 300ms ease;
    border-radius: 2px;
}

.auth-password-strength__label {
    font-size: 0.8125rem;
    font-weight: 600;
    transition: color 200ms ease;
}

/* ─── Reduced motion ──────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    .auth-form-column {
        animation: none;
    }
    .auth-input,
    .auth-social-btn,
    .auth-submit,
    .auth-field__affix,
    .auth-footer__link,
    .auth-otp-box,
    .auth-inline-link,
    .auth-resend,
    .auth-field__hint-link {
        transition: none;
        transform: none !important;
    }
    .auth-submit__spinner {
        animation-duration: 1200ms;
    }
    .auth-password-strength__bar {
        transition: width 300ms ease;
    }
}

/* ==========================================================================
   LWH parity overlay — auth shell (Sprint C, A1-A7).

   Scoped to body[data-shell-surface="auth"] (set in _AuthLayout.cshtml).

   A1 — auth card chrome (3 px ink + flat shadow on cream)
   A2 — password policy rules → pill chips + teal when met
   A3 — social buttons → btn-outline 3 px ink
   A4 — forgot-password / resend links → pink + hover underline
   A5 — 2FA / recovery code inputs → monospace + yellow-soft fill
   A6 — verify-email success → teal stripe via data-auth-success
   A7 — access-denied CTA → yellow flat-shadow button
   ========================================================================== */
body[data-shell-surface="auth"] {
    background: var(--tn-color-cream);
}

body[data-shell-surface="auth"] .auth-form-wrap {
    border: var(--tn-border-heavy);
    border-radius: var(--tn-radius-xl);
    background: var(--tn-color-paper);
    box-shadow: 6px 6px 0 var(--tn-color-ink);
    padding: var(--tn-space-6);
}

body[data-shell-surface="auth"] .auth-heading__title {
    color: var(--tn-color-ink);
    font-weight: 800;
    letter-spacing: -0.02em;
}

body[data-shell-surface="auth"] .auth-heading__subtitle {
    color: var(--tn-color-ink);
    opacity: 0.75;
}

body[data-shell-surface="auth"] .auth-input {
    border: 2px solid var(--tn-color-ink);
    border-radius: var(--tn-radius-md);
    background: var(--tn-color-paper);
    color: var(--tn-color-ink);
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

body[data-shell-surface="auth"] .auth-input:focus,
body[data-shell-surface="auth"] .auth-input:focus-visible {
    outline: none;
    border-color: var(--tn-color-pink);
    box-shadow: 3px 3px 0 var(--tn-color-pink);
}

body[data-shell-surface="auth"] .auth-submit {
    border: var(--tn-border-heavy);
    border-radius: var(--tn-radius-md);
    background: var(--tn-color-pink);
    color: var(--tn-color-ink);
    box-shadow: 4px 4px 0 var(--tn-color-ink);
    font-weight: 800;
    transition:
        box-shadow 0.15s ease,
        transform 0.15s ease;
}

body[data-shell-surface="auth"] .auth-submit:hover,
body[data-shell-surface="auth"] .auth-submit:focus-visible {
    box-shadow: 2px 2px 0 var(--tn-color-ink);
    transform: translate(2px, 2px);
}

body[data-shell-surface="auth"] .auth-field__hint-link,
body[data-shell-surface="auth"] .auth-resend__cta,
body[data-shell-surface="auth"] .auth-inline-link {
    color: var(--tn-accent-text);
    font-weight: 700;
}

body[data-shell-surface="auth"] .auth-field__hint-link:hover,
body[data-shell-surface="auth"] .auth-field__hint-link:focus-visible,
body[data-shell-surface="auth"] .auth-resend__cta:hover,
body[data-shell-surface="auth"] .auth-inline-link:hover {
    text-decoration: underline;
    text-decoration-thickness: 2px;
}

body[data-shell-surface="auth"] .auth-field__error,
body[data-shell-surface="auth"] .auth-validation-summary {
    color: var(--tn-color-pink);
    font-weight: 600;
}

body[data-shell-surface="auth"] .password-policy-rule {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 2px 4px 2px 0;
    padding: 4px 10px;
    border: 2px solid var(--tn-color-ink);
    border-radius: var(--tn-radius-pill);
    background: var(--tn-color-paper);
    color: var(--tn-color-ink);
    font-size: var(--tn-font-size-xs);
    font-weight: 600;
    transition:
        background 0.15s ease,
        color 0.15s ease;
}

body[data-shell-surface="auth"] .password-policy-rule[data-met="true"] {
    background: var(--tn-color-teal);
    color: var(--tn-color-ink);
}

body[data-shell-surface="auth"] .password-policy-rule__icon-met {
    display: none;
}

body[data-shell-surface="auth"] .password-policy-rule[data-met="true"] .password-policy-rule__icon-unmet {
    display: none;
}

body[data-shell-surface="auth"] .password-policy-rule[data-met="true"] .password-policy-rule__icon-met {
    display: inline-block;
}

body[data-shell-surface="auth"] .auth-social-btn,
body[data-shell-surface="auth"] .auth-social__btn,
body[data-shell-surface="auth"] [data-auth-social] {
    border: var(--tn-border-heavy);
    border-radius: var(--tn-radius-md);
    background: var(--tn-color-paper);
    color: var(--tn-color-ink);
    box-shadow: 3px 3px 0 var(--tn-color-ink);
    font-weight: 700;
    transition:
        box-shadow 0.15s ease,
        transform 0.15s ease;
}

body[data-shell-surface="auth"] .auth-social-btn:hover,
body[data-shell-surface="auth"] .auth-social__btn:hover,
body[data-shell-surface="auth"] [data-auth-social]:hover {
    box-shadow: 1px 1px 0 var(--tn-color-ink);
    transform: translate(2px, 2px);
}

body[data-shell-surface="auth"] .auth-otp-input,
body[data-shell-surface="auth"] .auth-recovery-input,
body[data-shell-surface="auth"] [data-auth-otp],
body[data-shell-surface="auth"] [data-auth-recovery],
body[data-shell-surface="auth"] .auth-input[autocomplete="one-time-code"],
body[data-shell-surface="auth"] .auth-input[inputmode="numeric"] {
    font-family: var(--tn-font-mono);
    font-size: var(--tn-font-size-lg);
    font-weight: 700;
    letter-spacing: 0.2em;
    text-align: center;
    border: var(--tn-border-heavy);
    border-radius: var(--tn-radius-md);
    background: var(--tn-color-yellow-soft);
    color: var(--tn-color-ink);
    box-shadow: 3px 3px 0 var(--tn-color-ink);
}

body[data-shell-surface="auth"] [data-auth-success="verify-email"] {
    border: var(--tn-border-heavy);
    border-radius: var(--tn-radius-lg);
    background: var(--tn-color-paper);
    box-shadow: 4px 4px 0 var(--tn-color-ink);
    padding: var(--tn-space-5);
    position: relative;
    overflow: hidden;
}

body[data-shell-surface="auth"] [data-auth-success="verify-email"]::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: var(--tn-color-teal);
}

body[data-shell-surface="auth"] [data-auth-cta="access-denied"],
body[data-shell-surface="auth"] .auth-access-denied__cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: var(--tn-space-2) var(--tn-space-5);
    border: var(--tn-border-heavy);
    border-radius: var(--tn-radius-md);
    background: var(--tn-color-yellow);
    color: var(--tn-color-ink);
    box-shadow: 4px 4px 0 var(--tn-color-ink);
    font-weight: 800;
    text-decoration: none;
    transition:
        box-shadow 0.15s ease,
        transform 0.15s ease;
}

body[data-shell-surface="auth"] [data-auth-cta="access-denied"]:hover,
body[data-shell-surface="auth"] .auth-access-denied__cta:hover {
    box-shadow: 1px 1px 0 var(--tn-color-ink);
    transform: translate(3px, 3px);
}

