/* ======================================================================
   auth.css —— 登录/注册页（高仿 stock.quicktiny.cn/login 设计）
   设计令牌提取自参考站点的 .auth-* 规则，并按本项目品牌/功能扩展：
   - 左侧深色渐变品牌区（480px）
   - 右侧白色表单区（欢迎回来 + 账号密码 + 记住我/忘记密码 + 登录）
   - 保留首登改密弹窗；底部含隐私政策/免责声明与备案信息
   - 支持浅/深双主题（深主题仅作用于右侧表单区，左栏恒定深色）
   ====================================================================== */

:root {
    --auth-sidebar-width: 480px;
}

body.auth-page {
    margin: 0;
    background: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
    color: #1f2937;
}

/* ---------- 布局：左右分屏 ---------- */
.auth-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
    margin: 0;
    padding: 0;
    background-color: #fff;
    overflow: hidden;
    position: relative;
}

/* ---------- 左侧品牌区 ---------- */
.auth-sidebar {
    width: var(--auth-sidebar-width);
    flex-shrink: 0;
    position: relative;
    /* 智能量化主题背景图 + 深色渐变遮罩保证文字可读 */
    background-image:
        linear-gradient(135deg, rgba(0, 21, 41, 0.75) 0%, rgba(0, 58, 140, 0.6) 100%),
        url('/static/images/login_sidebar_bg.png');
    background-size: cover;
    background-position: center;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.auth-sidebar-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(circle at 10% 150px, rgba(255, 255, 255, 0.05) 0%, transparent 200px),
        radial-gradient(circle at 90% 80%, rgba(255, 255, 255, 0.05) 0%, transparent 200px);
    z-index: 0;
}

.auth-sidebar-content {
    position: relative;
    z-index: 1;
    padding: 60px;
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: flex-start;
    padding-top: 35vh;
}

.auth-brand {
    display: flex;
    align-items: center;
    margin-bottom: 60px;
}

.auth-logo-icon {
    margin-right: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    background: color-mix(in srgb, #fff 12%, transparent);
    backdrop-filter: blur(6px);
}

.auth-brand-text {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #fff;
}

.auth-slogan h2 {
    font-size: 40px;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 24px;
    color: #fff;
}

.auth-slogan p {
    font-size: 18px;
    line-height: 1.6;
    margin: 0;
    opacity: 0.8;
    color: #ffffffd9;
}

/* 装饰光斑（毛玻璃圆） */
.auth-decoration {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 300px;
    pointer-events: none;
    z-index: 0;
}
.decoration-item {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.02) 100%);
    backdrop-filter: blur(10px);
}
.decoration-item.item-1 {
    width: 300px;
    height: 300px;
    bottom: -100px;
    left: -100px;
}
.decoration-item.item-2 {
    width: 200px;
    height: 200px;
    top: 20%;
    right: -50px;
}

/* ---------- 右侧表单区 ---------- */
.auth-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: #fff;
    position: relative;
    padding: 40px;
}

.auth-content-wrapper {
    width: 100%;
    max-width: 420px;
}

.auth-content-header-mobile {
    display: none;
    position: absolute;
    top: 24px;
    left: 24px;
}
.auth-brand-mobile {
    display: flex;
    align-items: center;
}
.auth-brand-mobile .auth-logo-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
}
.auth-brand-mobile .auth-brand-text {
    font-size: 20px;
}

.auth-form-container {
    width: 100%;
    max-width: 400px;
    animation: authFadeIn 0.6s ease-out;
}

@keyframes authFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-header {
    margin-bottom: 40px;
    text-align: left;
}
.auth-title {
    margin: 0 0 12px !important;
    font-weight: 700 !important;
    color: #1f2937 !important;
    font-size: 32px !important;
}
.auth-subtitle {
    font-size: 16px;
    color: #6b7280 !important;
    margin: 0;
}

/* ---------- 表单字段 ---------- */
.auth-form .auth-field {
    margin-bottom: 20px;
}
.auth-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

.auth-input-wrap {
    display: flex;
    position: relative;
    align-items: center;
    height: 48px;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius);
    background-color: #fff;
    padding: 0 14px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.auth-input-wrap:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(24, 144, 255, 0.12);
}
.auth-input-icon {
    color: #9ca3af;
    margin-right: 10px;
    display: flex;
    align-items: center;
}
.auth-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    height: 100%;
    font-size: 15px;
    color: #1f2937;
    font-family: inherit;
}
.auth-input::placeholder {
    color: #9ca3af;
}

/* 记住我 / 忘记密码 */
.auth-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 4px 0 24px;
    font-size: 14px;
}
.auth-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #4b5563;
    cursor: pointer;
    user-select: none;
}
.auth-remember input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}
/* 注册页「同意条款」：多行文本，复选框顶部对齐 */
.auth-terms {
    align-items: flex-start;
    margin: 4px 0 24px;
    font-size: 13px;
    line-height: 1.6;
    color: #6b7280;
}
.auth-terms input {
    margin-top: 3px;
    flex-shrink: 0;
}
.auth-terms a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}
.auth-terms a:hover {
    text-decoration: underline;
}
/* 验证码输入框 + 发送按钮 横排 */
.auth-code-row {
    display: flex;
    gap: 12px;
    align-items: stretch;
}
.auth-code-row .auth-input-wrap {
    flex: 1 1 auto;
    min-width: 0;
}
.auth-send-code {
    flex: 0 0 auto;
    height: 48px;
    padding: 0 16px;
    border-radius: var(--radius);
    border: 1px solid var(--primary);
    background: #fff;
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}
.auth-send-code:hover:not(:disabled) {
    background: #f0f7ff;
}
.auth-send-code:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    border-color: #d9d9d9;
    color: #9ca3af;
    background: #f5f5f5;
}
.auth-forgot {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}
.auth-forgot:hover {
    text-decoration: underline;
}

/* ---------- 图形验证码（注册） ---------- */
.captcha-row {
    display: flex;
    gap: 12px;
    align-items: stretch;
}
.captcha-input-wrap {
    flex: 1 1 auto;
    min-width: 0;
}
/* 图片按钮：内嵌 SVG，点击刷新；与输入框等高对齐 */
.captcha-img-btn {
    flex: 0 0 auto;
    width: 120px;
    height: 48px;
    padding: 4px 6px;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius);
    background: #fff;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.captcha-img-btn:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(24, 144, 255, 0.12);
}
.captcha-img-btn svg {
    width: 100%;
    height: 100%;
}
.captcha-loading {
    font-size: 12px;
    color: #9ca3af;
}
[data-theme="dark"] .captcha-img-btn {
    background: var(--surface);
    border-color: #2d3748;
}
[data-theme="dark"] .captcha-loading {
    color: #64748b;
}

/* 用户名实时校验提示（失焦查重内联反馈） */
.auth-field-hint {
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.4;
    color: #6b7280;
    transition: color 0.2s ease;
}
.auth-field-hint.hint-ok { color: #1a7f37; }
.auth-field-hint.hint-err { color: #c0392b; }
.auth-field-hint.hint-checking { color: #9ca3af; }
[data-theme="dark"] .auth-field-hint { color: #94a3b8; }
[data-theme="dark"] .auth-field-hint.hint-ok { color: #3fb950; }
[data-theme="dark"] .auth-field-hint.hint-err { color: #f85149; }

/* 密码可见切换（眼睛图标，绝对定位在输入框右侧） */
.password-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    border-radius: 4px;
    transition: color 0.2s ease;
}
.password-toggle:hover { color: #6b7280; }
/* 默认显 icon-eye（密码隐藏态，提示「可点看」）；.showing 显 icon-eye-off（密码可见态） */
.password-toggle .icon-eye-off { display: none; }
.password-toggle.showing .icon-eye { display: none; }
.password-toggle.showing .icon-eye-off { display: inline-flex; }
/* 含切换按钮的输入框右侧留白，避免文字被图标遮挡 */
.auth-input-wrap:has(.password-toggle) .auth-input { padding-right: 38px; }
[data-theme="dark"] .password-toggle { color: #64748b; }
[data-theme="dark"] .password-toggle:hover { color: #94a3b8; }

/* ---------- 按钮 ---------- */
.auth-button {
    width: 100%;
    height: 48px;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 6px -1px rgba(24, 144, 255, 0.2), 0 2px 4px -1px rgba(24, 144, 255, 0.1);
    transition: background 0.2s ease, transform 0.1s ease;
}
.auth-button:hover {
    background: var(--primary-hover);
}
.auth-button:active {
    transform: translateY(1px);
}
.auth-button:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* 游客登录按钮已移除（2026-07-07） */

/* ---------- 分隔线 + 底部注册 ---------- */
.auth-divider {
    display: flex;
    align-items: center;
    color: #9ca3af;
    font-size: 13px;
    margin: 28px 0;
}
.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}
.auth-divider span {
    padding: 0 12px;
}

.auth-footer-links {
    margin-top: 8px;
    text-align: center;
    color: #9ca3af;
    font-size: 14px;
}
.auth-footer-links .links {
    display: flex;
    justify-content: center;
    gap: 6px;
}
.auth-footer-links .footer-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}
.auth-footer-links .footer-link:hover {
    text-decoration: underline;
}

/* 页面底部：隐私政策 / 免责声明 + 备案信息 */
.auth-page-footer {
    margin-top: 32px;
    text-align: center;
    font-size: 12px;
    color: #9ca3af;
}
.auth-footer-links-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}
.auth-footer-links-row a {
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s;
}
.auth-footer-links-row a:hover {
    color: var(--primary);
    text-decoration: underline;
}
.auth-footer-links-row .dot {
    color: #d1d5db;
}
.auth-copyright {
    line-height: 1.6;
    color: #9ca3af;
}

/* alert 在表单顶部留白 */
.auth-alert {
    margin-bottom: 20px;
}
.auth-alert .alert {
    margin: 0;
}

/* 主题切换按钮（右上角浮动，复用 style.css 的 .qt-theme-toggle 样式） */
.auth-theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 5;
}

/* ---------- 响应式：窄屏隐藏左栏，显示移动品牌头 ---------- */
@media (max-width: 860px) {
    .auth-sidebar {
        display: none;
    }
    .auth-content {
        padding: 24px;
        justify-content: flex-start;
    }
    .auth-content-header-mobile {
        display: flex;
        position: static;
        margin-bottom: 36px;
    }
    .auth-content-wrapper,
    .auth-form-container {
        max-width: 100%;
    }
    .auth-header {
        margin-bottom: 28px;
    }
    .auth-title {
        font-size: 26px !important;
    }
}

/* ---------- 深主题：仅右侧表单区适配 ---------- */
[data-theme="dark"] body.auth-page {
    background: var(--bg);
}
[data-theme="dark"] .auth-container {
    background-color: var(--bg);
}
[data-theme="dark"] .auth-content {
    background-color: var(--bg);
}
[data-theme="dark"] .auth-title {
    color: #e5e7eb !important;
}
[data-theme="dark"] .auth-subtitle {
    color: #9ca3af !important;
}
[data-theme="dark"] .auth-label {
    color: #cbd5e1;
}
[data-theme="dark"] .auth-input-wrap {
    background-color: var(--surface);
    border-color: #2d3748;
}
[data-theme="dark"] .auth-input {
    color: #e5e7eb;
}
[data-theme="dark"] .auth-remember {
    color: #cbd5e1;
}
[data-theme="dark"] .auth-terms {
    color: #94a3b8;
}
[data-theme="dark"] .auth-send-code {
    background: var(--surface);
    border-color: var(--primary-hover);
    color: var(--primary-hover);
}
[data-theme="dark"] .auth-send-code:hover:not(:disabled) {
    background: #222b35;
}
[data-theme="dark"] .auth-send-code:disabled {
    background: var(--surface);
    border-color: #2d3748;
    color: #64748b;
}
[data-theme="dark"] .auth-divider::before,
[data-theme="dark"] .auth-divider::after {
    background: #2d3748;
}
[data-theme="dark"] .auth-button-ghost {
    background: var(--surface);
    border-color: #2d3748;
    color: var(--primary-hover);
}
[data-theme="dark"] .auth-button-ghost:hover {
    background: #222b35;
    border-color: var(--primary);
}
[data-theme="dark"] .auth-footer-links-row a {
    color: #9ca3af;
}
[data-theme="dark"] .auth-footer-links-row a:hover {
    color: var(--primary-hover);
}
[data-theme="dark"] .auth-footer-links-row .dot {
    color: #374151;
}
[data-theme="dark"] .auth-copyright {
    color: #6b7280;
}
