/*
 * 登录页视觉系统
 *
 * 这套样式只作用于 .auth-page，避免影响工作台内的表单组件。
 * 视觉方向：深色运营控制台 + 明亮任务卡，强调清晰层级和快速进入。
 */
:root {
    --auth-bg: #07131b;
    --auth-bg-deep: #050d13;
    --auth-surface: #10232d;
    --auth-card: #f6faf9;
    --auth-card-strong: #ffffff;
    --auth-ink: #10242d;
    --auth-muted: #58717b;
    --auth-muted-dark: #9cb0ba;
    --auth-line: rgba(15, 39, 49, 0.12);
    --auth-line-dark: rgba(222, 240, 241, 0.16);
    --auth-accent: #41d8c4;
    --auth-accent-rgb: 65, 216, 196;
    --auth-danger: #a83232;
    --auth-danger-bg: #fff0ef;
    --auth-radius: 28px;
    --auth-ease: cubic-bezier(.2, .75, .25, 1);
}

.auth-page--agent {
    --auth-accent: var(--primary-color, #efb46e);
    --auth-accent-rgb: 239, 180, 110;
}

.auth-page--admin {
    --auth-accent: #9a8cff;
    --auth-accent-rgb: 154, 140, 255;
}

.auth-page--register {
    --auth-accent: #f1b66d;
    --auth-accent-rgb: 241, 182, 109;
}

/* 品牌色可能来自代理配置；压低底色后使用白字，保证深色品牌色也有足够对比度。 */
.auth-page.auth-page--agent .auth-card button,
.auth-page.auth-page--agent .auth-card .btn {
    color: #f8ffff;
    background: #2e607d;
    background: color-mix(in srgb, var(--auth-accent) 72%, #0a2530);
}

/* 页面基底 */
body.auth-page {
    min-height: 100svh;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
    overflow-x: hidden;
    color: var(--auth-ink);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background:
        radial-gradient(900px 560px at 5% -12%, rgba(var(--auth-accent-rgb), .24), transparent 68%),
        radial-gradient(720px 520px at 102% 110%, rgba(40, 96, 123, .22), transparent 70%),
        linear-gradient(145deg, var(--auth-bg-deep) 0%, var(--auth-bg) 48%, #0a2029 100%);
}

body.auth-page::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: .34;
    background-image:
        linear-gradient(rgba(190, 231, 232, .045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(190, 231, 232, .045) 1px, transparent 1px);
    background-size: 76px 76px;
    mask-image: linear-gradient(to bottom, black 0%, rgba(0, 0, 0, .65) 55%, transparent 100%);
}

body.auth-page::after {
    content: "";
    position: fixed;
    width: min(42vw, 560px);
    aspect-ratio: 1;
    top: -18%;
    right: -12%;
    z-index: 0;
    pointer-events: none;
    border: 1px solid rgba(var(--auth-accent-rgb), .20);
    border-radius: 50%;
    box-shadow:
        0 0 0 28px rgba(var(--auth-accent-rgb), .035),
        0 0 0 84px rgba(var(--auth-accent-rgb), .022);
}

.auth-shell {
    position: relative;
    z-index: 1;
    width: min(1160px, calc(100% - 48px));
    min-height: calc(100svh - 48px);
    margin: 24px auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(380px, 460px);
    align-items: center;
    gap: clamp(36px, 7vw, 96px);
}

/* 左侧品牌区 */
.auth-brand {
    min-height: 560px;
    padding: 8px 0;
    color: #e8f2f2;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    animation: auth-rise .7s var(--auth-ease) both;
}

.auth-brand__top,
.auth-brand__meta,
.auth-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.auth-logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #f7ffff;
    text-decoration: none;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .02em;
}

.auth-logo img {
    width: 42px;
    height: 42px;
    display: block;
    border-radius: 13px;
    box-shadow: 0 10px 28px rgba(var(--auth-accent-rgb), .22);
}

.auth-kicker,
.auth-overline,
.auth-context,
.auth-secure,
.auth-fact__label {
    font-size: 10px;
    line-height: 1;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.auth-kicker {
    color: rgba(214, 239, 239, .56);
    white-space: nowrap;
}

.auth-brand__copy {
    max-width: 590px;
    margin: auto 0;
    padding: 72px 0 56px;
}

.auth-eyebrow {
    margin: 0 0 22px;
    color: var(--auth-accent);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .22em;
}

.auth-brand h2 {
    margin: 0;
    color: #f4fbfa;
    font-size: clamp(42px, 5.2vw, 76px);
    line-height: .98;
    letter-spacing: -.065em;
    font-weight: 760;
    text-wrap: balance;
}

.auth-brand h2 em {
    color: var(--auth-accent);
    font-style: normal;
}

.auth-brand__desc {
    max-width: 420px;
    margin: 26px 0 0;
    color: rgba(218, 235, 235, .68);
    font-size: 15px;
    line-height: 1.8;
}

.auth-brand__meta {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 30px;
    padding-top: 24px;
    border-top: 1px solid var(--auth-line-dark);
}

.auth-fact {
    min-width: 92px;
}

.auth-fact__value {
    display: block;
    margin-top: 8px;
    color: #e8f3f2;
    font-size: 13px;
    font-weight: 600;
}

.auth-fact__label {
    color: rgba(195, 222, 222, .44);
}

/* 右侧登录卡 */
.auth-page .login-container.auth-card,
.auth-page .register-container.auth-card {
    position: relative;
    isolation: isolate;
    width: 100%;
    max-width: 460px;
    margin: 0;
    padding: clamp(28px, 4.2vw, 48px);
    overflow: hidden;
    color: var(--auth-ink);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .985), rgba(238, 247, 246, .96));
    border: 1px solid rgba(222, 245, 242, .68);
    border-radius: var(--auth-radius);
    box-shadow:
        0 30px 90px rgba(0, 0, 0, .30),
        0 3px 0 rgba(255, 255, 255, .52) inset,
        0 0 0 1px rgba(var(--auth-accent-rgb), .07);
    animation: auth-card-in .72s var(--auth-ease) .08s both;
}

.auth-card::before {
    content: "";
    position: absolute;
    z-index: -1;
    width: 220px;
    height: 220px;
    top: -130px;
    right: -110px;
    border: 1px solid rgba(var(--auth-accent-rgb), .22);
    border-radius: 50%;
    box-shadow: 0 0 0 22px rgba(var(--auth-accent-rgb), .045);
}

.auth-card::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--auth-accent), rgba(var(--auth-accent-rgb), .15));
}

.auth-card__top {
    margin-bottom: 42px;
}

.auth-context {
    color: #5f757d;
    font-weight: 800;
}

.auth-secure {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #476766;
    letter-spacing: .08em;
    white-space: nowrap;
}

.auth-secure::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--auth-accent);
    box-shadow: 0 0 0 4px rgba(var(--auth-accent-rgb), .13);
}

.auth-heading {
    margin-bottom: 34px;
}

.auth-overline {
    margin: 0 0 13px;
    color: var(--auth-accent);
    font-weight: 800;
}

.auth-page .auth-card h1,
.auth-page .auth-card .login-title h1 {
    margin: 0;
    color: var(--auth-ink);
    font-size: clamp(30px, 3vw, 38px);
    line-height: 1.1;
    letter-spacing: -.045em;
    font-weight: 780;
    text-align: left;
}

.auth-page .auth-card .login-title {
    margin: 0;
    text-align: left;
}

.auth-page .auth-card .subtitle {
    margin: 12px 0 0;
    color: var(--auth-muted);
    font-size: 14px;
    line-height: 1.55;
    text-align: left;
}

.auth-page .auth-card .form-group {
    margin-bottom: 21px;
}

.auth-page .auth-card .form-group label {
    display: block;
    margin-bottom: 9px;
    color: #45606a;
    font-size: 12px;
    line-height: 1.2;
    font-weight: 750;
    letter-spacing: .02em;
}

.auth-page .auth-card .form-group input {
    width: 100%;
    min-height: 49px;
    padding: 13px 15px;
    color: var(--auth-ink);
    background: rgba(255, 255, 255, .78);
    border: 1px solid rgba(37, 78, 87, .19);
    border-radius: 13px;
    font-size: 14px;
    line-height: 1.2;
    box-sizing: border-box;
    transition: border-color .22s ease, box-shadow .22s ease, background-color .22s ease, transform .22s ease;
}

.auth-page .auth-card .form-group input::placeholder {
    color: #9aabb0;
}

.auth-page .auth-card .form-group input:hover {
    background: #fff;
    border-color: rgba(37, 78, 87, .30);
}

.auth-page .auth-card .form-group input:focus {
    outline: none;
    background: #fff;
    border-color: var(--auth-accent);
    box-shadow: 0 0 0 4px rgba(var(--auth-accent-rgb), .16);
}

.auth-page .auth-card .captcha-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-page .auth-card .captcha-group input {
    flex: 1 1 auto;
    min-width: 0;
}

.auth-page .auth-card .captcha-image {
    flex: 0 0 auto;
    width: 112px;
    height: 49px;
    display: block;
    object-fit: cover;
    cursor: pointer;
    border: 1px solid rgba(37, 78, 87, .18);
    border-radius: 13px;
    transition: border-color .22s ease, transform .22s ease, box-shadow .22s ease;
}

.auth-page .auth-card .captcha-image:hover,
.auth-page .auth-card .captcha-image:focus-visible {
    outline: none;
    border-color: var(--auth-accent);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(var(--auth-accent-rgb), .16);
}

.auth-page .auth-card .captcha-hint {
    display: block;
    margin-top: 8px;
    color: #5f757d;
    font-size: 11px;
    line-height: 1.4;
}

.auth-page .auth-card .error,
.auth-page .auth-card .error-msg {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin: 0 0 22px;
    padding: 12px 14px;
    color: var(--auth-danger);
    background: var(--auth-danger-bg);
    border: 1px solid rgba(168, 50, 50, .16);
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.45;
    text-align: left;
}

.auth-page .auth-card .error::before,
.auth-page .auth-card .error-msg::before {
    content: "!";
    flex: 0 0 auto;
    width: 17px;
    height: 17px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: var(--auth-danger);
    border-radius: 50%;
    font-size: 11px;
    font-weight: 800;
}

.auth-page .auth-card button,
.auth-page .auth-card .btn {
    position: relative;
    width: 100%;
    min-height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 7px;
    padding: 14px 18px;
    color: #06231f;
    background: var(--auth-accent);
    border: 1px solid rgba(0, 0, 0, .06);
    border-radius: 13px;
    box-shadow: 0 10px 24px rgba(var(--auth-accent-rgb), .22), 0 2px 0 rgba(255, 255, 255, .32) inset;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: .01em;
    cursor: pointer;
    transition: transform .22s var(--auth-ease), box-shadow .22s ease, filter .22s ease;
}

.auth-page .auth-card button::after,
.auth-page .auth-card .btn::after {
    content: "↗";
    font-size: 17px;
    line-height: 1;
    transition: transform .22s var(--auth-ease);
}

.auth-page .auth-card button:hover,
.auth-page .auth-card .btn:hover {
    filter: saturate(1.08) brightness(1.02);
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(var(--auth-accent-rgb), .28), 0 2px 0 rgba(255, 255, 255, .32) inset;
}

.auth-page .auth-card button:hover::after,
.auth-page .auth-card .btn:hover::after {
    transform: translate(2px, -2px);
}

.auth-page .auth-card button:active,
.auth-page .auth-card .btn:active {
    transform: translateY(0);
}

.auth-page .auth-card button:focus-visible,
.auth-page .auth-card .btn:focus-visible,
.auth-page .auth-card a:focus-visible,
.auth-page .auth-logo:focus-visible {
    outline: 3px solid rgba(var(--auth-accent-rgb), .42);
    outline-offset: 3px;
}

.auth-page .auth-card .divider {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 28px 0 20px;
    color: #9aabb0;
    font-size: 11px;
    line-height: 1;
}

.auth-page .auth-card .divider::before,
.auth-page .auth-card .divider::after {
    content: "";
    position: static;
    width: auto;
    height: 1px;
    flex: 1;
    background: rgba(37, 78, 87, .13);
}

.auth-page .auth-card .login-footer {
    margin-top: 0;
    text-align: center;
}

.auth-page .auth-card .login-footer p {
    margin: 0;
    color: #5f757d;
    font-size: 12px;
    line-height: 1.6;
}

.auth-page .auth-card .login-footer a {
    color: #267e78;
    text-decoration: none;
    font-weight: 750;
    transition: color .2s ease;
}

.auth-page--agent .auth-card .login-footer a {
    color: var(--auth-accent);
}

.auth-page--admin .auth-card .login-footer a {
    color: #6558d3;
}

.auth-page .auth-card .login-footer a:hover {
    color: var(--auth-ink);
}

@keyframes auth-rise {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes auth-card-in {
    from { opacity: 0; transform: translateY(22px) scale(.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 900px) {
    .auth-shell {
        width: min(620px, calc(100% - 36px));
        min-height: auto;
        margin: 18px auto;
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .auth-brand {
        min-height: auto;
        padding: 8px 0 0;
    }

    .auth-brand__copy {
        padding: 56px 0 30px;
    }

    .auth-brand h2 {
        max-width: 520px;
        font-size: clamp(40px, 9vw, 64px);
    }

    .auth-brand__desc {
        margin-top: 18px;
    }

    .auth-page .login-container.auth-card,
    .auth-page .register-container.auth-card {
        max-width: none;
    }
}

@media (min-width: 901px) and (max-height: 780px) {
    .auth-page .login-container.auth-card,
    .auth-page .register-container.auth-card {
        padding-top: 32px;
        padding-bottom: 32px;
    }

    .auth-card__top {
        margin-bottom: 30px;
    }

    .auth-heading {
        margin-bottom: 26px;
    }

    .auth-page .auth-card .form-group {
        margin-bottom: 16px;
    }

    .auth-page .auth-card .divider {
        margin-top: 20px;
        margin-bottom: 15px;
    }
}

@media (max-width: 560px) {
    body.auth-page::after {
        width: 340px;
        top: -11%;
        right: -40%;
    }

    .auth-shell {
        width: min(100% - 28px, 460px);
        margin: 14px auto 22px;
        gap: 14px;
    }

    .auth-brand__top {
        align-items: flex-start;
    }

    .auth-kicker {
        display: none;
    }

    .auth-brand__copy {
        padding: 28px 0 20px;
    }

    .auth-eyebrow {
        margin-bottom: 15px;
        font-size: 10px;
    }

    .auth-brand h2 {
        font-size: clamp(34px, 12vw, 50px);
    }

    .auth-brand__desc {
        display: none;
    }

    .auth-brand__meta {
        display: none;
    }

    .auth-page .login-container.auth-card,
    .auth-page .register-container.auth-card {
        padding: 27px 21px 23px;
        border-radius: 22px;
    }

    .auth-card__top {
        margin-bottom: 31px;
    }

    .auth-heading {
        margin-bottom: 28px;
    }

    .auth-page .auth-card h1,
    .auth-page .auth-card .login-title h1 {
        font-size: 29px;
    }

    .auth-page .auth-card .captcha-group {
        gap: 8px;
    }

    .auth-page .auth-card .captcha-image {
        width: 100px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-brand,
    .auth-page .login-container.auth-card,
    .auth-page .register-container.auth-card {
        animation: none;
    }

    .auth-page .auth-card button,
    .auth-page .auth-card .btn,
    .auth-page .auth-card .captcha-image,
    .auth-page .auth-card input {
        transition: none;
    }
}

/* 注册页：更宽的分段表单，沿用登录页的 token 与交互状态。 */
.auth-page--register .auth-shell {
    width: min(1280px, calc(100% - 48px));
    grid-template-columns: minmax(0, .78fr) minmax(520px, 640px);
    align-items: start;
    gap: clamp(38px, 6vw, 84px);
}

.auth-page--register .auth-brand {
    position: sticky;
    top: 24px;
    min-height: calc(100svh - 48px);
}

.auth-page--register .auth-card.auth-register-card {
    max-width: 640px;
}

.auth-register-card .auth-card__top {
    margin-bottom: 35px;
}

.auth-register-card .auth-heading {
    margin-bottom: 28px;
}

.auth-register-card .form-section {
    margin: 0 0 20px;
    padding: 18px 0 0;
    background: transparent;
    border-top: 1px solid rgba(37, 78, 87, .13);
    border-radius: 0;
}

.auth-register-card .form-section:first-of-type {
    padding-top: 0;
    border-top: 0;
}

.auth-register-card .form-section-title {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 15px;
    color: #294b56;
    font-size: 13px;
    line-height: 1.3;
    font-weight: 800;
    letter-spacing: .01em;
}

.auth-register-card .form-section-title::before {
    content: "";
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border-radius: 3px;
    background: var(--auth-accent);
    box-shadow: 0 0 0 4px rgba(var(--auth-accent-rgb), .14);
}

.auth-register-card .form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 14px;
}

.auth-register-card .form-group {
    min-width: 0;
}

.auth-register-card .optional {
    color: #7b8d94;
    font-size: 11px;
    font-weight: 500;
}

.auth-register-card .required {
    color: #c94a4a;
}

.auth-register-card .success-box {
    margin: 0;
    padding: 24px;
    text-align: left;
    background: #f0faf5;
    border: 1px solid rgba(37, 145, 91, .20);
    border-radius: 15px;
}

.auth-register-card .success-box h3 {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 10px;
    color: #16633d;
    font-size: 18px;
}

.auth-register-card .success-box h3::before {
    content: "✓";
    width: 23px;
    height: 23px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: #27a765;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 800;
}

.auth-register-card .success-box p {
    margin: 0 0 17px;
    color: #42745b;
    font-size: 13px;
    line-height: 1.6;
}

.auth-register-card .success-box a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    color: #fff;
    background: #24995f;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 750;
    text-decoration: none;
    transition: transform .2s ease, box-shadow .2s ease;
}

.auth-register-card .success-box a::after {
    content: "→";
    font-size: 16px;
}

.auth-register-card .success-box a:hover {
    transform: translateY(-1px);
    box-shadow: 0 7px 16px rgba(36, 153, 95, .23);
}

.auth-register-card .links,
.auth-register-card .back-home {
    text-align: center;
}

.auth-register-card .links {
    margin-top: 3px;
    font-size: 12px;
}

.auth-register-card .links p {
    margin: 0;
    color: #5f757d;
}

.auth-register-card .links a {
    color: #a16a2b;
    text-decoration: none;
    font-weight: 800;
}

.auth-register-card .links a:hover {
    color: var(--auth-ink);
}

.auth-register-card .back-home {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid rgba(37, 78, 87, .12);
}

.auth-register-card .back-home a {
    color: #6b8088;
    font-size: 12px;
    text-decoration: none;
}

.auth-register-card .back-home a:hover {
    color: var(--auth-ink);
}

.auth-register-card .captcha-image {
    border-color: rgba(241, 182, 109, .34);
}

.auth-register-card button[type="submit"] {
    margin-top: 2px;
}

@media (max-width: 1020px) {
    .auth-page--register .auth-shell {
        width: min(760px, calc(100% - 36px));
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .auth-page--register .auth-brand {
        position: static;
        min-height: auto;
    }

    .auth-page--register .auth-brand__copy {
        padding-bottom: 30px;
    }

    .auth-page--register .auth-card.auth-register-card {
        max-width: none;
    }
}

@media (max-width: 560px) {
    .auth-page--register .auth-shell {
        width: min(100% - 28px, 460px);
        margin-top: 14px;
    }

    .auth-register-card .form-row {
        grid-template-columns: 1fr;
    }

    .auth-register-card .form-section {
        margin-bottom: 17px;
        padding-top: 15px;
    }

    .auth-register-card .form-section-title {
        margin-bottom: 13px;
    }

    .auth-register-card .success-box {
        padding: 19px;
    }
}
