/* Enhanced Auth Styles - Premium & Dynamic */

/* ============================================
   Dynamic Background System
   ============================================ */
body {
    background-color: var(--auth-bg);
    /* 基础网格背景 - 更加细腻 */
    background-image: 
        linear-gradient(rgba(129, 140, 248, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(129, 140, 248, 0.03) 1px, transparent 1px);
    background-size: 30px 30px;
    background-position: center center;
    background-attachment: fixed;
    position: relative;
    overflow: hidden; /* 防止动画溢出 */
}

/* 动态光斑层 - 极光效果 */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 50% 50%, rgba(79, 70, 229, 0.15), transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(6, 182, 212, 0.15), transparent 40%),
        radial-gradient(circle at 20% 80%, rgba(236, 72, 153, 0.15), transparent 40%);
    z-index: -2;
    animation: auroraMove 20s ease-in-out infinite alternate;
    filter: blur(60px);
    opacity: 1;
}

/* 浮动粒子层 - 更加梦幻 */
body::after {
    content: '';
    position: fixed;
    top: -10%;
    left: -10%;
    width: 120%;
    height: 120%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, rgba(255, 255, 255, 0.5), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255, 255, 255, 0.5), transparent),
        radial-gradient(2px 2px at 50px 160px, rgba(255, 255, 255, 0.5), transparent),
        radial-gradient(2px 2px at 90px 40px, rgba(255, 255, 255, 0.5), transparent),
        radial-gradient(2px 2px at 130px 80px, rgba(255, 255, 255, 0.5), transparent),
        radial-gradient(2px 2px at 160px 120px, rgba(255, 255, 255, 0.5), transparent);
    background-size: 200px 200px;
    z-index: -1;
    opacity: 0.4;
    animation: particleFloat 40s linear infinite;
    pointer-events: none;
    /* 视差效果 */
    transform: translate(calc((var(--mouse-x, 0.5) - 0.5) * -40px), calc((var(--mouse-y, 0.5) - 0.5) * -40px));
    transition: transform 0.2s ease-out;
}

/* 额外的光晕层 - 增加层次感 */
.auth-glow {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 50%, transparent 20%, var(--auth-bg) 80%);
    z-index: -1;
    pointer-events: none;
    opacity: 0.6;
    /* JS 控制 transform */
    transition: transform 0.1s ease-out;
}

@keyframes auroraMove {
    0% {
        transform: rotate(0deg) translate(0, 0) scale(1);
    }
    33% {
        transform: rotate(5deg) translate(2%, 2%) scale(1.1);
    }
    66% {
        transform: rotate(-5deg) translate(-2%, 1%) scale(0.9);
    }
    100% {
        transform: rotate(0deg) translate(0, 0) scale(1);
    }
}

@keyframes particleFloat {
    0% { background-position: 0 0; }
    100% { background-position: 100px -200px; } /* 向上浮动 */
}

/* ============================================
   Premium Glassmorphism Card
   ============================================ */
.auth-modal {
    /* 增强的玻璃拟态 */
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    
    /* 精细边框 */
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-top: 1px solid rgba(255, 255, 255, 0.8);
    border-left: 1px solid rgba(255, 255, 255, 0.8);
    
    /* 多重阴影营造深度 */
    box-shadow: 
        0 4px 24px -1px rgba(0, 0, 0, 0.05),
        0 20px 40px -4px rgba(0, 0, 0, 0.1),
        inset 0 0 0 1px rgba(255, 255, 255, 0.2);
        
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* 暗色模式适配 */
[data-theme="dark"] .auth-modal {
    background: rgba(15, 23, 42, 0.6);
    border-color: rgba(255, 255, 255, 0.1);
    border-top-color: rgba(255, 255, 255, 0.15);
    border-left-color: rgba(255, 255, 255, 0.15);
    box-shadow: 
        0 4px 24px -1px rgba(0, 0, 0, 0.2),
        0 20px 40px -4px rgba(0, 0, 0, 0.4),
        inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

/* 悬停时的微动效 */
.auth-modal:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 32px -1px rgba(0, 0, 0, 0.08),
        0 24px 48px -4px rgba(0, 0, 0, 0.12),
        inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

/* ============================================
   Input Fields Interaction
   ============================================ */
.form-input {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.5);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
}

[data-theme="dark"] .form-input {
    background: rgba(0, 0, 0, 0.2);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

.form-input:hover {
    background: rgba(255, 255, 255, 0.8);
}

[data-theme="dark"] .form-input:hover {
    background: rgba(0, 0, 0, 0.3);
}

.form-input:focus {
    background: #fff;
    border-color: var(--auth-gradient-1);
    box-shadow: 
        0 0 0 4px rgba(99, 102, 241, 0.15),
        0 1px 2px rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
}

[data-theme="dark"] .form-input:focus {
    background: rgba(30, 41, 59, 0.8);
}

/* ============================================
   Button Glow Effect
   ============================================ */
.submit-button {
    background-size: 200% auto;
    background-image: linear-gradient(135deg, #4f46e5 0%, #06b6d4 50%, #4f46e5 100%);
    transition: all 0.5s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.submit-button:hover {
    background-position: right center;
    transform: translateY(-2px) scale(1.01);
    box-shadow: 
        0 10px 20px -5px rgba(79, 70, 229, 0.4),
        0 0 15px rgba(6, 182, 212, 0.3);
}

.submit-button:active {
    transform: translateY(0) scale(0.98);
}

/* ============================================
   Logo Animation
   ============================================ */
.auth-logo .icon {
    filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.3));
    animation: logoFloat 4s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-6px) rotate(2deg); }
}

/* ============================================
   Typography Enhancements
   ============================================ */
.auth-title {
    background: linear-gradient(135deg, var(--auth-text) 30%, var(--auth-gradient-1) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
    display: inline-block;
}

/* 标题下划线装饰 */
.auth-title::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, var(--auth-gradient-1), var(--auth-gradient-2));
    border-radius: 2px;
    opacity: 0.8;
}
