/* =============== AUTH PAGES (dark tech) ===============
 * 共用于:admin/agent/user 登录、用户注册、找回密码
 * 使用:<body class="auth-page theme-{admin|agent|user}">
 */

body.auth-page {
    margin: 0;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: #050816;
    color: #e2e8f0;
    -webkit-font-smoothing: antialiased;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    position: relative;
    overflow-x: hidden;
}
body.auth-page * { box-sizing: border-box; }
body.auth-page a { text-decoration: none; color: inherit; }

/* ---------- 背景层 ---------- */
body.auth-page .auth-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}
body.auth-page .auth-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.06) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse at center, #000 35%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse at center, #000 35%, transparent 80%);
}
body.auth-page .auth-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.55;
    animation: authOrbFloat 18s ease-in-out infinite;
}
body.auth-page .auth-orb-1 {
    width: 480px; height: 480px;
    top: -120px; left: -140px;
    background: radial-gradient(circle, #22d3ee 0%, transparent 70%);
}
body.auth-page .auth-orb-2 {
    width: 560px; height: 560px;
    bottom: -180px; right: -180px;
    background: radial-gradient(circle, #a855f7 0%, transparent 70%);
    animation-delay: -6s;
}
body.auth-page .auth-orb-3 {
    width: 400px; height: 400px;
    top: 40%; left: 40%;
    background: radial-gradient(circle, #3b82f6 0%, transparent 70%);
    animation-delay: -12s;
    opacity: 0.35;
}
@keyframes authOrbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, -40px) scale(1.08); }
}

/* ---------- 顶部返回首页 ---------- */
body.auth-page .back-home {
    position: fixed;
    top: 22px;
    left: 24px;
    z-index: 20;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    color: #cbd5e1;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(148, 163, 184, 0.18);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.25s ease;
}
body.auth-page .back-home:hover {
    color: #f8fafc;
    border-color: rgba(34, 211, 238, 0.5);
    background: rgba(34, 211, 238, 0.08);
}
body.auth-page .back-home i { font-size: 12px; }

/* ---------- 卡片容器 ---------- */
body.auth-page .auth-shell {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 440px;
    animation: authFadeUp 0.5s ease-out;
}
body.auth-page .auth-shell.wide { max-width: 480px; }
@keyframes authFadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
body.auth-page .auth-card {
    position: relative;
    padding: 44px 36px 32px;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.55) 0%, rgba(15, 23, 42, 0.65) 100%);
    border: 1px solid rgba(148, 163, 184, 0.14);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.6);
    overflow: hidden;
}
body.auth-page .auth-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.6), rgba(168, 85, 247, 0.6), transparent);
}

/* ---------- Header ---------- */
body.auth-page .auth-head { text-align: center; margin-bottom: 28px; }
body.auth-page .auth-logo {
    width: 64px;
    height: 64px;
    margin: 0 auto 18px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.2), rgba(168, 85, 247, 0.2));
    color: #22d3ee;
    box-shadow: 0 0 32px -6px rgba(34, 211, 238, 0.5), inset 0 1px 0 rgba(255,255,255,0.1);
    position: relative;
}
body.auth-page .auth-logo::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 19px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.6), rgba(168, 85, 247, 0.6));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
            mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    pointer-events: none;
}
body.auth-page .auth-title {
    font-size: 24px;
    font-weight: 700;
    color: #f8fafc;
    margin: 0 0 6px;
    letter-spacing: -0.01em;
}
body.auth-page .auth-sub {
    font-size: 13px;
    color: #94a3b8;
    margin: 0;
}

/* ---------- Form ---------- */
body.auth-page .auth-field {
    position: relative;
    margin-bottom: 16px;
}
body.auth-page .auth-field .field-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 15px;
    pointer-events: none;
    transition: color 0.2s ease;
    z-index: 2;
}
body.auth-page .auth-field .field-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 15px;
    cursor: pointer;
    background: transparent;
    border: 0;
    padding: 4px;
    z-index: 2;
    transition: color 0.2s ease;
}
body.auth-page .auth-field .field-toggle:hover { color: #22d3ee; }

/* 统一 input:覆盖 layui 默认浅色 */
body.auth-page .auth-input,
body.auth-page .auth-input.layui-input {
    width: 100%;
    height: 48px;
    padding: 0 16px 0 44px;
    color: #f1f5f9;
    font-size: 14px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 12px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    box-shadow: none;
}
body.auth-page .auth-input.has-suffix { padding-right: 44px; }
body.auth-page .auth-input::placeholder { color: #64748b; }
body.auth-page .auth-input:hover { border-color: rgba(148, 163, 184, 0.28); }
body.auth-page .auth-input:focus {
    border-color: rgba(34, 211, 238, 0.6);
    background: rgba(15, 23, 42, 0.85);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
}
body.auth-page .auth-field:focus-within .field-icon { color: #22d3ee; }
/* Chrome 自动填充背景修正 */
body.auth-page .auth-input:-webkit-autofill,
body.auth-page .auth-input:-webkit-autofill:hover,
body.auth-page .auth-input:-webkit-autofill:focus {
    -webkit-text-fill-color: #f1f5f9;
    -webkit-box-shadow: 0 0 0 1000px rgba(15, 23, 42, 0.95) inset;
    caret-color: #f1f5f9;
}

/* 并排字段:邮箱+验证码 */
body.auth-page .auth-field.row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}
body.auth-page .auth-field.row .auth-input {
    flex: 1;
    padding-right: 16px;
}
body.auth-page .auth-field.row .field-icon { left: 16px; }
body.auth-page .btn-send-code {
    flex-shrink: 0;
    height: 48px;
    padding: 0 18px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    color: #22d3ee;
    background: rgba(34, 211, 238, 0.08);
    border: 1px solid rgba(34, 211, 238, 0.28);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}
body.auth-page .btn-send-code:hover:not(:disabled) {
    background: rgba(34, 211, 238, 0.14);
    border-color: rgba(34, 211, 238, 0.5);
}
body.auth-page .btn-send-code:disabled {
    color: #64748b;
    background: rgba(148, 163, 184, 0.06);
    border-color: rgba(148, 163, 184, 0.14);
    cursor: not-allowed;
}

/* 辅助行 */
body.auth-page .auth-helper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: -4px 0 16px;
    font-size: 13px;
}
body.auth-page .auth-helper .link {
    color: #94a3b8;
    transition: color 0.2s ease;
}
body.auth-page .auth-helper .link:hover { color: #22d3ee; }
body.auth-page .auth-helper .link.accent { color: #22d3ee; font-weight: 500; }

/* 主按钮 */
body.auth-page .auth-submit,
body.auth-page .auth-submit.layui-btn {
    width: 100%;
    height: 50px;
    line-height: 50px;
    padding: 0;
    margin: 4px 0 0;
    font-size: 15px;
    font-weight: 600;
    color: #050816;
    background: linear-gradient(135deg, #22d3ee 0%, #a855f7 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
    box-shadow: 0 12px 28px -10px rgba(168, 85, 247, 0.55), inset 0 1px 0 rgba(255,255,255,0.25);
}
body.auth-page .auth-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 16px 32px -10px rgba(168, 85, 247, 0.75), inset 0 1px 0 rgba(255,255,255,0.3);
}
body.auth-page .auth-submit:active:not(:disabled) { transform: translateY(0); }
body.auth-page .auth-submit:disabled {
    filter: grayscale(0.4) brightness(0.7);
    cursor: not-allowed;
}

/* 底部链接 */
body.auth-page .auth-foot {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
}
body.auth-page .auth-actions {
    display: flex;
    gap: 10px;
}
body.auth-page .auth-actions .action {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 40px;
    padding: 0 12px;
    border-radius: 10px;
    font-size: 13px;
    color: #94a3b8;
    background: rgba(148, 163, 184, 0.05);
    border: 1px solid rgba(148, 163, 184, 0.14);
    transition: all 0.2s ease;
}
body.auth-page .auth-actions .action:hover {
    color: #22d3ee;
    border-color: rgba(34, 211, 238, 0.35);
    background: rgba(34, 211, 238, 0.06);
}
body.auth-page .auth-copy {
    text-align: center;
    margin-top: 18px;
    font-size: 12px;
    color: #64748b;
}

/* ---------- 主题变体 ---------- */
/* admin:冷蓝 */
body.auth-page.theme-admin .auth-logo {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(14, 165, 233, 0.2));
    color: #60a5fa;
    box-shadow: 0 0 32px -6px rgba(59, 130, 246, 0.5), inset 0 1px 0 rgba(255,255,255,0.1);
}
body.auth-page.theme-admin .auth-logo::after {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.6), rgba(14, 165, 233, 0.6));
}
body.auth-page.theme-admin .auth-submit {
    background: linear-gradient(135deg, #3b82f6 0%, #0ea5e9 100%);
    color: #f8fafc;
    box-shadow: 0 12px 28px -10px rgba(59, 130, 246, 0.6), inset 0 1px 0 rgba(255,255,255,0.2);
}
body.auth-page.theme-admin .auth-card::before {
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.7), rgba(14, 165, 233, 0.7), transparent);
}

/* agent:青→紫 (默认) — 无需覆盖 */

/* user:紫→粉 */
body.auth-page.theme-user .auth-logo {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.25), rgba(236, 72, 153, 0.2));
    color: #c084fc;
    box-shadow: 0 0 32px -6px rgba(168, 85, 247, 0.5), inset 0 1px 0 rgba(255,255,255,0.1);
}
body.auth-page.theme-user .auth-logo::after {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.6), rgba(236, 72, 153, 0.6));
}
body.auth-page.theme-user .auth-submit {
    background: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
    color: #f8fafc;
    box-shadow: 0 12px 28px -10px rgba(168, 85, 247, 0.6), inset 0 1px 0 rgba(255,255,255,0.2);
}
body.auth-page.theme-user .auth-card::before {
    background: linear-gradient(90deg, transparent, rgba(168, 85, 247, 0.7), rgba(236, 72, 153, 0.7), transparent);
}
body.auth-page.theme-user .auth-field:focus-within .field-icon { color: #c084fc; }
body.auth-page.theme-user .auth-input:focus {
    border-color: rgba(168, 85, 247, 0.55);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.12);
}
body.auth-page.theme-user .auth-helper .link.accent { color: #c084fc; }
body.auth-page.theme-user .back-home:hover {
    color: #f8fafc;
    border-color: rgba(168, 85, 247, 0.45);
    background: rgba(168, 85, 247, 0.08);
}
body.auth-page.theme-user .auth-actions .action:hover {
    color: #c084fc;
    border-color: rgba(168, 85, 247, 0.35);
    background: rgba(168, 85, 247, 0.06);
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
    body.auth-page { padding: 20px 14px; }
    body.auth-page .back-home {
        top: 14px; left: 14px;
        padding: 7px 12px;
        font-size: 12px;
    }
    body.auth-page .auth-card { padding: 34px 22px 26px; }
    body.auth-page .auth-logo { width: 56px; height: 56px; font-size: 24px; }
    body.auth-page .auth-title { font-size: 20px; }
    body.auth-page .auth-input { height: 44px; }
    body.auth-page .btn-send-code { height: 44px; padding: 0 12px; font-size: 12px; }
    body.auth-page .auth-submit { height: 46px; line-height: 46px; }
    body.auth-page .auth-actions { flex-direction: column; }
}
