/* ============================================================
   JennyEngine X — 登录 / 注册 / 找回密码 美化样式
   仅作用于带 .auth-page 的页面，不与全局 style.css 冲突
   ============================================================ */

/* 主题色变量由 theme.css 统一提供（按 html[data-theme] 切换） */

body.auth-page {
    background: var(--je-bg);
    color: var(--je-ink);
}

/* 双栏布局：左侧品牌区，右侧表单区 */
.auth-split {
    display: flex;
    min-height: 100vh;
}

/* ---------- 左侧品牌区 ---------- */
.auth-hero {
    flex: 1.3 1 0;
    background: var(--je-hero-grad);
    color: var(--je-hero-fg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 64px;
    position: relative;
    overflow: hidden;
}
.auth-hero::after {
    content: "";
    position: absolute;
    width: 380px;
    height: 380px;
    right: -120px;
    bottom: -120px;
    background: var(--je-hero-deco);
    border-radius: 50%;
}
.auth-hero::before {
    content: "";
    position: absolute;
    width: 240px;
    height: 240px;
    left: -80px;
    top: -80px;
    background: var(--je-hero-deco);
    border-radius: 50%;
}
.auth-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
    position: relative;
    z-index: 1;
}
.auth-brand img {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--je-hero-overlay-bg);
    padding: 6px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}
.auth-brand h1 {
    margin: 0;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: 0.5px;
}
.auth-tagline {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.5;
    margin: 0 0 14px;
    position: relative;
    z-index: 1;
}
.auth-quote {
    font-size: 14px;
    opacity: 0.85;
    line-height: 1.7;
    max-width: 600px;
    position: relative;
    z-index: 1;
}
/* 登录页「一言」：结构改为 #hitokoto（左侧文本 + 右侧换一条图标）
   品牌区可能是深色（多数主题）也可能是浅色（白色主题），
   统一用 --je-hero-fg 取「与品牌区背景相反」的前景色，保证始终可读。 */
.auth-quote #hitokoto {
    color: var(--je-hero-fg);
}
.auth-quote .hitokoto-text {
    color: var(--je-hero-fg);
}
.auth-quote .hitokoto-refresh {
    color: var(--je-hero-fg);
}
.auth-quote .hitokoto-refresh:hover {
    background: rgba(127, 127, 127, 0.28);
}
/* 「已复制」提示：用固定的深色小标签，深浅品牌区上都清晰 */
.auth-quote .hitokoto-copied {
    background: #111827;
    color: #ffffff;
}
.auth-about {
    margin-top: 36px;
    max-width: 600px;
    padding: 18px 20px;
    background: var(--je-hero-overlay-bg);
    border: 1px solid var(--je-hero-overlay-border);
    border-radius: 14px;
    backdrop-filter: blur(4px);
    position: relative;
    z-index: 1;
}
.auth-about h2 {
    margin: 0 0 8px;
    font-size: 16px;
    cursor: pointer;
}
.auth-about p {
    margin: 8px 0 0;
    font-size: 13.5px;
    line-height: 1.7;
    opacity: 0.92;
}
.auth-about hr {
    border: none;
    border-top: 1px solid var(--je-hero-overlay-border);
    margin: 10px 0;
}

/* ---------- 右侧表单区 ---------- */
.auth-panel {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
}
.login-card {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: 20px;
    padding: 38px 36px 34px;
    box-shadow: var(--je-shadow);
}
.login-card h2 {
    margin: 0 0 4px;
    font-size: 24px;
    font-weight: 800;
    color: var(--je-ink);
}
.login-card .subtitle {
    margin: 0 0 24px;
    color: var(--je-muted);
    font-size: 14px;
}

/* 表单字段 */
.auth-form { margin: 0; }
.auth-field {
    margin-bottom: 16px;
}
.auth-field > label {
    display: block;
    margin-bottom: 7px;
    font-size: 13.5px;
    font-weight: 700;
    color: #374151;
}
.auth-input {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--je-border);
    border-radius: 11px;
    font-size: 15px;
    color: var(--je-ink);
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.auth-input::placeholder {
    color: #9ca3af;
}
.auth-input:focus {
    outline: none;
    border-color: var(--je-primary);
    box-shadow: 0 0 0 4px var(--je-focus-ring);
}

/* 行内布局：密码框下的「忘记密码」 */
.auth-row-between {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}

/* 主按钮 */
.auth-btn {
    width: 100%;
    padding: 13px 16px;
    border: none;
    border-radius: 11px;
    background: var(--je-grad);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 6px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
    transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.auth-btn:hover {
    filter: brightness(1.15);
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
}
.auth-btn:active {
    transform: translateY(0);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.28);
}

/* 次按钮（描边） */
.auth-btn-secondary {
    padding: 11px 16px;
    border: 1.5px solid var(--je-primary);
    background: #fff;
    color: var(--je-primary);
    border-radius: 11px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s ease, color 0.2s ease;
}
.auth-btn-secondary:hover {
    background: var(--je-primary);
    color: #fff;
}
.auth-btn-secondary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* 链接 */
.auth-link {
    color: var(--je-primary);
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
}
.auth-link:hover {
    text-decoration: underline;
}
.auth-switch {
    text-align: center;
    margin: 18px 0 0;
    color: var(--je-muted);
    font-size: 13.5px;
}

/* 登录页底部合并的备案信息（替代原全宽 footer，置于右栏底部） */
.auth-footnote {
    margin-top: 18px;
    width: 100%;
    max-width: 400px;
    color: var(--je-muted);
    font-size: 12px;
    text-align: center;
    line-height: 1.7;
}
.auth-footnote a {
    color: var(--je-muted);
    text-decoration: none;
}
.auth-footnote a:hover {
    text-decoration: underline;
}
.auth-footnote img {
    vertical-align: middle;
    margin: 0 2px;
}

/* 提示信息 */
.auth-alert {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    color: #374151;
    padding: 10px 14px;
    border-radius: 11px;
    font-size: 13.5px;
    margin-bottom: 16px;
}
.auth-error {
    color: #dc2626;
    font-size: 13px;
    min-height: 18px;
    margin: 4px 0 10px;
}

/* ---------- 弹框 ---------- */
.popup-overlay {
    background: var(--je-overlay) !important;
}
.popup {
    padding: 30px 30px 30px;
    max-width: 420px;
}
.popup-title {
    margin: 0 0 18px;
    color: var(--je-primary-700);
    font-size: 20px;
    font-weight: 800;
    text-align: left;
}
.popup-title::after {
    content: "";
    display: block;
    width: 46px;
    height: 3px;
    margin-top: 10px;
    border-radius: 3px;
    background: var(--je-grad);
}
.popup-form { margin: 0; }
.popup-field {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}
.popup-field > label {
    flex: 0 0 56px;
    text-align: right;
    font-weight: 700;
    color: #374151;
    font-size: 14px;
}
.popup-field .auth-input {
    flex: 1;
}
.popup-field--code .code-row {
    flex: 1;
    display: flex;
    gap: 8px;
}
.popup-field--code .code-row .auth-input {
    flex: 1;
}
.popup-field--code .auth-btn-secondary {
    flex: 0 0 auto;
    padding: 0 14px;
    font-size: 13px;
}
.popup-desc {
    color: var(--je-muted);
    font-size: 13.5px;
    line-height: 1.6;
    margin: 0 0 16px;
}
.popup-contact {
    color: var(--je-muted);
    font-size: 12.5px;
    text-align: left;
    margin: 6px 0 0;
}

/* ---------- 找回密码落地页 ---------- */
.reset-card {
    width: 100%;
    max-width: 440px;
    background: #fff;
    border-radius: 20px;
    padding: 38px 36px 34px;
    box-shadow: var(--je-shadow);
}
.reset-card h2 {
    margin: 0 0 20px;
    font-size: 22px;
    font-weight: 800;
    color: var(--je-ink);
}
.auth-alert.ok {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #15803d;
}
.auth-alert.err {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}
.auth-alert.info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
}
.reset-tip {
    color: var(--je-muted);
    font-size: 12.5px;
    line-height: 1.7;
    margin: 14px 0 0;
}
.reset-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 18px;
}
.reset-actions .auth-btn {
    width: auto;
    margin-top: 0;
    padding: 12px 26px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
    .auth-split {
        flex-direction: column;
    }
    .auth-hero {
        flex: none;
        padding: 40px 28px;
    }
    .auth-panel {
        padding: 28px 20px 40px;
    }
    .login-card,
    .reset-card {
        padding: 30px 24px;
    }
}
