/* Night skyline stays sharp above a translucent charcoal fade. */
#authModalBackdrop {
    isolation: isolate; overflow: auto; background: #142638;
    height: 100dvh; box-sizing: border-box;
    --auth-art: url('/assets/brand/signup-shanghai-night.webp');
}
#authModalBackdrop.open, body.auth-page-mode #authModalBackdrop {
    display: flex !important; align-items: flex-end; justify-content: center;
    padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
#authModalBackdrop .auth-skyline { position: fixed; inset: 0; z-index: -2; pointer-events: none; overflow: hidden; }
#authModalBackdrop .auth-skyline picture, #authModalBackdrop .auth-skyline img { display: block; width: 100%; height: 100%; }
#authModalBackdrop .auth-skyline img { object-fit: cover; object-position: center; }
/* A slow wash of reflected light is exclusive to the website. */
#authModalBackdrop .auth-skyline::after {
    content: ""; position: absolute; inset: -12%; pointer-events: none;
    background: radial-gradient(ellipse at 25% 60%, #69b9ff26, transparent 42%), radial-gradient(ellipse at 75% 85%, #ffca8222, transparent 38%);
    mix-blend-mode: screen; animation: auth-water-light 22s ease-in-out infinite alternate;
}
@keyframes auth-water-light {
    from { transform: translate3d(-3%, 1%, 0); opacity: .35; }
    to { transform: translate3d(3%, -1%, 0); opacity: .75; }
}
@media (prefers-reduced-motion: reduce) {
    #authModalBackdrop .auth-skyline::after { animation: none; opacity: .35; }
}
#authModalBackdrop .auth-modal, body.auth-page-mode #authModalBackdrop .auth-modal {
    position: relative; isolation: isolate; width: min(440px, 100%); margin: 0;
    padding: 0; border: 1px solid #ffffff47; border-radius: 28px;
    background: #14263818 !important; box-shadow: 0 12px 40px #07121d20;
    max-height: 100%; overflow: auto; flex-shrink: 0;
}
#authModalBackdrop .auth-content { position: relative; margin: 0; padding: 12px 16px 16px; }
/* Blur is clipped to the bordered window; the skyline outside stays sharp. */
#authModalBackdrop .auth-panel-blur { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; z-index: -1; pointer-events: none; }
#authModalBackdrop .auth-panel-blur::before {
    content: ""; position: absolute; inset: -24px; z-index: -1; pointer-events: none;
    background-image: linear-gradient(rgba(20,28,38,.30), rgba(20,28,38,.50)), var(--auth-art);
    background-size: 100% 100%, var(--auth-art-width, 100vw) var(--auth-art-height, 100dvh);
    background-position: center, var(--auth-art-left, center) var(--auth-art-top, bottom);
    background-repeat: no-repeat; filter: blur(16px);
}
#authModalBackdrop .auth-modal-header { margin-bottom: 6px; }
#authModalBackdrop .auth-modal-header h2 { color: #fff; font-size: 24px; }
#authModalBackdrop .auth-subtitle { color: #eef2f7; margin: 0 0 10px; font-size: 13px; line-height: 1.4; }
#authModalBackdrop .auth-modal-header h2, #authModalBackdrop .auth-subtitle { text-shadow: 0 1px 8px #142638; }
/* Keep the accessible dialog name, without repeating the selected sign-in/up tab. */
#authModalBackdrop:has(:is(#authViewRegister, #authViewLoginStart, #authViewLoginPassword).active) #authModalTitle {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
#authModalBackdrop:has(:is(#authViewRegister, #authViewLoginStart, #authViewLoginPassword).active) #authModalSubtitle { display: none; }
body.auth-page-mode #authModalBackdrop:has(:is(#authViewRegister, #authViewLoginStart, #authViewLoginPassword).active) .auth-modal-header { margin: 0; height: 0; }
#authModalBackdrop .auth-mode-switch { margin-bottom: 10px; background: #233448a8 !important; border-color: #ffffff38; }
#authModalBackdrop .auth-mode-btn { min-height: 40px; color: #fff; background: transparent !important; }
#authModalBackdrop .auth-mode-btn.active { background: #ffffff24 !important; }
#authModalBackdrop .auth-actions { gap: 8px !important; margin-bottom: 8px; }
#authModalBackdrop .auth-btn { min-height: 44px; padding: 10px 14px !important; border-radius: 14px; }
#authModalBackdrop .auth-btn.provider { min-height: 46px; background: #26394dc2 !important; border-color: #ffffff45; color: #fff; }
#authModalBackdrop .auth-btn.provider .auth-provider-label { font-size: 15px; }
#authModalBackdrop .auth-icon.apple { background-size: contain; background-position: center; background-repeat: no-repeat; flex-shrink: 0; }
#authModalBackdrop .auth-divider { color: #edf2f7; margin: 6px 0 8px; }
#authModalBackdrop .auth-divider::before, #authModalBackdrop .auth-divider::after { background: #ffffff40; }
#authModalBackdrop .auth-step { gap: 8px; }
#authModalBackdrop .auth-email input:not([type=hidden]) { min-height: 44px; padding: 10px 13px; font-size: 16px; background: #203247d9 !important; color: #fff; border-color: #ffffff45; }
#authModalBackdrop .auth-email input::placeholder { color: #d0d8e2; }
#authModalBackdrop .auth-inline-actions .link-btn { background: transparent !important; color: #fff; }
#authModalBackdrop .auth-close { color: #fff; min-width: 44px; min-height: 44px; }
body.auth-page-mode #authModalBackdrop .auth-close {
    display: flex !important; align-items: center; justify-content: center;
    position: absolute; top: 12px; right: 16px; z-index: 2;
    border: 0; border-radius: 12px; background: transparent;
}
@media (max-aspect-ratio: 1/1) {
    #authModalBackdrop { --auth-art: url('/assets/brand/signup-shanghai-night-portrait.webp'); }
}
@media (min-width: 1100px) {
    #authModalBackdrop.open, body.auth-page-mode #authModalBackdrop {
        justify-content: flex-end; align-items: center;
        padding-right: clamp(28px, 5vw, 110px);
    }

}
@media (max-height: 650px) {
    #authModalBackdrop.open, body.auth-page-mode #authModalBackdrop { padding-top: 8px; padding-bottom: max(8px, env(safe-area-inset-bottom)); }
    #authModalBackdrop .auth-content { padding: 8px 12px 12px; }
    #authModalBackdrop .auth-subtitle { margin-bottom: 6px; font-size: 12px; }
    #authModalBackdrop .auth-actions, #authModalBackdrop .auth-step { gap: 6px !important; }
    #authModalBackdrop .auth-btn { padding: 8px 12px !important; }
    #authModalBackdrop .auth-mode-switch { margin-bottom: 6px; }
}

#authModalBackdrop .auth-back {
    display: flex; align-items: center; gap: 8px; min-height: 44px;
    padding: 0 4px; margin: 0 0 8px; border: 0; border-radius: 8px;
    background: transparent; color: #fff; font-family: inherit; font-size: 15px; font-weight: 500; line-height: 1.3; cursor: pointer;
}
#authModalBackdrop .auth-back span { font-size: 23px; }
#authModalBackdrop .auth-back:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
