/**
 * 公共认证页面样式
 * 登录、注册、找回密码等页面共用
 * 使用当前模板配色
 */

/* ========== 认证页面布局 ========== */
body.auth-page {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    max-width: 480px;
    width: 100%;
}

.auth-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

.auth-header h2 {
    margin: 0;
    font-weight: 700;
    font-size: 1.8rem;
}

.auth-header p {
    margin: 10px 0 0;
    opacity: 0.9;
    font-size: 0.95rem;
}

.auth-body {
    padding: 40px 30px;
}

.auth-footer {
    text-align: center;
    padding: 20px 30px 30px;
    color: #666;
    border-top: 1px solid #e9ecef;
}

.auth-footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

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

/* ========== 表单元素 ========== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    display: block;
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.form-control.is-invalid {
    border-color: #dc3545;
}

.form-control.is-valid {
    border-color: #198754;
}

/* ========== Tab 切换 ========== */
.form-tabs {
    display: flex;
    margin-bottom: 30px;
    border-radius: 10px;
    overflow: hidden;
    background: #f0f0f0;
}

.form-tab {
    flex: 1;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    font-weight: 600;
    color: #666;
    transition: all 0.3s;
}

.form-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.form-tab:hover:not(.active) {
    background: #e0e0e0;
}

/* ========== 按钮 ========== */
.btn-auth {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-auth:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.btn-send-code {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-send-code:hover {
    background: #764ba2;
}

.btn-send-code:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* ========== 输入组 ========== */
.input-group-sms {
    display: flex;
    gap: 10px;
}

.input-group-sms .form-control {
    flex: 1;
}

.captcha-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.captcha-group .form-control {
    flex: 1;
}

.captcha-img {
    height: 48px;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid #e0e0e0;
}

/* ========== 表单复选框 ========== */
.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-check-input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.form-check-label {
    color: #666;
    cursor: pointer;
}

.form-check-label a {
    color: #667eea;
    text-decoration: none;
}

.form-check-label a:hover {
    text-decoration: underline;
}

/* ========== 验证反馈 ========== */
.invalid-feedback {
    color: #dc3545;
    font-size: 0.85rem;
    margin-top: 5px;
}

.valid-feedback {
    color: #198754;
    font-size: 0.85rem;
    margin-top: 5px;
}

/* ========== 验证图标 ========== */
.check-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
}

.check-icon.valid {
    color: #198754;
}

.check-icon.invalid {
    color: #dc3545;
}

.input-wrapper {
    position: relative;
}

.input-wrapper .form-control {
    padding-right: 40px;
}

/* ========== 表单显示/隐藏 ========== */
.password-form, .sms-form {
    display: none;
}

.password-form.active, .sms-form.active {
    display: block;
}

/* ========== 提示框 ========== */
.alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.alert-danger {
    background: #fee;
    color: #c33;
    border: 1px solid #fcc;
}

.alert-success {
    background: #efe;
    color: #3c3;
    border: 1px solid #cfc;
}

/* ========== 返回链接 ========== */
.back-home {
    position: absolute;
    top: 20px;
    left: 20px;
    color: white;
    text-decoration: none;
    font-weight: 600;
    opacity: 0.9;
    transition: opacity 0.3s;
}

.back-home:hover {
    opacity: 1;
    color: white;
}

/* ========== 步骤指示器 ========== */
.step-indicator {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.step-item {
    display: flex;
    align-items: center;
}

.step-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.step-number.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.step-number.done {
    background: #10b981;
    color: white;
}

.step-line {
    width: 50px;
    height: 2px;
    background: #e0e0e0;
    margin: 0 10px;
}

.step-line.done {
    background: #10b981;
}

/* ========== Toast 提示 ========== */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: rgba(50, 50, 50, 0.95);
    color: white;
    padding: 14px 24px;
    border-radius: 10px;
    font-size: 0.95rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastIn 0.3s ease-out;
    backdrop-filter: blur(10px);
}

.toast.toast-out {
    animation: toastOut 0.3s ease-in forwards;
}

.toast.toast-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.toast.toast-error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.toast.toast-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.toast.toast-info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-20px); }
}

/* ========== 内容页面 (隐私政策/用户协议) ========== */
body.content-page {
    background: #f5f5f5;
    padding: 40px 20px;
}

.content-wrapper {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 40px;
}

.content-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #667eea;
}

.content-header h1 {
    color: #333;
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.content-body {
    line-height: 1.8;
    color: #555;
    font-size: 1rem;
}

.content-body h2, .content-body h3, .content-body h4 {
    color: #333;
    margin-top: 20px;
    margin-bottom: 10px;
}

.content-body p {
    margin-bottom: 15px;
}

.back-link {
    display: inline-block;
    margin-top: 30px;
    color: #667eea;
    text-decoration: none;
}

.back-link:hover {
    text-decoration: underline;
}
