/* ==========================================================================
   登录页 / 注册页 · 表单卡片样式
   --------------------------------------------------------------------------
   本文件只负责「中间那张卡片」。
   页面外框（顶部蓝色横幅 .site-banner、左侧导航 .sidebar、主内容避让 .main-content）
   全部复用站点统一组件：
       includes/header-top.php  +  includes/sidebar.php  +  assets/css/nav.css
   所以这里【不要】再写 .sidebar / .nav-item / .top-banner / .main-content 的样式，
   否则又会和统一导航打架（2026-10-22 之前这两个页面就是各写一套旧的彩色按钮侧栏，
   全站都改版了新导航，只有登录/注册还是彩虹渐变方块）。
   ========================================================================== */

/* 卡片居中容器
   .main-content 已由 nav.css 让出「左侧栏宽度 + 55px 顶部横幅」，
   这里只负责把卡片在剩余区域里水平+垂直居中。
   用 min-height 而不是 height：注册表单比登录长，内容超出时可以正常滚动。 */
.auth-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 55px - 1rem);
    padding: 1.5rem 0.75rem 2rem;
    box-sizing: border-box;
}

/* --- 卡片本体 --- */
.auth-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 450px;
    overflow: hidden;
}

/* 卡头：登录/注册共用天蓝主色（与全站 #486df1 一致） */
.auth-card-header {
    background: linear-gradient(135deg, #486df1 0%, #3355d8 100%);
    color: #fff;
    padding: 1.5rem;
    text-align: center;
}

.auth-card-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.4;
}

.auth-card-body {
    padding: 2rem;
}

/* --- 表单元素 --- */
.auth-card .form-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.auth-card .form-control {
    border-radius: 8px;
    border: 1px solid #dee2e6;
    padding: 0.75rem 1rem;
    font-size: 1rem;
}

.auth-card .form-control:focus {
    border-color: #486df1;
    box-shadow: 0 0 0 0.2rem rgba(72, 109, 241, 0.2);
}

.auth-card .form-text {
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

.auth-card .remember-me {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem 0;
    color: #666;
    font-size: 0.9rem;
}

/* 手机端 mobile-compact.css 给「所有 input」加了 min-height/min-width:44px 的触摸区，
   复选框会被撑成一个 44×44 的大方块（截图里那个巨型方框），这里显式还原。 */
.auth-card .remember-me input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-width: 0;
    min-height: 0;
    margin: 0;
    flex: 0 0 auto;
    accent-color: #486df1;
    cursor: pointer;
}

.auth-card .remember-me label {
    margin: 0;
    cursor: pointer;
}

/* --- 提交按钮 --- */
.auth-card .btn-auth {
    width: 100%;
    border: none;
    color: #fff;
    padding: 0.875rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1.05rem;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #486df1 0%, #3355d8 100%);
    box-shadow: 0 4px 12px rgba(72, 109, 241, 0.3);
}

.auth-card .btn-auth:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(72, 109, 241, 0.4);
}

/* 注册按钮沿用绿色语义（提交=绿色，与全站「成功/确认」配色一致） */
.auth-card .btn-auth.is-register {
    background: linear-gradient(135deg, #198754 0%, #146c43 100%);
    box-shadow: 0 4px 12px rgba(25, 135, 84, 0.3);
}

.auth-card .btn-auth.is-register:hover {
    box-shadow: 0 6px 16px rgba(25, 135, 84, 0.4);
}

/* --- 卡片底部链接区 --- */
.auth-card-footer {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #dee2e6;
    text-align: center;
}

.auth-card-footer p {
    margin-bottom: 0.5rem;
    color: #666;
}

.auth-card-footer a {
    color: #486df1;
    text-decoration: none;
    font-weight: 600;
}

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

/* --- 提示条 --- */
.auth-alert {
    padding: 0.875rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

.auth-alert.is-error {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

.auth-alert.is-success {
    background: #dcfce7;
    border: 1px solid #bbf7d0;
    color: #16a34a;
}

/* 注册关闭提示卡 */
.auth-card-body.is-center {
    text-align: center;
    padding: 3rem 2rem;
}

.auth-card-body.is-center .auth-closed-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 1rem;
}

.auth-card-body.is-center .auth-closed-message {
    font-size: 1.05rem;
    color: #666;
    margin-bottom: 2rem;
    line-height: 1.7;
}

/* --- 小屏 --- */
@media (max-width: 768px) {
    .auth-wrap {
        /* 手机端：顶部横幅 55px + 底部固定导航 55px（style.css 给 body 加了同样的 padding-bottom），
           两者都要扣掉，否则卡片会顶到/藏到固定栏底下 */
        min-height: calc(100vh - 55px - 55px - 1rem);
        padding: 1rem 0.5rem 1.5rem;
        align-items: flex-start;
    }

    .auth-card-header {
        padding: 1.1rem 1rem;
    }

    .auth-card-header h2 {
        font-size: 1.2rem;
    }

    .auth-card-body {
        padding: 1.25rem 1rem;
    }

    .auth-card .btn-auth {
        font-size: 1rem;
        padding: 0.75rem;
    }
}
