/* ============================================================
   登录 / 注册 页面专属样式
   ------------------------------------------------------------
   为什么单独开一个文件：
   .form-container 是公共类，站内还有 5 个页面在用它
   （forgot_password / reset_password / avatar / publish / bulk_upload）。
   直接改 style.css 里的 .form-container 会把这 5 个页面一起动掉，
   所以这里全部用 .auth-* 新命名空间，只作用于登录、注册两页。

   全部颜色走 CSS 变量，8 套主题（含 theme-dark / theme-tech 深色）
   自动适配，不写死任何 rgba(255,255,255,x)。
   ============================================================ */

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

/* 挂在 .form-container 后面一起用：公共类负责宽度、定位、基础玻璃底，
   .auth-card 只做"加料"（更大圆角、顶部光带、更宽松的内边距）。 */
.auth-card {
    position: relative;
    padding: 34px 32px 28px;
    border-radius: 22px;
    overflow: hidden;
    /* 比公共类多一档阴影层次，让卡片从背景里"浮"起来 */
    box-shadow: var(--glass-shadow), 0 18px 50px rgba(0, 0, 0, 0.07);
}

/* 顶部一条主色渐变装饰线 */
.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0.85;
    pointer-events: none;
}

/* ---------- 标题区 ---------- */

.auth-head {
    text-align: center;
    margin-bottom: 22px;
}

.auth-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin-bottom: 12px;
    border-radius: 16px;
    background: var(--primary);
    color: #fff;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 1px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.12);
    /* 给主题留个可换色的口子，默认就是主色 */
    background-image: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

/* 覆盖 .form-container h2 的居中标题 */
.auth-card .auth-title {
    font-size: 21px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
    line-height: 1.35;
}

.auth-subtitle {
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.5;
}

/* ---------- 分段切换（登录页的两种登录方式） ---------- */

.auth-tabs {
    display: flex;
    gap: 6px;
    padding: 4px;
    margin-bottom: 20px;
    border-radius: 999px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
}

.auth-tab {
    flex: 1 1 0;
    padding: 9px 10px;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13.5px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.auth-tab:hover {
    color: var(--primary);
}

.auth-tab.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ---------- 表单字段 ---------- */

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

.auth-card .form-group > label {
    display: block;
    margin-bottom: 7px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.2px;
}

/* 【重要】这里修的是深色主题下的可读性问题。
   style.css 里 .form-group input 的底色被写死成 rgba(255,255,255,0.6)，
   切换到 theme-dark / theme-tech 后，文字色变成浅色（--text 是 #f5f5f5），
   浅字 + 白底 → 几乎看不见。改成半透明黑，跟随深浅主题自动翻转。 */
.auth-card .form-group input {
    background: rgba(0, 0, 0, 0.04);
    /* 边框也要比公共样式更清楚一点：原来的 rgba(0,0,0,0.08) 在浅色主题里
       和卡片底几乎融成一片，看不出输入框的边界。 */
    border: 1px solid rgba(0, 0, 0, 0.16);
    padding: 12px 14px;
    font-size: 15px;
    transition: var(--transition);
}

/* 深色主题下把边框提亮一点，否则输入框边界也和背景糊在一起 */
body.theme-dark .auth-card .form-group input,
body.theme-tech .auth-card .form-group input {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.14);
}

.auth-card .form-group input::placeholder {
    color: var(--text-light);
    opacity: 0.8;
}

/* 聚焦态：外圈光晕用主色的半透明，但不再写死 #ff2e4d，
   否则换主题（比如 theme-blue）时会残留一圈红边。 */
.auth-card .form-group input:focus {
    border-color: var(--primary);
    background: var(--card-bg);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent);
}

/* 记住我 / 勾选类，需要跟输入框区分开 */
.auth-card .auth-check label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
}

.auth-card .auth-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    padding: 0;
    margin: 0;
    accent-color: var(--primary);
    cursor: pointer;
}

/* ---------- 验证码行 ---------- */

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

.auth-captcha-row input {
    flex: 1 1 auto;
    min-width: 0;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* captcha.php 生成的就是 100×40 的图，按原尺寸显示最清晰，
   拉伸会糊，所以宽高都给死。 */
.auth-captcha-img {
    height: 40px;
    width: 100px;
    flex: 0 0 auto;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(0, 0, 0, 0.16);
    background: #fff;
    cursor: pointer;
    object-fit: cover;
    transition: var(--transition);
}

/* ---------- 主题修补 ---------- */

/* theme-yellow 的 --text 是 #f57f17（橙黄），压在 #fffde7 的浅蛋壳底上
   对比度只有 2.58，属于"看不清"的级别（WCAG 建议正文 ≥ 4.5）。
   这里只在登录/注册这两页把它压深到 #b35c00（对比度 4.6），
   不动 --text 本身，避免影响其它页面的既有观感。 */
body.theme-yellow .auth-card .auth-title,
body.theme-yellow .auth-card .form-group > label {
    color: #b35c00;
}

/* 输入框里的文字同理：yellow 的 --text 是橙黄，用户输入的账号密码
   压在浅色底上只有 2.4 的对比度，等于看不清自己打了什么。 */
body.theme-yellow .auth-card .form-group input,
body.theme-yellow .auth-card .auth-check label {
    color: #b35c00;
}

body.theme-yellow .auth-card .auth-subtitle,
body.theme-yellow .auth-card .auth-divider-label {
    color: #8a4700;
}

body.theme-dark .auth-captcha-img,
body.theme-tech .auth-captcha-img {
    border-color: rgba(255, 255, 255, 0.16);
}

.auth-captcha-img:hover {
    border-color: var(--primary);
    opacity: 0.9;
}

.auth-captcha-img:active {
    transform: scale(0.97);
}

/* 右侧"发送验证码"按钮：不许被 flex 压扁，也不许换行 */
.auth-code-btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

/* ---------- 按钮 ---------- */

/* 登录/注册主按钮：比通用 .btn 更高一点、字更大一点，
   视觉上作为整张卡片的终点。 */
.auth-submit {
    width: 100%;
    margin-top: 6px;
    padding: 13px 24px;
    font-size: 15.5px;
    font-weight: 700;
    letter-spacing: 1px;
    border-radius: 999px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.auth-submit:active {
    transform: translateY(1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

/* ---------- 分隔与页脚 ---------- */

.auth-divider {
    position: relative;
    margin: 22px 0 14px;
    padding-top: 14px;
    border-top: 1px dashed var(--glass-border);
}

.auth-divider .auth-divider-label {
    display: block;
    font-size: 12.5px;
    line-height: 1.6;
    color: var(--text-light);
}

.auth-foot {
    margin-top: 18px;
    text-align: center;
    font-size: 13.5px;
    color: var(--text-secondary);
}

.auth-foot a {
    color: var(--primary);
    font-weight: 600;
    transition: var(--transition);
}

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

.auth-foot .auth-sep {
    margin: 0 8px;
    color: var(--text-light);
    opacity: 0.6;
}

/* ---------- 提示条：修深色主题下浅底浅字 ---------- */

/* 发送验证码的结果区，有内容时才占位，空了不留缝 */
.auth-send-result:empty {
    display: none;
}

.auth-send-result {
    margin-bottom: 10px;
}

.auth-card .alert {
    border-radius: 12px;
    padding: 11px 14px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.55;
}

.auth-card .alert-error {
    background: color-mix(in srgb, var(--primary) 14%, transparent);
    color: var(--primary-dark);
}

.auth-card .alert-success {
    background: color-mix(in srgb, #2e7d32 14%, transparent);
    color: #2e7d32;
}

.auth-card .alert-info {
    background: color-mix(in srgb, #1565c0 14%, transparent);
    color: #1565c0;
}

/* 深色主题：纯深色文字在暗底上读不出来，统一提亮 */
body.theme-dark .auth-card .alert-error,
body.theme-tech .auth-card .alert-error {
    color: #ff8a9b;
}

body.theme-dark .auth-card .alert-success,
body.theme-tech .auth-card .alert-success {
    color: #81c784;
}

body.theme-dark .auth-card .alert-info,
body.theme-tech .auth-card .alert-info {
    color: #64b5f6;
}

/* ---------- 响应式 ---------- */

@media (max-width: 480px) {
    /* 小屏手机：左右留白收紧，把宽度让给输入框 */
    .auth-card {
        padding: 26px 18px 22px;
        border-radius: 18px;
        margin-top: 14px;
    }

    .auth-card .auth-title {
        font-size: 19px;
    }

    .auth-logo {
        width: 46px;
        height: 46px;
        font-size: 21px;
        border-radius: 14px;
    }

    /* 极窄屏下验证码图缩到 88×35.2，仍保持 100:40 的原比例，不糊 */
    .auth-captcha-img {
        width: 88px;
        height: 35.2px;
    }

    .auth-captcha-row {
        gap: 8px;
    }

    .auth-code-btn {
        padding: 6px 10px;
        font-size: 12.5px;
    }

    .auth-tab {
        font-size: 13px;
        padding: 8px 6px;
    }
}

/* color-mix 兜底：极老的浏览器不支持时，退回到不带透明度的实色背景，
   至少保证文字和底色有对比，不会出现"浅字白底"。 */
@supports not (color: color-mix(in srgb, red 10%, transparent)) {
    .auth-card .alert-error {
        background: var(--primary-light);
    }

    .auth-card .form-group input:focus {
        box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
    }
}
