/* ========================================
   AI 问卷助手 - 登录/注册页面样式
   专业级深色主题
   ======================================== */

:root {
    --bg-dark: #0A0A0A;
    --bg-dark-secondary: #111827;
    --bg-dark-tertiary: #1F2937;
    --text-primary: #FFFFFF;
    --text-secondary: #E5E7EB;
    --text-muted: #9CA3AF;
    --brand-primary: #6366F1;
    --brand-primary-light: #818CF8;
    --brand-primary-dark: #4F46E5;
    --brand-gradient: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
    --success-gradient: linear-gradient(135deg, #10B981 0%, #059669 100%);
    --border-color: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', 'SF Pro Display', 'Microsoft YaHei', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ========================================
   登录/注册容器
   ======================================== */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    overflow: hidden;
    background: var(--bg-dark);
}

/* 动态网格背景 */
.auth-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(99, 102, 241, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.1) 1px, transparent 1px);
    background-size: 60px 60px;
    opacity: 0.3;
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(60px, 60px); }
}

/* 渐变光晕效果 */
.auth-container::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    animation: rotate 30s linear infinite;
    pointer-events: none;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.auth-card {
    width: 100%;
    max-width: 460px;
    background: rgba(31, 41, 55, 0.8);
    border-radius: 24px;
    padding: 48px 40px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: 24px 24px 0 0;
}

.auth-header {
    text-align: center;
    margin-bottom: 36px;
}

.auth-logo {
    width: 70px;
    height: 70px;
    background: var(--brand-gradient);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 20px;
    color: white;
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.4);
    position: relative;
    overflow: hidden;
}

.auth-logo::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
    animation: rotate 10s linear infinite;
}

.auth-title {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #FFFFFF 0%, #E5E7EB 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ========================================
   标签切换
   ======================================== */
.auth-tabs {
    display: flex;
    gap: 4px;
    background: rgba(31, 41, 55, 0.6);
    border-radius: 12px;
    padding: 6px;
    margin-bottom: 32px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.auth-tab {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.auth-tab.active {
    background: var(--brand-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.auth-tab:hover:not(.active) {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

/* ========================================
   表单
   ======================================== */
.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(31, 41, 55, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input:focus {
    outline: none;
    border-color: var(--brand-primary);
    background: rgba(31, 41, 55, 0.8);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-error {
    color: #EF4444;
    font-size: 0.85rem;
    margin-top: 8px;
    margin-bottom: 20px;
    padding: 10px 12px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
}

/* ========================================
   按钮
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--brand-gradient);
    color: white;
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.4);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.6);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-block {
    width: 100%;
}

.btn-lg {
    padding: 16px 24px;
    font-size: 1.05rem;
}

/* ========================================
   Footer
   ======================================== */
.auth-footer {
    text-align: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--brand-primary-light);
    font-weight: 500;
    text-decoration: none;
    transition: color 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.auth-footer a:hover {
    color: var(--brand-primary);
}

/* ========================================
   Toast 容器
   ======================================== */
.toast-container {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    background: rgba(31, 41, 55, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px 20px;
    color: #FFFFFF;
    font-size: 0.95rem;
    font-weight: 500;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
    min-width: 300px;
    animation: slideInRight 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast-message {
    color: #FFFFFF !important;
    font-weight: 500;
}

.toast-icon {
    font-weight: bold;
    font-size: 1.2rem;
}

.toast.success {
    border-left: 4px solid #10B981;
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.4);
}

.toast.success .toast-icon {
    color: #10B981;
}

.toast.error {
    border-left: 4px solid #EF4444;
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
}

.toast.error .toast-icon {
    color: #EF4444;
}

.toast.info {
    border-left: 4px solid #3B82F6;
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.4);
}

.toast.info .toast-icon {
    color: #3B82F6;
}

/* ========================================
   响应式设计
   ======================================== */
@media (max-width: 768px) {
    .auth-container {
        padding: 20px;
    }
    
    .auth-card {
        padding: 36px 28px;
        max-width: 100%;
    }
    
    .auth-title {
        font-size: 1.5rem;
    }
    
    .auth-logo {
        width: 60px;
        height: 60px;
        font-size: 1.75rem;
    }
    
    .toast-container {
        right: 16px;
        left: 16px;
        top: 20px;
    }
    
    .toast {
        min-width: auto;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 32px 24px;
    }
    
    .auth-title {
        font-size: 1.35rem;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
}

