:root {
    --ink: #171b35;
    --muted: #71778f;
    --line: #e4e2ef;
    --blue: #6852e5;
    --blue-dark: #5a43d6;
    --blue-soft: #eeebff;
    --purple: #8067ee;
    --brand-blue: #3972e8;
    --danger: #c92a2a;
    --success: #157f5b;
    --surface: #fff;
    --radius: 22px;
    --shadow: 0 28px 76px -28px rgba(75, 53, 168, .34);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: #f8f8fc; }
body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at 48% 10%, rgba(128, 103, 238, .14), transparent 34rem),
        radial-gradient(circle at 9% 34%, rgba(57, 114, 232, .08), transparent 29rem),
        radial-gradient(circle at 92% 88%, rgba(104, 82, 229, .08), transparent 28rem),
        linear-gradient(145deg, #fdfdff 0%, #f8f7fc 52%, #f5f7ff 100%);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.auth-page { min-height: 100vh; display: grid; grid-template-rows: auto 1fr; }
.auth-topbar {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    padding: 24px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.brand { display: inline-flex; align-items: center; gap: 11px; font-size: 20px; font-weight: 700; letter-spacing: -.025em; }
.brand-mark { position: relative; width: 34px; height: 30px; display: inline-block; overflow: hidden; border-radius: 9px; background: linear-gradient(145deg, #4479ec 2%, #7654ec 55%, #9c72ee 100%); box-shadow: 0 7px 16px rgba(104, 82, 229, .22); }
.brand-mark::before, .brand-mark::after {
    content: "";
    position: absolute;
    top: 1px;
    width: 8px;
    height: 28px;
    border-radius: 8px;
    background: rgba(255,255,255,.92);
    transform: rotate(-36deg);
}
.brand-mark::before { left: 8px; }
.brand-mark::after { right: 7px; opacity: .52; }
.brand-mark span { display: none; }
.topbar-action { color: var(--muted); font-size: 14px; }
.topbar-action a { margin-left: 8px; color: var(--blue); font-weight: 700; }

.auth-main {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    padding: 28px 0 72px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(390px, 500px);
    align-items: center;
    gap: clamp(56px, 8vw, 120px);
}
.auth-story { max-width: 570px; }
.story-label {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 18px;
    color: var(--blue);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}
.story-label::before { content: ""; width: 24px; height: 2px; background: var(--blue); }
.auth-story h1 {
    margin: 0;
    max-width: 500px;
    font-size: clamp(40px, 3.7vw, 52px);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -.035em;
}
.auth-story h1 span { color: transparent; background: linear-gradient(92deg, var(--brand-blue) 5%, var(--blue) 58%, var(--purple) 100%); background-clip: text; -webkit-background-clip: text; }
.auth-story > p { max-width: 520px; margin: 20px 0 0; color: var(--muted); font-size: 17px; line-height: 1.85; }
.trust-list { margin: 40px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; list-style: none; }
.trust-list li { padding: 16px; border: 1px solid rgba(104,82,229,.13); border-radius: 16px; background: rgba(255,255,255,.66); box-shadow: 0 10px 26px -23px rgba(75,53,168,.34); }
.trust-list strong { display: block; margin-bottom: 5px; font-size: 14px; }
.trust-list span { color: var(--muted); font-size: 12px; line-height: 1.5; }

.auth-card { border: 1px solid #dcdae9; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.auth-card-inner { padding: clamp(30px, 4vw, 46px); }
.auth-card h2 { margin: 0; font-size: 31px; letter-spacing: -.035em; }
.auth-subtitle { margin: 10px 0 30px; color: var(--muted); font-size: 14px; line-height: 1.65; }
.auth-form { display: grid; gap: 18px; }
.field { display: grid; gap: 8px; }
.field label, .field-label { color: #344054; font-size: 13px; font-weight: 700; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap input {
    width: 100%;
    min-height: 52px;
    border: 1px solid var(--line);
    border-radius: 12px;
    outline: 0;
    padding: 0 14px;
    color: var(--ink);
    background: #fff;
    transition: border-color .18s, box-shadow .18s;
}
.input-wrap input:focus { border-color: rgba(104,82,229,.62); box-shadow: 0 0 0 4px rgba(104,82,229,.1); }
.input-wrap input::placeholder { color: #98a2b3; }
.password-input input { padding-right: 52px; }
.password-toggle {
    position: absolute;
    right: 7px;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 9px;
    color: #667085;
    background: transparent;
    cursor: pointer;
}
.password-toggle::before, .password-toggle::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}
.password-toggle::before {
    width: 20px;
    height: 14px;
    border: 1.8px solid currentColor;
    border-radius: 70% 30% / 65% 35%;
    transform: translate(-50%, -50%) rotate(45deg);
}
.password-toggle::after {
    width: 5px;
    height: 5px;
    border: 1.8px solid currentColor;
    border-radius: 50%;
    background: #fff;
}
.password-toggle.is-visible::after { background: currentColor; }
.password-toggle:hover, .password-toggle:focus-visible { color: var(--blue); background: var(--blue-soft); outline: 0; }
.code-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.code-button {
    min-width: 118px;
    border: 1px solid rgba(104,82,229,.24);
    border-radius: 12px;
    padding: 0 14px;
    color: var(--blue);
    background: var(--blue-soft);
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
}
.code-button:disabled { color: #98a2b3; border-color: var(--line); background: #f4f6f9; cursor: not-allowed; }
.form-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 13px; }
.remember { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.remember input { accent-color: var(--blue); }
.text-link { color: var(--blue); font-weight: 700; }
.captcha-field { display: grid; gap: 10px; padding: 2px 0; }
.captcha-box {
    min-height: 78px;
    display: grid;
    place-items: center;
    overflow: hidden;
}
.captcha-box > [data-captcha-widget] {
    width: 304px;
    max-width: 100%;
    height: 78px;
}
.captcha-status {
    grid-area: 1 / 1;
    width: min(304px, 100%);
    min-height: 54px;
    display: grid;
    place-items: center;
    padding: 10px 18px;
    border-radius: 12px;
    color: var(--muted);
    background: #f6f8fc;
    font-size: 12px;
    text-align: center;
}
.captcha-status[hidden] { display: none; }
.captcha-status.is-error { color: var(--danger); }
.submit-button {
    min-height: 54px;
    border: 0;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(110deg, var(--brand-blue) 0%, var(--blue) 56%, var(--purple) 100%);
    box-shadow: 0 15px 30px -8px rgba(83,59,202,.35);
    cursor: pointer;
    font-weight: 800;
    transition: transform .18s, box-shadow .18s, opacity .18s;
}
.submit-button:hover { transform: translateY(-1px); box-shadow: 0 19px 36px -8px rgba(83,59,202,.43); }
.submit-button:disabled { opacity: .66; transform: none; cursor: wait; }
.error-home-link { display: grid; place-items: center; }
.form-message { display: none; padding: 11px 13px; border-radius: 10px; font-size: 13px; line-height: 1.55; }
.form-message.is-visible { display: block; }
.form-message.is-error { color: var(--danger); background: #fff1f1; border: 1px solid #ffd4d4; }
.form-message.is-success { color: var(--success); background: #edfff8; border: 1px solid #c9f2e3; }
.auth-footnote { margin: 22px 0 0; color: var(--muted); text-align: center; font-size: 13px; }
.auth-footnote a { color: var(--blue); font-weight: 700; }

@media (max-width: 900px) {
    .auth-main { grid-template-columns: 1fr; gap: 34px; padding-top: 16px; }
    .auth-story { max-width: 680px; }
    .auth-story h1 { font-size: clamp(36px, 7vw, 48px); }
    .auth-story > p { font-size: 15px; }
    .trust-list { margin-top: 26px; }
    .auth-card { width: min(520px, 100%); margin: 0 auto; }
}
@media (max-width: 560px) {
    .auth-topbar, .auth-main { width: min(100% - 28px, 1180px); }
    .auth-topbar { padding: 18px 0; }
    .topbar-action span { display: none; }
    .auth-main { padding-bottom: 38px; }
    .auth-story h1 { font-size: 34px; }
    .trust-list { grid-template-columns: 1fr; }
    .trust-list li { padding: 12px 14px; }
    .auth-card-inner { padding: 28px 20px; }
    .code-row { grid-template-columns: 1fr; }
    .code-button { min-height: 44px; }
}
@media (max-width: 380px) {
    .captcha-box { min-height: 69px; }
    .captcha-box > [data-captcha-widget] {
        transform: scale(.88);
        transform-origin: center top;
    }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
