/**
 * 认证页面样式 - auth.css
 * 用于：登录、注册、忘记密码、重置密码页面
 * 设计：现代化卡片式布局、渐变背景、流畅动画
 */

/* ==========================================
   认证页面整体布局
   ========================================== */

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 70px 20px 30px;
    position: relative;
    overflow: hidden;
}

/* 动态背景 */
.auth-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background: linear-gradient(135deg, #FF6B4A 0%, #FF8E6B 50%, #FFA987 100%);
    overflow: hidden;
}

.bg-shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.1;
    animation: float 20s infinite ease-in-out;
}

.shape-1 {
    width: 500px;
    height: 500px;
    background: white;
    top: -200px;
    right: -100px;
    animation-delay: 0s;
}

.shape-2 {
    width: 300px;
    height: 300px;
    background: white;
    bottom: -100px;
    left: -50px;
    animation-delay: 5s;
}

.shape-3 {
    width: 200px;
    height: 200px;
    background: white;
    top: 50%;
    left: 50%;
    animation-delay: 10s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(50px, -50px) scale(1.1); }
    50% { transform: translate(-20px, 20px) scale(0.9); }
    75% { transform: translate(30px, 50px) scale(1.05); }
}

/* 主要内容布局 */
.auth-wrapper {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 460px;
    gap: 50px;
    max-width: 1100px;
    width: 100%;
    align-items: center;
}

/* ==========================================
   左侧品牌展示
   ========================================== */

.auth-brand {
    color: white;
}

.brand-content {
    max-width: 500px;
}

.brand-logo {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.brand-logo svg {
    width: 36px;
    height: 36px;
}

.brand-title {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 3.5vw, 2.5rem);
    font-weight: 800;
    color: white;
    margin-bottom: 14px;
    line-height: 1.2;
}

.brand-description {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.5;
    margin-bottom: 28px;
}

.brand-features {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: background 0.3s var(--ease-out), transform 0.3s var(--ease-out);
}

.feature-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(8px);
}

.feature-icon {
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.feature-icon svg {
    width: 22px;
    height: 22px;
}

.feature-text h3 {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    color: white;
    margin-bottom: 3px;
}

.feature-text p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.4;
}

/* ==========================================
   右侧表单容器
   ========================================== */

.auth-form-container {
    width: 100%;
}

.auth-card {
    background: white;
    border-radius: 20px;
    padding: 28px 28px 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s var(--ease-out);
}

.auth-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .auth-card {
    background: var(--gray-800);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.auth-card-header {
    text-align: center;
    margin-bottom: 20px;
}

.auth-title {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 6px;
}

.auth-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
}

/* 忘记密码页面的图标 */
.auth-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, var(--coral) 0%, var(--coral-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 8px 25px rgba(255, 107, 74, 0.3);
}

.forgot-card {
    max-width: 460px;
}

/* ==========================================
   提示信息
   ========================================== */

.alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 0.95rem;
    font-weight: 500;
}

.alert-error {
    background: #FEE2E2;
    color: #DC2626;
    border: 1px solid #FCA5A5;
}

.alert-success {
    background: #D1FAE5;
    color: #059669;
    border: 1px solid #6EE7B7;
}

[data-theme="dark"] .alert-error {
    background: rgba(220, 38, 38, 0.2);
    color: #FCA5A5;
    border-color: rgba(220, 38, 38, 0.3);
}

[data-theme="dark"] .alert-success {
    background: rgba(5, 150, 105, 0.2);
    color: #6EE7B7;
    border-color: rgba(5, 150, 105, 0.3);
}

/* ==========================================
   表单样式
   ========================================== */

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
}

.form-label svg {
    color: var(--coral);
}

.input-wrapper {
    position: relative;
}

.form-input {
    width: 100%;
    padding: 11px 15px;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.3s, box-shadow 0.3s;
    background: white;
    color: var(--text);
}

[data-theme="dark"] .form-input {
    background: var(--gray-700);
    border-color: var(--gray-700);
    color: var(--text);
}

.form-input:focus {
    outline: none;
    border-color: var(--coral);
    box-shadow: 0 0 0 3px rgba(255, 107, 74, 0.1);
}

.input-focus-effect {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--coral);
    transition: width 0.3s;
    transform: translateX(-50%);
}

.form-input:focus + .input-focus-effect {
    width: 100%;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.3s;
}

.toggle-password:hover {
    color: var(--coral);
}

/* ==========================================
   表单选项（记住我、忘记密码）
   ========================================== */

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.form-checkbox input[type="checkbox"] {
    display: none;
}

.checkbox-mark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--gray-300);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s, border-color 0.3s;
}

.form-checkbox input[type="checkbox"]:checked + .checkbox-mark {
    background: var(--coral);
    border-color: var(--coral);
}

.checkbox-mark svg {
    color: white;
    opacity: 0;
    transition: opacity 0.3s;
}

.form-checkbox input[type="checkbox"]:checked + .checkbox-mark svg {
    opacity: 1;
}

.form-link {
    font-size: 0.95rem;
    color: var(--coral);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.form-link:hover {
    color: var(--coral-dark);
    text-decoration: underline;
}

/* ==========================================
   提交按钮
   ========================================== */

.btn-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 32px;
    background: linear-gradient(135deg, var(--coral) 0%, var(--coral-dark) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.05rem;
    cursor: pointer;
    transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
    margin-top: 6px;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 107, 74, 0.4);
}

.btn-submit:active {
    transform: translateY(0);
}

.btn-icon {
    transition: transform 0.3s;
}

.btn-submit:hover .btn-icon {
    transform: translateX(4px);
}

/* ==========================================
   分隔线
   ========================================== */

.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 20px 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gray-200);
}

[data-theme="dark"] .auth-divider::before,
[data-theme="dark"] .auth-divider::after {
    background: var(--gray-700);
}

/* ==========================================
   社交登录
   ========================================== */

.auth-social {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.auth-social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 24px;
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-secondary);
    cursor: not-allowed;
    opacity: 0.6;
    transition: border-color 0.3s, background 0.3s;
}

[data-theme="dark"] .auth-social-btn {
    background: var(--gray-700);
    border-color: var(--gray-700);
}

.coming-soon {
    font-size: 0.8rem;
    padding: 2px 8px;
    background: var(--gray-100);
    border-radius: 100px;
    color: var(--text-secondary);
}

[data-theme="dark"] .coming-soon {
    background: var(--gray-600);
}

/* ==========================================
   密码强度指示器
   ========================================== */

.password-strength {
    margin-top: 8px;
}

.strength-bars {
    display: flex;
    gap: 4px;
    margin-bottom: 6px;
}

.strength-bar {
    flex: 1;
    height: 4px;
    background: var(--gray-200);
    border-radius: 2px;
    transition: background 0.3s;
}

.strength-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: color 0.3s;
}

/* ==========================================
   底部链接
   ========================================== */

.auth-footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--gray-200);
}

[data-theme="dark"] .auth-footer {
    border-top-color: var(--gray-700);
}

.auth-footer p {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.auth-link {
    color: var(--coral);
    font-weight: 700;
    text-decoration: none;
    transition: color 0.3s;
}

.auth-link:hover {
    color: var(--coral-dark);
    text-decoration: underline;
}

/* ==========================================
   额外信息
   ========================================== */

.auth-extra {
    text-align: center;
    margin-top: 16px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

.auth-extra a {
    color: white;
    font-weight: 600;
    text-decoration: underline;
    transition: opacity 0.3s;
}

.auth-extra a:hover {
    opacity: 0.8;
}

/* ==========================================
   注册成功页面
   ========================================== */

.register-success {
    text-align: center;
    padding: 40px 20px;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    animation: scaleIn 0.5s var(--ease-out);
}

@keyframes scaleIn {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

.success-icon svg {
    width: 40px;
    height: 40px;
    color: white;
}

.register-success h2 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 12px;
}

.register-success p {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.6;
}

.register-success .user-name {
    font-weight: 700;
    color: var(--coral);
}

.register-success .action-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 32px;
}

/* ==========================================
   注册成功页面 v2（新设计）
   ========================================== */

.register-success-card {
    max-width: 600px;
    margin: 0 auto;
}

/* 成功图标 */
.success-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto 30px;
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    animation: successPulse 2s ease-in-out infinite;
}

@keyframes successPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    50% { transform: scale(1.05); box-shadow: 0 0 0 20px rgba(16, 185, 129, 0); }
}

/* 成功信息 */
.success-content {
    text-align: center;
    margin-bottom: 40px;
}

.success-title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 12px;
}

.success-message {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* 下一步操作 */
.next-steps {
    margin-bottom: 30px;
}

.steps-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 20px;
    text-align: center;
}

.steps-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px;
    background: var(--gray-50);
    border-radius: 12px;
    border: 2px solid transparent;
    transition: border-color 0.3s, transform 0.3s;
}

[data-theme="dark"] .step-item {
    background: var(--gray-700);
}

.step-item:hover {
    border-color: var(--coral);
    transform: translateX(4px);
}

.step-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--coral) 0%, var(--coral-dark) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.step-text {
    flex: 1;
}

.step-text h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.step-text p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.step-link {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--coral);
    text-decoration: none;
    transition: color 0.3s;
    flex-shrink: 0;
}

.step-link:hover {
    color: var(--coral-dark);
    text-decoration: underline;
}

/* 快捷操作 */
.quick-actions {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.btn-primary,
.btn-secondary {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s, background 0.3s, border-color 0.3s;
    text-decoration: none;
    border: none;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, var(--coral) 0%, var(--coral-dark) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 107, 74, 0.4);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--text);
    border: 2px solid var(--gray-200);
}

[data-theme="dark"] .btn-secondary {
    background: var(--gray-700);
    color: var(--text);
    border-color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-200);
    transform: translateY(-2px);
}

[data-theme="dark"] .btn-secondary:hover {
    background: var(--gray-600);
}

/* 响应式 */
@media (max-width: 640px) {
    .success-title {
        font-size: 1.6rem;
    }

    .success-message {
        font-size: 1rem;
    }

    .quick-actions {
        flex-direction: column;
    }

    .step-item {
        flex-direction: column;
        text-align: center;
    }

    .step-link {
        display: block;
        margin-top: 8px;
    }
}

/* ==========================================
   响应式设计
   ========================================== */

@media (max-width: 968px) {
    .auth-wrapper {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .auth-brand {
        display: none;
    }
}

@media (max-width: 480px) {
    .auth-page {
        padding: 60px 12px 20px;
    }

    .auth-card {
        padding: 24px 20px 20px;
    }

    .auth-title {
        font-size: 1.5rem;
    }

    .form-options {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
}

/* ==========================================
   可访问性改进样式
   ========================================== */

/* 屏幕阅读器专用（视觉隐藏，屏幕阅读器可访问）*/
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 表单错误提示 */
.form-error {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #dc2626;
    font-size: 0.875rem;
    margin-top: 6px;
    padding: 8px 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
}

.form-error svg {
    flex-shrink: 0;
}

/* 表单帮助文本 */
.form-help {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 4px;
}

/* 输入框错误状态 */
input[aria-invalid="true"] {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

input[aria-invalid="true"]:focus {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2);
}

/* 加载状态 */
.btn-loading {
    display: none;
    margin-left: 8px;
}

.btn-submit[aria-busy="true"] .btn-text {
    display: none;
}

.btn-submit[aria-busy="true"] .btn-icon {
    display: none;
}

.btn-submit[aria-busy="true"] .btn-loading {
    display: inline-flex;
}

/* 加载动画 */
.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 移动端优化：增大触摸目标 */
@media (max-width: 768px) {
    .form-input {
        min-height: 44px; /* WCAG 触摸目标最小尺寸 */
        font-size: 16px; /* 防止 iOS 自动缩放 */
    }
    
    .btn-submit {
        min-height: 44px;
        padding: 12px 24px;
    }
    
    .toggle-password {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .form-checkbox {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    .auth-social-btn {
        min-height: 44px;
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .form-input {
        border-width: 2px;
    }
    
    .btn-submit {
        border: 2px solid transparent;
    }
}

/* 减少动画（用户偏好）*/
@media (prefers-reduced-motion: reduce) {
    .bg-shape {
        animation: none;
    }
    
    .loading-spinner {
        animation: none;
        border-style: solid;
    }
}
