/**
 * NISHOW 认证页面样式
 * 登录、注册、忘记密码等页面
 * 基于 common.css 的变量系统
 */

/* ========== 主题变量 ========== */
:root {
    /* 暗色主题（默认） */
    --bg-primary: #131314;
    --bg-secondary: #1e1f20;
    --bg-tertiary: #282a2c;
    --bg-hover: #3c4043;
    --text-primary: #e3e3e3;
    --text-secondary: #9aa0a6;
    --text-tertiary: #6e7681;
    --border-color: #3c4043;
    --accent-primary: #a8c7fa;
    --accent-secondary: #7cacf8;
    --accent-gradient: linear-gradient(135deg, #a8c7fa 0%, #c4a7e7 50%, #f2a7c3 100%);
    --danger-color: #f28b82;
    --warning-color: #fdd663;
    --success-color: #81c995;
    --shadow-color: rgba(0, 0, 0, 0.3);
}

[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #f1f3f4;
    --bg-hover: #e8eaed;
    --text-primary: #202124;
    --text-secondary: #5f6368;
    --text-tertiary: #9aa0a6;
    --border-color: #dadce0;
    --accent-primary: #1a73e8;
    --accent-secondary: #4285f4;
    --danger-color: #d93025;
    --warning-color: #f9ab00;
    --success-color: #188038;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

/* ========== 基础样式 ========== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body.auth-page {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ========== 顶部导航 ========== */
.auth-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
}

.brand-logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
}

.brand-name {
    font-size: 18px;
    font-weight: 600;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.btn-theme {
    width: 40px;
    height: 40px;
    border: none;
    background-color: transparent;
    color: var(--text-secondary);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s;
}

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

/* ========== 主容器 ========== */
.auth-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

/* ========== 认证卡片 ========== */
.auth-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
}

.auth-title {
    text-align: center;
    margin-bottom: 32px;
}

.auth-title h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.auth-title p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ========== 错误提示 ========== */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.alert-danger {
    background-color: rgba(242, 139, 130, 0.15);
    color: var(--danger-color);
    border: 1px solid rgba(242, 139, 130, 0.3);
}

.alert-success {
    background-color: rgba(129, 201, 149, 0.15);
    color: var(--success-color);
    border: 1px solid rgba(129, 201, 149, 0.3);
}

.alert i {
    font-size: 18px;
}

/* ========== 忘记密码页面 ========== */
.auth-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 12px;
    background-color: var(--bg-tertiary);
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.auth-info i {
    color: var(--accent-primary);
    flex-shrink: 0;
}

.success-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: var(--accent-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.success-icon i {
    font-size: 32px;
    color: #000;
}

[data-theme="light"] .success-icon i {
    color: #fff;
}

.email-tips {
    background-color: var(--bg-tertiary);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}

.email-tips h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.email-tips ol {
    margin: 0;
    padding-left: 20px;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.8;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-hover);
}

.error-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background-color: rgba(242, 139, 130, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.error-icon i {
    font-size: 32px;
    color: var(--danger-color);
}

.auth-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-actions .btn-submit {
    text-align: center;
    text-decoration: none;
}

/* ========== OAuth 按钮 ========== */
.oauth-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.btn-oauth {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 12px 20px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-oauth:hover {
    background-color: var(--bg-hover);
    border-color: var(--text-tertiary);
}

.btn-oauth svg {
    flex-shrink: 0;
}

.btn-oauth i {
    font-size: 20px;
}

/* ========== 分隔线 ========== */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
    color: var(--text-tertiary);
    font-size: 13px;
}

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

.auth-divider span {
    padding: 0 16px;
}

/* ========== 表单样式 ========== */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group label small {
    font-weight: 400;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
    transition: all 0.2s;
}

.form-control:focus {
    border-color: var(--accent-primary);
    background-color: var(--bg-secondary);
}

.form-control::placeholder {
    color: var(--text-tertiary);
}

/* ========== 密码输入框 ========== */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper .form-control {
    padding-right: 44px;
}

.btn-toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

/* ========== 表单行（记住我 + 忘记密码） ========== */
.form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-primary);
    flex-shrink: 0;
    margin-top: 2px;
}

.checkbox-label span {
    line-height: 1.5;
}

.checkbox-label a {
    color: var(--accent-primary);
    text-decoration: none;
}

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

.link-forgot {
    font-size: 14px;
    color: var(--accent-primary);
    text-decoration: none;
}

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

/* ========== 提交按钮 ========== */
.btn-submit {
    width: 100%;
    padding: 14px 24px;
    background: var(--accent-gradient);
    color: #000;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

[data-theme="light"] .btn-submit {
    color: #fff;
}

.btn-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--shadow-color);
}

.btn-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-loading {
    display: flex;
    align-items: center;
    gap: 8px;
}

.spin {
    animation: spin 1s linear infinite;
}

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

/* ========== 切换链接 ========== */
.auth-switch {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-secondary);
}

.auth-switch a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
}

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

/* ========== 底部链接 ========== */
.auth-footer {
    margin-top: 32px;
    text-align: center;
    font-size: 13px;
    color: var(--text-tertiary);
}

.auth-footer a {
    color: var(--text-secondary);
    text-decoration: none;
}

.auth-footer a:hover {
    color: var(--text-primary);
}

.auth-footer .divider {
    margin: 0 12px;
    color: var(--border-color);
}

/* ========== 响应式 ========== */
@media (max-width: 480px) {
    .auth-header {
        padding: 12px 16px;
    }

    .auth-container {
        padding: 24px 16px;
    }

    .auth-card {
        padding: 24px;
    }

    .auth-title h1 {
        font-size: 20px;
    }

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