/* Auth-only composition. Shared controls, fields and theme tokens come from auth.css. */
.auth-page {
    color: var(--text);
    font-family: var(--font-sans);
    --auth-input-autofill-focus-bg: color-mix(in srgb, var(--field-surface) 90%, var(--accent) 10%);
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}

.auth-page input,
.auth-page textarea,
.auth-page .auth-input,
.auth-page .auth-code-input {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    user-select: text !important;
}

.auth-shell {
    width: min(1120px, 100%);
    min-height: 100vh;
    min-height: 100svh;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    flex-direction: column;
}

.auth-header {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-size: 23px;
    font-weight: 600;
    letter-spacing: var(--tracking-tight);
    line-height: 1.2;
    text-decoration: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}

.auth-brand:hover {
    color: var(--text);
}

.auth-brand .sidebar-logo {
    width: 36px;
    height: 40px;
    flex-basis: 36px;
    margin: 0;
    filter: brightness(0);
    -webkit-user-drag: none;
    user-drag: none;
}

.darkmode .auth-brand .sidebar-logo {
    filter: none;
}

.auth-header-actions {
    display: flex;
    align-items: center;
    gap: 22px;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}

.auth-page .auth-layout {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 440px;
    align-items: center;
    gap: clamp(32px, 5vw, 64px);
    padding: var(--space-6) 0 var(--space-8);
}

.auth-story {
    min-width: 0;
    position: relative;
    align-self: center;
    margin-top: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    --auth-art-height: 440px;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}

.auth-story-copy {
    position: relative;
    z-index: 1;
    margin: 0 0 var(--space-4);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}

.auth-story h2 {
    font-size: clamp(32px, 3.2vw, 44px);
    font-weight: var(--type-weight-medium);
    letter-spacing: var(--tracking-tighter);
    line-height: var(--type-leading-tight);
    margin: 0 0 10px;
    color: var(--text);
    text-align: center;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}

.auth-story-line {
    display: inline-block;
}

.auth-story-line-1 {
    animation: auth-story-rise 700ms var(--motion-ease) both;
}

.auth-story-line-2 {
    animation: auth-story-rise 700ms var(--motion-ease) 160ms both;
}

.auth-story h2 em {
    font-style: normal;
    color: var(--text-muted);
    font-weight: 400;
    text-wrap: balance;
}

/* The lightweight globe and its SVG fallback share the auth theme palette. */
.auth-art {
    position: relative;
    height: var(--auth-art-height, 440px);
    width: calc(100% + 96px);
    margin: -6px -48px 0;
    isolation: isolate;
    pointer-events: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}
.auth-globe-poster,
#auth-globe-canvas {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    -webkit-user-drag: none;
    user-drag: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}
#auth-scene-description {
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}
#auth-globe-canvas { visibility: hidden; }
.auth-globe-poster > svg { display: block; width: 100%; height: 100%; }
/* A render failure must reveal the reserve image in the same paint. */
.auth-page .auth-globe-poster,
.auth-page .auth-globe-poster *,
.auth-page #auth-globe-canvas { transition: none !important; }
.auth-art[data-globe-state="ready"] #auth-globe-canvas { visibility: visible; }
.auth-art[data-globe-state="ready"] .auth-globe-poster { visibility: hidden; }
.auth-scene-pause [hidden] { display: none !important; }

/* Keep the page's ambient light gently connected to the illustration. */
.auth-page .app-backdrop { overflow: hidden; }
.auth-page .app-backdrop::before,
.auth-page .app-backdrop::after {
    transform: none;
    transition: opacity .4s ease;
}
.auth-page .app-backdrop::before {
    background: radial-gradient(ellipse 48% 55% at 90% 6%, rgba(var(--accent-rgb), .07), transparent 70%);
}
.auth-page .app-backdrop::after {
    background:
        radial-gradient(ellipse 50% 60% at 90% 6%, rgba(var(--info-rgb), .09), rgba(var(--accent-rgb), .04) 42%, transparent 72%),
        radial-gradient(ellipse 40% 48% at 22% 58%, rgba(var(--info-rgb), .025), transparent 76%);
}

.auth-form-panel {
    min-width: 0;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}

@media (min-width: 1024px) {
    .auth-form-panel { min-height: var(--auth-form-min-height, 0px); }
}

.auth-page .auth-container {
    max-width: 440px !important;
}

.auth-page .form.auth-card {
    margin: 0;
    padding: var(--space-8) !important;
    overflow: visible;
    border-color: var(--surface-card-edge) !important;
    box-shadow: var(--surface-card-shadow) !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    background-color: var(--surface-card) !important;
    background-image: var(--surface-card-sheen) !important;
    border-radius: var(--surface-card-radius) !important;
}

.auth-page .form.auth-card::before { display: none; }
html.theme-transitioning .auth-page .form.auth-card { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }

.auth-page .auth-form-heading,
.auth-page .auth-title,
.auth-page .auth-description,
.auth-page .auth-mode-description,
.auth-page .label,
.auth-page .auth-divider,
.auth-page .divider-text,
.auth-page .auth-account-switch,
.auth-page .auth-switch-link,
.auth-page .button-auth-switch {
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}

.auth-page .auth-form-heading {
    margin-bottom: var(--space-5);
}

.auth-page .auth-title {
    font-size: 28px;
    font-weight: 550;
    letter-spacing: var(--tracking-tight);
    line-height: var(--type-leading-tight);
}

.auth-description {
    color: var(--text-muted);
    font-size: var(--type-size-body);
    line-height: var(--type-leading-relaxed);
    margin: 6px 0 0;
}

.auth-page .auth-card .label {
    font-size: var(--type-size-small) !important;
    font-weight: var(--type-weight-medium) !important;
    line-height: var(--type-leading-ui) !important;
    margin-bottom: var(--space-2) !important;
}

.auth-page .auth-card input.auth-input {
    height: 48px !important;
    min-height: 48px !important;
    margin-bottom: var(--space-4) !important;
    font-size: var(--type-size-body) !important;
}

.auth-page .auth-card input.auth-input::placeholder {
    font-size: var(--type-size-body) !important;
    color: var(--text-muted) !important;
}

.auth-page .auth-card input.auth-input:focus-visible,
.auth-page .auth-card .auth-code-input:focus-visible {
    outline: none !important;
    outline-offset: 0 !important;
}

/* Focus uses the field surface and its label, without an extra outer border. */
.auth-page .auth-card .wrapper:focus-within > .label {
    color: var(--accent-text) !important;
}

.auth-password-control {
    position: relative;
}

.auth-page .auth-password-control input.auth-input {
    width: 100%;
    padding-right: 52px !important;
}

.auth-page .auth-password-toggle {
    position: absolute;
    top: 0;
    right: 3px;
    height: 48px;
    width: 44px;
    min-width: 44px;
    padding: 0;
    display: grid;
    place-items: center;
    color: var(--text-subtle);
    border: 0;
    background: transparent;
    border-radius: var(--radius-control);
}

.auth-password-toggle:hover {
    color: var(--text);
}

.auth-password-toggle svg {
    width: 17px;
    height: 17px;
}

.auth-page .auth-password-toggle[aria-pressed="true"] {
    color: var(--accent-text);
}

.auth-page .auth-card .auth-password-strength-container {
    height: 4px;
    margin: 6px 0 0;
    border-radius: var(--radius-pill);
    background: var(--surface-ambient-border-strong);
}
.auth-password-feedback { margin: -4px 0 var(--space-3); }
.auth-password-feedback-heading { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); color: var(--text-subtle); font-size: var(--type-size-caption); line-height: var(--type-leading-ui); }
.auth-password-feedback [role="status"] { font-weight: var(--type-weight-medium); }
.auth-page .auth-password-feedback .auth-password-strength-bar { display: block; opacity: 1; background: var(--text-subtle); }
.auth-password-feedback[data-password-status="invalid"] [role="status"] { color: var(--status-danger-text); }
.auth-page .auth-password-feedback[data-password-status="invalid"] .auth-password-strength-bar { background: var(--status-danger-text); }
.auth-password-feedback[data-password-status="weak"] [role="status"] { color: var(--status-warning-text); }
.auth-page .auth-password-feedback[data-password-status="weak"] .auth-password-strength-bar { background: var(--status-warning-text); }
.auth-password-feedback[data-password-status="good"] [role="status"] { color: var(--status-warning-text); }
.auth-page .auth-password-feedback[data-password-status="good"] .auth-password-strength-bar { background: var(--status-warning-text); }
.auth-password-feedback[data-password-status="strong"] [role="status"] { color: var(--status-success-text); }
.auth-page .auth-password-feedback[data-password-status="strong"] .auth-password-strength-bar { background: var(--status-success-text); }

.auth-page .auth-submit-row {
    margin-top: 0;
}

/* Keep canceled row transforms from retaining inherited hidden visibility in
 * Chromium. Inactive cards continue inheriting their container's visibility. */
html[data-auth-mode="login"] #login-container .auth-submit-row,
html[data-auth-mode="register"] #register-container .auth-submit-row {
    visibility: visible;
}

.auth-page .button-auth-submit {
    min-height: 48px;
    height: 48px;
    font-size: var(--type-size-body);
    font-weight: 600;
    letter-spacing: 0;
}

.auth-page .button-auth-submit:disabled {
    opacity: .65;
}

.auth-page .auth-card .auth-google-container {
    margin: var(--space-4) 0 0;
    min-height: 64px;
}

.auth-page .auth-divider {
    gap: 0;
    margin-bottom: var(--space-3);
    height: 12px;
}

.auth-page .divider-text {
    text-transform: none;
    letter-spacing: 0;
    padding: 0;
    font-size: 11px;
    font-weight: 400;
    color: var(--text-muted);
}

.auth-page .auth-card .border-hr {
    background: var(--surface-ambient-border-strong);
}

.auth-page button.button-auth-switch {
    width: 100%;
    max-width: 100%;
    min-height: 44px;
    height: 44px;
    gap: 10px;
    padding: 6px 12px 6px 7px;
    margin: var(--space-3) 0 0;
    background: var(--surface-ambient-nested-raised);
    color: var(--text-muted);
    border: 1px solid var(--surface-ambient-border-strong);
    border-radius: var(--radius-control) !important;
    box-shadow: none;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
}
.auth-page button.button-auth-switch:hover {
    background: var(--surface-ambient-nested-hover);
    color: var(--text);
    border-color: var(--field-border-hover);
    transform: translateY(-1px);
}
.auth-page button.button-auth-switch:active { transform: translateY(0); }
.auth-page .button-auth-switch [id$="-with-code-text"] { flex: 1 1 0; min-width: 0; }
.auth-page .button-auth-switch[aria-disabled="true"] { cursor: progress; }
.auth-mode-icon { width: 28px; height: 28px; flex: 0 0 28px; display: grid; place-items: center; border-radius: var(--radius-compact); background: var(--surface-ambient-selected); color: var(--text); }
.auth-page .button-auth-switch .auth-mode-icon svg { width: 14px; height: 14px; }
.auth-page .button-auth-switch .auth-mode-arrow { width: 13px; height: 13px; flex: 0 0 13px; margin-left: 3px; color: var(--text-subtle); transition: transform var(--motion-base) var(--motion-ease); }
.auth-page .button-auth-switch:hover .auth-mode-arrow { transform: translateX(2px); }
.auth-page .button-auth-switch[aria-expanded="true"] .auth-mode-arrow { transform: rotate(180deg); }
.auth-page .button-auth-switch[aria-expanded="true"]:hover .auth-mode-arrow { transform: translateX(-2px) rotate(180deg); }

.auth-account-switch {
    border-top: 1px solid var(--surface-ambient-border);
    margin-top: var(--space-5);
    padding-top: var(--space-4);
}

.auth-page .auth-switch-link {
    white-space: normal;
    font-size: 12px !important;
    line-height: 1.8;
    margin: 0;
    text-align: center;
}

.auth-page .auth-link-bold {
    color: var(--accent-text) !important;
    font-weight: 500;
    white-space: nowrap;
    margin-left: 3px;
}

.auth-link-bold svg {
    width: 12px;
    height: 12px;
    margin-left: 2px;
    vertical-align: -2px;
    transition: transform var(--motion-base) var(--motion-ease);
}

.auth-link-bold:hover svg {
    transform: translate(2px, -2px);
}

.auth-mode-description {
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-muted);
    margin: 0 0 var(--space-4);
}

.auth-page .auth-card .auth-code-input {
    font-size: 12px !important;
    padding: 0 10px !important;
    border-radius: var(--radius-control) !important;
}

.auth-page .auth-card .input-group .input-support-button {
    margin-bottom: 0 !important;
    min-width: 0;
    width: 0;
    flex: 1 1 0%;
    border-radius: var(--radius-control) !important;
}
.auth-page #code-register-form .input-group { flex-wrap: nowrap; gap: 8px; }
.auth-page #register-code-copy-button {
    border-radius: var(--radius-control) !important;
    margin-left: 0;
    flex: 0 0 46px;
    width: 46px;
    padding: 0;
}
/* The invisible verification remains active without adding page chrome. */
.auth-page .grecaptcha-badge { visibility: hidden; }

.auth-page .button-auth-copy {
    height: 48px;
    background: var(--field-surface);
}

.auth-shell > .footer {
    margin-top: 0;
}

.auth-shell > .footer > .container {
    width: 100%;
    max-width: none;
    padding-right: 0;
    padding-left: 0;
    gap: 16px;
}

.auth-page a:focus-visible, .auth-page button:focus-visible {
    outline: 2px solid var(--focus-visible-color);
    outline-offset: 4px;
}

/* A quiet entrance; movement never blocks input or waits for the artwork. */
.auth-art {
    animation: auth-art-reveal 240ms var(--motion-ease) both;
}

.auth-page .auth-card.app-reveal {
    animation: auth-rise 420ms var(--motion-ease) both !important;
}

@keyframes auth-story-rise {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes auth-rise {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes auth-art-reveal {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@media (min-width: 1600px) {
    .auth-page .auth-layout {
        padding-top: var(--space-8);
        padding-bottom: var(--space-8);
    }
}

@media (max-width: 1050px) {
    .auth-shell {
        padding: 0 32px;
    }
    .auth-page .auth-layout {
        grid-template-columns: minmax(0, 1fr) 400px;
        gap: 38px;
    }
    .auth-page .form.auth-card {
        padding: var(--space-6) !important;
    }
    .auth-story {
        --auth-art-height: 340px;
    }
    .auth-story h2 {
        font-size: 34px;
        letter-spacing: -1.4px;
    }
    .auth-art {
        height: 340px;
    }
}

@media (max-width: 1023.98px) {
    .auth-shell {
        max-width: 600px;
        padding: 0 24px;
    }
    .auth-header {
        min-height: 76px;
    }
    .auth-page .auth-layout {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: start;
        gap: 20px;
        padding: 8px 0 20px;
    }
    .auth-story {
        width: 100%;
    }
    .auth-story-copy {
        padding: 0;
    }
    .auth-story h2 {
        font-size: 30px;
        line-height: 1.12;
        letter-spacing: -1.2px;
        margin: 0;
    }
    .auth-art {
        width: calc(100% + 32px);
        height: 340px;
        margin: 12px -16px -12px;
    }
    .auth-page .auth-container {
        max-width: 100% !important;
    }
    .auth-header-actions {
        gap: 14px;
    }
    .auth-shell > .footer > .container { flex-direction: column; text-align: center; gap: 10px; }
}

@media (max-width: 479.98px) {
    .auth-shell {
        padding: 0 20px;
    }
    .auth-brand {
        font-size: 20px;
        gap: 6px;
    }
    .auth-brand .sidebar-logo {
        width: 30px;
        flex-basis: 30px;
        height: 34px;
    }
    .auth-page .form.auth-card {
        padding: 22px 20px !important;
    }
    .auth-page .auth-title {
        font-size: 26px;
    }
    .auth-page .auth-card input.auth-input, .auth-page .auth-card input.auth-input::placeholder {
        font-size: 16px !important;
    }
    /* Access codes stay readable and scroll within the input when long. */
    .auth-page .auth-card .auth-code-input {
        font-size: 16px !important;
    }
    .auth-description {
        font-size: var(--type-size-small);
    }
    .auth-story h2 {
        font-size: 27px;
    }

}

@media (max-width: 359.98px) {
    .auth-story h2 { font-size: 27px; letter-spacing: -1px; }
    .auth-art { height: 220px; }
}

@media (prefers-reduced-motion: reduce) {
    .auth-page *, .auth-page *::before, .auth-page *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        will-change: auto !important;
    }

}


/* Account selection stays outside the animated card, using the shared selector. */
.auth-tabs { margin-bottom: var(--space-3); width: 100%; padding: var(--space-1); }

.auth-register-identity { display: grid; grid-template-columns: minmax(0, 1fr); }
.auth-register-identity > .wrapper { min-width: 0; }


/* One surface stays in place while the form contents exchange. */
html[data-auth-document="auth"] { scrollbar-gutter: stable; }
.auth-card-stage { position: relative; isolation: isolate; overflow-anchor: none; }
.auth-card-stage::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    border: 1px solid var(--surface-card-edge);
    border-radius: var(--surface-card-radius);
    box-shadow: var(--surface-card-shadow);
    background-color: var(--surface-card);
    background-image: var(--surface-card-sheen);
}
.auth-card-stage > .auth-container { position: relative; z-index: 1; }
.auth-card-stage.is-switching > .auth-container { will-change: transform; }
.auth-page .auth-card-stage .form.auth-card {
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
    transition: none !important;
}
.auth-page .auth-container { width: 100%; display: block; }
/* GIS measures inside its iframe after loading. Preserve a layout box in the
 * inactive, inert panel so that its native button can finish initializing.
 * Size/paint containment keeps the hidden form out of document overflow.
 */
.auth-card-stage > .auth-container[hidden] {
    display: block !important;
    position: absolute;
    top: 0;
    left: 0;
    visibility: hidden;
    pointer-events: none;
    contain: layout size paint;
}
/* History state is available in head; PHP only sees the clean /auth URL.
 * Paint the restored registration card until startup updates hidden/inert.
 * These rules never apply during the animated card exchange.
 */
html[data-auth-restoring="register"] #login-container {
    position: absolute;
    top: 0;
    left: 0;
    visibility: hidden;
    pointer-events: none;
    contain: layout size paint;
}
html[data-auth-restoring="register"] #register-container {
    position: relative;
    visibility: visible;
    pointer-events: auto;
    contain: none;
}
html[data-auth-restoring="register"] #auth-tab-login { color: var(--selector-pill-text, var(--text-muted)); }
html[data-auth-restoring="register"] #auth-tab-register { color: var(--selector-pill-selected-text, var(--text)); }
.auth-scene-pause[hidden] { display: none !important; }
.auth-page .auth-card .auth-google-container[inert] {
    display: block !important;
    height: 0;
    min-height: 0;
    margin: 0;
    overflow: hidden;
    visibility: hidden;
    pointer-events: none;
    contain: layout size paint;
}
.auth-story-description {
    margin: 0 auto;
    max-width: 420px;
    color: var(--text-muted);
    font-size: var(--type-size-body-lg);
    line-height: var(--type-leading-relaxed);
    letter-spacing: var(--tracking-snug);
    text-align: center;
    animation: auth-story-rise 700ms var(--motion-ease) 320ms both;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}
.auth-scene-controls {
    position: absolute;
    right: 0;
    bottom: 0;
    z-index: 2;
}
.auth-page .auth-scene-pause {
    width: 34px;
    height: 34px;
    padding: 0;
    margin: 0;
    border: 0;
    display: grid;
    place-items: center;
    background: transparent;
    color: transparent;
    opacity: 0;
    cursor: default;
    transition: opacity var(--motion-fast) var(--motion-ease);
}
.auth-page .auth-scene-pause:focus-visible {
    opacity: 1;
    color: var(--text);
    background: var(--surface-card);
    border: 1px solid var(--surface-ambient-border-strong);
    border-radius: var(--radius-pill);
    outline: 2px solid var(--focus-visible-color);
}
.auth-scene-pause svg { width: 14px; height: 14px; }
.auth-google-button { position: relative; min-height: 40px; }
.auth-google-control { width: 100%; min-height: 44px; display: flex; align-items: center; }
.auth-page .auth-google-control [hidden] { display: none !important; }
.auth-page .auth-google-custom-button { width: 100%; min-height: 44px; display: grid; grid-template-columns: 20px minmax(0, 1fr) 20px; align-items: center; gap: var(--space-2); padding: 10px 12px; }
.auth-google-custom-button > img { display: block; width: 20px; height: 20px; }
.auth-google-custom-label { grid-column: 2; }
.auth-google-custom-loading { grid-column: 3; display: block; box-sizing: border-box; width: 20px; height: 20px; border: 2px solid var(--surface-ambient-border-strong); border-top-color: currentColor; border-radius: var(--radius-pill); animation: auth-spinner-rotate .65s linear infinite; }
.auth-page .auth-google-custom-button[aria-busy="true"] { opacity: 1; cursor: progress; }
.google-slot-active { width: 100%; height: 40px; display: flex; align-items: center; justify-content: center; position: relative; z-index: 2; }
.google-slot-pending,
.google-slot-retired { position: absolute; inset: 0; visibility: hidden; opacity: 0; pointer-events: none; }

/* Hide the SDK outline in both auth themes, retaining its logo and text. */
.auth-page .auth-google-button .google-slot-active {
    -webkit-clip-path: inset(1px round calc(var(--radius-control) - 1px));
    clip-path: inset(1px round calc(var(--radius-control) - 1px));
}

/* Cover SDK strokes/corners opaquely when Chrome rounds fractional pixels.
 * Mask both the visible host and the SDK viewport; neither intercepts input.
 */
.auth-page .auth-google-button::after,
.auth-page .auth-google-button .google-slot-active > div::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 3;
    box-sizing: border-box;
    border: 3px solid var(--surface-card);
    border-radius: var(--radius-control);
    box-shadow: 0 0 0 4px var(--surface-card);
    pointer-events: none;
}

/* Match shared keyboard focus without outlining pointer interactions. */
.auth-page .auth-google-button.is-google-focused {
    border-radius: var(--radius-control);
    outline: 2px solid var(--focus-visible-color);
    outline-offset: 2px;
}

@media (max-width: 1023.98px) {
    .auth-story {
        margin-top: 0;
        align-items: center;
        text-align: center;
        --auth-art-height: 340px;
    }
    .auth-story h2 { max-width: 500px; text-align: center; }
    .auth-art { height: 340px; margin-top: -4px; margin-bottom: -4px; }
    .auth-story-copy { margin-top: 10px; align-items: center; text-align: center; }
    .auth-story-description { margin: 10px auto 0; text-align: center; }
    .auth-form-panel { width: 100%; max-width: 440px; margin: 0 auto; }
    .auth-page .auth-layout { gap: 20px; }
}
@media (max-width: 767.98px) {
    .auth-art { display: none; }
    .auth-scene-controls { display: none !important; }
    .auth-shell { max-width: 488px; }
    .auth-header { min-height: 64px; }
    .auth-story-copy { margin-top: 0; align-items: center; text-align: center; }
    .auth-story h2 { font-size: 26px; line-height: 1.15; text-align: center; }
    .auth-story-description { font-size: var(--type-size-body); margin: 10px auto 0; text-align: center; max-width: none; }
    .auth-page .auth-layout { padding-top: 4px; gap: 16px; }
    .auth-tabs { margin-bottom: 10px; }
    .auth-page .form.auth-card { padding: 22px 20px !important; }
    .auth-page .auth-title { font-size: 26px; }
    .auth-page .auth-form-heading { margin-bottom: var(--space-4); }
}
@media (min-width: 1024px) and (max-height: 800px) {
    .auth-header { min-height: 64px; }
    .auth-page .auth-layout { padding: 8px 0 12px; }
    .auth-tabs { margin-bottom: var(--space-2); }
    .auth-shell > .footer { padding-top: 8px; padding-bottom: 8px; }
    .auth-story {
        margin-top: 0;
        --auth-art-height: 360px;
    }
    .auth-art { height: var(--auth-art-height); }
    .auth-story-copy { margin-top: 0; }
    .auth-story h2 { font-size: 36px; margin-bottom: var(--space-3); }
}
@media (prefers-reduced-motion: reduce) {

    .auth-page .auth-scene-pause { display: none !important; }
    .auth-story-line-1,
    .auth-story-line-2,
    .auth-story-description {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
        -webkit-text-fill-color: initial !important;
        background: none !important;
    }
    .auth-story h2 em {
        animation: none !important;
        -webkit-text-fill-color: initial !important;
        background: none !important;
    }
}

/* ---- 2FA Authentication Code Typography & Input Polish ---- */
.auth-page .auth-card #twofactor-code-input {
    font-family: var(--font-sans) !important;
    font-size: 1.5rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.28em !important;
    text-indent: 0.28em !important;
    font-variant-numeric: tabular-nums !important;
    font-feature-settings: 'tnum' 1, 'cv01' 1, 'cv02' 1 !important;
    height: 52px !important;
    min-height: 52px !important;
    padding: 0 16px !important;
    cursor: text !important;
    border-radius: var(--radius-control) !important;
    text-align: center !important;
    color: var(--text) !important;
    background: var(--auth-input-bg) !important;
    border: 1px solid var(--field-border) !important;
}

.auth-page .auth-card #twofactor-code-input::placeholder {
    font-family: var(--font-sans) !important;
    font-weight: 400 !important;
    letter-spacing: 0.20em !important;
    text-indent: 0.20em !important;
    opacity: 0.35 !important;
    color: var(--text-muted) !important;
    font-size: 1.15rem !important;
}

.auth-page .auth-card #twofactor-recovery-input {
    font-family: var(--font-mono) !important;
    font-size: 0.9375rem !important;
    font-weight: 500 !important;
    letter-spacing: 0.08em !important;
    font-variant-numeric: tabular-nums !important;
    height: 48px !important;
    min-height: 48px !important;
    cursor: text !important;
    border-radius: var(--radius-control) !important;
    text-align: center !important;
    color: var(--text) !important;
    background: var(--auth-input-bg) !important;
    border: 1px solid var(--field-border) !important;
}

.auth-tabs .selector-pill:disabled { cursor: progress; }
