/**
 * 用户认证页面样式
 * 包含表单样式、切换动画和响应式设计
 */

/* ===== 认证卡片容器 ===== */
.auth-card {
    background: rgba(18, 18, 26, 0.85);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
}

.auth-card:hover {
    border-color: rgba(139, 92, 246, 0.3);
    box-shadow: 0 8px 40px rgba(139, 92, 246, 0.1);
}

/* ===== 表单切换动画 ===== */
.auth-form {
    display: none;
    animation: authFadeIn 0.4s ease;
}

.auth-form.active {
    display: block;
}

@keyframes authFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== 输入框样式 ===== */
.auth-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    outline: none;
}

/* 隐藏 Edge 浏览器自带的密码显示按钮 */
.auth-input::-ms-reveal,
.auth-input::-ms-clear {
    display: none;
}

.auth-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.auth-input:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

/* 输入框验证状态 */
.auth-input.valid {
    border-color: rgba(16, 185, 129, 0.5);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.auth-input.invalid {
    border-color: rgba(239, 68, 68, 0.5);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* 错误信息 */
.form-error {
    animation: errorShake 0.4s ease;
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* ===== 复选框样式 ===== */
.auth-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.auth-checkbox:checked {
    background: #8b5cf6;
    border-color: #8b5cf6;
}

.auth-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.auth-checkbox:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

/* ===== 密码显示/隐藏按钮 ===== */
.toggle-password {
    cursor: pointer;
    padding: 4px;
}

/* ===== 表单切换按钮 ===== */
.auth-switch-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
}

/* ===== 响应式设计 ===== */
@media (max-width: 640px) {
    .auth-card {
        padding: 1.5rem;
        border-radius: 1rem;
    }

    .auth-card h2 {
        font-size: 1.5rem;
    }
}

/* ===== Toast 提示 ===== */
.auth-toast {
    position: fixed;
    top: 5rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    z-index: 100;
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s;
    pointer-events: none;
}

.auth-toast.success {
    background: rgba(16, 185, 129, 0.9);
    color: #ffffff;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3);
}

.auth-toast.error {
    background: rgba(239, 68, 68, 0.9);
    color: #ffffff;
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.3);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
}