:root {
    --sp-blue: #0085FF;
    --sp-blue-light: #EBF5FF;
    --sp-orange: #FF6B00;
    --sp-orange-light: #FFF0E6;
    --sp-yellow: #FFC700;
    --sp-bg: #F8FAFC;
    --sp-card: rgba(255, 255, 255, .90);
    --sp-text: #1E293B;
    --sp-muted: #64748B;
    --sp-input-bg: #F8FAFC;
    --sp-input-border: #E2E8F0;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--sp-text);
}

body {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--sp-bg);
}

.bg-container {
    position: fixed;
    inset: 0;
    z-index: 1;
    overflow: hidden;
    background: radial-gradient(circle at 50% 50%, #FFFFFF 0%, #F0F7FF 100%);
    pointer-events: none;
    transition: background 1.2s ease;
}

body[data-theme="theme-1"] .bg-container { background: radial-gradient(circle at 50% 50%, #FFFFFF 0%, #F0F7FF 100%); }
body[data-theme="theme-2"] .bg-container { background: radial-gradient(circle at 50% 50%, #FFFFFF 0%, #FFFDF0 100%); }
body[data-theme="theme-3"] .bg-container { background: radial-gradient(circle at 50% 50%, #FFFFFF 0%, #FFF5F9 100%); }
body[data-theme="theme-4"] .bg-container { background: radial-gradient(circle at 50% 50%, #FFFFFF 0%, #F5F3FF 100%); }
body[data-theme="theme-5"] .bg-container { background: radial-gradient(circle at 50% 50%, #FFFFFF 0%, #F0FDF8 100%); }

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: .55;
    animation: floatOrb 12s infinite ease-in-out alternate;
}

.glow-1 { width: 500px; height: 500px; top: -10%; left: -10%; background: #D0E8FF; }
.glow-2 { width: 450px; height: 450px; right: -5%; bottom: -10%; background: #FFE4D1; animation-duration: 15s; animation-delay: -3s; }
.glow-3 { width: 400px; height: 400px; top: 30%; right: 25%; background: rgba(255, 199, 0, .15); animation-duration: 18s; animation-delay: -6s; }

.floating-element {
    position: absolute;
    color: var(--sp-blue);
    opacity: .2;
    animation: floatElement 16s infinite linear;
    pointer-events: none;
}

.sound-wave-decor {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 2;
    width: 580px;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transform: translate(-50%, -50%);
    opacity: .22;
    pointer-events: none;
}

.wave-bar {
    width: 5px;
    border-radius: 8px;
    background: linear-gradient(to top, var(--sp-blue), var(--sp-orange));
    animation: wavePulse 3s infinite ease-in-out alternate;
}

.login-wrapper {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 410px;
    padding: 20px;
}

.login-language-switcher {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-left: 12px;
}

.login-language-btn {
    border: 0;
    padding: 2px 4px;
    color: var(--sp-muted);
    background: transparent;
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}

.login-language-btn.active { color: var(--sp-blue); font-weight: 800; }
.login-language-btn:hover { color: var(--sp-orange); }
.login-language-divider { color: #CBD5E1; font-size: 12px; }

.login-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
    padding: 38px 32px 32px;
    border-radius: 28px;
    background: var(--sp-card);
    box-shadow: 0 16px 36px rgba(0, 133, 255, .08), 0 8px 20px rgba(255, 107, 0, .05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.login-card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    padding: 1.5px;
    border-radius: 28px;
    background: linear-gradient(135deg, rgba(0, 133, 255, .4) 0%, rgba(255, 255, 255, .8) 50%, rgba(255, 107, 0, .4) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.login-card > * { position: relative; z-index: 1; }

.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 24px;
}

.mic-icon-wrapper {
    width: 96px;
    height: 96px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    animation: logoFloat 4s infinite ease-in-out;
}

.member-login-logo-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 0;
}

.brand-title {
    margin-bottom: 6px;
    color: var(--sp-blue);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: .8px;
    text-transform: uppercase;
}

.brand-name-cn {
    margin: 0 0 4px;
    color: var(--sp-orange);
    font-size: 16px;
    font-weight: 800;
    letter-spacing: .12em;
}

.subtitle-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 14px;
    border: 1px solid rgba(0, 133, 255, .2);
    border-radius: 20px;
    background: rgba(0, 133, 255, .06);
}

.subtitle-text {
    color: #0066CC;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .5px;
}

.login-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
}

.login-form .input-label {
    display: block;
    margin: 0 0 0 2px;
    color: #1E293B;
    font-size: 13px;
    line-height: normal;
    font-weight: 700;
}

.login-form .input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.login-form .input-icon {
    position: absolute;
    left: 16px;
    width: 20px;
    height: 20px;
    color: #94A3B8;
    pointer-events: none;
    transition: color .25s ease;
}

.login-form .custom-input {
    width: 100%;
    height: 52px;
    padding: 0 44px 0 48px;
    border: 1.5px solid var(--sp-input-border);
    border-radius: 14px;
    outline: none;
    background: var(--sp-input-bg);
    color: #1E293B;
    font-size: 15px;
    font-weight: 500;
    transition: all .25s ease;
}

.login-form .custom-input::placeholder {
    color: #94A3B8;
    font-weight: 400;
    opacity: 1;
}

.login-form .custom-input:hover {
    border-color: #CBD5E1;
    background: #FFFFFF;
}

.login-form .custom-input:focus {
    border-color: var(--sp-blue);
    background: #FFFFFF;
    box-shadow: 0 0 0 3.5px rgba(0, 133, 255, .18);
}

.login-form .input-wrapper:focus-within .input-icon { color: var(--sp-blue); }

.login-form .toggle-password {
    position: absolute;
    right: 14px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border: 0;
    background: transparent;
    color: #94A3B8;
    cursor: pointer;
    transition: color .2s ease;
}

.login-form .toggle-password:hover { color: var(--sp-blue); }

.error-msg {
    min-height: 18px;
    display: none;
    align-items: center;
    gap: 4px;
    margin: -8px 0 0;
    color: #EF4444;
    font-size: 12px;
    font-weight: 600;
}

.form-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: -2px;
}

.forgot-link {
    color: var(--sp-orange);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.forgot-link:hover {
    text-decoration: underline;
    opacity: .8;
}

.submit-btn {
    width: 100%;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 4px;
    border: 1px solid rgba(255, 255, 255, .4);
    border-radius: 14px;
    background: linear-gradient(135deg, #FF7A14 0%, #FF5500 100%);
    box-shadow: 0 8px 20px rgba(255, 107, 0, .28);
    color: #FFFFFF;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all .25s cubic-bezier(.4, 0, .2, 1);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(255, 107, 0, .38), 0 0 0 2px rgba(255, 107, 0, .2);
}

.submit-btn:active { transform: translateY(1px); }
.submit-btn.loading { pointer-events: none; opacity: .9; }

.spinner {
    width: 20px;
    height: 20px;
    display: none;
    border: 2.5px solid rgba(255, 255, 255, .35);
    border-top-color: #FFFFFF;
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Forced logout modal used by member_login.js */
.force-logout-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .7);
    backdrop-filter: blur(8px);
    animation: forceLogoutFadeIn .3s ease-out;
}

.force-logout-modal {
    width: 90%;
    max-width: 400px;
    overflow: hidden;
    border-radius: 20px;
    background: #FFFFFF;
    box-shadow: 0 20px 40px rgba(0, 0, 0, .3);
    animation: forceLogoutSlideIn .4s cubic-bezier(.175, .885, .32, 1.275);
}

.force-logout-content { padding: 40px 30px 30px; text-align: center; }
.force-logout-icon { margin-bottom: 20px; font-size: 60px; animation: forceLogoutIconPulse 2s ease-in-out infinite; }
.force-logout-title { margin-bottom: 15px; color: #E53E3E; font-size: 24px; font-weight: 700; }
.force-logout-message { margin-bottom: 30px; color: #666; font-size: 16px; line-height: 1.6; }
.force-logout-btn {
    min-width: 140px;
    padding: 15px 40px;
    border: 0;
    border-radius: 25px;
    background: linear-gradient(135deg, #E53E3E 0%, #C53030 100%);
    box-shadow: 0 4px 15px rgba(229, 62, 62, .4);
    color: #FFFFFF;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all .3s ease;
}

.force-logout-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(229, 62, 62, .5); }
.force-logout-btn:active { transform: translateY(0); }

.forgot-password-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, .38);
    backdrop-filter: blur(8px);
}

.forgot-password-modal {
    width: min(360px, 100%);
    padding: 28px 24px 22px;
    border: 1px solid rgba(0, 133, 255, .18);
    border-radius: 24px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 20px 45px rgba(15, 23, 42, .22);
    text-align: center;
    animation: forgotModalIn .22s ease-out;
}

.forgot-password-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: #FFF0E6;
    color: var(--sp-orange);
    font-size: 24px;
    font-weight: 800;
}

.forgot-password-modal h2 {
    margin-bottom: 12px;
    color: var(--sp-text);
    font-size: 20px;
}

.forgot-password-modal p {
    color: var(--sp-muted);
    font-size: 14px;
    line-height: 1.6;
}

.forgot-password-modal .forgot-password-phone {
    margin-top: 4px;
    color: var(--sp-orange);
    font-weight: 700;
}

.forgot-password-modal button {
    min-width: 120px;
    margin-top: 20px;
    padding: 10px 24px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, #FF7A14 0%, #FF5500 100%);
    box-shadow: 0 6px 16px rgba(255, 107, 0, .22);
    color: #FFFFFF;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

@keyframes forgotModalIn {
    from { opacity: 0; transform: translateY(8px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes floatOrb {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(40px, -30px) scale(1.08); }
    100% { transform: translate(-30px, 40px) scale(.95); }
}

@keyframes floatElement {
    0% { transform: translateY(105vh) rotate(0deg); opacity: 0; }
    20% { opacity: .25; }
    80% { opacity: .25; }
    100% { transform: translateY(-10vh) rotate(360deg); opacity: 0; }
}

@keyframes wavePulse {
    0% { height: 20%; }
    50% { height: 100%; }
    100% { height: 35%; }
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

@keyframes forceLogoutFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes forceLogoutSlideIn {
    from { opacity: 0; transform: scale(.8) translateY(-50px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes forceLogoutIconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@media (prefers-reduced-motion: reduce) {
    .glow-orb, .floating-element, .wave-bar, .mic-icon-wrapper, .force-logout-modal { animation: none !important; }
}

@media (max-width: 480px) {
    .login-wrapper { padding: 16px; }
    .login-card { padding: 30px 20px 24px; border-radius: 22px; }
    .custom-input, .submit-btn { height: 48px; }
    .custom-input { font-size: 14px; }
    .submit-btn { font-size: 15px; }
    .sound-wave-decor { width: 100%; }
    .force-logout-modal { width: 95%; }
    .force-logout-content { padding: 30px 20px 25px; }
    .force-logout-icon { margin-bottom: 15px; font-size: 50px; }
    .force-logout-title { font-size: 20px; }
    .force-logout-message { margin-bottom: 25px; font-size: 15px; }
    .force-logout-btn { padding: 12px 30px; font-size: 15px; }
}
