/* ==========================================================================
   CC 采集系统 · 登录页样式
   Theme · 极光 Aurora Duo —— 昼夜双模
   --------------------------------------------------------------------------
   说明：登录页是独立文档，不加载 admin.css，因此这里镜像一份与
   admin.css 第 01 / 02 节完全相同的设计令牌。两者共用同一套变量名，
   调整主题色时请同步修改 admin.css 顶部的令牌区（唯二的两处定义点）。
   --------------------------------------------------------------------------
   分区：01 令牌 · 白昼 / 02 令牌 · 夜间 / 03 基础 / 04 卡片 / 05 表单 / 06 响应式
   ========================================================================== */

/* ==========================================================================
   01  设计令牌 · 白昼
   ========================================================================== */
:root {
    --bg: #f5f7fb;
    --bg-2: #eef1f8;
    --surface: #ffffff;
    --surface-2: #f8fafd;
    --surface-3: #f1f5fb;
    --surface-sunken: #f6f8fc;

    --line: #e6eaf2;
    --line-2: #dae0ec;

    --text: #0b1220;
    --text-2: #55617a;
    --text-3: #8a94a9;

    --accent: #4f6ef7;
    --accent-2: #3b5be8;
    --accent-3: #22d3ee;
    --accent-soft: #eef2ff;

    --bad: #dc4a54;
    --bad-bg: #fdecde;
    --ok: #0d9b73;
    --ok-bg: #e5f7f1;

    --on-solid: #ffffff;
    --qr-bg: #ffffff;

    --sh-1: 0 1px 2px rgba(11, 18, 32, .05);
    --sh-2: 0 1px 2px rgba(11, 18, 32, .04), 0 6px 16px -10px rgba(11, 18, 32, .14);
    --sh-4: 0 3px 8px rgba(11, 18, 32, .06), 0 28px 60px -26px rgba(11, 18, 32, .34);
    --edge: inset 0 1px 0 rgba(255, 255, 255, .9);

    --aurora-1: rgba(79, 110, 247, .17);
    --aurora-2: rgba(34, 211, 238, .15);
    --aurora-3: rgba(139, 92, 246, .12);

    --r-lg: 15px;
    --r: 12px;
    --r-sm: 9px;
    --r-pill: 100px;
    --h-ctl: 48px;

    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
    --ease: cubic-bezier(.22, .61, .36, 1);
    --ease-soft: cubic-bezier(.25, .7, .3, 1);
    --t-fast: .18s cubic-bezier(.22, .61, .36, 1);
}

/* ==========================================================================
   02  设计令牌 · 夜间
   ========================================================================== */
html[data-theme="dark"] {
    --bg: #0a0f1a;
    --bg-2: #0d1421;
    --surface: #111827;
    --surface-2: #151d2e;
    --surface-3: #1a2337;
    --surface-sunken: #0e1523;

    --line: #1f2a3f;
    --line-2: #2b3852;

    --text: #e8eefb;
    --text-2: #9aa8c0;
    --text-3: #6b7891;

    --accent: #5ea8ff;
    --accent-2: #7cbcff;
    --accent-3: #22d3ee;
    --accent-soft: rgba(94, 168, 255, .14);

    --bad: #ff6b7a;
    --bad-bg: rgba(255, 107, 122, .13);
    --ok: #34d3a4;
    --ok-bg: rgba(52, 211, 164, .13);

    --on-solid: #ffffff;
    --qr-bg: #ffffff;

    --sh-1: inset 0 1px 0 rgba(255, 255, 255, .04);
    --sh-2: inset 0 1px 0 rgba(255, 255, 255, .045), 0 8px 20px -14px #000;
    --sh-4: inset 0 1px 0 rgba(255, 255, 255, .06), 0 30px 66px -30px #000;
    --edge: inset 0 1px 0 rgba(255, 255, 255, .05);

    --aurora-1: rgba(94, 168, 255, .17);
    --aurora-2: rgba(34, 211, 238, .12);
    --aurora-3: rgba(139, 92, 246, .15);
}

/* 切换主题瞬间才挂过渡 */
html.is-theme-switching,
html.is-theme-switching * {
    transition: background-color .28s var(--ease), border-color .28s var(--ease),
                color .28s var(--ease), box-shadow .28s var(--ease) !important;
}

/* ==========================================================================
   03  基础
   ========================================================================== */
* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    color-scheme: light;
}

html[data-theme="dark"] {
    color-scheme: dark;
}

body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 24px;
    overflow: hidden;
    color: var(--text);
    background-color: var(--bg);
    background-image:
        radial-gradient(1000px 560px at 50% -10%, var(--aurora-1), transparent 62%),
        radial-gradient(820px 480px at 92% 104%, var(--aurora-3), transparent 60%),
        radial-gradient(760px 460px at 6% 100%, var(--aurora-2), transparent 62%),
        linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
    background-attachment: fixed;
    font: 14px/1.62 var(--font);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button,
input {
    font: inherit;
    color: inherit;
}

button {
    border: 0;
    background: transparent;
    cursor: pointer;
}

:where(a, button, input, [tabindex]):focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 26%, transparent);
    border-radius: var(--r-sm);
}

::selection {
    background: color-mix(in srgb, var(--accent) 22%, transparent);
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--line-2) transparent;
}

*::-webkit-scrollbar {
    width: 9px;
    height: 9px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: var(--r-pill);
    background: var(--line-2);
    background-clip: content-box;
}

/* 背景极光光斑 */
.glow {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 0;
    width: 460px;
    height: 460px;
    border-radius: 50%;
    background: linear-gradient(140deg, var(--accent), var(--accent-3));
    filter: blur(150px);
    opacity: .12;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

/* ==========================================================================
   04  卡片
   ========================================================================== */
.login-card {
    position: relative;
    z-index: 1;
    width: min(404px, 100%);
    padding: 42px 40px 36px;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--surface);
    box-shadow: var(--sh-4), var(--edge);
    animation: cardIn .5s var(--ease-soft);
}

.login-card::before {
    content: "";
    position: absolute;
    top: -1px;
    left: 12%;
    right: 12%;
    height: 2px;
    border-radius: 0 0 3px 3px;
    background: linear-gradient(90deg, transparent, var(--accent), var(--accent-3) 50%, transparent);
    opacity: .8;
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(14px) scale(.985);
    }
}

.login-icon {
    width: 74px;
    height: 74px;
    display: block;
    margin: 0 auto 16px;
    box-sizing: border-box;
    padding: 11px;
    border-radius: 20px;
    background: linear-gradient(145deg, var(--accent) 0%, var(--accent-2) 52%, var(--accent-3) 130%);
    object-fit: contain;
    box-shadow: 0 14px 30px -14px color-mix(in srgb, var(--accent) 75%, transparent),
                inset 0 0 0 1px color-mix(in srgb, var(--accent) 20%, transparent);
}

.brand {
    margin-bottom: 6px;
    color: var(--accent);
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: .32em;
    text-align: center;
    text-transform: uppercase;
}

.welcome-text {
    margin: 0 0 30px;
    color: var(--text);
    font-size: 23px;
    font-weight: 680;
    letter-spacing: -.024em;
    text-align: center;
}

/* ==========================================================================
   05  表单
   ========================================================================== */
.form-group {
    position: relative;
    margin-bottom: 18px;
}

.form-group > label {
    display: block;
    margin: 0 0 7px 2px;
    color: var(--text-3);
    font-size: 12.5px;
}

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

.input-wrapper > i {
    position: absolute;
    left: 15px;
    color: var(--text-3);
    font-size: 18px;
    transition: color var(--t-fast);
    pointer-events: none;
}

.input-wrapper:focus-within > i {
    color: var(--accent);
}

.form-control {
    width: 100%;
    min-height: 48px;
    padding: 13px 15px 13px 46px;
    border: 1px solid var(--line);
    border-radius: var(--r);
    outline: none;
    color: var(--text);
    background: var(--surface-2);
    font-size: 14px;
    transition: background var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast);
}

.form-control::placeholder {
    color: var(--text-3);
}

.form-control:hover {
    border-color: var(--line-2);
}

.form-control:focus {
    border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
    background: var(--surface);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.code-input {
    letter-spacing: .16em;
    text-transform: uppercase;
}

.options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    font-size: 13px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-2);
    cursor: pointer;
    user-select: none;
}

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

.forgot-link,
.footer-note button {
    padding: 0;
    color: var(--text-3);
    font-size: inherit;
    text-decoration: none;
    transition: color var(--t-fast);
}

.forgot-link:hover,
.footer-note button:hover {
    color: var(--accent);
}

.btn-login {
    width: 100%;
    min-height: 48px;
    margin-bottom: 20px;
    padding: 13px;
    border-radius: var(--r);
    background: linear-gradient(120deg, var(--accent), color-mix(in srgb, var(--accent-3) 40%, var(--accent)));
    box-shadow: 0 12px 26px -12px color-mix(in srgb, var(--accent) 95%, transparent),
                inset 0 1px 0 rgba(255, 255, 255, .3);
    color: var(--on-solid);
    font-size: 15px;
    font-weight: 650;
    letter-spacing: .04em;
    transition: transform var(--t-fast), box-shadow var(--t-fast), filter var(--t-fast);
}

.btn-login:hover {
    filter: brightness(1.06);
    transform: translateY(-2px);
    box-shadow: 0 16px 32px -13px color-mix(in srgb, var(--accent) 100%, transparent),
                inset 0 1px 0 rgba(255, 255, 255, .34);
}

.btn-login:active {
    transform: translateY(0) scale(.99);
}

.footer-note {
    color: var(--text-3);
    font-size: 13px;
    text-align: center;
}

.footer-note button {
    color: var(--accent);
    font-weight: 600;
}

/* 提示条与浮动提示 */
.alert {
    margin: -6px 0 20px;
    padding: 11px 14px;
    border: 1px solid color-mix(in srgb, var(--bad) 32%, var(--line));
    border-radius: var(--r);
    background: var(--bad-bg);
    color: var(--bad);
    font-size: 13px;
    line-height: 1.65;
}

.hint {
    min-height: 18px;
    margin-top: 10px;
    color: var(--accent);
    font-size: 12px;
    text-align: center;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity var(--t-fast), transform var(--t-fast);
}

.hint.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   06  响应式
   ========================================================================== */
@media (max-width: 480px) {
    body {
        padding: 16px;
    }

    .login-card {
        padding: 30px 22px 26px;
    }

    .options {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }
}

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