﻿/* Shared by the website and the packaged desktop account entry. */
.auth-dialog-overlay { position: fixed; inset: 0; z-index: 3000; display: flex; align-items: center; justify-content: center; padding: 20px; box-sizing: border-box; background: #0a0e27; isolation: isolate; gap: 26px; flex-direction: column; }
body.is-auth-dialog-open { overflow: hidden; }
.auth-dialog-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 80px 20px 40px; }
.auth-dialog {
    position: relative;
    width: min(460px, 100%);
    flex: 0 1 auto;
    z-index: 1;
    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);
    padding: 36px 32px 28px;
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 1px solid #2e5362;
    border-radius: 20px;
    color: #e0e6f0;
    background: linear-gradient(135deg, rgba(15, 20, 41, .96), rgba(10, 14, 39, .98));
    box-shadow: 0 24px 80px rgba(0, 0, 0, .5), 0 0 32px rgba(100, 255, 218, .06);
    box-sizing: border-box;
    font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    scrollbar-width: thin;
    scrollbar-color: #365869 transparent;
    color-scheme: dark;
}
.auth-dialog *, .auth-dialog *::before, .auth-dialog *::after { box-sizing: border-box; }
.auth-dialog [hidden], .auth-dialog-overlay[hidden] { display: none !important; }
.auth-dialog button, .auth-dialog input { font: inherit; }
.auth-dialog button { cursor: pointer; }
.auth-dialog button:disabled { opacity: 0.55; cursor: default; }
.auth-dialog-close { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 9px; color: #94a3b8; background: transparent; }
.auth-dialog .auth-dialog-close { font-size: 24px; line-height: 1; }
.auth-dialog-close:hover { color: #e0e6f0; background: #1a3042; }
.auth-dialog :where(button, input, a):focus-visible { outline: 2px solid #64ffda; outline-offset: 3px; }
.auth-dialog__title { margin: 0 0 8px; color: #e0e6f0; font-size: 26px; font-weight: 700; line-height: 1.3; text-align: center; }
.auth-dialog__copy { margin: 0 0 22px; color: #94a3b8; font-size: 13px; line-height: 1.6; text-align: center; }
.auth-dialog__error { margin: 0 0 14px; padding: 10px 12px; border-radius: 8px; font-size: 13px; color: #ffacb9; background: #3b2035; }
.auth-dialog__error.is-success { color: #8eecd1; background: #163b38; }
.auth-dialog__form { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.auth-dialog__label { margin: 5px 0 0; color: #b8c8de; font-size: 13px; font-weight: 600; }
.auth-dialog__form input:not([type="checkbox"]) { width: 100%; min-width: 0; height: 44px; padding: 0 12px; border: 1px solid #33485f; border-radius: 9px; color: #e0e6f0; background: #0c1528; outline: none; }
.auth-dialog__form input::placeholder { color: #7f91ab; font-size: 13px; }
.auth-dialog__form input:focus { border-color: #64ffda; box-shadow: 0 0 0 3px rgba(100, 255, 218, .14); }
.auth-dialog__password { position: relative; }
.auth-dialog__password input { padding-right: 64px !important; }
.auth-dialog__password button { position: absolute; top: 4px; right: 4px; height: 36px; padding: 0 9px; border: 0; border-radius: 6px; color: #9aafc8; background: transparent; font-size: 12px; }
.auth-dialog__password button:hover { color: #8ef5dd; background: #193a43; }
.auth-dialog__code-row { display: flex; gap: 8px; }
.auth-dialog__code-row input { flex: 1; }
.auth-dialog__code-btn { flex: 0 0 auto; padding: 0 12px; border: 1px solid #31575f; border-radius: 9px; color: #8ef5dd; background: #132d38; white-space: nowrap; }
.auth-dialog__code-btn:hover { background: #1d4148; }
.auth-dialog__terms { display: flex; align-items: flex-start; gap: 8px; margin-top: 8px; color: #94a3b8; font-size: 12px; }
.auth-dialog__terms input { flex: 0 0 auto; width: 15px; height: 15px; margin: 2px 0 0; accent-color: #64ffda; }
.auth-dialog__terms a { color: #8ef5dd; text-decoration: underline; text-underline-offset: 2px; }
.auth-dialog button.auth-dialog__submit, .auth-dialog button.auth-dialog__verify-done { width: 100%; min-height: 44px; margin-top: 12px; padding: 10px 14px; border: 0; border-radius: 9px; color: #0f1429; background: #64ffda; font-weight: 600; }
.auth-dialog button.auth-dialog__submit:hover, .auth-dialog button.auth-dialog__verify-done:hover { background: #8ef5dd; }
.auth-dialog__switch { margin: 20px 0 0; color: #94a3b8; font-size: 13px; text-align: center; }
.auth-dialog__switch button, .auth-dialog__forgot button { padding: 2px 0; border: 0; color: #8ef5dd; background: transparent; }
.auth-dialog__switch button:hover, .auth-dialog__forgot button:hover { text-decoration: underline; }
.auth-dialog__forgot { margin: 8px 0 0; text-align: center; font-size: 13px; }
.auth-dialog__forgot button { color: #94a3b8; }
.auth-dialog__verify-msg { margin: 0 0 16px; padding: 12px; border-radius: 9px; color: #b8c8de; background: #16263c; overflow-wrap: anywhere; }
.auth-dialog__verify-resend { width: 100%; min-height: 44px; border: 1px solid #31575f; border-radius: 9px; color: #8ef5dd; background: #132d38; }
.auth-dialog__verify-feedback { margin: 12px 0 0; color: #8eecd1; font-size: 13px; text-align: center; }
.auth-back { color: #94a3b8; font-size: 14px; }

/* The login scene reuses the existing form in both overlay and standalone entries. */
.auth-dialog-page { position: relative; isolation: isolate; flex-direction: column; gap: 26px; padding: 24px; background: #0a0e27; }
.auth-dialog-scene { position: absolute; z-index: -1; inset: 0; overflow: hidden; pointer-events: none; background: radial-gradient(ellipse at 50% 12%, #38305b4d, transparent 55%), linear-gradient(135deg, #0a0e27, #1a1f3a 50%, #0f1429); }
.auth-dialog-scene__star { position: absolute; width: 2px; height: 2px; border-radius: 50%; background: #fff; animation: auth-star-twinkle 4s ease-in-out infinite; }
.auth-dialog-scene__particle { position: absolute; top: 0; width: 3px; height: 3px; border-radius: 50%; background: #64ffda80; box-shadow: 0 0 10px #64ffda99; animation: auth-particle-rise 20s linear infinite; }
.auth-dialog-scene__character { position: absolute; bottom: -28px; width: min(25vw, 340px); height: min(56vh, 540px); background-repeat: no-repeat; background-size: contain; background-position: center bottom; opacity: .5; filter: drop-shadow(0 0 28px #a78bfa35); animation: auth-character-float 6s ease-in-out infinite; }
.auth-dialog-scene__character.is-left { left: 5%; background-image: url('../assets/hero-characters/adult-woman-fullbody.webp'); }
.auth-dialog-scene__character.is-right { right: 5%; background-image: url('../assets/hero-characters/adult-man-fullbody.webp'); animation-delay: -3s; }
.auth-dialog-brand { position: relative; flex: 0 0 auto; display: flex; align-items: center; flex-direction: column; gap: 7px; max-width: 100%; color: #94a3b8; text-align: center; font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif; animation: auth-brand-enter .7s ease-out both; }
.auth-dialog-brand__logo { display: grid; place-items: center; width: 68px; height: 68px; margin-bottom: 5px; border: 1px solid #a78bfa66; border-radius: 20px; color: #172139; background: linear-gradient(135deg, #64ffda, #a78bfa); box-shadow: 0 0 38px #a78bfa30, 0 8px 28px #64ffda15; animation: auth-logo-float 4s ease-in-out infinite; }
.auth-dialog-brand strong { font-size: clamp(24px, 3vw, 36px); line-height: 1.4; letter-spacing: .04em; background: linear-gradient(90deg, #64ffda, #a78bfa); background-clip: text; -webkit-background-clip: text; color: transparent; }
.auth-dialog-brand > span:last-child { font-size: 14px; }
.auth-dialog { overflow-x: hidden; animation: auth-card-enter .6s ease-out both; }
.auth-dialog::before { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 2px; background: linear-gradient(90deg, transparent, #64ffda, transparent) 200% 0 / 200% 100%; pointer-events: none; animation: auth-card-shimmer 3s linear infinite; }
.auth-dialog button { transition: color .2s, background .2s, border-color .2s, box-shadow .2s, transform .2s; }
.auth-dialog button.auth-dialog__submit, .auth-dialog button.auth-dialog__verify-done { position: relative; overflow: hidden; color: #172139; background: linear-gradient(135deg, #64ffda, #a78bfa); box-shadow: 0 4px 18px #64ffda18; }
.auth-dialog button.auth-dialog__submit:hover:not(:disabled), .auth-dialog button.auth-dialog__verify-done:hover:not(:disabled) { color: #172139; background: linear-gradient(135deg, #83ffe3, #b5a0ff); transform: translateY(-3px); box-shadow: 0 8px 25px #64ffda40, 0 0 28px #a78bfa22; }
.auth-dialog__submit::before, .auth-dialog__verify-done::before { content: ""; position: absolute; top: 50%; left: 50%; width: 0; height: 0; border-radius: 50%; background: #ffffff24; transform: translate(-50%, -50%); pointer-events: none; transition: width .6s, height .6s; }
.auth-dialog__submit:hover:not(:disabled)::before, .auth-dialog__verify-done:hover:not(:disabled)::before { width: 480px; height: 480px; }
.auth-dialog button.auth-dialog__submit:active:not(:disabled), .auth-dialog button.auth-dialog__verify-done:active:not(:disabled) { transform: translateY(0) scale(.98); }
.auth-dialog__code-btn:hover:not(:disabled), .auth-dialog__verify-resend:hover:not(:disabled) { color: #b0ffe9; border-color: #64ffda; box-shadow: 0 0 16px #64ffda1a; }
.auth-dialog button:disabled { transform: none; box-shadow: none; }
.auth-dialog__success { display: grid; justify-items: center; gap: 16px; padding: 18px 0 22px; color: #a3b7cf; text-align: center; animation: auth-success-enter .5s ease-out both; }
.auth-dialog__success-mark { display: grid; place-items: center; width: 76px; height: 76px; border: 1px solid #64ffda66; border-radius: 50%; color: #64ffda; background: #64ffda12; font-size: 38px; box-shadow: 0 0 35px #64ffda26; animation: auth-success-glow 1s ease-in-out infinite alternate; }
.auth-dialog__success p { margin: 0; }
.auth-dialog.is-success { border-color: #64ffda80; }
@keyframes auth-star-twinkle { 0%, 100% { opacity: .2; transform: scale(1); } 50% { opacity: 1; transform: scale(1.5); } }
@keyframes auth-particle-rise { 0% { transform: translate(0, 100dvh) scale(0); opacity: 0; } 10%, 90% { opacity: 1; } 100% { transform: translate(100px, -30px) scale(1); opacity: 0; } }
@keyframes auth-logo-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes auth-character-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-15px); } }
@keyframes auth-brand-enter { from { opacity: 0; transform: translateY(-24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes auth-card-enter { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes auth-card-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes auth-success-enter { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: scale(1); } }
@keyframes auth-success-glow { to { box-shadow: 0 0 50px #64ffda40; } }
@media (max-width: 1000px) { .auth-dialog-scene__character { opacity: .25; width: 28vw; } }
@media (max-width: 540px), (max-height: 650px) {
    .auth-dialog-overlay, .auth-dialog-page { padding: 12px; gap: 14px; }
    .auth-dialog { max-height: calc(100dvh - 24px); padding: 32px 22px 22px; border-radius: 16px; }
    .auth-dialog-brand { gap: 4px; }
    .auth-dialog-brand__logo { width: 44px; height: 44px; margin: 0; border-radius: 13px; }
    .auth-dialog-brand__logo svg { width: 27px; height: 27px; }
    .auth-dialog-brand strong { font-size: 22px; }
    .auth-dialog-brand > span:last-child { font-size: 11px; }
    .auth-dialog-scene__character { display: none; }
}
@media (max-height: 440px) { .auth-dialog-brand { display: none; } }
@media (prefers-reduced-motion: reduce) {
    .auth-dialog, .auth-dialog::before, .auth-dialog *, .auth-dialog *::before, .auth-dialog-brand, .auth-dialog-brand *, .auth-dialog-scene * { animation: none !important; transition: none !important; }
    .auth-dialog-scene__star, .auth-dialog-scene__particle { display: none; }
    .auth-dialog button:hover, .auth-dialog button:active { transform: none !important; }
}
