/* ==========================================================================
   server_auth 认证页共用样式：登陆 / 注册 / 忘记密码 / 重置密码
   - 只作用于 .auth-* 命名空间，不覆盖主站 base.css 的任何全局选择器
   - 配色沿用主站：顶栏靛蓝 #3f3f7a + 主色蓝 #377ba8，主按钮用渐变
   - 由 view/xxx.html 通过 url_for('auth.static', filename='auth_css/auth.css') 引入
   ========================================================================== */

.auth-page {
    --auth-ink: #2b2f45;
    --auth-ink-soft: #6b7189;
    --auth-muted: #9aa0b4;
    --auth-line: #e3e6f0;
    --auth-brand: #3f3f7a;
    --auth-accent: #377ba8;
    --auth-accent-2: #4a5bb5;
    --auth-field: #fbfbfe;
    --auth-radius: 12px;

    display: flex;
    justify-content: center;
    padding: 2.5rem 1rem 3.5rem;
    border-radius: 18px;
}

/* ------------------------------------------------------------------ 卡片 */

.auth-card {
    box-sizing: border-box;
    width: 100%;
    max-width: 430px;
    padding: 2.1rem 2rem 1.7rem;
    background: #fff;
    border: 1px solid var(--auth-line);
    border-radius: 18px;
    box-shadow: 0 18px 40px -20px rgba(43, 47, 69, .25), 0 2px 8px rgba(43, 47, 69, .05);
}

.auth-head {
    margin-bottom: 1.5rem;
}

.auth-head .auth-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: .55rem;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--auth-accent);
}

.auth-head .auth-eyebrow::before {
    content: "";
    display: inline-block;
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--auth-brand), var(--auth-accent));
}

.auth-head h2 {
    margin: 0 0 .35rem;
    font-size: 1.42rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--auth-ink);
}

.auth-head p {
    margin: 0;
    font-size: .86rem;
    line-height: 1.65;
    color: var(--auth-ink-soft);
}

/* ------------------------------------------------------------------ 表单 */

.auth-card form {
    margin: 0;
}

.auth-card .field {
    margin-bottom: 1rem;
}

.auth-card .field > label {
    display: block;
    margin: 0 0 .4rem;
    font-size: .84rem;
    font-weight: 600;
    letter-spacing: .01em;
    color: var(--auth-ink);
}

.auth-card .field input {
    box-sizing: border-box;
    width: 100%;
    height: 44px;
    margin: 0;
    padding: 0 .85rem;
    font-family: inherit;
    font-size: .95rem;
    color: var(--auth-ink);
    background: var(--auth-field);
    border: 1px solid var(--auth-line);
    border-radius: var(--auth-radius);
    transition: border-color .18s, box-shadow .18s, background .18s;
}

.auth-card .field input::placeholder {
    color: var(--auth-muted);
}

.auth-card .field input:focus {
    outline: none;
    background: #fff;
    border-color: #8a93d8;
    box-shadow: 0 0 0 4px rgba(74, 91, 181, .12);
}

.auth-card .field-hint {
    margin: .4rem 0 0;
    font-size: .76rem;
    line-height: 1.6;
    color: var(--auth-muted);
}

.auth-card .field-error {
    margin-left: .4rem;
    font-size: .78rem;
    font-weight: 600;
    color: #cc2f2e;
}

/* 图形验证码：输入框 + 图片 + 显式的「换一张」 */

.auth-card .captcha-row,
.auth-card .code-row {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
}

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

.auth-card .captcha-row input {
    letter-spacing: .22em;
    font-weight: 600;
}

.auth-card .code-row input {
    letter-spacing: .12em;
}

.auth-card .captcha-side {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: center;
    gap: .3rem;
}

.auth-card .captcha-side img {
    display: block;
    width: 120px;
    height: 44px;
    background: #fff;
    border: 1px solid var(--auth-line);
    border-radius: var(--auth-radius);
    cursor: pointer;
    transition: border-color .18s, box-shadow .18s;
}

.auth-card .captcha-side img:hover {
    border-color: #8a93d8;
    box-shadow: 0 0 0 3px rgba(74, 91, 181, .10);
}

.auth-card .captcha-refresh {
    padding: 0;
    font-size: .74rem;
    font-weight: 600;
    color: var(--auth-accent);
    background: transparent;
    border: 0;
    cursor: pointer;
}

.auth-card .captcha-refresh:hover {
    text-decoration: underline;
}

/* 次级按钮（获取验证码） */

.auth-card .btn-ghost {
    flex: 0 0 auto;
    height: 44px;
    padding: 0 1rem;
    font-family: inherit;
    font-size: .88rem;
    font-weight: 600;
    color: var(--auth-accent-2);
    white-space: nowrap;
    background: #fff;
    border: 1px solid #c3cbea;
    border-radius: var(--auth-radius);
    cursor: pointer;
    transition: background .18s, border-color .18s, box-shadow .18s;
}

.auth-card .btn-ghost:hover:not(:disabled) {
    background: #f3f5ff;
    border-color: #8a93d8;
    box-shadow: 0 6px 14px -8px rgba(74, 91, 181, .8);
}

.auth-card .btn-ghost:disabled {
    color: #aab0c4;
    background: #f7f8fc;
    border-color: var(--auth-line);
    cursor: not-allowed;
}

/* 主按钮：渐变 + 悬浮微升 */

.auth-card .btn-submit {
    width: 100%;
    height: 46px;
    margin-top: .35rem;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: .1em;
    color: #fff;
    background: linear-gradient(135deg, var(--auth-accent-2) 0%, var(--auth-accent) 100%);
    border: 0;
    border-radius: var(--auth-radius);
    box-shadow: 0 12px 24px -12px rgba(63, 63, 122, .65);
    cursor: pointer;
    transition: transform .15s ease, filter .2s ease, box-shadow .2s ease;
}

.auth-card .btn-submit:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
    box-shadow: 0 16px 28px -12px rgba(63, 63, 122, .7);
}

.auth-card .btn-submit:active {
    transform: translateY(0);
    filter: brightness(.97);
}

/* 主按钮的链接形态（例如「重新申请重置链接」） */

.auth-card a.btn-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    text-decoration: none;
}

/* ------------------------------------------------------- 底部链接 / 说明 */

.auth-alt {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .4rem .9rem;
    margin-top: 1.2rem;
    padding-top: 1rem;
    font-size: .85rem;
    color: var(--auth-ink-soft);
    border-top: 1px dashed var(--auth-line);
}

.auth-alt a {
    font-weight: 600;
    color: var(--auth-accent);
    text-decoration: none;
}

.auth-alt a:hover {
    text-decoration: underline;
}

.auth-note {
    margin: 1rem 0 0;
    font-size: .78rem;
    line-height: 1.8;
    color: var(--auth-muted);
}

.auth-note b {
    font-weight: 600;
    color: var(--auth-ink-soft);
}

/* 提示条（链接过期/无效/已被使用） */

.auth-alert {
    margin-bottom: 1.2rem;
    padding: .8rem 1rem;
    font-size: .87rem;
    line-height: 1.7;
    color: #9c5346;
    background: #fff7f5;
    border: 1px solid #f2d9d2;
    border-left: 4px solid #d98b7a;
    border-radius: 12px;
}

/* --------------------------------------------------------------- 小屏幕 */

@media (max-width: 520px) {
    .auth-page {
        padding: 1.2rem .5rem 2rem;
        border-radius: 12px;
    }

    .auth-card {
        padding: 1.5rem 1.15rem 1.2rem;
        border-radius: 16px;
    }

    .auth-head h2 {
        font-size: 1.24rem;
    }

    .auth-card .captcha-side img {
        width: 104px;
    }
}
