/* ================================================================
   Auth pages (sign in / sign up / reset / verified)
   ----------------------------------------------------------------
   Split layout: a brand panel on the app canvas (--qs-bg-secondary:
   gray-50 in light, Ink canvas in dark) beside a form panel on the app
   surface. Both follow the --qs-* tokens, so the pages read as the
   first screen of the product rather than a separate marketing site.
   Display type is Poppins, the same face the app shell uses.

   Images that need a per-theme variant carry .auth-img-light /
   .auth-img-dark; html.dark-mode swaps them (see bottom).
   ================================================================ */

.auth-shell {
    --auth-brand-text: var(--qs-text-primary);
    --auth-brand-muted: var(--qs-text-secondary);
    --auth-brand-line: var(--qs-border-primary);
    --auth-brand-glass: var(--qs-bg-primary);
    --auth-brand-accent: var(--qs-accent);
    --auth-field-h: 46px;
    --auth-max: 440px;

    display: grid;
    grid-template-columns: minmax(0, 1fr);
    min-height: 100vh;
    background: var(--qs-bg-primary);
    color: var(--qs-text-primary);
}

@media (min-width: 992px) {
    .auth-shell {
        grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    }
}

/* ---------- Brand panel ---------- */

.auth-brand {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1.25rem 1.75rem;
    background: var(--qs-bg-secondary);
    color: var(--auth-brand-text);
    border-bottom: 1px solid var(--qs-border-primary);
}

.auth-brand > * {
    position: relative;
}

@media (min-width: 992px) {
    .auth-brand {
        padding: 2.25rem 3rem 2.5rem;
        min-height: 100vh;
        border-bottom: 0;
        border-right: 1px solid var(--qs-border-primary);
    }
}

.auth-brand-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.auth-logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.auth-logo img {
    height: 38px;
    width: auto;
    display: block;
}

.auth-brand-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 520px;
    margin: 1.75rem 0 1.25rem;
}

@media (min-width: 992px) {
    .auth-brand-body {
        margin: 2.5rem 0 2rem;
    }
}

.auth-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--auth-brand-accent);
    margin-bottom: 1rem;
}

.auth-eyebrow::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: var(--qs-radius-circle);
    background: currentColor;
    box-shadow: 0 0 0 4px var(--qs-accent-light);
}

.auth-headline {
    font-family: "Poppins", var(--qs-font-family);
    font-weight: 700;
    font-size: clamp(1.65rem, 1.1rem + 1.6vw, 2.45rem);
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--auth-brand-text);
    margin: 0 0 0.9rem;
    text-wrap: balance;
}

.auth-lede {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--auth-brand-muted);
    margin: 0 0 1.5rem;
    max-width: 46ch;
}

/* Proof chips */
.auth-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0 0 1.5rem;
    padding: 0;
    list-style: none;
}

.auth-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    border-radius: var(--qs-radius-full);
    background: var(--auth-brand-glass);
    border: 1px solid var(--auth-brand-line);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--auth-brand-text);
    white-space: nowrap;
}

.auth-chip svg {
    width: 14px;
    height: 14px;
    flex: none;
}

.auth-chip-star svg {
    color: var(--qs-warning);
}

.auth-chip a {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: var(--auth-brand-line);
    text-underline-offset: 2px;
}

.auth-chip a:hover {
    text-decoration-color: currentColor;
}

.auth-footnote {
    font-size: 0.74rem;
    color: var(--auth-brand-muted);
    margin: -0.9rem 0 1.5rem;
}

/* Live preview card (sign-up) */
.auth-preview {
    background: var(--auth-brand-glass);
    border: 1px solid var(--auth-brand-line);
    border-radius: var(--qs-radius-card);
    padding: 0.9rem 1rem 0.8rem;
    margin: 0 0 1.5rem;
    box-shadow: var(--qs-shadow-xs);
}

.auth-preview-cap {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--auth-brand-muted);
    margin: 0 0 0.6rem;
}

.auth-preview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding-bottom: 0.55rem;
    border-bottom: 1px solid var(--auth-brand-line);
}

.auth-preview-sku {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--auth-brand-text);
}

.auth-preview-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--qs-success);
    background: var(--qs-success-light);
    border-radius: var(--qs-radius-full);
    padding: 0.15rem 0.6rem;
    white-space: nowrap;
}

.auth-preview-badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: var(--qs-radius-circle);
    background: currentColor;
}

.auth-preview-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    font-size: 0.875rem;
    color: var(--auth-brand-text);
}

.auth-preview-row + .auth-preview-row {
    border-top: 1px solid var(--auth-brand-line);
}

.auth-preview-chan {
    flex: 1;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.auth-preview-chan img {
    height: 16px;
    width: auto;
    opacity: 0.9;
}

.auth-preview-delta {
    font-size: 0.74rem;
    color: var(--auth-brand-muted);
    white-space: nowrap;
}

.auth-preview-qty {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    min-width: 1.6rem;
    text-align: right;
}

.auth-preview-foot {
    margin: 0;
    padding-top: 0.55rem;
    border-top: 1px solid var(--auth-brand-line);
    font-size: 0.78rem;
    line-height: 1.45;
    color: var(--auth-brand-muted);
}

/* Testimonial */
.auth-quote {
    margin: 0 0 1.5rem;
    padding: 0 0 0 1rem;
    border-left: 2px solid var(--qs-accent);
}

.auth-quote p {
    font-size: 0.95rem;
    line-height: 1.55;
    color: var(--auth-brand-text);
    margin: 0 0 0.45rem;
}

.auth-quote footer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: var(--auth-brand-muted);
}

.auth-quote-stars {
    color: var(--qs-warning);
    letter-spacing: 0.08em;
    font-size: 0.72rem;
}

/* Platform logos */
.auth-logos {
    margin: 0;
}

.auth-logos-cap {
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--auth-brand-muted);
    margin: 0 0 0.7rem;
}

.auth-logos ul {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.9rem 1.4rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.auth-logos img {
    height: 20px;
    width: auto;
    display: block;
    opacity: 0.7;
    filter: grayscale(1);
    transition: opacity 0.15s ease, filter 0.15s ease;
}

.auth-logos li:hover img {
    opacity: 1;
    filter: none;
}

html.dark-mode .auth-logos img {
    filter: none;
}

html.dark-mode .auth-logos li:hover img {
    opacity: 1;
}

.auth-brand-bottom {
    font-size: 0.78rem;
    color: var(--auth-brand-muted);
    margin-top: auto;
}

.auth-brand-bottom a {
    color: var(--auth-brand-text);
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-color: var(--auth-brand-line);
}

.auth-brand-bottom a:hover {
    text-decoration-color: currentColor;
}

/* Compact brand band on small screens */
@media (max-width: 991.98px) {
    .auth-brand-body {
        margin: 1.25rem 0 0.25rem;
    }
    .auth-lede {
        margin-bottom: 1rem;
    }
    .auth-chips {
        margin-bottom: 0.25rem;
    }
    .auth-footnote,
    .auth-quote,
    .auth-logos,
    .auth-brand-bottom {
        display: none;
    }
    .auth-preview {
        display: none;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .auth-preview {
        display: block;
        margin-top: 1rem;
    }
}

/* ---------- Form panel ---------- */

.auth-panel {
    display: flex;
    flex-direction: column;
    padding: 1.25rem 1.25rem 2rem;
    background: var(--qs-bg-primary);
}

@media (min-width: 992px) {
    .auth-panel {
        padding: 1.75rem 3rem 2rem;
        min-height: 100vh;
    }
}

.auth-panel-top {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--qs-text-secondary);
}

.auth-panel-top .auth-switch,
.auth-topbar .auth-switch {
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 0 0.9rem;
    border-radius: var(--qs-radius-full);
    border: 1px solid var(--qs-border-primary);
    color: var(--qs-text-primary);
    font-weight: 600;
    font-size: 0.82rem;
    text-decoration: none;
    background: var(--qs-bg-primary);
    transition: border-color 0.15s ease, background 0.15s ease;
}

.auth-panel-top .auth-switch:hover,
.auth-topbar .auth-switch:hover {
    border-color: var(--qs-text-primary);
    background: var(--qs-bg-secondary);
    color: var(--qs-text-primary);
}

.auth-panel-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    max-width: var(--auth-max);
    margin: 1.5rem auto 1rem;
}

@media (min-width: 992px) {
    .auth-panel-body {
        margin: 2rem auto 1.5rem;
    }
}

.auth-title {
    font-family: "Poppins", var(--qs-font-family);
    font-weight: 700;
    font-size: 1.7rem;
    line-height: 1.2;
    letter-spacing: -0.015em;
    color: var(--qs-text-primary);
    margin: 0 0 0.35rem;
}

.auth-sub {
    font-size: 0.95rem;
    color: var(--qs-text-secondary);
    margin: 0 0 1.5rem;
}

/* Buttons */
.auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    min-height: 48px;
    padding: 0 1.25rem;
    border-radius: var(--qs-radius-full);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.auth-btn:focus-visible {
    outline: 2px solid var(--qs-accent);
    outline-offset: 3px;
}

.auth-btn-primary {
    background: var(--qs-btn-fill);
    border: 1px solid var(--qs-btn-fill);
    color: var(--qs-text-bright);
    box-shadow: 0 1px 2px rgba(17, 24, 39, 0.12);
}

.auth-btn-primary:hover {
    background: var(--qs-btn-fill-hover);
    border-color: var(--qs-btn-fill-hover);
    color: var(--qs-text-bright);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(17, 24, 39, 0.18);
}

.auth-btn-primary:disabled,
.auth-btn-primary[aria-busy="true"] {
    opacity: 0.7;
    cursor: progress;
    transform: none;
    box-shadow: none;
}

.auth-btn-google {
    background: var(--qs-bg-primary);
    border: 1px solid var(--qs-border-secondary);
    color: var(--qs-text-primary);
}

.auth-btn-google:hover {
    border-color: var(--qs-text-primary);
    background: var(--qs-bg-secondary);
    color: var(--qs-text-primary);
}

.auth-btn-google img {
    width: 20px;
    height: 20px;
}

.auth-hint {
    font-size: 0.78rem;
    color: var(--qs-text-muted);
    text-align: center;
    margin: 0.5rem 0 0;
}

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.25rem 0;
}

.auth-divider-rule {
    flex: 1;
    height: 1px;
    background: var(--qs-border-primary);
}

.auth-divider-label {
    font-size: 0.78rem;
    color: var(--qs-text-muted);
    white-space: nowrap;
}

/* Fields */
.auth-field {
    margin-bottom: 1rem;
}

.auth-field-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
}

.auth-label {
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--qs-text-primary);
    margin: 0;
}

.auth-field-link {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--qs-accent);
    text-decoration: none;
}

.auth-field-link:hover {
    text-decoration: underline;
    color: var(--qs-accent-hover);
}

.auth-input {
    display: block;
    width: 100%;
    min-height: var(--auth-field-h);
    padding: 0.55rem 0.9rem;
    font-size: 0.95rem;
    line-height: 1.4;
    color: var(--qs-text-primary);
    background: var(--qs-bg-primary);
    border: 1px solid var(--qs-border-secondary);
    border-radius: var(--qs-radius-lg);
    box-shadow: var(--qs-shadow-xs);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    -webkit-appearance: none;
    appearance: none;
}

.auth-input::placeholder {
    color: var(--qs-text-muted);
    opacity: 0.8;
}

.auth-input:focus {
    outline: none;
    border-color: var(--qs-accent);
    box-shadow: 0 0 0 3px var(--qs-accent-light);
}

.auth-input[aria-invalid="true"],
.auth-input.error {
    border-color: var(--qs-danger);
}

.auth-input[aria-invalid="true"]:focus,
.auth-input.error:focus {
    box-shadow: 0 0 0 3px var(--qs-danger-light);
}

.pw-field {
    position: relative;
}

.pw-field .auth-input {
    padding-right: 2.9rem;
}

.pw-toggle-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    background: none;
    border: none;
    padding: 0;
    min-width: 40px;
    min-height: 40px;
    cursor: pointer;
    color: var(--qs-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--qs-radius-full);
}

.pw-toggle-btn:hover,
.pw-toggle-btn:focus-visible {
    color: var(--qs-text-primary);
}

.auth-field-error {
    font-size: 0.8rem;
    color: var(--qs-danger);
    margin: 0.35rem 0 0;
}

.auth-alert {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    font-size: 0.86rem;
    line-height: 1.45;
    color: var(--qs-danger);
    background: var(--qs-danger-light);
    border: 1px solid rgba(220, 38, 38, 0.25);
    border-radius: var(--qs-radius-lg);
    padding: 0.7rem 0.9rem;
    margin: 0 0 1rem;
}

.auth-alert:focus {
    outline: none;
}

.auth-alert svg {
    flex: none;
    width: 16px;
    height: 16px;
    margin-top: 2px;
}

.auth-submit {
    margin-top: 0.5rem;
}

/* Password strength */
.auth-strength {
    margin: 0.5rem 0 0;
}

.auth-strength-bars {
    display: flex;
    gap: 4px;
    height: 4px;
    margin-bottom: 0.35rem;
}

.auth-strength-bar {
    flex: 1;
    background: var(--qs-border-primary);
    border-radius: var(--qs-radius-full);
    transition: background 0.3s ease;
}

.auth-strength[data-level="issue"] .auth-strength-bar:nth-child(1),
.auth-strength[data-level="weak"] .auth-strength-bar:nth-child(1) {
    background: var(--qs-danger);
}

.auth-strength[data-level="medium"] .auth-strength-bar:nth-child(-n + 2) {
    background: var(--qs-warning);
}

.auth-strength[data-level="strong"] .auth-strength-bar {
    background: var(--qs-success);
}

.auth-strength-label {
    font-size: 0.76rem;
    color: var(--qs-text-muted);
}

.auth-strength[data-level="issue"] .auth-strength-label,
.auth-strength[data-level="weak"] .auth-strength-label {
    color: var(--qs-danger);
}

.auth-strength[data-level="strong"] .auth-strength-label {
    color: var(--qs-success);
}

/* Fine print + switches */
.auth-fineprint {
    font-size: 0.78rem;
    line-height: 1.55;
    color: var(--qs-text-muted);
    text-align: center;
    margin: 0.9rem 0 0;
}

.auth-fineprint a {
    color: var(--qs-text-secondary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.auth-fineprint a:hover {
    color: var(--qs-text-primary);
}

.auth-alt {
    font-size: 0.9rem;
    color: var(--qs-text-secondary);
    text-align: center;
    margin: 1.5rem 0 0;
}

.auth-alt a {
    color: var(--qs-accent);
    font-weight: 600;
    text-decoration: none;
}

.auth-alt a:hover {
    text-decoration: underline;
}

.auth-alt-note {
    display: block;
    font-size: 0.78rem;
    color: var(--qs-text-muted);
    margin-top: 0.2rem;
}

.auth-alt-note a {
    color: var(--qs-accent);
    font-weight: 600;
    text-decoration: none;
}

.auth-alt-note a:hover {
    text-decoration: underline;
}

.auth-notice {
    font-size: 0.86rem;
    color: var(--qs-text-secondary);
    background: var(--qs-bg-secondary);
    border: 1px solid var(--qs-border-primary);
    border-radius: var(--qs-radius-lg);
    padding: 0.7rem 0.9rem;
    margin-top: 1rem;
}

.auth-notice a,
.auth-notice .btn-link {
    color: var(--qs-accent);
    font-size: inherit;
    padding: 0;
    vertical-align: baseline;
}

/* Store sign-in (Shopify / WooCommerce) */
.auth-store {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--qs-border-light);
}

.auth-store-cap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--qs-text-muted);
    margin: 0 0 0.6rem;
}

.auth-store-btns {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.auth-store-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    height: 36px;
    padding: 0 0.85rem;
    border-radius: var(--qs-radius-full);
    border: 1px solid var(--qs-border-primary);
    background: var(--qs-bg-primary);
    color: var(--qs-text-primary);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.auth-store-btn img {
    height: 16px;
    width: auto;
}

.auth-store-btn:hover,
.auth-store-btn[aria-expanded="true"] {
    border-color: var(--qs-text-primary);
    background: var(--qs-bg-secondary);
}

.auth-store-panel {
    margin-top: 0.75rem;
}

.auth-store-panel[hidden] {
    display: none;
}

.auth-store-panel .auth-input-group {
    display: flex;
    align-items: stretch;
}

.auth-store-panel .auth-input-group .auth-input {
    flex: 1;
    min-width: 0;
    border-radius: var(--qs-radius-lg) 0 0 var(--qs-radius-lg);
    min-height: 42px;
}

.auth-store-panel .auth-input-group .auth-input:only-child {
    border-radius: var(--qs-radius-lg);
}

.auth-shop-suffix {
    display: inline-flex;
    align-items: center;
    padding: 0 0.8rem;
    font-size: 0.8rem;
    color: var(--qs-text-muted);
    background: var(--qs-bg-secondary);
    border: 1px solid var(--qs-border-secondary);
    border-left: 0;
    border-radius: 0 var(--qs-radius-lg) var(--qs-radius-lg) 0;
    white-space: nowrap;
}

.auth-store-panel .auth-btn {
    min-height: 40px;
    margin-top: 0.5rem;
    font-size: 0.86rem;
}

.auth-btn-ghost {
    background: var(--qs-bg-primary);
    border: 1px solid var(--qs-border-secondary);
    color: var(--qs-text-primary);
}

.auth-btn-ghost:hover {
    border-color: var(--qs-text-primary);
    background: var(--qs-bg-secondary);
    color: var(--qs-text-primary);
}

/* Panel footer */
.auth-panel-foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem 1rem;
    font-size: 0.76rem;
    color: var(--qs-text-muted);
    margin-top: 1rem;
}

.auth-panel-foot a {
    color: var(--qs-text-muted);
    text-decoration: none;
}

.auth-panel-foot a:hover {
    color: var(--qs-text-primary);
    text-decoration: underline;
}

/* Captcha */
.auth-captcha {
    display: flex;
    justify-content: center;
    margin: 0.5rem 0 1rem;
}

/* Legacy error-list styles kept for auth-password-rules.js output */
.error-list {
    list-style: none;
    padding: 0;
    margin: 0.25rem 0 0;
}

.error-item {
    color: var(--qs-danger);
    font-size: 0.8rem;
    margin-bottom: 0.15rem;
}

.validation-messages .error-list {
    margin: 0;
}

.validation-messages .help-text {
    color: var(--qs-text-muted);
    font-size: 0.8rem;
    margin-bottom: 0.15rem;
}

/* Motion: a quiet entrance, a badge that breathes, chips that respond.
   The reduced-motion block below switches every one of these off. */
@keyframes auth-rise {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes auth-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
}

.auth-brand-body > * {
    animation: auth-rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.auth-brand-body > :nth-child(2) { animation-delay: 0.05s; }
.auth-brand-body > :nth-child(3) { animation-delay: 0.1s; }
.auth-brand-body > :nth-child(4) { animation-delay: 0.15s; }
.auth-brand-body > :nth-child(5) { animation-delay: 0.2s; }
.auth-brand-body > :nth-child(6) { animation-delay: 0.25s; }
.auth-brand-body > :nth-child(7) { animation-delay: 0.3s; }

.auth-panel-body {
    animation: auth-rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}

.auth-preview-badge::before {
    animation: auth-pulse 2.4s ease-out infinite;
}

.auth-chip {
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.auth-chip:hover {
    transform: translateY(-1px);
    background: var(--qs-bg-tertiary);
    border-color: var(--qs-border-secondary);
}

.auth-logos li img {
    transform: translateZ(0);
}

/* Focus + motion */
.auth-shell a:focus-visible,
.auth-shell button:focus-visible,
.auth-shell input:focus-visible,
.auth-shell select:focus-visible {
    outline: 2px solid var(--qs-accent);
    outline-offset: 2px;
}

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

/* Dark theme: the form panel follows tokens automatically; these only tidy
   the bits that would otherwise inherit light-only Bootstrap colours. */
html.dark-mode .auth-btn-google,
body.dark-mode .auth-btn-google,
html.dark-mode .auth-store-btn,
body.dark-mode .auth-store-btn,
html.dark-mode .auth-switch,
body.dark-mode .auth-switch {
    background: var(--qs-bg-elevated);
}

html.dark-mode .auth-input,
body.dark-mode .auth-input {
    background: var(--qs-bg-elevated);
}

html.dark-mode .auth-alert,
body.dark-mode .auth-alert {
    color: var(--qs-danger-hover);
    border-color: rgba(248, 113, 113, 0.35);
}

/* ================================================================
   Per-theme images. A light/dark pair sits side by side in the markup;
   the stylesheet shows one of them.
   ================================================================ */
/* Scoped under the page roots so they outrank `.auth-logos img` etc. */
.auth-shell .auth-img-dark,
.auth-header .auth-img-dark {
    display: none;
}

html.dark-mode .auth-shell .auth-img-light,
html.dark-mode .auth-header .auth-img-light {
    display: none;
}

html.dark-mode .auth-shell .auth-img-dark,
html.dark-mode .auth-header .auth-img-dark {
    display: block;
}

/* ================================================================
   Single-column pages (password reset / done / confirm / complete,
   email verified): the app canvas, a top bar with the logo and one
   switch, and a 440px card built from the same pieces as the split
   pages.
   ================================================================ */
.auth-header {
    background: var(--qs-bg-secondary);
}

.auth-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    max-width: 1120px;
    margin: 0 auto;
    padding: 1rem 1.25rem;
}

.auth-topbar .auth-logo img {
    height: 34px;
}

.auth-single {
    /* Same control sizes as the split pages, which declare these on .auth-shell. */
    --auth-field-h: 46px;
    --auth-max: 440px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    min-height: calc(100vh - 66px);
    padding: 1.5rem 1.25rem 3rem;
    background: var(--qs-bg-secondary);
    color: var(--qs-text-primary);
}

.auth-card {
    width: 100%;
    max-width: var(--auth-max, 440px);
    background: var(--qs-bg-primary);
    border: 1px solid var(--qs-border-primary);
    border-radius: var(--qs-radius-card);
    box-shadow: var(--qs-shadow-xs);
    padding: 2rem 1.5rem;
    animation: auth-rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@media (min-width: 576px) {
    .auth-card {
        padding: 2.25rem 2rem;
    }
}

.auth-card-head {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-card-head .auth-title {
    font-size: 1.5rem;
}

.auth-card-head .auth-sub {
    margin-bottom: 0;
}

.auth-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    border-radius: var(--qs-radius-lg);
    background: var(--qs-bg-tertiary);
    color: var(--qs-text-secondary);
}

.auth-card-icon svg {
    width: 24px;
    height: 24px;
}

.auth-card-icon--success {
    background: var(--qs-success-bg);
    color: var(--qs-success);
}

.auth-card-icon--danger {
    background: var(--qs-danger-bg);
    color: var(--qs-danger);
}

.auth-card .auth-alt {
    margin-top: 1.25rem;
}

.auth-card .auth-fineprint {
    text-align: center;
}

.auth-link-btn {
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    color: var(--qs-accent);
    font-weight: 600;
    cursor: pointer;
}

.auth-link-btn:hover {
    text-decoration: underline;
}

.auth-link-btn:disabled {
    color: var(--qs-text-muted);
    cursor: default;
    text-decoration: none;
}

.auth-single .auth-panel-foot {
    margin-top: 0;
}

/* The marketing base paints body white; in dark the canvas must reach the
   overscroll edges too. */
html.dark-mode body {
    background: var(--qs-bg-secondary);
    color: var(--qs-text-primary);
}
