/* 登录页专属布局与视觉层，主题色继续复用 base.css 的设计令牌。 */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    --login-card-bg: rgba(255, 255, 255, 0.9);
    --login-card-border: rgba(255, 255, 255, 0.78);
    --login-input-bg: #ffffff;
    --login-input-border: #e2e8f0;
    font-family: 'Plus Jakarta Sans', 'Microsoft YaHei', -apple-system, sans-serif;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(ellipse 72% 52% at 8% 12%, rgba(129, 140, 248, 0.2), transparent 70%),
        radial-gradient(ellipse 60% 48% at 94% 88%, rgba(168, 85, 247, 0.13), transparent 72%),
        linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    color: var(--text-primary);
    position: relative;
    overflow: auto;
    isolation: isolate;
}

.dark body {
    --login-card-bg: rgba(30, 41, 59, 0.88);
    --login-card-border: rgba(255, 255, 255, 0.12);
    --login-input-bg: rgba(15, 23, 42, 0.88);
    --login-input-border: #475569;
    background:
        radial-gradient(ellipse 72% 52% at 8% 12%, rgba(79, 70, 229, 0.28), transparent 70%),
        radial-gradient(ellipse 60% 48% at 94% 88%, rgba(124, 58, 237, 0.2), transparent 72%),
        linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.login-background {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.ambient-orb {
    position: absolute;
    display: block;
    border-radius: 50%;
    filter: blur(2px);
    opacity: 0.8;
}

.ambient-orb-primary {
    width: 390px;
    height: 390px;
    top: -205px;
    right: -70px;
    background: radial-gradient(circle at 38% 58%, rgba(99, 102, 241, 0.2), rgba(99, 102, 241, 0) 70%);
}

.ambient-orb-accent {
    width: 330px;
    height: 330px;
    bottom: -170px;
    left: -85px;
    background: radial-gradient(circle at 62% 42%, rgba(168, 85, 247, 0.16), rgba(168, 85, 247, 0) 70%);
}

.ambient-grid {
    position: absolute;
    width: min(78vw, 760px);
    height: min(58vw, 560px);
    right: -170px;
    top: 14%;
    opacity: 0.24;
    transform: rotate(-17deg);
    background-image:
        linear-gradient(rgba(99, 102, 241, 0.11) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.11) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(90deg, transparent, black 28%, black 72%, transparent);
}

.login-container {
    width: min(100%, 430px);
    padding: 44px 40px 32px;
    text-align: center;
    position: relative;
    z-index: 1;
    background: var(--login-card-bg);
    border: 1px solid var(--login-card-border);
    border-radius: 20px;
    box-shadow:
        0 25px 50px -12px rgba(15, 23, 42, 0.12),
        0 10px 18px -8px rgba(15, 23, 42, 0.08),
        0 0 0 1px rgba(255, 255, 255, 0.14) inset;
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
}

.dark .login-container {
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.42),
        0 10px 18px -8px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

.login-container::before {
    content: '';
    position: absolute;
    left: 14%;
    right: 14%;
    top: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.95), transparent);
    pointer-events: none;
}

.logo-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 17px;
    background: linear-gradient(160deg, #a5b4fc 0%, var(--primary) 50%, #4338ca 100%);
    box-shadow:
        0 12px 28px rgba(79, 70, 229, 0.28),
        0 0 0 5px rgba(99, 102, 241, 0.07),
        0 1px 0 rgba(255, 255, 255, 0.4) inset;
}

.logo-icon svg { filter: drop-shadow(0 2px 3px rgba(30, 41, 59, 0.2)); }

h1 {
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.35;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 30px;
}

.form-group { margin-bottom: 16px; text-align: left; }

label {
    display: block;
    margin-bottom: 7px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 13px;
}

.input-shell { position: relative; display: flex; align-items: center; }

.input-icon {
    position: absolute;
    left: 15px;
    width: 19px;
    height: 19px;
    color: var(--text-muted);
    pointer-events: none;
    z-index: 1;
    transition: color 0.2s ease;
}

.input-shell:focus-within .input-icon { color: var(--primary); }

input[type="text"], input[type="password"] {
    width: 100%;
    height: 48px;
    padding: 0 16px 0 44px;
    color: var(--text-primary);
    background: var(--login-input-bg);
    border: 1px solid var(--login-input-border);
    border-radius: 11px;
    font: inherit;
    font-size: 15px;
    line-height: 48px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

input.password-input { padding-right: 52px; }

input::placeholder { color: var(--text-muted); }

input:hover { border-color: var(--primary-lighter); }

input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-input-focus);
    box-shadow: 0 0 0 3px var(--accent-focus-ring), 0 2px 5px rgba(30, 41, 59, 0.04);
}

.password-toggle {
    position: absolute;
    right: 2px;
    top: 2px;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    background: transparent;
    border: 0;
    border-radius: 9px;
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.password-toggle:hover { color: var(--primary); background: var(--primary-bg); }

.password-toggle:focus-visible,
.remember-option input:focus-visible,
.login-btn:focus-visible {
    outline: 3px solid var(--accent-focus-ring);
    outline-offset: 2px;
}

.password-icon { width: 19px; height: 19px; }
.password-icon[hidden] { display: none; }

.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
    margin: -2px 0 5px;
}

.remember-option {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 44px;
    margin: 0;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

.remember-option input {
    width: 17px;
    height: 17px;
    margin: 0;
    accent-color: var(--primary);
    cursor: pointer;
}

.login-btn {
    width: 100%;
    min-height: 50px;
    margin-top: 7px;
    padding: 12px 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-white);
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border: 0;
    border-radius: 11px;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 5px 14px var(--accent-glow);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
    touch-action: manipulation;
}

.login-btn:hover:not(:disabled) {
    filter: brightness(1.05);
    transform: translateY(-1px);
    box-shadow: 0 9px 24px var(--accent-glow-strong);
}

.login-btn:active:not(:disabled) { transform: translateY(1px); box-shadow: 0 3px 8px var(--accent-glow); }

.login-btn:disabled { opacity: 0.76; cursor: wait; }
.login-btn.is-loading { filter: saturate(0.9); }
.login-btn-content, .login-loading { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.login-btn-content[hidden], .login-loading[hidden] { display: none; }

.login-spinner {
    width: 16px;
    height: 16px;
    display: inline-block;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

.error-msg {
    min-height: 20px;
    margin-top: 12px;
    color: var(--danger);
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    line-height: 1.5;
}

.error-msg[hidden] { display: none; }

.security-notice {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 19px;
    padding: 0 2px;
    color: var(--text-muted);
    background: transparent;
    border: 0;
    font-size: 12px;
    line-height: 1.6;
    text-align: left;
}

.security-notice svg { width: 15px; height: 15px; flex: 0 0 auto; margin-top: 2px; color: var(--text-muted); }

@media (max-width: 480px) {
    body { padding: 16px; }
    .login-container { padding: 36px 24px 28px; border-radius: 17px; }
    h1 { font-size: 19px; }
    .subtitle { margin-bottom: 26px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
