/* 认证页面样式修复 */

/* 修复背景渐变 */
.auth-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* 添加动态背景效果 */
.auth-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: backgroundMove 20s linear infinite;
    z-index: 0;
}

@keyframes backgroundMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

/* 修复卡片样式 */
.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 40px 32px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

.dark-mode .auth-card {
    background: rgba(30, 30, 30, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

.auth-card:hover {
    transform: translateY(-5px);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

/* 修复头部样式 */
.auth-header {
    text-align: center;
    margin-bottom: 32px;
    position: relative;
}

.auth-header .logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 12px;
}

.auth-header .logo-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
    box-shadow: 
        0 8px 16px rgba(99, 102, 241, 0.3),
        0 0 0 2px rgba(255, 255, 255, 0.1) inset;
    transition: all 0.3s ease;
}

.auth-header .logo-icon:hover {
    transform: rotate(5deg) scale(1.05);
}

.auth-header h1 {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    letter-spacing: -0.5px;
}

.auth-header p {
    color: var(--text-color);
    opacity: 0.7;
    font-size: 15px;
    margin: 0;
    font-weight: 400;
}

/* 修复标签页样式 */
.auth-tabs {
    display: flex;
    margin-bottom: 32px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    padding: 4px;
    position: relative;
}

.dark-mode .auth-tabs {
    background: rgba(255, 255, 255, 0.05);
}

.auth-tab {
    flex: 1;
    padding: 14px 20px;
    border: none;
    background: transparent;
    color: var(--text-color);
    font-size: 15px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.auth-tab:hover {
    background: rgba(0, 0, 0, 0.05);
}

.dark-mode .auth-tab:hover {
    background: rgba(255, 255, 255, 0.05);
}

.auth-tab.active {
    background: var(--card-bg);
    color: var(--primary-color);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    font-weight: 600;
}

/* 修复表单样式 */
.form-group {
    margin-bottom: 24px;
    position: relative;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
    font-size: 14px;
    opacity: 0.9;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.8);
    color: var(--text-color);
    font-size: 15px;
    transition: all 0.3s ease;
    position: relative;
}

.dark-mode .form-input {
    background: rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 
        0 0 0 3px rgba(99, 102, 241, 0.1),
        0 4px 12px rgba(99, 102, 241, 0.15);
}

.dark-mode .form-input:focus {
    background: rgba(0, 0, 0, 0.3);
    border-color: var(--primary-color);
}

.form-input::placeholder {
    color: #9ca3af;
    opacity: 0.7;
}

.form-help {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #6b7280;
    opacity: 0.8;
}

/* 修复复选框样式 */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-color);
    user-select: none;
    margin-bottom: 24px;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.dark-mode .checkmark {
    border-color: rgba(255, 255, 255, 0.2);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-color: transparent;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* 修复按钮样式 */
.btn-full {
    width: 100%;
    margin-top: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border: none;
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* 修复动画效果 */
.auth-form {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease;
}

.auth-form.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 修复消息提示样式 */
.message {
    padding: 14px 18px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-size: 14px;
    text-align: center;
    animation: slideDown 0.4s ease;
    position: relative;
    border: 1px solid transparent;
    backdrop-filter: blur(10px);
}

.message.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #dc2626;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.1);
}

.message.success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #059669;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.1);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 修复响应式设计 */
@media (max-width: 768px) {
    .auth-container {
        padding: 15px;
        align-items: flex-start;
        padding-top: 50px;
    }
    
    .auth-card {
        max-width: 100%;
        padding: 32px 24px;
        border-radius: 20px;
    }
    
    .auth-header .logo-icon {
        width: 48px;
        height: 48px;
        font-size: 24px;
    }
    
    .auth-header h1 {
        font-size: 28px;
    }
    
    .auth-tabs {
        margin-bottom: 28px;
    }
    
    .auth-tab {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .form-input {
        padding: 12px 14px;
        font-size: 16px; /* 防止iOS缩放 */
    }
    
    .btn-primary {
        padding: 14px 20px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .auth-container {
        padding: 10px;
        padding-top: 30px;
    }
    
    .auth-card {
        padding: 24px 20px;
        border-radius: 16px;
    }
    
    .auth-header {
        margin-bottom: 24px;
    }
    
    .auth-header .logo {
        gap: 12px;
    }
    
    .auth-header .logo-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .auth-header h1 {
        font-size: 24px;
    }
    
    .auth-header p {
        font-size: 13px;
    }
    
    .auth-tabs {
        margin-bottom: 24px;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
    
    .form-label {
        font-size: 13px;
        margin-bottom: 6px;
    }
    
    .form-input {
        padding: 10px 12px;
        font-size: 16px;
    }
    
    .form-help {
        font-size: 11px;
    }
    
    .checkbox-label {
        font-size: 13px;
        margin-bottom: 20px;
    }
    
    .checkmark {
        width: 18px;
        height: 18px;
    }
    
    .btn-primary {
        padding: 12px 16px;
        font-size: 15px;
        gap: 6px;
    }
    
    .message {
        padding: 12px 14px;
        font-size: 13px;
        margin-bottom: 20px;
    }
}

/* 修复高对比度模式 */
@media (prefers-contrast: high) {
    .auth-card {
        border: 2px solid var(--border-color);
    }
    
    .form-input {
        border-width: 2px;
    }
    
    .auth-tab.active {
        border: 2px solid var(--primary-color);
    }
}

/* 修复减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
    .auth-form,
    .message,
    .btn-primary,
    .auth-tab,
    .form-input,
    .checkmark {
        transition: none;
    }
    
    @keyframes fadeIn,
    @keyframes slideDown,
    @keyframes backgroundMove {
        from { opacity: 1; transform: none; }
        to { opacity: 1; transform: none; }
    }
}

/* 密码可见性切换按钮样式 */
.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s ease;
    z-index: 2;
}

.password-toggle:hover {
    color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
}

.password-toggle:active {
    transform: translateY(-50%) scale(0.95);
}

.password-toggle i {
    font-size: 16px;
    transition: all 0.2s ease;
}

.password-toggle:hover i {
    transform: scale(1.1);
}

/* 表单组增强样式 */
.form-group {
    position: relative;
    transition: all 0.3s ease;
}

.form-group::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.form-group.focused::after {
    width: 100%;
}

.form-group.focused .form-label {
    color: var(--primary-color);
    transform: translateY(-2px);
}

/* 密码强度指示器 */
.password-strength {
    height: 4px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.password-strength-bar {
    height: 100%;
    width: 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.password-strength-weak {
    background: #ef4444;
    width: 33%;
}

.password-strength-medium {
    background: #f59e0b;
    width: 66%;
}

.password-strength-strong {
    background: #10b981;
    width: 100%;
}

/* 修复暗色模式下的颜色对比 */
.dark-mode .auth-header p {
    color: rgba(255, 255, 255, 0.7);
}

.dark-mode .form-help {
    color: rgba(255, 255, 255, 0.6);
}

.dark-mode .checkbox-label {
    color: rgba(255, 255, 255, 0.9);
}

/* 修复加载状态 */
.btn-primary.loading {
    position: relative;
    color: transparent;
}

.btn-primary.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}