:root {
    --fa-ink: #0f1c2e;
    --fa-ink-soft: #31435c;
    --fa-muted: #5f6e85;
    --fa-line: #dfe6ef;
    --fa-bg: #f4f7fb;
    --fa-card: #ffffff;
    --fa-primary: #1656c8;
    --fa-primary-dark: #11429b;
    --fa-ok: #15734a;
    --fa-bad: #c22f2f;
    --fa-warn: #9a5b00;
    --fa-radius: 16px;
    --fa-shadow: 0 24px 70px rgba(15, 28, 46, .10);
}

* { box-sizing: border-box; }

body.fa-auth {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 12% 8%, rgba(22, 86, 200, .14), transparent 34%),
        radial-gradient(circle at 88% 92%, rgba(21, 115, 74, .10), transparent 38%),
        var(--fa-bg);
    color: var(--fa-ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    -webkit-font-smoothing: antialiased;
}

.fa-auth a { color: var(--fa-primary); text-decoration: none; }
.fa-auth a:hover { color: var(--fa-primary-dark); }

/* .fa-auth a 的权重高于单个类，按钮/品牌必须显式覆盖，否则深色底上会出现深色字 */
.fa-auth a.fa-auth-submit,
.fa-auth a.fa-auth-submit:hover { color: #fff; }

.fa-auth a.fa-auth-brand,
.fa-auth a.fa-auth-brand:hover { color: var(--fa-ink); }

.fa-auth-shell {
    width: min(1120px, calc(100% - 40px));
    margin: 0 auto;
}

.fa-auth-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 26px 0 8px;
}

.fa-auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--fa-ink);
    font-weight: 800;
    letter-spacing: -.02em;
}

.fa-auth-brand:hover { color: var(--fa-ink); }

.fa-auth-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: linear-gradient(135deg, #1656c8, #0b2f75);
    color: #fff;
    font-size: 13px;
    letter-spacing: .04em;
    box-shadow: 0 8px 20px rgba(22, 86, 200, .28);
}

.fa-auth-brand-name { font-size: 18px; }

.fa-auth-nav {
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: 14px;
    color: var(--fa-muted);
}

.fa-auth-nav a { color: var(--fa-muted); font-weight: 600; }
.fa-auth-nav a:hover { color: var(--fa-ink); }

/* 登录/注册页的语言切换：与主站页头同一套交互，但用 auth 自己的窄间距 */
.fa-auth-lang {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--fa-line);
    border-radius: 999px;
}

.fa-auth-nav .fa-auth-lang-btn {
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 12px;
    line-height: 1.5;
}

.fa-auth-nav .fa-auth-lang-btn.is-active {
    background: var(--fa-ink);
    color: var(--fa-card);
}

.fa-auth-main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 38px 0 64px;
}

.fa-auth-card-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
    width: 100%;
    max-width: 980px;
    background: var(--fa-card);
    border: 1px solid var(--fa-line);
    border-radius: 24px;
    box-shadow: var(--fa-shadow);
    overflow: hidden;
}

.fa-auth-aside {
    position: relative;
    padding: 46px 42px;
    background:
        radial-gradient(circle at 100% 0, rgba(255, 255, 255, .16), transparent 42%),
        linear-gradient(150deg, #0c2b66 0%, #113f96 52%, #1656c8 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 30px;
}

.fa-auth-aside::after {
    content: "";
    position: absolute;
    right: -70px;
    bottom: -90px;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .22);
}

.fa-auth-aside h2 {
    margin: 0 0 12px;
    font-size: 25px;
    line-height: 1.3;
    letter-spacing: -.02em;
}

.fa-auth-aside p {
    margin: 0;
    color: rgba(255, 255, 255, .78);
    font-size: 14px;
    line-height: 1.8;
}

.fa-auth-points {
    position: relative;
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 13px;
    color: rgba(255, 255, 255, .88);
}

.fa-auth-points li { display: flex; gap: 9px; align-items: flex-start; }
.fa-auth-points i { color: #7dd3fc; margin-top: 2px; }

.fa-auth-side-foot {
    position: relative;
    font-size: 12px;
    color: rgba(255, 255, 255, .56);
}

.fa-auth-form {
    padding: 42px 40px;
    min-width: 0;
}

.fa-auth-kicker {
    margin: 0 0 8px;
    color: var(--fa-primary);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.fa-auth-form h1 {
    margin: 0 0 8px;
    font-size: 26px;
    line-height: 1.25;
    letter-spacing: -.02em;
}

.fa-auth-sub {
    margin: 0 0 24px;
    color: var(--fa-muted);
    font-size: 14px;
    line-height: 1.7;
}

.fa-auth-alert {
    display: flex;
    gap: 9px;
    align-items: flex-start;
    margin: 0 0 18px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid #f0c2c2;
    background: #fff5f5;
    color: var(--fa-bad);
    font-size: 13px;
    line-height: 1.6;
}

.fa-auth-alert.is-info {
    border-color: #bcd3f5;
    background: #f2f7ff;
    color: #16457f;
}

.fa-auth-alert.is-warn {
    border-color: #f0d9a8;
    background: #fffaef;
    color: var(--fa-warn);
}

.fa-auth-field { margin-bottom: 16px; }

.fa-auth-field label {
    display: block;
    margin-bottom: 7px;
    color: var(--fa-ink-soft);
    font-size: 13px;
    font-weight: 700;
}

.fa-auth-input {
    display: block;
    width: 100%;
    height: 46px;
    padding: 0 13px;
    border: 1px solid var(--fa-line);
    border-radius: 10px;
    background: #fff;
    color: var(--fa-ink);
    font-size: 14px;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.fa-auth-input:focus {
    outline: none;
    border-color: #7aa7ee;
    box-shadow: 0 0 0 4px rgba(22, 86, 200, .10);
}

.fa-auth-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.fa-auth-code-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.fa-auth-code-row .fa-auth-input { flex: 1 1 auto; min-width: 0; }

.fa-auth-code-btn {
    flex: 0 0 auto;
    min-width: 112px;
    padding: 0 14px;
    border: 1px solid #bcd3f5;
    border-radius: 10px;
    background: #f2f7ff;
    color: var(--fa-primary);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s ease;
}

.fa-auth-code-btn:hover:not(:disabled) { background: #e4efff; }
.fa-auth-code-btn:disabled { cursor: not-allowed; color: #8a99ad; background: #f4f6f9; border-color: var(--fa-line); }

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

.fa-auth-captcha .fa-auth-input { flex: 1 1 auto; min-width: 0; }

.fa-auth-captcha img {
    width: 108px;
    height: 44px;
    border: 1px solid var(--fa-line);
    border-radius: 9px;
    cursor: pointer;
    background: #fff;
}

.fa-auth-hint {
    margin: 7px 0 0;
    color: var(--fa-muted);
    font-size: 12px;
    line-height: 1.6;
}

.fa-auth-check {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 4px 0 18px;
    color: var(--fa-ink-soft);
    font-size: 13px;
    line-height: 1.6;
}

.fa-auth-check input { margin-top: 3px; }

.fa-auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 2px 0 20px;
    font-size: 13px;
    color: var(--fa-muted);
}

.fa-auth-row label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }

.fa-auth-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 46px;
    padding: 0 18px;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(180deg, #1656c8, #11429b);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(22, 86, 200, .24);
    transition: transform .12s ease, box-shadow .12s ease;
}

.fa-auth-submit:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(22, 86, 200, .30); }
.fa-auth-submit:active { transform: translateY(0); }

.fa-auth-alt {
    margin: 18px 0 0;
    color: var(--fa-muted);
    font-size: 13px;
    text-align: center;
}

/* Google 登录：白底是 Google 品牌规范要求，深色皮肤下也不反色 */
.fa-auth-oauth {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 46px;
    padding: 0 18px;
    border: 1px solid #d5dce8;
    border-radius: 10px;
    background: #fff;
    color: #1c2430;
    font-size: 14.5px;
    font-weight: 700;
    text-decoration: none;
    transition: border-color .15s ease, box-shadow .15s ease, transform .12s ease;
}

.fa-auth-oauth:hover {
    border-color: #b6c2d4;
    box-shadow: 0 8px 18px rgba(20, 32, 56, .10);
    transform: translateY(-1px);
}

.fa-auth-oauth:active { transform: translateY(0); }

.fa-auth-oauth-mark {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.fa-auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    color: var(--fa-muted);
    font-size: 12px;
}

.fa-auth-divider::before,
.fa-auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e3e8f0;
}

.fa-auth-alt a { font-weight: 700; }

.fa-auth-flash {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    width: min(980px, 100%);
    margin: 0 auto 18px;
    padding: 13px 16px;
    border: 1px solid #bcd3f5;
    border-radius: 12px;
    background: #f2f7ff;
    color: #16457f;
    font-size: 13px;
}

.fa-auth-flash.is-success { border-color: #b8dfc9; background: #f1fbf5; color: var(--fa-ok); }
.fa-auth-flash.is-warn { border-color: #f0d9a8; background: #fffaef; color: var(--fa-warn); }
.fa-auth-flash.is-error { border-color: #f0c2c2; background: #fff5f5; color: var(--fa-bad); }

.fa-auth-flash button {
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    opacity: .6;
}

.fa-auth-footer {
    padding: 0 0 34px;
    color: var(--fa-muted);
    font-size: 12px;
}

.fa-auth-footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    border-top: 1px solid var(--fa-line);
    padding-top: 18px;
}

.fa-auth-footer a { color: var(--fa-muted); }
.fa-auth-footer a:hover { color: var(--fa-ink); }

.fa-auth-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 9px;
    border-radius: 99px;
    background: #eef4ff;
    color: #16457f;
    font-size: 12px;
    font-weight: 700;
}

.fa-auth-status.is-ok { background: #eaf8f0; color: var(--fa-ok); }

@media (max-width: 860px) {
    .fa-auth-card-wrap { grid-template-columns: 1fr; max-width: 520px; }
    .fa-auth-aside { display: none; }
    .fa-auth-main { padding: 20px 0 40px; }
}

@media (max-width: 560px) {
    .fa-auth-shell { width: calc(100% - 28px); }
    .fa-auth-header { padding-top: 18px; flex-wrap: wrap; gap: 10px; }
    /* 五个入口 + 语言切换在 375px 一定放不进一行：允许折行，但收紧间距，
       否则换行后按钮会像散落的两三块。 */
    .fa-auth-nav { gap: 8px 12px; font-size: 13px; flex-wrap: wrap; }
    .fa-auth-nav .fa-auth-lang-btn { padding: 2px 8px; }
    .fa-auth-form { padding: 30px 22px; }
    .fa-auth-form h1 { font-size: 23px; }
    .fa-auth-grid-2 { grid-template-columns: 1fr; gap: 0; }
    .fa-auth-code-btn { min-width: 96px; font-size: 12px; }
    .fa-auth-captcha img { width: 96px; }
}
