/**
 * 算立方 MAXCUBE - 注册/登录页面样式
 * v2: 嵌套卡片布局 — 浅灰蓝背景 + 白色主卡片 + 深蓝品牌区 + 白色表单区
 * 参考 SeaRates 嵌套风格优化
 */

/* ==================== CSS 变量（继承 platform_base 设计体系） ==================== */
:root {
    --auth-primary: #1890ff;
    --auth-primary-hover: #40a9ff;
    --auth-primary-active: #096dd9;
    --auth-primary-light: #e6f7ff;
    --auth-brand-blue: #00A0E9;

    --auth-text-primary: #1f2937;
    --auth-text-secondary: #6b7280;
    --auth-text-tertiary: #9ca3af;
    --auth-text-placeholder: #bfbfbf;

    --auth-border: #e5e7eb;
    --auth-border-hover: #d1d5db;
    --auth-border-focus: #1890ff;

    /* v2: 页面背景改为浅灰蓝 */
    --auth-bg-page: #eef2f7;
    --auth-bg-form: #ffffff;

    --auth-error: #ef4444;
    --auth-error-light: #fef2f2;
    --auth-success: #10b981;

    --auth-shadow-input: 0 0 0 3px rgba(24, 144, 255, 0.1);
    --auth-shadow-card: 0 25px 60px rgba(0, 0, 0, 0.08), 0 8px 24px rgba(0, 0, 0, 0.04);
    --auth-shadow-btn: 0 2px 8px rgba(24, 144, 255, 0.25);
    --auth-shadow-btn-hover: 0 4px 16px rgba(24, 144, 255, 0.35);

    --auth-radius: 8px;
    --auth-radius-lg: 12px;
    --auth-radius-card: 20px;

    --auth-transition: 0.2s ease;
    --auth-transition-slow: 0.3s ease;

    --auth-navbar-height: 64px;

    --auth-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
        'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue',
        Helvetica, Arial, sans-serif;
}

/* ==================== 基础重置 ==================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--auth-font);
    font-size: 14px;
    color: var(--auth-text-primary);
    background: var(--auth-bg-page);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: var(--auth-primary);
    text-decoration: none;
    transition: color var(--auth-transition);
}

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

ul,
ol {
    list-style: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

input,
textarea,
select {
    font-family: inherit;
    font-size: inherit;
}

/* ==================== 导航栏 ==================== */
.auth-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--auth-navbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    z-index: 100;
    background: transparent;
    transition: background var(--auth-transition-slow), box-shadow var(--auth-transition-slow);
}

.auth-navbar.solid {
    background: rgba(238, 242, 247, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.auth-nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}

.auth-nav-brand-logo {
    width: 38px;
    height: 38px;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.auth-nav-brand-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.auth-nav-brand-title {
    display: flex;
    flex-direction: column;
}

.auth-nav-brand-name {
    font-size: 17px;
    font-weight: 600;
    color: var(--auth-text-primary);
    line-height: 1.2;
}

.auth-nav-brand-sub {
    font-size: 11px;
    color: var(--auth-text-tertiary);
    line-height: 1.2;
}

.auth-nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.auth-language-selector {
    position: relative;
}

.auth-nav-lang-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border: 1px solid var(--auth-border);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    color: var(--auth-text-secondary);
    cursor: pointer;
    transition: all var(--auth-transition);
}

.auth-nav-lang-btn:hover {
    border-color: var(--auth-primary);
    color: var(--auth-primary);
}

.auth-nav-lang-btn.is-open {
    border-color: var(--auth-primary);
    color: var(--auth-primary);
}

.auth-nav-lang-globe {
    width: 16px;
    height: 16px;
}

.auth-nav-lang-chevron {
    width: 12px;
    height: 12px;
    transition: transform var(--auth-transition);
}

.auth-nav-lang-btn.is-open .auth-nav-lang-chevron {
    transform: rotate(180deg);
}

.auth-language-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 156px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px;
    background: #ffffff;
    border: 1px solid var(--auth-border);
    border-radius: 6px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
    z-index: 1200;
}

.auth-language-menu[hidden] {
    display: none;
}

.auth-language-option {
    width: 100%;
    min-height: 36px;
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--auth-text-primary);
    font-size: 13px;
    line-height: 1.35;
    text-align: left;
    cursor: pointer;
    transition: background-color var(--auth-transition), color var(--auth-transition);
}

.auth-language-option:hover,
.auth-language-option:focus-visible {
    outline: none;
    background: #f1f5f9;
    color: var(--auth-text-primary);
}

.auth-language-option.is-active,
.auth-language-option.is-active:hover,
.auth-language-option.is-active:focus-visible {
    background: #f1f5f9;
    color: var(--auth-primary);
    font-weight: 600;
}

.auth-nav-home-link {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--auth-text-secondary);
    padding: 5px 12px;
    border-radius: 6px;
    transition: all var(--auth-transition);
}

.auth-nav-home-link:hover {
    color: var(--auth-primary);
    background: var(--auth-primary-light);
}

.auth-nav-home-link svg {
    width: 16px;
    height: 16px;
}

/* ==================== 主体布局（v2: 居中卡片） ==================== */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: calc(var(--auth-navbar-height) + 24px) 24px 24px;
}

/* ==================== 主卡片容器（v2 核心改动） ==================== */
.auth-main-card {
    display: flex;
    width: 100%;
    max-width: 1100px;
    min-height: 640px;
    background: var(--auth-bg-form);
    border-radius: var(--auth-radius-card);
    box-shadow: var(--auth-shadow-card);
    padding: 24px;
    overflow: hidden;
    animation: cardFadeIn 0.5s ease;
}

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.99);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ==================== 左侧品牌展示区（v2: 深蓝渐变） ==================== */
.auth-visual {
    flex: 0 0 48%;
    max-width: 48%;
    background: linear-gradient(160deg, #0A2540 0%, #0d3b66 45%, #1474cc 85%, #1890ff 100%);
    /* background: linear-gradient(135deg, #0052D4 0%, #4364F7 100%); */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 48px 40px;
    position: relative;
    overflow: hidden;
    border-radius: 24px;
}

/* 精致的装饰光效 */
.auth-visual::before {
    content: '';
    position: absolute;
    top: -80px;
    right: -80px;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(24, 144, 255, 0.2) 0%, transparent 70%);
    pointer-events: none;
}

.auth-visual::after {
    content: '';
    position: absolute;
    bottom: -60px;
    left: -60px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 160, 233, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.auth-visual-content {
    max-width: 420px;
    width: 100%;
    position: relative;
    z-index: 1;
}

.auth-visual-slogan {
    margin-bottom: 8px;
}

/* v2: 徽章改为半透明白色 */
.auth-visual-slogan .slogan-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    margin-bottom: 20px;
    backdrop-filter: blur(4px);
}

.auth-visual-slogan .slogan-badge .badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4dd0e1;
    animation: pulseDot 2s ease infinite;
}

@keyframes pulseDot {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(0.8);
    }
}

/* v2: 标题改为白色 */
.auth-visual-slogan h2 {
    font-size: 28px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.35;
    margin-bottom: 4px;
}

.auth-visual-slogan h2 .highlight {
    color: #4dd0e1;
}

.auth-visual-slogan .subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.7;
    margin-top: 8px;
}

/* v2: 3D 渲染图 — 去掉白色背景卡片，透明悬浮 */
.auth-visual-image {
    margin: 28px 0;
    border-radius: var(--auth-radius-lg);
    overflow: hidden;
    box-shadow: none;
    background: transparent;
    padding: 0;
}

.auth-visual-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--auth-radius);
    /* 添加微微发光效果让3D图与深色背景更融合 */
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.3));
}

/* v2: 卖点列表 — 白色文字 */
.auth-visual-features {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-visual-features .feature-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.5;
}

.auth-visual-features .feature-check {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(77, 208, 225, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}

.auth-visual-features .feature-check svg {
    width: 12px;
    height: 12px;
    color: #4dd0e1;
}

/* ==================== 右侧表单区 ==================== */
.auth-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 48px;
    background: transparent;
    border-radius: 0;
}

.auth-form-container {
    width: 100%;
    max-width: 380px;
}

/* 表单头部 */
.auth-form-header {
    margin-bottom: 28px;
}

.auth-form-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--auth-text-primary);
    line-height: 1.3;
    margin-bottom: 6px;
}

.auth-form-header p {
    font-size: 14px;
    color: var(--auth-text-tertiary);
}

/* ==================== 表单元素 ==================== */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.hidden {
    display: none !important;
}

.auth-form.hidden {
    display: none;
}

/* 表单组 */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--auth-text-primary);
}

/* v2: 输入框 — 更紧凑 */
.auth-input-wrapper {
    position: relative;
}

.auth-input {
    width: 100%;
    height: 42px;
    padding: 0 14px;
    font-size: 14px;
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius);
    background: var(--auth-bg-form);
    color: var(--auth-text-primary);
    outline: none;
    transition: border-color var(--auth-transition), box-shadow var(--auth-transition);
}

.auth-input:hover {
    border-color: var(--auth-border-hover);
}

/* v2: focus 蓝色光晕增强 */
.auth-input:focus {
    border-color: var(--auth-border-focus);
    box-shadow: var(--auth-shadow-input);
}

.auth-input::placeholder {
    color: var(--auth-text-placeholder);
}

.auth-input.error {
    border-color: var(--auth-error);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.08);
}

.auth-input:disabled {
    background: #f9fafb;
    color: var(--auth-text-tertiary);
    cursor: not-allowed;
}

/* 验证码行 */
.auth-code-row {
    display: flex;
    gap: 10px;
}

.auth-code-row .auth-input {
    flex: 1;
}

.auth-send-code-btn {
    flex-shrink: 0;
    height: 42px;
    padding: 0 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--auth-primary);
    background: var(--auth-primary-light);
    border: 1px solid rgba(24, 144, 255, 0.2);
    border-radius: var(--auth-radius);
    cursor: pointer;
    transition: all var(--auth-transition);
    white-space: nowrap;
}

.auth-send-code-btn:hover:not(:disabled) {
    background: rgba(24, 144, 255, 0.12);
    border-color: rgba(24, 144, 255, 0.3);
}

.auth-send-code-btn:disabled {
    color: var(--auth-text-tertiary);
    background: #f9fafb;
    border-color: var(--auth-border);
    cursor: not-allowed;
}

/* 密码输入框（含眼睛图标） */
.auth-password-wrapper {
    position: relative;
}

.auth-password-wrapper .auth-input {
    padding-right: 42px;
}

.auth-password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: var(--auth-text-tertiary);
    cursor: pointer;
    transition: color var(--auth-transition);
    background: none;
    border: none;
    padding: 0;
}

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

.auth-password-toggle svg {
    width: 18px;
    height: 18px;
}

/* 错误提示 */
.form-error {
    font-size: 12px;
    color: var(--auth-error);
    display: none;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
}

.form-error.visible {
    display: flex;
}

.form-error svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* ==================== 复选框 ==================== */
.auth-checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.auth-checkbox {
    width: 16px;
    height: 16px;
    border: 1.5px solid var(--auth-border);
    border-radius: 4px;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    transition: all var(--auth-transition);
    position: relative;
    flex-shrink: 0;
    margin-top: 2px;
}

.auth-checkbox:checked {
    background: var(--auth-primary);
    border-color: var(--auth-primary);
}

.auth-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.auth-checkbox:hover {
    border-color: var(--auth-primary);
}

.auth-checkbox-label {
    font-size: 13px;
    color: var(--auth-text-secondary);
    line-height: 1.5;
    cursor: pointer;
}

.auth-checkbox-label a {
    color: var(--auth-primary);
    font-weight: 500;
}

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

/* 记住我 + 忘记密码行 */
.auth-remember-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.auth-remember-row .auth-checkbox-group {
    margin: 0;
}

.auth-forgot-link {
    font-size: 13px;
    color: var(--auth-primary);
    font-weight: 500;
    transition: color var(--auth-transition);
}

.auth-forgot-link:hover {
    color: var(--auth-primary-hover);
    text-decoration: underline;
}

/* ==================== 提交按钮 ==================== */
.auth-submit-btn {
    width: 100%;
    height: 44px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, var(--auth-primary) 0%, #3b82f6 100%);
    border: none;
    border-radius: var(--auth-radius);
    cursor: pointer;
    transition: all var(--auth-transition);
    box-shadow: var(--auth-shadow-btn);
    position: relative;
    overflow: hidden;
}

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

.auth-submit-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: var(--auth-shadow-btn);
}

.auth-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.auth-submit-btn.loading {
    pointer-events: none;
    opacity: 0.8;
}

.auth-submit-btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: authSpin 0.6s linear infinite;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
}

@keyframes authSpin {
    from {
        transform: translateY(-50%) rotate(0deg);
    }

    to {
        transform: translateY(-50%) rotate(360deg);
    }
}

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

.auth-switch a {
    color: var(--auth-primary);
    font-weight: 600;
    margin-left: 4px;
    transition: color var(--auth-transition);
}

.auth-switch a:hover {
    color: var(--auth-primary-hover);
    text-decoration: underline;
}

.auth-switch a svg {
    width: 14px;
    height: 14px;
    vertical-align: middle;
    margin-left: 2px;
}

/* ==================== 表单切换动画 ==================== */
.auth-form-wrapper {
    position: relative;
}

.auth-form {
    animation: authFadeIn 0.3s ease;
}

@keyframes authFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== 成功提示 ==================== */
.auth-success-toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: #fff;
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--auth-radius);
    padding: 12px 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    pointer-events: none;
    transition: all var(--auth-transition-slow);
    z-index: 1000;
    font-size: 14px;
    color: var(--auth-text-primary);
}

.auth-success-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.auth-success-toast .toast-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.auth-success-toast .toast-icon svg {
    width: 12px;
    height: 12px;
    color: var(--auth-success);
}

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

.password-strength .strength-bar {
    flex: 1;
    height: 3px;
    border-radius: 2px;
    background: #e5e7eb;
    transition: background var(--auth-transition);
}

.password-strength.weak .strength-bar:nth-child(1) {
    background: var(--auth-error);
}

.password-strength.medium .strength-bar:nth-child(1),
.password-strength.medium .strength-bar:nth-child(2) {
    background: #f59e0b;
}

.password-strength.strong .strength-bar:nth-child(1),
.password-strength.strong .strength-bar:nth-child(2),
.password-strength.strong .strength-bar:nth-child(3) {
    background: var(--auth-success);
}

.password-strength-text {
    font-size: 11px;
    color: var(--auth-text-tertiary);
    margin-top: 2px;
}

.password-strength.weak+.password-strength-text {
    color: var(--auth-error);
}

.password-strength.medium+.password-strength-text {
    color: #f59e0b;
}

.password-strength.strong+.password-strength-text {
    color: var(--auth-success);
}

/* ==================== 响应式：平板 ==================== */
@media (max-width: 1024px) {
    .auth-main-card {
        max-width: 960px;
        min-height: 580px;
        padding: 24px;
    }

    .auth-visual {
        flex: 0 0 44%;
        max-width: 44%;
        padding: 36px 32px;
        border-radius: 20px;
    }

    .auth-form-panel {
        padding: 36px 32px;
    }

    .auth-visual-slogan h2 {
        font-size: 24px;
    }

    .auth-visual-image {
        margin: 20px 0;
    }
}

/* ==================== 响应式：手机 ==================== */
@media (max-width: 768px) {
    .auth-page {
        padding: calc(var(--auth-navbar-height) + 16px) 16px 16px;
        align-items: flex-start;
    }

    .auth-main-card {
        flex-direction: column;
        min-height: auto;
        border-radius: var(--auth-radius-lg);
        padding: 16px;
    }

    .auth-visual {
        flex: none;
        max-width: 100%;
        padding: 28px 24px;
        border-radius: var(--auth-radius-lg);
    }

    /* 在手机端只显示精简版左侧 */
    .auth-visual-image {
        display: none;
    }

    .auth-visual-features {
        display: none;
    }

    .auth-visual-slogan h2 {
        font-size: 22px;
    }

    .auth-visual-slogan .subtitle {
        font-size: 13px;
    }

    .auth-form-panel {
        border-radius: 0;
        padding: 28px 24px;
    }

    .auth-form-container {
        max-width: 380px;
    }

    .auth-navbar {
        padding: 0 16px;
    }

    .auth-nav-brand-sub {
        display: none;
    }

    .auth-form-header h1 {
        font-size: 22px;
    }
}

/* ==================== 响应式：小手机 ==================== */
@media (max-width: 374px) {
    .auth-page {
        padding: calc(var(--auth-navbar-height) + 12px) 12px 12px;
    }

    .auth-form-panel {
        padding: 24px 16px;
    }

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

    .auth-submit-btn {
        height: 42px;
        font-size: 14px;
    }

    .auth-input {
        height: 40px;
    }

    .auth-send-code-btn {
        height: 40px;
        padding: 0 12px;
    }
}
