/* ══════════════════════════════════════════════════════════════
   auth-modal.css — 全站公共登录 / 注册弹窗样式
   白底 · 红黑品牌配色 (与首页 index.html 风格一致)
   ══════════════════════════════════════════════════════════════ */

/* ── 弹窗容器 (默认隐藏) ── */
#site-auth:empty { display: none; }
.auth-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
body.auth-modal-open .auth-modal { display: flex; }

/* ── 遮罩 ── */
.auth-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(9, 10, 15, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* ── 面板卡片 ── */
.auth-modal-panel {
    position: relative;
    z-index: 1;
    display: flex;
    width: min(94vw, 860px);
    max-height: min(92vh, 660px);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(255,255,255,0.08);
}

/* ══════════ 左侧品牌区 ══════════ */
.auth-modal-brand {
    position: relative;
    width: 38%;
    flex-shrink: 0;
    background: #090a0f;
    padding: 40px 32px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
}
.auth-modal-brand__mesh {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.auth-modal-brand__blob {
    position: absolute;
    border-radius: 50%;
}
.auth-modal-brand__blob--1 {
    width: 220px; height: 220px;
    background: rgba(220, 38, 38, 0.28);
    filter: blur(70px);
    top: -50px; right: -50px;
}
.auth-modal-brand__blob--2 {
    width: 160px; height: 160px;
    background: rgba(220, 38, 38, 0.15);
    filter: blur(60px);
    bottom: 10px; left: -40px;
}
.auth-modal-brand__blob--3 {
    width: 130px; height: 130px;
    background: rgba(220, 38, 38, 0.08);
    filter: blur(50px);
    top: 45%; left: 45%;
    transform: translate(-50%, -50%);
}
.auth-modal-brand__inner { position: relative; z-index: 1; }

.auth-brand-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
}
.auth-brand-logo-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    background: #dc2626;
    border-radius: 10px;
    flex-shrink: 0;
}
.auth-brand-logo-mark img { width: 22px; height: 22px; }
.auth-brand-name {
    font-size: 18px;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: -0.02em;
}
.auth-brand-tagline {
    font-size: 20px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.025em;
    line-height: 1.35;
    margin-bottom: 24px;
}
.auth-brand-features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.auth-brand-feature {
    display: flex;
    align-items: center;
    gap: 10px;
}
.auth-brand-feature__ico {
    width: 28px; height: 28px;
    background: rgba(220, 38, 38, 0.15);
    border: 1px solid rgba(220, 38, 38, 0.3);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #f87171;
}
.auth-brand-feature__ico svg,
.auth-brand-feature__ico [data-lucide] { width: 14px; height: 14px; }
.auth-brand-feature__txt {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.4;
}

/* ══════════ 右侧表单区 ══════════ */
.auth-modal-form-side {
    flex: 1;
    background: #ffffff;
    padding: 36px 36px 32px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-y: auto;
}

/* mini logo (移动端显示) */
.auth-modal-brand-mini {
    display: none;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}
.auth-brand-logo-mark--sm {
    width: 28px; height: 28px;
    background: #090a0f;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.auth-brand-logo-mark--sm img { width: 18px; height: 18px; }
.auth-brand-name--sm {
    font-size: 14px;
    font-weight: 900;
    color: #090a0f;
}

/* 关闭按钮 */
.auth-modal-close {
    position: absolute;
    top: 14px; right: 14px;
    width: 32px; height: 32px;
    background: #f1f5f9;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    transition: all 0.2s;
    flex-shrink: 0;
}
.auth-modal-close:hover { background: #fef2f2; color: #dc2626; }
.auth-modal-close svg,
.auth-modal-close [data-lucide] { width: 16px; height: 16px; }

/* 标题区 */
.auth-modal-heading { margin-bottom: 22px; }
.auth-modal-kicker {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #dc2626;
    margin-bottom: 5px;
}
.auth-modal-kicker svg,
.auth-modal-kicker [data-lucide] { width: 12px; height: 12px; }
.auth-modal-title {
    font-size: 22px;
    font-weight: 900;
    color: #090a0f;
    letter-spacing: -0.03em;
}

/* ── 表单窗格 ── */
.auth-pane { display: none; }
.auth-pane.active { display: block; }

/* 表单字段 */
.auth-field { margin-bottom: 14px; }
.auth-field label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 6px;
}
.auth-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.auth-input-wrap .field-icon {
    position: absolute;
    left: 12px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    pointer-events: none;
    z-index: 1;
}
.auth-input-wrap .field-icon svg,
.auth-input-wrap .field-icon [data-lucide] { width: 15px; height: 15px; }
.auth-input-wrap input {
    width: 100%;
    padding: 10px 38px 10px 38px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 13px;
    color: #090a0f;
    background: #ffffff;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
    -webkit-appearance: none;
}
.auth-input-wrap input:focus {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}
.auth-input-wrap input::placeholder { color: #cbd5e1; }

/* 验证码行 */
.auth-code-row { display: flex; gap: 8px; align-items: flex-end; }
.auth-code-input { flex: 1; }
.auth-code-input input { padding-left: 14px; }
.auth-send-code {
    white-space: nowrap;
    padding: 10px 14px;
    border: 1.5px solid #e2e8f0;
    background: #ffffff;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    color: #090a0f;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    flex-shrink: 0;
    height: 40px;
}
.auth-send-code:hover { border-color: #dc2626; color: #dc2626; }
.auth-send-code:disabled { opacity: 0.45; cursor: not-allowed; }

/* 提交按钮 */
.btn-primary.btn-gold,
.auth-submit {
    width: 100%;
    padding: 11px 20px;
    background: #090a0f;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    margin-top: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: 0.01em;
}
.btn-primary.btn-gold:hover,
.auth-submit:hover {
    background: #dc2626;
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.25);
    transform: translateY(-1px);
}

/* 消息提示 */
.auth-msg {
    font-size: 12px;
    color: #dc2626;
    margin-top: 8px;
    min-height: 16px;
    line-height: 1.5;
}

/* 标签页 */
.auth-tabs {
    display: flex;
    gap: 4px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 14px;
}
.auth-tab {
    flex: 1;
    padding: 7px 12px;
    border: none;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.auth-tab.active {
    background: #ffffff;
    color: #090a0f;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}
.auth-login-method-panel { display: none; }
.auth-login-method-panel:not([hidden]) { display: block; }

/* 辅助行 */
.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    gap: 8px;
}
.auth-check {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    line-height: 1.5;
}
.auth-check input[type=checkbox] {
    width: 14px; height: 14px;
    margin-top: 2px;
    accent-color: #dc2626;
    cursor: pointer;
    flex-shrink: 0;
}
.auth-link {
    background: none;
    border: none;
    font-size: 12px;
    font-weight: 700;
    color: #dc2626;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
    text-decoration: none;
}
.auth-link:hover { text-decoration: underline; }
.auth-switch {
    text-align: center;
    margin-top: 12px;
    font-size: 12px;
    color: #64748b;
}
.auth-reset-lead {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 18px;
    line-height: 1.6;
}

/* 密码显隐按钮 */
.auth-toggle-pw {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    display: flex;
    align-items: center;
    padding: 4px;
    z-index: 1;
}
.auth-toggle-pw:hover { color: #dc2626; }
.auth-toggle-pw svg,
.auth-toggle-pw [data-lucide] { width: 15px; height: 15px; }
.auth-toggle-pw .icon-eye { display: none; }
.auth-toggle-pw .icon-eye-off { display: block; }
.auth-toggle-pw.is-revealed .icon-eye { display: block; }
.auth-toggle-pw.is-revealed .icon-eye-off { display: none; }

/* ── Toast 通知 ── */
.maclogin-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    background: #090a0f;
    color: #ffffff;
    padding: 11px 22px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    z-index: 99999;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
}
.maclogin-toast--error { background: #dc2626; }
.maclogin-toast--ok { background: #16a34a; }
[hidden].maclogin-toast { display: none; }

/* ── 响应式 ── */
@media (max-width: 640px) {
    .auth-modal-panel {
        flex-direction: column;
        max-height: 96vh;
        width: 96vw;
        border-radius: 20px;
    }
    .auth-modal-brand { display: none; }
    .auth-modal-brand-mini { display: flex; }
    .auth-modal-form-side { padding: 28px 22px 24px; }
    .auth-modal-title { font-size: 20px; }
}
