/**
 * Waywave 渡澜 - 认证页面样式（登录/注册）
 * 海洋主题 · 波浪动效 · 统一设计语言
 */

/* ========================================
   字体定义
   ======================================== */
:root {
    --font-display: 'Sora', 'Noto Sans SC', system-ui, sans-serif;
    --font-body: 'Noto Sans SC', 'Sora', system-ui, sans-serif;
}

/* ========================================
   认证页面布局
   ======================================== */
.auth-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    font-family: var(--font-body);
    background: linear-gradient(180deg, #f0f9ff 0%, #e0f2fe 50%, #f0fdf4 100%);
    position: relative;
    overflow-x: hidden;
}

.theme-dark .auth-page {
    background: linear-gradient(180deg, #020617 0%, #0c1426 50%, #041c14 100%);
}

/* ========================================
   背景装饰 - 波浪效果
   ======================================== */
.auth-bg-decoration {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

/* 光晕效果 */
.auth-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    animation: auth-glow-drift 20s ease-in-out infinite;
}

.auth-glow-1 {
    width: 500px;
    height: 500px;
    top: -15%;
    right: -8%;
    background: radial-gradient(circle, rgba(163, 230, 53, 0.2) 0%, transparent 70%);
}

.auth-glow-2 {
    width: 400px;
    height: 400px;
    bottom: 5%;
    left: -5%;
    background: radial-gradient(circle, rgba(20, 184, 166, 0.15) 0%, transparent 70%);
    animation-delay: -10s;
}

.theme-dark .auth-glow-1 {
    background: radial-gradient(circle, rgba(163, 230, 53, 0.12) 0%, transparent 70%);
}

.theme-dark .auth-glow-2 {
    background: radial-gradient(circle, rgba(20, 184, 166, 0.1) 0%, transparent 70%);
}

@keyframes auth-glow-drift {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    50% {
        transform: translate(20px, -20px) scale(1.1);
        opacity: 0.7;
    }
}

/* 波浪容器 */
.auth-bg-decoration .wave-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
}

/* 波浪层 */
.auth-bg-decoration .wave-layer {
    position: absolute;
    left: -100%;
    width: 300%;
    overflow: visible;
}

.auth-bg-decoration .wave-layer svg {
    position: absolute;
    display: block;
    width: 100%;
    height: 100%;
}

/* 波浪1 - 最底层 */
.auth-bg-decoration .wave-layer-1 {
    bottom: 0;
    height: 70%;
    animation: wave-drift-right 22s linear infinite;
}

.auth-bg-decoration .wave-layer-1 svg path {
    fill: rgba(163, 230, 53, 0.06);
}

/* 波浪2 - 中间层 */
.auth-bg-decoration .wave-layer-2 {
    bottom: 0;
    height: 55%;
    animation: wave-drift-left 18s linear infinite;
}

.auth-bg-decoration .wave-layer-2 svg path {
    fill: rgba(20, 184, 166, 0.08);
}

/* 波浪3 - 上层 */
.auth-bg-decoration .wave-layer-3 {
    bottom: 0;
    height: 40%;
    animation: wave-drift-right 26s linear infinite;
}

.auth-bg-decoration .wave-layer-3 svg path {
    fill: rgba(34, 197, 94, 0.05);
}

/* 顶部波浪（倒置） */
.auth-bg-decoration .wave-layer-top {
    top: 0;
    height: 30%;
    transform: scaleY(-1);
    animation: wave-drift-left 30s linear infinite;
}

.auth-bg-decoration .wave-layer-top svg path {
    fill: rgba(163, 230, 53, 0.04);
}

/* 深色模式波浪 */
.theme-dark .auth-bg-decoration .wave-layer-1 svg path {
    fill: rgba(163, 230, 53, 0.04);
}

.theme-dark .auth-bg-decoration .wave-layer-2 svg path {
    fill: rgba(20, 184, 166, 0.06);
}

.theme-dark .auth-bg-decoration .wave-layer-3 svg path {
    fill: rgba(99, 102, 241, 0.04);
}

.theme-dark .auth-bg-decoration .wave-layer-top svg path {
    fill: rgba(163, 230, 53, 0.02);
}

/* 波浪动画 */
@keyframes wave-drift-right {
    0% { transform: translateX(0); }
    100% { transform: translateX(-33.333%); }
}

@keyframes wave-drift-left {
    0% { transform: translateX(-33.333%); }
    100% { transform: translateX(0); }
}

/* ========================================
   顶部导航
   ======================================== */
.auth-header {
    padding: 16px 24px;
    position: relative;
    z-index: 10;
}

.auth-header-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.auth-logo {
    display: flex;
    align-items: baseline;
    gap: 8px;
    text-decoration: none;
}

.auth-logo:hover {
    text-decoration: none;
}

.auth-logo-en {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    color: var(--color-text-primary);
    letter-spacing: -1px;
}

.auth-logo-zh {
    font-size: 14px;
    color: var(--brand-primary);
    font-weight: 500;
}

/* 头部右侧区域 */
.auth-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 导航链接 */
.auth-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.auth-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-secondary);
    background: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.auth-nav-link:hover {
    color: var(--color-text-primary);
    background: rgba(0, 0, 0, 0.04);
    text-decoration: none;
}

.theme-dark .auth-nav-link:hover {
    background: rgba(255, 255, 255, 0.06);
}

.auth-nav-link .iconify {
    font-size: 16px;
    opacity: 0.7;
}

/* 分隔线 */
.auth-header-divider {
    width: 1px;
    height: 24px;
    background: var(--color-border);
    margin: 0 8px;
}

/* 主题切换按钮 */
.auth-theme-toggle {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid var(--color-border);
    background: var(--color-bg-elevated);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 18px;
}

.auth-theme-toggle:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(163, 230, 53, 0.15);
}

/* ========================================
   主内容区
   ======================================== */
.auth-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg);
    position: relative;
    z-index: 10;
}

/* ========================================
   登录卡片
   ======================================== */
.auth-card {
    width: 100%;
    max-width: 420px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
    animation: card-appear 0.6s ease-out;
}

.theme-dark .auth-card {
    background: rgba(15, 23, 42, 0.8);
    border-color: rgba(255, 255, 255, 0.1);
}

@keyframes card-appear {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 返回链接 */
.auth-back-link {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-lg);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.auth-back-link:hover {
    color: var(--brand-primary);
    text-decoration: none;
}

/* ========================================
   表单标签切换
   ======================================== */
.auth-tabs {
    display: flex;
    margin-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--color-border);
}

.auth-tab {
    flex: 1;
    padding: var(--spacing-md);
    text-align: center;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.auth-tab:hover {
    color: var(--color-text-secondary);
}

.auth-tab.active {
    color: var(--brand-primary);
    border-bottom-color: var(--brand-primary);
}

/* ========================================
   表单内容区
   ======================================== */
.auth-form-content {
    display: none;
}

.auth-form-content.active {
    display: block;
    animation: fadeIn var(--transition-normal) ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ========================================
   密码可见性切换
   ======================================== */
.password-wrapper {
    position: relative;
}

.password-wrapper .form-input {
    padding-right: 48px;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 4px;
    font-size: 16px;
    transition: color var(--transition-fast);
}

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

/* ========================================
   密码强度指示器
   ======================================== */
.password-strength {
    display: flex;
    gap: 4px;
    margin-top: var(--spacing-sm);
}

.password-strength-bar {
    flex: 1;
    height: 4px;
    background: var(--color-border);
    border-radius: var(--radius-full);
    transition: background var(--transition-fast);
}

.password-strength-bar.weak { background: var(--color-error); }
.password-strength-bar.medium { background: var(--color-warning); }
.password-strength-bar.strong { background: var(--color-success); }

.password-strength-text {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    margin-top: 4px;
}

/* ========================================
   表单操作区
   ======================================== */
.auth-form-actions {
    margin-top: var(--spacing-lg);
}

.auth-form-actions .btn {
    width: 100%;
    padding: 14px;
    font-size: var(--font-size-base);
    border-radius: 12px;
    background: linear-gradient(135deg, var(--brand-primary) 0%, #84cc16 100%);
    color: #0f172a;
    font-weight: 600;
    box-shadow: 0 6px 24px rgba(163, 230, 53, 0.3);
    transition: all 0.3s ease;
}

.auth-form-actions .btn:hover {
    box-shadow: 0 10px 32px rgba(163, 230, 53, 0.45);
    transform: translateY(-2px);
}

/* ========================================
   社交登录区
   ======================================== */
.auth-social {
    margin-top: var(--spacing-lg);
}

.auth-social-title {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
    margin-bottom: var(--spacing-md);
}

.auth-social-title::before,
.auth-social-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-border);
}

.auth-social-buttons {
    display: flex;
    gap: var(--spacing-sm);
}

.auth-social-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: 12px;
    background: var(--color-bg-hover);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.auth-social-btn:hover:not(:disabled) {
    background: var(--color-bg-elevated);
    border-color: var(--color-text-muted);
    color: var(--color-text-primary);
}

.auth-social-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========================================
   辅助链接
   ======================================== */
.auth-helper-links {
    margin-top: var(--spacing-lg);
    text-align: center;
}

.auth-helper-link {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.auth-helper-link a {
    color: var(--brand-primary);
    text-decoration: none;
}

.auth-helper-link a:hover {
    text-decoration: underline;
}

/* ========================================
   加载状态
   ======================================== */
.auth-loading {
    position: relative;
    pointer-events: none;
}

.auth-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 24px;
}

.theme-dark .auth-loading::after {
    background: rgba(15, 23, 42, 0.7);
}

/* ========================================
   底部
   ======================================== */
.auth-footer {
    text-align: center;
    padding: var(--spacing-lg);
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
}

.auth-footer p {
    margin-bottom: 0;
}

/* ========================================
   联系弹窗
   ======================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.contact-modal {
    position: relative;
    width: 100%;
    max-width: 400px;
    background: var(--color-bg-elevated);
    border-radius: 24px;
    padding: 48px 32px 32px;
    text-align: center;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.modal-overlay.show .contact-modal {
    transform: scale(1) translateY(0);
}

.modal-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    color: var(--color-text-muted);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 24px;
}

.modal-close-btn:hover {
    background: var(--color-bg-hover);
    color: var(--color-text-primary);
}

.contact-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, rgba(163, 230, 53, 0.2) 0%, rgba(20, 184, 166, 0.2) 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--brand-secondary);
}

.theme-dark .contact-icon {
    color: var(--brand-primary);
}

.contact-title {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 12px;
}

.contact-text {
    font-size: 15px;
    color: var(--color-text-secondary);
    margin-bottom: 24px;
    line-height: 1.6;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--brand-primary) 0%, #84cc16 100%);
    color: #0f172a;
    font-size: 15px;
    font-weight: 600;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 6px 24px rgba(163, 230, 53, 0.3);
}

.contact-link:hover {
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 10px 32px rgba(163, 230, 53, 0.45);
}

/* ========================================
   响应式
   ======================================== */
@media (max-width: 768px) {
    .auth-header {
        padding: 12px 16px;
    }
    
    .auth-logo-en {
        font-size: 20px;
    }
    
    .auth-nav-link {
        padding: 8px 10px;
    }
    
    .auth-nav-link .nav-text {
        display: none;
    }
    
    .auth-header-divider {
        margin: 0 4px;
    }
    
    .auth-theme-toggle {
        width: 36px;
        height: 36px;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 24px 20px;
        border-radius: 20px;
    }
    
    .auth-header {
        padding: var(--spacing-md);
    }
    
    .auth-glow-1 {
        width: 300px;
        height: 300px;
    }
    
    .auth-glow-2 {
        width: 250px;
        height: 250px;
    }
}
