/* ============================================================
   auth.css —— 登录 / 注册 独立页共享样式
   ------------------------------------------------------------
   面向 /static/css/app.css 之外的独立认证页（login / register），
   提供统一、现代、清晰的视觉：桌面与移动端自适应。
   两页共用同一套卡片 / 背景 / 语言切换 / 表单 / 按钮样式，
   保证风格统一。
   ============================================================ */

/* ---- 认证页主体：渐变背景，垂直水平居中 ---- */
.auth-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 24px 16px;
    background: linear-gradient(135deg, #183a5e 0%, #2f6feb 55%, #3f9fbf 100%);
    font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    color: #1f2a3d;
}

/* 内容包装：卡片 + 版权作为一个整体垂直居中；
   当高度不足以容纳时 margin:auto 自动归零，页面自然滚动而不裁切 */
.auth-wrap {
    width: 100%;
    max-width: 380px;
    margin: auto 0;
}

/* 顶部语言切换（右上角） */
.auth-lang {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 20;
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, .16);
    padding: 4px;
    border-radius: 999px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, .22);
}
.auth-lang a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    transition: background .15s, color .15s;
}
.auth-lang a:hover { background: rgba(255, 255, 255, .2); color: #fff; }
.auth-lang a.active {
    background: #fff;
    color: #2f6feb;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .12);
}

/* ---- 认证卡片 ---- */
.auth-card {
    width: 100%;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(8, 24, 51, .28);
    overflow: hidden;
    animation: authFadeUp .5s ease both;
}
@keyframes authFadeUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}
.auth-card-inner { padding: 15px 32px 15px; }

/* 站点 Logo */
.auth-logo {
    display: block;
    text-align: center;
}
.auth-logo img {
    max-width: 200px;
    max-height: 56px;
    object-fit: contain;
}

/* 标题区 */
.auth-head { text-align: center; margin-bottom: 26px; }
.auth-head h1 {
    font-size: 24px;
    font-weight: 700;
    color: #1f2a3d;
    margin: 0 0 6px;
    letter-spacing: .2px;
}
.auth-head p {
    margin: 0;
    font-size: 14px;
    color: #7a8798;
}

/* 提示 / 错误 */
.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13.5px;
    line-height: 1.5;
    margin-bottom: 18px;
}
.auth-alert i { line-height: 1.4; }
.auth-alert-warning { background: #fff7e6; color: #9a6b00; border: 1px solid #ffe1a6; }
.auth-alert-error   { background: #fdecec; color: #c0392b; border: 1px solid #f5c6c6; }
.auth-alert-success { background: #eaf7f0; color: #0c8f5b; border: 1px solid #bfe6d1; }

/* ---- 表单字段 ---- */
.auth-form .field { margin-bottom: 18px; }
.auth-form .field:last-of-type { margin-bottom: 24px; }

.auth-label {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    color: #3c4656;
    margin-bottom: 6px;
}
.auth-input-group { position: relative; }
.auth-input-group .auth-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #9aa5b5;
    font-size: 16px;
    pointer-events: none;
}
.auth-input {
    width: 100%;
    height: 36px;
    padding: 0 44px 0 42px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14.5px;
    color: #1f2a3d;
    background: #fbfcfe;
    outline: none;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.auth-input::placeholder { color: #aab4c3; }
.auth-input:hover { border-color: #cfd8e4; }
.auth-input:focus {
    border-color: #2f6feb;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(47, 111, 235, .14);
}

/* 密码可见切换按钮 */
.auth-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border: 0;
    background: transparent;
    color: #9aa5b5;
    font-size: 17px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color .15s, background .15s;
}
.auth-toggle:hover { color: #2f6feb; background: #eef3ff; }

/* ---- 主按钮 ---- */
.auth-submit {
    width: 100%;
    height: 48px;
    border: 0;
    border-radius: 10px;
    font-size: 15.5px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(135deg, #2f6feb 0%, #4b8ff0 100%);
    box-shadow: 0 8px 18px rgba(47, 111, 235, .28);
    transition: transform .12s, box-shadow .12s, filter .12s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.auth-submit:hover { filter: brightness(1.04); transform: translateY(-1px); box-shadow: 0 10px 22px rgba(47, 111, 235, .32); }
.auth-submit:active { transform: translateY(0); box-shadow: 0 4px 10px rgba(47, 111, 235, .24); }
.auth-submit:disabled { opacity: .6; cursor: not-allowed; transform: none; }

/* ---- 卡片底部链接 ---- */
.auth-foot {
    margin-top: 22px;
    text-align: center;
    font-size: 13.5px;
    color: #7a8798;
}
.auth-foot a {
    color: #2f6feb;
    font-weight: 600;
    text-decoration: none;
    margin-left: 2px;
}
.auth-foot a:hover { text-decoration: underline; }

/* 页面底部版权 */
.auth-copyright {
    margin-top: 22px;
    text-align: center;
    font-size: 12px;
    color: rgba(255, 255, 255, .75);
}

/* ---- 移动端适配 ---- */
@media (max-width: 480px) {
    .auth-body { padding: 20px 14px; }
    .auth-card-inner { padding: 30px 22px 24px; }
    .auth-lang { top: 12px; right: 12px; }
    .auth-head h1 { font-size: 21px; }
}
