/**
 * 登录页：极光背景、玻璃拟态、输入聚焦与 CTA 动效（浅色参考 DemoGet 风格，深色同步可读）
 */

@keyframes login-aurora-a {
    0%,
    100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.48;
    }
    40% {
        transform: translate(4%, -3%) scale(1.06);
        opacity: 0.62;
    }
    70% {
        transform: translate(-3%, 4%) scale(0.96);
        opacity: 0.52;
    }
}

@keyframes login-aurora-b {
    0%,
    100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.42;
    }
    50% {
        transform: translate(-5%, 5%) scale(1.08);
        opacity: 0.58;
    }
}

@keyframes login-aurora-c {
    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.35;
    }
    33% {
        transform: translate(-48%, -52%) scale(1.12);
        opacity: 0.48;
    }
    66% {
        transform: translate(-52%, -48%) scale(0.94);
        opacity: 0.4;
    }
}

@keyframes login-float-y {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes login-cta-shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

@keyframes login-glow-pulse {
    0%,
    100% {
        opacity: 0.45;
        transform: scale(1);
    }
    50% {
        opacity: 0.65;
        transform: scale(1.05);
    }
}

.login-aurora-root {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.login-aurora-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(88px);
    will-change: transform, opacity;
}

.login-aurora-blob--cyan {
    width: min(72vw, 520px);
    height: min(72vw, 520px);
    left: -18%;
    top: 8%;
    background: radial-gradient(circle at 40% 40%, rgba(56, 189, 248, 0.55) 0%, rgba(56, 189, 248, 0) 68%);
    animation: login-aurora-a 22s ease-in-out infinite;
}

.login-aurora-blob--violet {
    width: min(78vw, 580px);
    height: min(78vw, 580px);
    right: -22%;
    bottom: 5%;
    background: radial-gradient(circle at 55% 55%, rgba(99, 102, 241, 0.5) 0%, rgba(139, 92, 246, 0) 70%);
    animation: login-aurora-b 26s ease-in-out infinite;
}

.login-aurora-blob--rose {
    width: min(50vw, 380px);
    height: min(50vw, 380px);
    left: 42%;
    top: 38%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle at 50% 50%, rgba(236, 72, 153, 0.38) 0%, rgba(236, 72, 153, 0) 65%);
    animation: login-aurora-c 30s ease-in-out infinite;
}

.light-theme .login-aurora-blob {
    filter: blur(100px);
}

html:not(.light-theme) .login-aurora-blob--cyan {
    background: radial-gradient(circle at 40% 40%, rgba(56, 189, 248, 0.35) 0%, transparent 68%);
}

html:not(.light-theme) .login-aurora-blob--violet {
    background: radial-gradient(circle at 55% 55%, rgba(129, 140, 248, 0.38) 0%, transparent 70%);
}

html:not(.light-theme) .login-aurora-blob--rose {
    background: radial-gradient(circle at 50% 50%, rgba(167, 139, 250, 0.28) 0%, transparent 65%);
}

.login-aurora-halo {
    position: absolute;
    left: 50%;
    top: 42%;
    width: min(70vmin, 420px);
    height: min(70vmin, 420px);
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.2) 0%, rgba(56, 189, 248, 0.08) 45%, transparent 70%);
    filter: blur(40px);
    animation: login-glow-pulse 8s ease-in-out infinite;
}

.light-theme .login-aurora-halo {
    background: radial-gradient(circle, rgba(99, 102, 241, 0.28) 0%, rgba(56, 189, 248, 0.12) 45%, transparent 72%);
}

.login-hero-icon-wrap {
    animation: login-float-y 5.5s ease-in-out infinite;
}

.login-form-glass {
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.65);
    box-shadow:
        0 4px 24px rgba(15, 23, 42, 0.06),
        0 24px 64px -20px rgba(15, 23, 42, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

html:not(.light-theme) .login-form-glass {
    background: rgba(22, 27, 34, 0.82);
    border: 1px solid rgba(148, 163, 184, 0.12);
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.35),
        0 24px 64px -20px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.login-field {
    width: 100%;
    height: 2.75rem;
    padding-left: 2.35rem;
    padding-right: 0.875rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    border-radius: 0.875rem;
    outline: none;
    border: 1px solid transparent;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease;
    background: var(--bg-tertiary);
    color: var(--color-dark);
}

.login-field::-moz-placeholder {
    color: var(--text-tertiary);
}

.login-field::placeholder {
    color: var(--text-tertiary);
}

.login-field:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-primary) 22%, transparent);
}

.login-cta {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 2.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 700;
    border-radius: 0.875rem;
    border: none;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(135deg, var(--color-primary-hover) 0%, var(--color-primary) 45%, #6366f1 100%);
    box-shadow:
        0 4px 16px color-mix(in srgb, var(--color-primary) 35%, transparent),
        0 12px 32px -8px rgba(99, 102, 241, 0.45);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        filter 0.2s ease;
}

.login-cta:hover:not(:disabled) {
    transform: translateY(-1px);
    filter: brightness(1.05);
    box-shadow:
        0 6px 20px color-mix(in srgb, var(--color-primary) 42%, transparent),
        0 16px 40px -8px rgba(99, 102, 241, 0.5);
}

.login-cta:active:not(:disabled) {
    transform: translateY(0);
}

.login-cta:disabled {
    cursor: not-allowed;
    opacity: 0.92;
}

.login-cta--loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        105deg,
        transparent 0%,
        rgba(255, 255, 255, 0.22) 45%,
        transparent 90%
    );
    background-size: 200% 100%;
    animation: login-cta-shimmer 1.4s linear infinite;
}

.login-mode-pill {
    border-radius: 0.875rem;
    padding: 0.25rem;
    background: color-mix(in srgb, var(--bg-tertiary) 92%, transparent);
    border: 1px solid var(--border-hairline);
}

.login-mode-pill button {
    transition:
        background 0.2s ease,
        color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.15s ease;
}

.login-mode-pill button[aria-pressed='true'] {
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

@media (prefers-reduced-motion: reduce) {
    .login-aurora-blob,
    .login-aurora-halo,
    .login-hero-icon-wrap,
    .login-cta--loading::after {
        animation: none !important;
    }

    .login-aurora-blob {
        opacity: 0.45;
    }

    .login-aurora-halo {
        opacity: 0.5;
    }
}
