/* =============================================
   AUTH PAGES (登录 / 注册 / 忘记密码 / 社交绑定)
   独立样式层，覆盖 web/public/user/login.php 等页面的
   非 .auth-wrap/.auth-card 基础布局（那些定义在 app.css）
   ============================================= */

/* 登录页标题/副标题（admin.css 也定义了同名类供后台内部页复用，这里保证
   helper/user 等未加载 admin.css 的登录页同样有样式） */
.admin-login-title {
  text-align: center;
  font-size: 20px;
  font-weight: 800;
  color: var(--c-text);
  margin-bottom: 4px;
}
.admin-login-subtitle {
  text-align: center;
  font-size: 13px;
  color: var(--c-muted);
  margin-bottom: 24px;
}

.remember-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--c-muted);
  margin-top: -2px;
}
.remember-wrap input[type="checkbox"] {
  appearance: auto;
  width: 14px;
  height: 14px;
  min-width: 14px;
  padding: 0;
  margin: 0;
}

/* ── 移动端顶部品牌条：<900px 显示，取代被隐藏的 .auth-left ── */
.auth-mobile-topbar {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: var(--c-side-bg);
  color: #fff;
}
.auth-mobile-topbar img { max-height: 26px; display: block; }
.auth-mobile-topbar-text { font-size: 16px; font-weight: 800; letter-spacing: -.02em; }
.auth-mobile-topbar-tag {
  margin-left: auto;
  font-size: 12px;
  color: #a1a1aa;
}

/* ══════════════════════════════════════════
   居中卡片 + 壁纸背景布局
   （去掉左侧装饰栏，卡片居中悬浮在壁纸上）
══════════════════════════════════════════ */
.auth-wrap.is-centered {
  justify-content: center;
  background: transparent;
  position: relative;
  overflow: hidden;
}
.auth-wrap.is-centered .auth-right {
  background: transparent;
  position: relative;
  z-index: 1;
  width: auto;
  padding: 48px 20px;
}
.auth-wrap.is-centered .auth-card {
  width: 65vw;
  max-width: 800px;
  /* 移除白色遮罩，使用纯高斯模糊毛玻璃效果 */
  background: rgba(255,255,255,.12);
  backdrop-filter: blur(24px) saturate(1.6);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  border: none; /* 移除边框 */
  box-shadow: 0 8px 32px rgba(0,0,0,.08),
              0 1px 0 rgba(255,255,255,.3) inset; /* 玻璃高光边缘 */
}
[data-theme="dark"] .auth-wrap.is-centered .auth-card {
  background: rgba(30,41,59,.2);
  box-shadow: 0 8px 32px rgba(0,0,0,.3),
              0 1px 0 rgba(255,255,255,.1) inset;
}

/* 壁纸层：复用管理后台 admin_bg_* 设置渲染，固定铺满全屏，卡片浮在其上 */
.auth-bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: opacity .6s ease;
  opacity: 0;
  /* 背景增加模糊效果 */
  filter: blur(8px);
}
.auth-bg-layer.bg-active { opacity: 1; }
/* 移除背景层的白色遮罩层 */
.auth-bg-layer.bg-image::after {
  content: '';
  position: absolute;
  inset: 0;
  /* 移除白色遮罩和模糊，保持背景清晰可见 */
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
[data-theme="dark"] .auth-bg-layer.bg-image::after {
  background: transparent;
}

/* ── Tab 切换：滑块指示条 ── */
.auth-tabs { position: relative; }
.auth-tabs-slider {
  position: absolute;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: var(--c-primary);
  border-radius: var(--r-full);
  transition: transform .25s cubic-bezier(.4,0,.2,1), width .25s cubic-bezier(.4,0,.2,1);
  pointer-events: none;
}

/* ── 登录/注册表单切换过渡 ── */
.auth-form-hidden { display: none; }
.auth-form-entering { animation: auth-form-in .26s cubic-bezier(.22,1,.36,1) both; }
@keyframes auth-form-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .auth-form-entering { animation: none; }
}

/* ══════════════════════════════════════════
   注册三步 · 渲染进度轨
   （步骤序列真实存在：账号信息 → 邮箱验证 → 设置密码）
══════════════════════════════════════════ */
.auth-form-register {
  gap: 16px;
}
.auth-steps {
  margin: 2px 0 8px;
  position: relative;
}
.auth-step-rail {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  position: relative;
  z-index: 1;
}
.auth-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  color: var(--c-subtle, #9ca3af);
}
.auth-step-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  background: var(--c-surface, #fff);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-surface, #fff) 85%, transparent);
  transition: background .25s ease, border-color .25s ease, transform .25s ease, box-shadow .25s ease;
}
.auth-step-label {
  font-size: 12px;
  letter-spacing: .04em;
  white-space: nowrap;
  transition: color .25s ease;
}
.auth-step.is-done {
  color: var(--c-primary, #6BAAB8);
}
.auth-step.is-done .auth-step-dot {
  background: var(--c-primary, #6BAAB8);
  border-color: var(--c-primary, #6BAAB8);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-surface, #fff) 85%, transparent);
}
.auth-step.is-active {
  color: var(--c-text, #111827);
}
.auth-step.is-active .auth-step-dot {
  background: var(--c-primary, #6BAAB8);
  border-color: var(--c-primary, #6BAAB8);
  transform: scale(1.2);
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--c-surface, #fff) 85%, transparent),
    0 0 0 6px color-mix(in srgb, var(--c-primary, #6BAAB8) 18%, transparent);
}
.auth-step.is-active .auth-step-label {
  font-weight: 600;
}

.auth-step-track {
  position: absolute;
  left: 16.5%;
  right: 16.5%;
  top: 4px;
  height: 2px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--c-border, #e5e7eb) 85%, transparent);
  overflow: hidden;
  z-index: 0;
}
.auth-step-track-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--c-primary, #6BAAB8) 45%, transparent),
    var(--c-primary, #6BAAB8));
  transition: width .45s cubic-bezier(.22,1,.36,1);
}

.auth-step-panel {
  display: none;
  gap: 14px;
}
.auth-step-panel.is-active {
  display: grid;
  animation: auth-step-in .32s cubic-bezier(.22,1,.36,1) both;
}
@keyframes auth-step-in {
  from { opacity: 0; transform: translateX(10px); }
  to   { opacity: 1; transform: translateX(0); }
}
.auth-step-lead {
  margin: 0 0 2px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--c-muted, #6b7280);
}
.auth-step-lead strong {
  color: var(--c-text, #111827);
  font-weight: 600;
  word-break: break-all;
}
.auth-step-nav {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 4px;
}
.auth-step-nav .btn {
  flex: 1;
  border-radius: var(--r-lg);
}
/* .btn 是 inline-flex，会盖住 [hidden]；不可回退时必须真正隐藏「上一步」 */
.auth-step-nav .btn[hidden] {
  display: none !important;
}
.auth-step-nav .btn-ghost {
  flex: 0 0 30%;
}
.auth-step-nav .btn:not(.btn-ghost) {
  min-width: 0;
}
@media (prefers-reduced-motion: reduce) {
  .auth-step-panel.is-active { animation: none; }
  .auth-step-track-fill { transition: none; }
  .auth-step-dot { transition: none; }
}

/* ══════════════════════════════════════════
   进入工作台转场（登录/注册成功）
══════════════════════════════════════════ */
.auth-enter-shell {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(ellipse at center,
    color-mix(in srgb, var(--c-primary, #6BAAB8) 22%, transparent) 0%,
    rgba(8, 12, 18, .55) 70%);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  transition: opacity .45s ease;
}
.auth-enter-shell.is-on {
  opacity: 1;
  pointer-events: auto;
}
.auth-is-leaving .auth-card {
  transform: scale(.97) translateY(8px);
  opacity: 0;
  transition: transform .5s cubic-bezier(.22,1,.36,1), opacity .4s ease;
}
.auth-enter-shell-inner {
  text-align: center;
  color: #fff;
  transform: translateY(8px) scale(.96);
  opacity: 0;
  transition: transform .5s cubic-bezier(.22,1,.36,1) .08s, opacity .4s ease .08s;
}
.auth-enter-shell.is-on .auth-enter-shell-inner {
  transform: translateY(0) scale(1);
  opacity: 1;
}
.auth-enter-orbit {
  width: 44px;
  height: 44px;
  margin: 0 auto 16px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.18);
  border-top-color: #fff;
  animation: auth-orbit-spin .9s linear infinite;
}
@keyframes auth-orbit-spin {
  to { transform: rotate(360deg); }
}
.auth-enter-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .08em;
}
.auth-enter-sub {
  margin-top: 6px;
  font-size: 12px;
  opacity: .72;
  letter-spacing: .04em;
}
@media (prefers-reduced-motion: reduce) {
  .auth-enter-shell { transition: none; }
  .auth-enter-shell-inner { transition: none; }
  .auth-is-leaving .auth-card { transition: none; }
  .auth-enter-orbit { animation: none; border-top-color: rgba(255,255,255,.5); }
}

/* ── 表单错误 / 提示（字段级反馈） ── */
.auth-err {
  display: none;
  color: var(--c-danger);
  font-size: 13px;
  line-height: 1.5;
}

/* ── 通用提示弹窗（报错统一走这里，不用 emoji） ── */
.auth-alert-card {
  width: min(380px, calc(100vw - 48px));
}
.auth-alert-msg {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--c-text, #1f2937);
  word-break: break-word;
  white-space: pre-wrap;
}

/* ── 线性图标（CSS mask SVG，与后台 nav-icon 同风格；不用 emoji） ── */
.auth-icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  flex-shrink: 0;
  background: currentColor;
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  -webkit-mask-position: center;
          mask-position: center;
  -webkit-mask-size: contain;
          mask-size: contain;
  vertical-align: -0.125em;
}

/* 礼盒 — 邀请福利 */
.auth-icon-gift {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='8' width='18' height='4' rx='1'/><path d='M5 12v8a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-8'/><path d='M12 8v13'/><path d='M12 8c-2 0-4-1-4-3a2 2 0 0 1 4 0c0 2-2 3-4 3M12 8c2 0 4-1 4-3a2 2 0 0 0-4 0c0 2 2 3 4 3'/></svg>");
          mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='8' width='18' height='4' rx='1'/><path d='M5 12v8a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-8'/><path d='M12 8v13'/><path d='M12 8c-2 0-4-1-4-3a2 2 0 0 1 4 0c0 2-2 3-4 3M12 8c2 0 4-1 4-3a2 2 0 0 0-4 0c0 2 2 3 4 3'/></svg>");
}

/* 钱包 / 余额 — 注册赠送 */
.auth-icon-wallet {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'><rect x='2.5' y='6' width='19' height='13' rx='2.5'/><path d='M2.5 10h19'/><circle cx='17' cy='14.5' r='1.2' fill='%23000' stroke='none'/></svg>");
          mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'><rect x='2.5' y='6' width='19' height='13' rx='2.5'/><path d='M2.5 10h19'/><circle cx='17' cy='14.5' r='1.2' fill='%23000' stroke='none'/></svg>");
}

/* 返回 — 左尖角 */
.auth-icon-back {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M14.5 6.5 9 12l5.5 5.5'/></svg>");
          mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M14.5 6.5 9 12l5.5 5.5'/></svg>");
}

/* 关闭 — 细线 X */
.auth-icon-close {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round'><path d='M7 7l10 10M17 7 7 17'/></svg>");
          mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round'><path d='M7 7l10 10M17 7 7 17'/></svg>");
}

/* 确认 — 细线勾 */
.auth-icon-check {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M5.5 12.5 10 17l8.5-9'/></svg>");
          mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M5.5 12.5 10 17l8.5-9'/></svg>");
}

/* 提示 — 圆圈 i */
.auth-icon-info {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='9'/><path d='M12 11v5.5'/><path d='M12 8h.01'/></svg>");
          mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='9'/><path d='M12 11v5.5'/><path d='M12 8h.01'/></svg>");
}

/* 警告 — 圆角三角 */
.auth-icon-alert {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'><path d='M12 3.8 3.8 18.5h16.4L12 3.8z'/><path d='M12 10v4'/><path d='M12 16.8h.01'/></svg>");
          mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'><path d='M12 3.8 3.8 18.5h16.4L12 3.8z'/><path d='M12 10v4'/><path d='M12 16.8h.01'/></svg>");
}

/* 按钮 / 链接里的小图标排版 */
.btn .auth-icon,
.auth-links a .auth-icon {
  width: 14px;
  height: 14px;
  margin-right: 6px;
}
.modal-close .auth-icon {
  width: 14px;
  height: 14px;
  display: block;
  margin: 0 auto;
}
.auth-banner .auth-icon {
  width: 18px;
  height: 18px;
  margin-top: 1px;
}
.auth-banner-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.auth-alert-head-icon {
  width: 36px;
  height: 36px;
  margin: 4px auto 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--c-danger, #dc2626) 10%, transparent);
  color: var(--c-danger, #dc2626);
}
.auth-alert-head-icon .auth-icon {
  width: 18px;
  height: 18px;
}
.auth-alert-body {
  text-align: center;
}
.auth-field-tip {
  font-size: 12px;
  color: var(--c-muted);
  margin-top: 3px;
  display: none;
}
.auth-field-tip.is-danger { color: var(--c-danger); }
.auth-field-hint {
  font-size: 11px;
  color: var(--c-muted);
  margin-top: 3px;
}

/* ── 后端开关控制显示的字段：默认隐藏，JS 加 is-visible ── */
.auth-field-email-code,
.auth-field-captcha,
.auth-tos-field,
.auth-field-invite {
  display: none;
}
.auth-field-email-code.is-visible,
.auth-field-captcha.is-visible,
.auth-tos-field.is-visible,
.auth-field-invite.is-visible {
  display: block;
}
.auth-tos-field { margin-bottom: 12px; }
.auth-tos-field.is-visible { display: block; }

/* ── 注册赠送 / 邀请福利 banner ── */
.auth-banner {
  display: none;
  margin-bottom: 14px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.6;
}
.auth-banner.is-visible { display: block; }
.auth-banner-success {
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border: 1px solid #86efac;
  color: #166534;
}
.auth-banner-success strong { color: #15803d; font-size: 15px; }
.auth-banner-info {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border: 1px solid #93c5fd;
  color: #1e40af;
}
.auth-banner-info strong { color: #1d4ed8; font-size: 15px; }

/* ── 内联控件组（验证码输入 + 按钮/图片） ── */
.auth-inline-group { display: flex; gap: 8px; align-items: center; }
.auth-code-input { width: 130px; letter-spacing: .12em; font-size: 15px; }
.auth-code-btn {
  white-space: nowrap;
  padding: 0 14px;
  height: 38px;
  border-radius: var(--r);
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  color: var(--c-text);
  font-size: 13px;
  cursor: pointer;
  transition: border-color var(--transition-fast), color var(--transition-fast);
}
.auth-code-btn:hover:not(:disabled) { border-color: var(--c-primary); color: var(--c-primary); }
.auth-code-btn:disabled { color: var(--c-subtle); cursor: not-allowed; }

.auth-captcha-input { width: 120px; letter-spacing: .15em; font-size: 16px; }
.auth-captcha-img {
  height: 38px;
  border-radius: var(--r);
  border: 1px solid var(--c-border);
  cursor: pointer;
  flex-shrink: 0;
}
.auth-captcha-refresh {
  font-size: 12px;
  color: var(--c-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  white-space: nowrap;
}
.auth-captcha-refresh:hover { color: var(--c-primary); }

/* ── 服务协议勾选 ── */
.auth-tos-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: var(--c-muted);
  cursor: pointer;
}
.auth-tos-label input[type="checkbox"] {
  appearance: auto;
  -webkit-appearance: checkbox;
  width: 14px;
  height: 14px;
  min-width: 14px;
  margin-top: 2px;
  flex-shrink: 0;
  cursor: pointer;
}
.auth-tos-link { color: var(--c-primary); cursor: pointer; text-decoration: underline; }

/* ── 服务协议弹窗（复用 .modal-overlay / .modal-card） ── */
.auth-tos-modal { width: 100%; max-width: 620px; height: 80vh; display: flex; flex-direction: column; }
.auth-tos-modal-body { flex: 1; overflow: hidden; }
.auth-tos-modal-body iframe { width: 100%; height: 100%; border: none; }

/* ── 底部链接行 ── */
.auth-links-muted { color: var(--c-muted); }
.auth-links-sep { margin: 0 8px; color: var(--c-border-2); }

/* ── 聚合社交登录按钮 ── */
.auth-social-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--auth-social-color, var(--c-primary));
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--auth-social-color, var(--c-primary));
  text-decoration: none;
  background: var(--c-surface);
  transition: background var(--transition-fast);
  margin-left: 8px;
}
.auth-social-btn:hover { background: var(--auth-social-bg-hover, var(--c-surface-2)); text-decoration: none; }

/* ── 响应式：<900px 顶部品牌条替代左侧栏（仅左右分栏布局需要；居中布局本就没有左栏） ── */
@media (max-width: 899px) {
  .auth-wrap:not(.is-centered) .auth-mobile-topbar { display: flex; }
}

/* ── 响应式：<600px 移动端 50% 宽度 ── */
@media (max-width: 599px) {
  .auth-wrap.is-centered .auth-right {
    padding: 32px 16px;
  }
  .auth-wrap.is-centered .auth-card {
    width: 90vw;
    max-width: none;
    padding: 28px 20px;
  }
}
