/* ========== 用户认证页面样式 ========== */

/* 认证页面主体 */
.auth-section {
    min-height: calc(100vh - 120px);
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px 0;
    display: flex;
    align-items: center;
}

/* 认证卡片 */
.auth-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* 认证头部 */
.auth-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 0;
}

/* 认证表单 */
.auth-form {
    margin-bottom: 1.5rem;
}

.form-group {
    position: relative;
}

.form-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.input-group {
    position: relative;
}

.input-group-text {
    background: var(--light-bg);
    border: 1px solid var(--border-color);
    border-right: none;
    color: var(--text-secondary);
    padding: 0.75rem 1rem;
}

.form-control {
    border: 1px solid var(--border-color);
    border-radius: 0 8px 8px 0;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.1);
}

.input-group .btn {
    border-radius: 0 8px 8px 0;
    border-left: none;
    padding: 0.75rem 1rem;
}

/* 密码强度指示器 */
.password-strength {
    margin-top: 0.5rem;
    display: none;
}

.password-strength.show {
    display: block;
}

.strength-bar {
    height: 4px;
    background: var(--light-secondary);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.strength-fill {
    height: 100%;
    width: 0%;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.strength-fill.weak {
    width: 33%;
    background: #dc3545;
}

.strength-fill.medium {
    width: 66%;
    background: #ffc107;
}

.strength-fill.strong {
    width: 100%;
    background: #28a745;
}

.strength-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.agreement-link {
    color: var(--primary-color);
}

.agreement-link:hover {
    text-decoration: underline;
}

/* 表单选项 */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.form-check {
    margin-bottom: 0;
}

.form-check-input {
    border: 1px solid var(--border-color);
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-check-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.forgot-password {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.forgot-password:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* 主要按钮 */
.btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: #0b5ed7;
    border-color: #0a58ca;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

.btn-primary:disabled {
    background: var(--text-muted);
    border-color: var(--text-muted);
    transform: none;
    box-shadow: none;
}

/* 按钮加载状态 */
.btn-loading {
    display: none;
}

.btn-loading.show {
    display: inline-block;
}

.btn-text.hide {
    display: none;
}

/* 分割线 */
.auth-divider {
    text-align: center;
    margin: 1.5rem 0;
    position: relative;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-color);
}

.auth-divider span {
    background: white;
    padding: 0 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
}

/* 社交登录 */
.social-login {
    margin-bottom: 1.5rem;
}

.social-login .btn {
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.social-login .btn:hover {
    background: var(--light-bg);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
}

/* 认证页脚 */
.auth-footer {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.auth-footer p {
    margin-bottom: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.auth-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.auth-link:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* 验证码按钮 */
#sendCodeBtn {
    white-space: nowrap;
    min-width: 100px;
}

#sendCodeBtn:disabled {
    background: var(--light-secondary);
    border-color: var(--border-color);
    color: var(--text-muted);
}

/* 错误状态 */
.form-control.is-invalid {
    border-color: #dc3545;
    background-color: #fff5f5;
    background-image: none !important;
    padding-right: 0.75rem !important;
}

.form-control.is-invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
    background-color: #fff5f5;
    background-image: none !important;
}

.invalid-feedback {
    display: none;
    font-size: 0.875rem;
    color: #dc3545;
    margin-top: 0.5rem;
    font-weight: 500;
    line-height: 1.4;
    padding: 0.25rem 0.5rem;
    background-color: #fff5f5;
    border: 1px solid #fecaca;
    border-radius: 4px;
    position: relative;
}

.invalid-feedback::before {
    content: "⚠ ";
    margin-right: 0.25rem;
}

.invalid-feedback.show {
    display: block;
}

/* 成功状态 */
.form-control.is-valid {
    border-color: #28a745;
    background-color: #f0fff4;
    background-image: none !important;
    padding-right: 0.75rem !important;
}

.form-control.is-valid:focus {
    border-color: #28a745;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
    background-color: #f0fff4;
    background-image: none !important;
}

.valid-feedback {
    display: none;
    font-size: 0.875rem;
    color: #28a745;
    margin-top: 0.5rem;
    font-weight: 500;
    line-height: 1.4;
    padding: 0.25rem 0.5rem;
    background-color: #f0fff4;
    border: 1px solid #9ae6b4;
    border-radius: 4px;
    position: relative;
}

.valid-feedback::before {
    content: "✓ ";
    margin-right: 0.25rem;
}

.valid-feedback.show {
    display: block;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .auth-section {
        min-height: calc(100vh - 100px);
        padding: 15px 0;
    }
    
    .auth-card {
        padding: 1.5rem 1rem;
        margin: 0 1rem;
    }
    
    .auth-title {
        font-size: 1.5rem;
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .forgot-password {
        align-self: flex-end;
    }
}

@media (max-width: 576px) {
    .auth-card {
        padding: 1.5rem 1rem;
    }
    
    .auth-title {
        font-size: 1.5rem;
    }
    
    .input-group-text,
    .form-control,
    .input-group .btn {
        padding: 0.6rem 0.8rem;
        font-size: 0.9rem;
    }
    
    .btn-primary {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
}

/* 移除动画效果 */
.auth-card {
    /* 移除动画，直接显示 */
}

/* 焦点状态优化 */
.form-control:focus,
.btn:focus {
    outline: none;
}

/* 高对比度支持 */
@media (prefers-contrast: high) {
    .auth-card {
        border: 2px solid var(--text-primary);
    }
    
    .form-control {
        border-width: 2px;
    }
    
    .btn-primary {
        border-width: 2px;
    }
}

/* 减少动画支持 */
@media (prefers-reduced-motion: reduce) {
    .auth-card {
        animation: none;
    }
    
    .btn-primary:hover,
    .social-login .btn:hover {
        transform: none;
    }
    
    .form-control,
    .strength-fill {
        transition: none;
    }
}
