/* 登录 / 注册 / 找回密码页样式（品牌落地页）。
   设计变量直接引 tokens.css（登录页 HTML 里 link，已在 app/auth.py 豁免名单），本文件不再抄变量。
   颜色 / 字号 / 字重 / 行高 / 间距 / 圆角 / 阴影 / 动效一律用 tokens；唯一例外是下面 :root 里
   三条经用户批准的「品牌 hero 受控例外」（见 docs/方案/登录注册/01_产品文档_V1.1_定稿.md §1.1）：
   照片压暗遮罩、照片上的白字、hero 主标题字号。它们只允许出现在这一个 :root 块里，不进 shared/ui/tokens.css。 */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* —— 例外 1：全屏摄影 hero 的压暗遮罩（底部要放白字标题，必须压暗保证对比度） —— */
  --hero-scrim-top: rgba(0, 0, 0, .06);
  --hero-scrim-mid: rgba(0, 0, 0, 0);
  --hero-scrim-bot: rgba(0, 0, 0, .80);
  /* —— 例外 2：压在照片上的文字色（照片恒为深色，不随主题变） —— */
  --hero-fg: #ffffff;
  --hero-fg-dim: rgba(255, 255, 255, .74);
  /* —— 例外 3：品牌主标题字号（超出 --fs-2xl，仅登录页 hero 使用） —— */
  --hero-title: clamp(30px, 3.4vw, 52px);
}

html, body { height: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }

.shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 3fr) minmax(380px, 2fr); }

/* ---------- 左：品牌 hero（摄影图 + 压暗遮罩 + 白字） ---------- */
.hero { position: relative; overflow: hidden; background: var(--bg); min-height: 640px; }  /* 图加载失败时的降级底色 */
.scene { position: absolute; inset: 0; opacity: 0; transition: opacity var(--dur-slow) var(--ease); }
.scene.active { opacity: 1; }
.scene img { width: 100%; height: 100%; object-fit: cover; display: block; }
.scene::after {   /* 例外 1 */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, var(--hero-scrim-top) 0%, var(--hero-scrim-mid) 38%, var(--hero-scrim-bot) 100%);
}
.brand {
  position: absolute; z-index: 2; top: var(--sp-6); left: 6%;
  display: flex; align-items: center; gap: var(--sp-3);
  color: var(--hero-fg); font-weight: var(--fw-semibold);
  letter-spacing: .06em; font-size: var(--fs-lg);
}
.brand .mark {   /* 装饰几何：圆环标识，非 token 维度 */
  width: 26px; height: 26px; border: 2px solid var(--hero-fg);
  border-radius: 50%; position: relative; flex: none;
}
.brand .mark::after {
  content: ""; position: absolute; width: 8px; height: 8px;
  background: var(--hero-fg); border-radius: 50%; top: 7px; left: 7px;
}
.story { position: absolute; z-index: 2; bottom: var(--sp-8); left: 6%; right: 8%; color: var(--hero-fg); }
.story h1 {
  font-size: var(--hero-title);            /* 例外 3 */
  font-weight: var(--fw-semibold);
  letter-spacing: -.01em;
  line-height: var(--lh-tight);
  margin: 0 0 var(--sp-3);
}
.story p { font-size: var(--fs-lg); color: var(--hero-fg-dim); line-height: var(--lh); }
.controls { position: absolute; z-index: 2; bottom: var(--sp-5); left: 6%; display: flex; align-items: center; gap: var(--sp-2); }
.dot {   /* 装饰几何：轮播进度条 */
  border: 0; padding: 0; width: 36px; height: 3px;
  background: var(--hero-fg-dim); cursor: pointer;
}
.dot.active { background: var(--hero-fg); }
.dot:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.counter { font-size: var(--fs-xs); letter-spacing: .12em; color: var(--hero-fg-dim); margin-left: var(--sp-3); font-variant-numeric: var(--num); }

/* ---------- 右：表单面板（完全走 tokens，跟随深浅色） ---------- */
.panel {
  background: var(--card); color: var(--text);
  display: flex; align-items: center; justify-content: center;
  padding: var(--sp-8) var(--sp-6);
}
.content { width: 100%; max-width: 380px; }
.eyebrow { font-size: var(--fs-sm); color: var(--text-dim); letter-spacing: .08em; }
.content h2 { font-size: var(--fs-2xl); font-weight: var(--fw-semibold); margin: var(--sp-2) 0; letter-spacing: -.01em; }
.muted { font-size: var(--fs-md); color: var(--text-dim); line-height: var(--lh-loose); }

.tabs { display: flex; gap: var(--sp-6); border-bottom: 1px solid var(--line); margin: var(--sp-6) 0 var(--sp-5); }
.tab { background: none; border: 0; padding: 0 0 var(--sp-3); color: var(--text-faint); font-weight: var(--fw-medium); cursor: pointer; }
.tab.active { color: var(--text); border-bottom: 2px solid var(--accent); }
.tab:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.field { margin: 0 0 var(--sp-4); }
.field label { display: block; font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--text-dim); margin-bottom: var(--sp-2); }
.field input {
  display: block; width: 100%; height: calc(var(--ctl-h) + var(--sp-2));
  background: var(--input-bg); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: 0 var(--sp-3); outline: none;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.field input:focus { border-color: var(--accent); box-shadow: var(--focus-ring); }
.field-hint { margin: var(--sp-2) 0 0; font-size: var(--fs-sm); color: var(--text-faint); line-height: var(--lh-normal, 1.6); }
::placeholder { color: var(--text-faint); }

.code { display: flex; gap: var(--sp-2); }
.code input { flex: 1; min-width: 0; }
.code-btn {
  white-space: nowrap; background: var(--surface-3); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: 0 var(--sp-3); font-size: var(--fs-sm); cursor: pointer;
  transition: background-color var(--dur-fast);
}
.code-btn:hover:not(:disabled) { background: var(--hover); }
.code-btn:disabled { color: var(--text-faint); cursor: default; }

.primary {
  width: 100%; border: 0; border-radius: var(--radius);
  background: var(--accent); color: var(--on-accent);
  font-weight: var(--fw-semibold); padding: var(--sp-3) var(--sp-4);
  margin-top: var(--sp-2); cursor: pointer;
  transition: background-color var(--dur-fast);
}
.primary:hover:not(:disabled) { background: var(--accent-hover); }
.primary:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.primary:disabled { opacity: .7; cursor: default; }
.secondary { background: transparent; border: 0; color: var(--accent-fg); font-size: var(--fs-sm); padding: var(--sp-2) 0; cursor: pointer; }
.secondary:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--sp-2) var(--sp-3); }
.small { font-size: var(--fs-sm); color: var(--text-dim); display: flex; align-items: center; gap: var(--sp-2); }
.small input { accent-color: var(--accent); }

.foot { border-top: 1px solid var(--line); margin-top: var(--sp-6); padding-top: var(--sp-5); color: var(--text-faint); font-size: var(--fs-sm); line-height: var(--lh-loose); }

/* 统一提示条：服务端登录错误与前端流程消息共用；.ok 为成功 / 信息态 */
.notice { display: none; margin: 0 0 var(--sp-4); padding: var(--sp-3); background: var(--c-red-bg); border: 1px solid var(--c-red-line); color: var(--c-red-fg); border-radius: var(--radius); font-size: var(--fs-sm); line-height: var(--lh-loose); }
.notice.on { display: block; }
.notice.ok { background: var(--c-blue-bg); border-color: var(--c-blue-line); color: var(--c-blue-fg); }
.hidden { display: none !important; }

/* 右上角深浅色切换（浅色 → 深色 → 跟随系统），与旧登录页同一行为 */
button.login-theme {
  position: fixed; top: var(--sp-3); right: var(--sp-3); z-index: 50;
  padding: var(--sp-1) var(--sp-3); font-size: var(--fs-sm);
  border-radius: var(--radius);
  background: var(--card); color: var(--text-dim); border: 1px solid var(--line);
  cursor: pointer; transition: background-color var(--dur-fast), color var(--dur-fast);
}
button.login-theme:hover { color: var(--text); background: var(--hover); border-color: var(--line-strong); }
button.login-theme:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* ---------- 响应式：平板与手机只留简短品牌区 + 表单 ---------- */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .hero { min-height: 220px; height: 220px; }
  .story { bottom: var(--sp-5); }
  .story h1 { font-size: var(--fs-xl); margin-bottom: var(--sp-1); }
  .story p, .controls, .counter { display: none; }
  .brand { top: var(--sp-4); }
  .panel { padding: var(--sp-6) var(--sp-5); }
}
@media (prefers-reduced-motion: reduce) { .scene { transition: none; } }
