/**
 * 认证页面通用样式
 * 适用于注册、忘记密码等认证相关页面
 * 使用 .auth- 前缀统一命名
 */

/* ==================== 页面布局 ==================== */
.auth-page {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    min-height: calc(100vh - 64px);
    padding: 40px 0;
}

.auth-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.auth-container {
    max-width: 620px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==================== 卡片样式 ==================== */
.auth-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    margin-bottom: 30px;
}

.auth-card-header {
    background: #f8fafc;
    padding: 24px;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
}

.auth-card-header h2 {
    color: #2d3748;
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px 0;
    letter-spacing: -0.5px;
}

.auth-card-header p {
    color: #718096;
    font-size: 16px;
    margin: 0;
    font-weight: 500;
}

.auth-card-header a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.auth-card-header a:hover {
    color: #5a67d8;
    text-decoration: none;
}

.auth-card-body {
    padding: 30px;
}

/* ==================== 表单样式 ==================== */
.modern-form-group {
    margin-bottom: 24px;
}

.modern-form-group label {
    display: block;
    color: #374151;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: -0.025em;
}

.modern-form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    color: #374151;
    background: #ffffff;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.modern-form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: #ffffff;
}

.modern-form-control:hover {
    border-color: #d1d5db;
}

.form-hint {
    color: #6b7280;
    font-size: 12px;
    margin-top: 4px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.form-hint.checking {
    color: #f59e0b;
}

.form-hint.success {
    color: #10b981;
}

.form-hint.error {
    color: #ef4444;
}

.form-hint i {
    margin-right: 4px;
}

/* 选择框样式 */
select.modern-form-control {
    height: 48px;
    background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 5"><path fill="%23666" d="M2 0L0 2h4z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

/* ==================== 滑动验证器 ==================== */
.slide-verification {
    width: 100%;
    height: 48px;
    background: linear-gradient(90deg, #f8fafc 0%, #f1f5f9 100%);
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    margin-bottom: 15px;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
    /* 移动端触摸优化 */
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.slide-verification:hover {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.slide-verification.completed {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.05) 0%, rgba(5, 150, 105, 0.05) 100%);
    border-color: #10b981;
    cursor: default;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.slide-track {
    width: 100%;
    height: 100%;
    background: transparent;
    position: relative;
}

.slide-thumb {
    width: 52px;
    height: 44px;
    background: linear-gradient(135deg, #667eea 0%, #5a67d8 100%);
    border: 2px solid #5a67d8;
    border-radius: 6px;
    position: absolute;
    top: 1px;
    left: 1px;
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
    /* 移动端触摸优化 */
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

.slide-thumb:active {
    cursor: grabbing;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.slide-thumb.completed {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-color: #059669;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
}

.slide-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
    pointer-events: none;
    transition: all 0.3s ease;
}

.slide-text.completed {
    color: #065f46;
    font-weight: 600;
}

.slide-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.1) 0%, rgba(102, 126, 234, 0.05) 100%);
    border-radius: 6px 0 0 6px;
    transition: width 0.1s ease;
}

.slide-progress.completed {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0.08) 100%);
}

/* 邮箱输入组 */
.email-input-group {
    width: 100%;
}

.email-input-group .modern-form-control {
    margin-bottom: 15px;
}

/* ==================== 提交按钮 ==================== */
.modern-submit-btn {
    border: none;
    padding: 14px 32px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    margin-top: 10px;
}

.modern-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
    color: white;
}

.modern-submit-btn:active {
    transform: translateY(0);
}

/* ==================== 消息提示 - 浮动 Toast 风格 ==================== */
.message-area {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1050;
    width: auto;
    max-width: 90%;
    min-width: 300px;
}

#message:empty {
    display: none;
}

#message .alert {
    border-radius: 10px;
    padding: 14px 24px;
    font-size: 14px;
    margin-bottom: 0;
    border: none;
    font-weight: 500;
    line-height: 1.5;
    animation: slideDown 0.4s ease-out;
    word-break: break-word;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    text-align: center;
}

/* 从顶部滑入动画 */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#message .alert-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
}

#message .alert-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #ffffff;
}

#message .alert-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #ffffff;
}

/* ==================== 底部说明区域 ==================== */
.auth-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.auth-footer span {
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
}

.auth-footer a {
    color: #667eea;
    font-weight: 600;
    margin-left: 5px;
    text-decoration: none;
    transition: color 0.3s ease;
}

.auth-footer a:hover {
    color: #5a67d8;
    text-decoration: none;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 768px) {
    .auth-page {
        padding: 20px 0;
    }
    
    .auth-container {
        max-width: 100%;
        padding: 0 15px;
    }
    
    .auth-card-header {
        padding: 20px;
    }
    
    .auth-card-header h2 {
        font-size: 24px;
    }
    
    .auth-card-header p {
        font-size: 14px;
    }
    
    .auth-card-body {
        padding: 25px 20px;
    }
    
    .slide-verification {
        height: 52px;
        /* 移动端增加高度，提升触摸体验 */
        margin-bottom: 20px;
    }
    
    .slide-thumb {
        width: 56px;
        height: 48px;
        font-size: 18px;
        /* 增大触摸区域 */
    }
    
    .slide-thumb:active {
        transform: scale(1.05);
    }
    
    /* 移动端表单控件优化 */
    .modern-form-control {
        font-size: 16px; /* 防止iOS缩放 */
        padding: 14px 16px;
    }
}

@media (max-width: 480px) {
    .auth-card-header h2 {
        font-size: 22px;
    }
    
    .auth-card-header p {
        font-size: 13px;
    }
}
