/* =============== AUTH PAGES (light luxury) ===============
 * 共用于:user 登录/注册/找回密码、agent 登录
 * 依赖 theme/*.css 提供的设计令牌 --lx-*（与首页同一套主题）
 */

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: var(--lx-bg);
    color: var(--lx-text);
    -webkit-font-smoothing: antialiased;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    position: relative;
    overflow-x: hidden;
    transition: background 0.4s ease, color 0.4s ease;
}
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(var(--lx-text) 1px, transparent 1px),
        linear-gradient(90deg, var(--lx-text) 1px, transparent 1px);
    background-size: 56px 56px;
    opacity: 0.04;
    mask-image: radial-gradient(ellipse at center, #000 30%, transparent 78%);
    -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 78%);
}
body.auth-page .auth-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.5;
    animation: authOrbFloat 20s ease-in-out infinite;
}
body.auth-page .auth-orb-1 {
    width: 480px; height: 480px;
    top: -120px; left: -140px;
    background: radial-gradient(circle, var(--lx-glow) 0%, transparent 70%);
}
body.auth-page .auth-orb-2 {
    width: 560px; height: 560px;
    bottom: -180px; right: -180px;
    background: radial-gradient(circle, var(--lx-glow) 0%, transparent 70%);
    opacity: 0.4;
    animation-delay: -7s;
}
body.auth-page .auth-orb-3 {
    width: 400px; height: 400px;
    top: 40%; left: 40%;
    background: radial-gradient(circle, var(--lx-glow) 0%, transparent 70%);
    opacity: 0.3;
    animation-delay: -13s;
}
@keyframes authOrbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(28px, -36px) scale(1.06); }
}

/* ---------- 顶部返回首页 ---------- */
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: var(--lx-text-2);
    background: var(--lx-nav-bg);
    border: 1px solid var(--lx-line);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.25s ease;
}
body.auth-page .back-home:hover {
    color: var(--lx-text);
    border-color: var(--lx-accent);
    background: var(--lx-accent-soft);
}
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: var(--lx-surface);
    border: 1px solid var(--lx-line);
    box-shadow: var(--lx-shadow-lg);
    overflow: hidden;
}
body.auth-page .auth-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--lx-accent), 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: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    background: var(--lx-accent-soft);
    color: var(--lx-accent-strong);
    border: 1px solid var(--lx-line-strong);
    position: relative;
}
body.auth-page .auth-title {
    font-family: var(--lx-serif);
    font-size: 25px;
    font-weight: 700;
    color: var(--lx-text);
    margin: 0 0 8px;
    letter-spacing: 0.02em;
}
body.auth-page .auth-sub {
    font-size: 13px;
    color: var(--lx-text-3);
    margin: 0;
    letter-spacing: 0.04em;
}

/* ---------- 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: var(--lx-text-3);
    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: var(--lx-text-3);
    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: var(--lx-accent-strong); }

/* 统一 input:覆盖 layui 默认浅色 */
body.auth-page .auth-input,
body.auth-page .auth-input.layui-input {
    width: 100%;
    height: 48px;
    padding: 0 16px 0 44px;
    color: var(--lx-text);
    font-size: 14px;
    background: var(--lx-surface-2);
    border: 1px solid var(--lx-line-strong);
    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: var(--lx-text-3); }
body.auth-page .auth-input:hover { border-color: var(--lx-accent); }
body.auth-page .auth-input:focus {
    border-color: var(--lx-accent);
    box-shadow: 0 0 0 3px var(--lx-accent-soft);
}
body.auth-page .auth-field:focus-within .field-icon { color: var(--lx-accent-strong); }
/* 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: var(--lx-text);
    -webkit-box-shadow: 0 0 0 1000px var(--lx-surface-2) inset;
    caret-color: var(--lx-text);
}

/* 并排字段:邮箱+验证码 */
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: var(--lx-accent-strong);
    background: var(--lx-accent-soft);
    border: 1px solid var(--lx-line-strong);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}
body.auth-page .btn-send-code:hover:not(:disabled) {
    background: var(--lx-accent-soft-2);
    border-color: var(--lx-accent);
}
body.auth-page .btn-send-code:disabled {
    color: var(--lx-text-3);
    background: var(--lx-surface-2);
    border-color: var(--lx-line);
    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: var(--lx-text-3);
    transition: color 0.2s ease;
}
body.auth-page .auth-helper .link:hover { color: var(--lx-accent-strong); }
body.auth-page .auth-helper .link.accent { color: var(--lx-accent-strong); 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;
    letter-spacing: 0.08em;
    color: var(--lx-on-accent);
    background: linear-gradient(135deg, var(--lx-accent) 0%, var(--lx-accent-strong) 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 -12px var(--lx-accent);
}
body.auth-page .auth-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 16px 34px -12px var(--lx-accent);
}
body.auth-page .auth-submit:active:not(:disabled) { transform: translateY(0); }
body.auth-page .auth-submit:disabled {
    filter: grayscale(0.4) brightness(0.8);
    cursor: not-allowed;
}

/* 底部链接 */
body.auth-page .auth-foot {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--lx-line);
}
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: var(--lx-text-2);
    background: var(--lx-surface-2);
    border: 1px solid var(--lx-line);
    transition: all 0.2s ease;
}
body.auth-page .auth-actions .action:hover {
    color: var(--lx-accent-strong);
    border-color: var(--lx-accent);
    background: var(--lx-accent-soft);
}
body.auth-page .auth-copy {
    text-align: center;
    margin-top: 18px;
    font-size: 12px;
    color: var(--lx-text-3);
    letter-spacing: 0.02em;
}

/* ---------- 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: 22px; }
    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; }
}
