/* public/css/auth-style.css */

/* --- 1. 基础变量与全局重置 --- */
:root { 
    --primary: #39c5bb; 
    --primary-dark: #2cb5ab; 
    --input-border: rgba(255, 255, 255, 0.15); 
}

/* 页面进入动画 */
@keyframes pageFadeIn {
    0% { opacity: 0; transform: scale(0.98); } 
    100% { opacity: 1; transform: scale(1); }
}

/* 星星呼吸动画：仅改变透明度，确保位置绝对静止 */
@keyframes starBreathing {
    0%, 100% { opacity: 0; } 
    50% { opacity: 1; }
}

/* --- 2. Body 背景层 (保持原有光晕颜色与亮度) --- */
body {
    background-color: #05070a; 
    background-image: 
        /* --- B. 保持不动：核心光晕 (数值与原文件完全一致) --- */
        radial-gradient(circle at 15% 20%, rgba(120, 50, 255, 0.25), transparent 40%),
        radial-gradient(circle at 85% 80%, rgba(57, 197, 187, 0.2), transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(20, 30, 60, 0.6), transparent 70%),
        /* --- C. 对比度优化层 (最底层) --- */
        radial-gradient(circle at 50% 50%, rgba(10, 15, 30, 0.85), transparent 80%);

    height: 100vh; width: 100vw; 
    display: flex; align-items: center; justify-content: center;
    font-family: system-ui, -apple-system, sans-serif; 
    margin: 0; overflow: hidden;
    position: relative;
    opacity: 0;
    animation: pageFadeIn 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

/* --- 3. 动态繁星层 (原地闪烁) --- */

/* 第一组星星：8秒周期 */
body::before {
    content: '';
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 0; /* 位于背景之上，线条之下 */
    background-image: 
        radial-gradient(1px 1px at 5% 10%, #fff, transparent),
        radial-gradient(1px 1px at 25% 15%, #fff, transparent),
        radial-gradient(1px 1px at 45% 15%, #fff, transparent),
        radial-gradient(1px 1px at 65% 10%, #fff, transparent),
        radial-gradient(1px 1px at 85% 15%, #fff, transparent),
        radial-gradient(1px 1px at 10% 65%, #fff, transparent),
        radial-gradient(1px 1px at 35% 75%, #fff, transparent),
        radial-gradient(1px 1px at 60% 80%, #fff, transparent),
        radial-gradient(1px 1px at 85% 88%, #fff, transparent);
    animation: starBreathing 8s ease-in-out infinite;
}

/* 第二组星星：13秒周期 + 延迟，制造“熄灭后在别处出现”的错觉 */
body::after {
    content: '';
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 0;
    background-image: 
        radial-gradient(1px 1px at 15% 25%, #fff, transparent),
        radial-gradient(1px 1px at 35% 45%, #fff, transparent),
        radial-gradient(1px 1px at 55% 25%, #fff, transparent),
        radial-gradient(1px 1px at 75% 30%, #fff, transparent),
        radial-gradient(1px 1px at 95% 40%, #fff, transparent),
        radial-gradient(1px 1px at 22% 85%, #fff, transparent),
        radial-gradient(1px 1px at 48% 92%, #fff, transparent),
        radial-gradient(1px 1px at 72% 60%, #fff, transparent),
        radial-gradient(1px 1px at 92% 70%, #fff, transparent);
    animation: starBreathing 13s ease-in-out infinite 4s;
    opacity: 0;
}

/* 线条火花：层级 Z-INDEX: 1 保持不变 */
#J_dotLine { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }

/* --- 4. 核心卡片 (磨砂玻璃) - 完全保留原有样式 --- */
.auth-card {
    background: rgba(255, 255, 255, 0.15); 
    backdrop-filter: blur(30px); 
    -webkit-backdrop-filter: blur(30px);
    width: 440px; 
    padding: 45px 35px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 30px 60px rgba(0,0,0,0.5), inset 0 0 20px rgba(255,255,255,0.05);
    text-align: center;
    position: relative;
    z-index: 10;
    transition: transform 0.3s, box-shadow 0.3s;
    /* ✅ 新增：开启 GPU 硬件加速，减少卡顿 */
    transform: translateZ(0); 
    will-change: transform, opacity;
}

.auth-card:hover { transform: translateY(-5px); box-shadow: 0 40px 80px rgba(0,0,0,0.6); }

/* --- 5. 标题与文字 --- */
.app-title { font-size: 26px; font-weight: 800; letter-spacing: 2px; color: #fff; margin-bottom: 5px; text-shadow: 0 2px 10px rgba(0,0,0,0.3), 0 1px 3px rgba(0, 0, 0, 0.5); }
.app-subtitle { font-size: 13px; color: var(--primary); font-weight: 700; letter-spacing: 1px; margin-bottom: 35px; text-shadow: 0 0 10px rgba(57, 197, 187, 0.5); }
.text-muted { color: rgba(255, 255, 255, 0.95) !important; font-weight: 600; }

/* --- 6. 表单组件 (Input/Select) --- */
.form-control, .form-select {
    background: rgba(0, 0, 0, 0.2) !important; 
    border: 1px solid var(--input-border) !important;
    border-radius: 12px !important; 
    height: 50px; 
    padding-left: 15px; 
    margin-bottom: 20px; 
    transition: 0.3s;
    color: #fff !important;
    font-size: 14px;
}

.form-control::placeholder { color: rgba(255,255,255,0.65); }

.form-control:focus, .form-select:focus { 
    background: rgba(0, 0, 0, 0.4) !important; 
    border-color: var(--primary) !important; 
    box-shadow: 0 0 0 4px rgba(57, 197, 187, 0.25), 0 0 15px rgba(57, 197, 187, 0.3) !important;
    outline: none;
}

/* --- 7. 按钮 --- */
.btn-primary {
    background: linear-gradient(135deg, #39c5bb, #2cb5ab); 
    border: none; width: 100%; height: 50px; border-radius: 12px; font-weight: 700; letter-spacing: 1px; transition: 0.3s;
    box-shadow: 0 10px 20px rgba(57, 197, 187, 0.3);
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    color: #fff;
}

.btn-primary:hover:not(:disabled) { 
    background: linear-gradient(135deg, #4fd1c5, #38b2ac); 
    transform: translateY(-2px); 
    box-shadow: 0 0 25px rgba(57, 197, 187, 0.6);
}

/* --- 8. 步骤指示器 --- */
.step-indicator { 
    display: flex !important; flex-direction: row !important;
    justify-content: center; align-items: center; gap: 15px; margin-bottom: 35px; 
}

.step-dot { 
    width: 38px; height: 38px; border-radius: 50%; 
    background: rgba(255, 255, 255, 0.25); color: #fff; 
    display: flex !important; align-items: center; justify-content: center; 
    font-weight: 800; font-size: 16px; 
    border: 2px solid rgba(255, 255, 255, 0.4); 
    backdrop-filter: blur(10px); transition: all 0.3s;
}

.step-dot.active { 
    background: var(--primary) !important; 
    border-color: #fff; 
    box-shadow: 0 0 20px rgba(57, 197, 187, 0.8);
    transform: scale(1.1);
}

/* --- 9. 其他辅助组件 (验证码、链接、警告) --- */
.captcha-row { display: flex; gap: 10px; margin-bottom: 20px; }
.captcha-img { height: 50px; border-radius: 12px; cursor: pointer; border: 1px solid rgba(255,255,255,0.2); opacity: 0.9; transition: 0.3s; }
.captcha-img:hover { border-color: var(--primary); transform: scale(1.03); }

.info-box { background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.2); border-radius: 10px; padding: 15px; color: #fff; }

.alert-error { background: rgba(255, 82, 82, 0.1); color: #ff5252; border: 1px solid rgba(255, 82, 82, 0.2); border-radius: 10px; font-size: 13px; padding: 12px; margin-bottom: 25px; }

.back-link a, .auth-links a { 
    color: rgba(255,255,255,0.8); text-decoration: none; transition: 0.3s; 
    position: relative; padding-bottom: 3px; font-weight: 500; font-size: 14px;
}
.back-link a:hover, .auth-links a:hover { color: var(--primary); text-shadow: 0 0 8px var(--primary); }

/* 密码反馈提示栏 */
.pwd-feedback {
    font-size: 13px;
    font-weight: 600;
    margin-top: -10px; /* 拉近与输入框的距离 */
    margin-bottom: 15px;
    padding: 0 5px;
    text-align: left;
    height: 20px;       /* 占位高度防止抖动 */
    opacity: 0;         /* 默认隐藏 */
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

/* 错误状态（亮红） */
.pwd-feedback.error {
    color: #ff6b6b; /* 在深色背景下更清晰的红色 */
    opacity: 1;
    text-shadow: 0 0 10px rgba(255, 107, 107, 0.3);
}

/* 成功状态（亮绿） */
.pwd-feedback.success {
    color: #4cd964; /* iOS风格的亮绿 */
    opacity: 1;
    text-shadow: 0 0 10px rgba(76, 217, 100, 0.3);
}

/* 输入框校验状态边框 */
.form-control.is-invalid {
    border-color: #ff6b6b !important;
    box-shadow: 0 0 0 2px rgba(255, 107, 107, 0.25) !important;
}

.form-control.is-valid {
    border-color: #4cd964 !important;
    box-shadow: 0 0 0 2px rgba(76, 217, 100, 0.25) !important;
}

/* 强制消除浏览器自动填充的背景色和文字颜色 */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
input:-webkit-autofill:active {
    -webkit-transition-delay: 99999s; /* 通过极长的延迟让背景色无法显示 */
    -webkit-transition: background-color 99999s ease-out;
    -webkit-text-fill-color: #fff !important; /* 强制文字为白色 */
    caret-color: #fff; /* 光标颜色 */
}

/* 兼容部分浏览器的另一种写法 */
.form-control:-webkit-autofill {
    box-shadow: 0 0 0px 1000px rgba(0, 0, 0, 0.5) inset !important; /* 用深色内阴影覆盖原本的黄色 */
    -webkit-text-fill-color: #fff !important;
}

/* =========================================
   10. 全局 Toast 适配 (Auth 页面专用补丁)
   继承自 global.css，但强制提升层级以覆盖星空背景
   ========================================= */

/* 强制提升层级，确保在磨砂卡片和 Canvas 之上 */
.alert-success.animate-toast {
    z-index: 2147483647 !important; /* 浏览器允许的最大 z-index 值 */
    top: 30px !important;           /* 距离顶部稍微多一点，避免贴边 */
    position: fixed !important;     /* 确保是固定定位 */
    
    /* 针对登录页深色背景的微调 (可选) */
    box-shadow: 0 0 20px rgba(57, 197, 187, 0.6) !important; /* 增加发光效果，更显眼 */
}

/* 确保显示状态的样式优先级 */
.alert-success.animate-toast.show {
    opacity: 1 !important;
    transform: translate(-50%, 0) !important;
}