/* ============================================================
   M11 · 认证页（登录 / 注册 / 改密）
   左右分栏：左侧品牌侧栏（深色），右侧表单卡。
   ============================================================ */

.page-auth { background: var(--bg-soft); }

.auth-shell {
  display: grid;
  grid-template-columns: minmax(360px, 44%) 1fr;
  min-height: 100vh;
  min-height: 100svh;
}

/* ---------------- 左侧品牌栏 ---------------- */
.auth-aside {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 40px;
  padding: 40px 44px;
  color: #fff;
  overflow: hidden;
  background:
    radial-gradient(720px 420px at 20% 8%, rgba(62, 196, 189, .38), transparent 62%),
    radial-gradient(560px 340px at 88% 92%, rgba(19, 168, 161, .28), transparent 60%),
    linear-gradient(160deg, var(--ink-950), var(--teal-900) 62%, var(--teal-800));
}

.auth-aside::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(70% 60% at 30% 30%, #000, transparent 85%);
  pointer-events: none;
}

.auth-logo {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 700;
  letter-spacing: -.02em;
  width: fit-content;
}
.auth-logo:hover { color: #fff; }

.auth-aside-body {
  position: relative;
  z-index: 1;
  margin-top: auto;
}
.auth-aside-body h2 {
  font-size: clamp(1.8rem, 1.2rem + 1.6vw, 2.5rem);
  line-height: 1.1;
  letter-spacing: -.035em;
  color: #fff;
  margin-bottom: 14px;
}
.auth-aside-lead {
  max-width: 380px;
  color: rgba(255, 255, 255, .74);
  font-size: var(--fs-sm);
  line-height: 1.65;
  margin-bottom: 26px;
}

.auth-points { display: flex; flex-direction: column; gap: 14px; }
.auth-points li {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  font-size: var(--fs-sm);
  line-height: 1.5;
  color: rgba(255, 255, 255, .86);
}
.auth-points svg {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  color: var(--teal-300);
}

.auth-aside-foot {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 36px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, .14);
}
.auth-mini-stat strong {
  display: block;
  font-size: 1.3rem;
  font-weight: 720;
  letter-spacing: -.02em;
}
.auth-mini-stat .tiny { color: rgba(255, 255, 255, .6); }

/* ---------------- 右侧表单 ---------------- */
.auth-main {
  display: grid;
  place-items: center;
  padding: 48px 32px;
}

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

.auth-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 28px;
  font-size: var(--fs-sm);
  color: var(--text-3);
}
.auth-back svg { width: 15px; height: 15px; transform: rotate(180deg); }
.auth-back:hover { color: var(--teal-700); }

.auth-head { margin-bottom: 26px; }
.auth-head h1 {
  font-size: clamp(1.7rem, 1.4rem + 1vw, 2.1rem);
  letter-spacing: -.03em;
  margin-bottom: 6px;
}
.auth-head p { margin: 0; font-size: var(--fs-sm); }

.auth-form .field { margin-bottom: 16px; }

.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 22px;
}

.link-btn {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--teal-700);
  padding: 2px;
  border-radius: 4px;
}
.link-btn:hover { color: var(--teal-800); text-decoration: underline; }

.auth-alt {
  margin: 20px 0 0;
  text-align: center;
  font-size: var(--fs-sm);
  color: var(--text-2);
}
.auth-alt a { font-weight: 650; }

.check--block {
  display: flex;
  margin-bottom: 6px;
  font-size: var(--fs-xs);
}

.demo-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 26px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, .7);
  font-size: var(--fs-xs);
  line-height: 1.5;
  color: var(--text-2);
}
.demo-note svg { width: 15px; height: 15px; margin-top: 1px; color: var(--teal-600); flex: none; }

/* ---------------- 验证码 / 强度 ---------------- */
.code-input {
  letter-spacing: .42em;
  font-family: var(--mono);
  font-size: 1.05rem !important;
  text-align: center;
  padding-left: .42em !important;
}

.strength {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
}
.strength-bar {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--ink-100);
  overflow: hidden;
}
.strength-bar i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 2px;
  background: var(--bad);
  transition: width var(--e), background-color var(--e);
}
.strength-label {
  font-size: 11px;
  color: var(--text-3);
  min-width: 62px;
  text-align: right;
}

.strength[data-score="1"] .strength-bar i { width: 25%; background: var(--bad); }
.strength[data-score="2"] .strength-bar i { width: 50%; background: var(--warn); }
.strength[data-score="3"] .strength-bar i { width: 75%; background: #84cc16; }
.strength[data-score="4"] .strength-bar i { width: 100%; background: var(--ok); }

/* ---------------- 响应式 ---------------- */
@media (max-width: 960px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-aside {
    gap: 24px;
    padding: 28px 24px;
  }
  .auth-aside-body { margin-top: 8px; }
  .auth-aside-body h2 { font-size: 1.6rem; }
  .auth-aside-lead { display: none; }
  .auth-points { display: none; }
  .auth-aside-foot { display: none; }
  .auth-main { padding: 32px 20px 56px; }
  .auth-card { max-width: 440px; }
  .auth-back { margin-bottom: 20px; }
}

/* ---------- 条款 / 隐私 弹窗 ---------- */
.auth-legal {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--brand-ink);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.auth-legal:hover { color: var(--brand-strong); }

.legal-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 24px;
}
.legal-modal[hidden] { display: none; }

.legal-scrim {
  position: absolute;
  inset: 0;
  background: rgba(9, 15, 26, .58);
  backdrop-filter: blur(2px);
}

.legal-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(680px, 100%);
  max-height: 84vh;
  background: var(--bg);
  border-radius: 16px;
  box-shadow: 0 30px 70px -30px rgba(9, 15, 26, .6);
  overflow: hidden;
}

.legal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
}
.legal-head h2 { margin: 0; font-size: 1.05rem; letter-spacing: -.01em; }
.legal-close {
  width: 32px; height: 32px;
  border: 0; border-radius: 8px;
  background: transparent;
  color: var(--text-3);
  font-size: 22px; line-height: 1;
  cursor: pointer;
}
.legal-close:hover { background: var(--bg-soft); color: var(--text); }

.legal-body {
  overflow-y: auto;
  padding: 6px 24px 26px;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--text-2);
}
.legal-body h3 {
  margin: 20px 0 6px;
  font-size: .92rem;
  color: var(--text);
  letter-spacing: -.01em;
}
.legal-body p { margin: 0 0 10px; }
.legal-body ul { margin: 0 0 12px; padding-left: 20px; }
.legal-body li { margin: 5px 0; }
.legal-body strong { color: var(--text); }

body.is-locked { overflow: hidden; }

/* 条款勾选框：跟随品牌色（原站是实心青勾） */
.auth-form input[type="checkbox"] {
  accent-color: var(--brand-ink);
  width: 16px;
  height: 16px;
  margin: 0 8px 0 0;
  vertical-align: -2px;
  cursor: pointer;
}

/* 登录/注册页右上角的语言切换 */
.auth-lang {
  position: fixed;
  top: 18px;
  right: 20px;
  z-index: 40;
}
@media (max-width: 900px) {
  .auth-lang { top: 12px; right: 12px; }
  .auth-lang .lang-btn { height: 32px; padding: 0 8px; font-size: 12px; }
  .auth-lang .lang-native { display: none; }
}

/* 前后台入口切换 */
.auth-switch {
  margin: 14px 0 0;
  text-align: center;
  font-size: 13px;
}
.auth-switch a { color: var(--accent); font-weight: 600; }

/* 阿拉伯语（RTL）：语言切换移到左上角，菜单向左展开，避免被裁掉 */
[dir="rtl"] .auth-lang {
  right: auto;
  left: 20px;
}
[dir="rtl"] .auth-lang .lang-menu {
  right: auto;
  left: 0;
}
@media (max-width: 900px) {
  [dir="rtl"] .auth-lang { left: 12px; right: auto; }
}

/* 危险操作区（登出所有裝置） */
.auth-danger {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--stroke, #e5e9f0);
  text-align: center;
}
.auth-danger p { margin: 0 0 10px; }

/* 手机端登录页：减少顶部视觉占高，表单更早出现在首屏 */
@media (max-width: 640px) {
  .auth-aside { padding: 20px 18px; gap: 12px; }
  .auth-aside h1, .auth-aside .auth-aside-title { font-size: 1.5rem; line-height: 1.25; }
  .auth-aside-body, .auth-aside p { font-size: .9rem; }
  .auth-main { place-items: start center; padding: 16px 18px 32px; }
  .auth-card { padding: 20px 18px; border-radius: 16px; }
  .auth-card h2 { font-size: 1.5rem; }
  .field input { font-size: 16px; } /* 防止 iOS 聚焦时自动放大 */
  .btn-block { min-height: 48px; }
}
