/**
 * 登录和注册页面样式
 * 
 * 描述: 用户认证页面的专用样式，包含登录和注册表单
 * 功能: 毛玻璃效果、响应式设计、表单切换动画
 */

/* ========================================
   登录页面主容器
   ======================================== */
.auth-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #1e3c72 100%),
                linear-gradient(45deg, rgba(255,255,255,0.02) 25%, transparent 25%),
                linear-gradient(-45deg, rgba(255,255,255,0.02) 25%, transparent 25%),
                linear-gradient(45deg, transparent 75%, rgba(255,255,255,0.02) 75%),
                linear-gradient(-45deg, transparent 75%, rgba(255,255,255,0.02) 75%);
    background-size: 100% 100%, 20px 20px, 20px 20px, 20px 20px, 20px 20px;
    background-position: 0 0, 0 0, 10px 0, 10px -10px, 0px 10px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* ========================================
   认证卡片容器
   ======================================== */
.auth-card {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25), 
                0 0 0 1px rgba(255, 255, 255, 0.2);
    width: 100%;
    max-width: 480px;
    padding: 40px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    animation: authCardFadeIn 0.5s ease forwards;
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border-radius: 20px;
    pointer-events: none;
}

.auth-card > * {
    position: relative;
    z-index: 1;
}

/* ========================================
   认证页面头部
   ======================================== */
.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo {
    font-size: 42px;
    color: #ff8c00;
    margin-bottom: 15px;
    text-shadow: 0 2px 10px rgba(255, 140, 0, 0.3);
}

.auth-container .auth-title {
    color: #fff;
    font-size: 28px;
    margin-bottom: 8px;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.auth-container .auth-subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
}

/* ========================================
   登录/注册切换按钮
   ======================================== */
.auth-switch {
    display: flex;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 6px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.auth-container .auth-switch-btn {
    flex: 1;
    text-align: center;
    padding: 12px;
    cursor: pointer;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.3s ease;
    font-weight: 500;
}

/* 所有切换按钮激活状态 - 统一蓝色 */
.auth-container .auth-switch-btn.active {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.auth-container .auth-switch-btn:hover:not(.active) {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.05);
}

/* ========================================
   表单部分显示控制
   ======================================== */
.form-section {
    display: none;
    animation: formFadeIn 0.3s ease forwards;
}

.form-section.active {
    display: block;
}

/* ========================================
   表单样式
   ======================================== */
.form-group {
    margin-bottom: 20px;
}

.auth-container .form-group label {
    display: block;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    font-size: 14px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.auth-container .form-control {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 16px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-sizing: border-box;
}

.auth-container .form-control::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.auth-container .form-control:focus {
    outline: none;
    border-color: #ff9900;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 3px rgba(255, 153, 0, 0.2);
}

.auth-container .form-control:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.12);
}

/* ========================================
   按钮样式
   ======================================== */
.btn {
    padding: 14px 24px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
}

.auth-container .btn-primary {
    background: linear-gradient(135deg, #ff9900, #ff7700);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 153, 0, 0.3);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #ff7700, #ff5500);
    box-shadow: 0 6px 20px rgba(255, 153, 0, 0.4);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(255, 153, 0, 0.3);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* ========================================
   复选框样式
   ======================================== */
.auth-container .checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.auth-container .checkbox-container input[type="checkbox"] {
    display: none;
}

.auth-container .checkmark {
    width: 18px;
    height: 18px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    margin-right: 10px;
    position: relative;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.auth-container .checkbox-container:hover .checkmark {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.15);
}

.auth-container .checkbox-container input[type="checkbox"]:checked + .checkmark {
    background: linear-gradient(135deg, #ff9900, #ff7700);
    border-color: #ff9900;
}

.auth-container .checkbox-container input[type="checkbox"]:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* ========================================
   消息提示样式
   ======================================== */
.form-error {
    font-size: 14px;
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    text-align: center;
    font-weight: 500;
    display: none;
}

.form-error:not(:empty) {
    display: block;
}

/* 登录页面特殊的消息样式 - 适配毛玻璃背景 */
.auth-card .form-error {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    color: rgba(255, 255, 255, 0.9);
}

/* 登录页面错误消息样式 */
.auth-card .form-error.error {
    color: #ff8a80;
    border-color: rgba(255, 138, 128, 0.4);
    background: rgba(255, 138, 128, 0.15);
}

/* 登录页面成功消息样式 */
.auth-card .form-error.success {
    color: #81c784;
    border-color: rgba(129, 199, 132, 0.4);
    background: rgba(129, 199, 132, 0.15);
}

.form-error.info {
    background: rgba(255, 153, 0, 0.2);
    color: #ffb366;
    border: 1px solid rgba(255, 153, 0, 0.3);
}

/* ========================================
   页面底部
   ======================================== */
.auth-container .auth-footer {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    margin-top: 25px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* ========================================
   动画效果
   ======================================== */
@keyframes authCardFadeIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes formFadeIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ========================================
   响应式设计
   ======================================== */
@media (max-width: 480px) {
    .auth-card {
        padding: 25px;
        margin: 10px;
    }
    
    .auth-title {
        font-size: 24px;
    }
    
    .auth-logo {
        font-size: 36px;
    }
    
    .form-control {
        padding: 12px 14px;
        font-size: 16px; /* 防止iOS缩放 */
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 15px;
    }
    
    .auth-switch-btn {
        padding: 10px;
        font-size: 14px;
    }
}

@media (max-width: 360px) {
    .auth-container {
        padding: 15px;
    }
    
    .auth-card {
        padding: 20px;
    }
    
    .auth-title {
        font-size: 22px;
    }
    
    .auth-logo {
        font-size: 32px;
    }
}