/* HWS warm-felt identity entry — the only public login surface.
 *
 * Source: docs/design/hws-warm-redesign-20261105/concepts/login.html (frozen
 * round-3 concept), extracted to an external stylesheet because production CSP
 * is style-src 'self'. The page is self-contained (no site.css): warm tokens,
 * centered brand lockup, two soft choices, one-line error, one support link.
 *
 * Tokens come from the Xiaoban warm-felt design system: canvas #FBF4EA, surface
 * #FFFDF9, cocoa ink #3B2A22, jade action #9ED3BE (always with cocoa text).
 * No blue/cold-gray tokens; no external fonts or icon libraries; icons are
 * inline SVG. Motion 200-320ms; prefers-reduced-motion is honoured by both the
 * stylesheet and the navigation script (which jumps immediately).
 */

:root {
  --canvas: #fbf4ea;
  --surface: #fffdf9;
  --surface-warm: #f5e8d6;
  --blush: #fad0c7;
  --pink: #fbc9c0;
  --action: #9ed3be;
  --action-pressed: #8cc6af;
  --selected-fill: #e3f2ea;
  --ink: #3b2a22;
  --text2: #735b50;
  --text2-on-tint: #6a5246;
  --jade-deep: #2f6b55;
  --separator: #eadbc8;
  --disabled-fill: #ede3d6;
  --danger: #a3403b;
  --danger-bg: #fbe5e1;

  --radius-card: 22px;
  --radius-panel: 18px;
  --radius-chip: 16px;
  --radius-pill: 999px;

  --shadow-card: 0 1px 3px rgb(59 42 34 / 4%), 0 10px 26px rgb(59 42 34 / 6%);
  --shadow-lift: 0 2px 6px rgb(59 42 34 / 5%), 0 16px 34px rgb(59 42 34 / 9%);
  --shadow-bead: 0 3px 8px rgb(47 107 85 / 24%), 0 16px 30px rgb(47 107 85 / 18%);

  --font-sans: "PingFang SC", "Noto Sans SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-round: ui-rounded, "SF Pro Rounded", "Hiragino Maru Gothic ProN", "PingFang SC", "Noto Sans SC", sans-serif;
  --ease-soft: cubic-bezier(0.22, 0.9, 0.24, 1);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
svg { display: block; flex: none; }
button { font: inherit; color: inherit; }
.skip-link {
  position: absolute; left: 16px; top: -64px; z-index: 100;
  padding: 10px 16px; background: var(--ink); color: var(--canvas);
  border-radius: var(--radius-pill); font-size: 13px;
  transition: top 0.2s var(--ease-soft);
}
.skip-link:focus { top: 16px; }
:focus-visible { outline: 2px solid var(--jade-deep); outline-offset: 3px; border-radius: 8px; }

/* ---------- 品牌锁合（居中，和 App 首页的居中标题同一气质） ---------- */
.brand {
  display: inline-flex; align-items: center; gap: 12px;
  min-height: 44px; margin-bottom: 32px;
}
.brand img {
  width: 40px; height: 40px;
  /* 品牌蓝 logo 在暖色页面上改为单色 cocoa；生产建议直接用 cocoa 版 SVG */
  filter: grayscale(1) sepia(1) saturate(2.6) hue-rotate(-8deg) brightness(0.55) contrast(1.04);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; text-align: left; }
.brand-text strong { font-family: var(--font-round); font-size: 18px; font-weight: 800; letter-spacing: 0.02em; }
.brand-text span { font-size: 12px; color: var(--text2); letter-spacing: 0.01em; }

/* ---------- 居中主体 ---------- */
.gate {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 52px 40px 40px;
  text-align: center;
}
.gate-head { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.gate h1 {
  margin: 0;
  font-size: 56px;
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.gate h1 .wordmark { font-family: var(--font-round); font-weight: 800; letter-spacing: 0.01em; }
.gate-sub { margin: 0; font-size: 17px; line-height: 1.6; color: var(--text2); }

/* ---------- 两个大而柔软的选项 ---------- */
.choices {
  width: min(560px, 100%);
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 48px;
  text-align: left;
}
.choice {
  position: relative;
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr) 52px;
  align-items: center;
  gap: 20px;
  width: 100%;
  min-height: 116px;
  padding: 24px 24px 24px 24px;
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: transform 0.32s var(--ease-soft), box-shadow 0.32s var(--ease-soft),
              border-color 0.2s var(--ease-soft), background 0.2s var(--ease-soft);
}
.choice:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.choice:active { transform: scale(0.988); }
.choice:focus-visible { outline: none; border-color: var(--jade-deep); box-shadow: var(--shadow-lift), 0 0 0 4px rgb(47 107 85 / 12%); }
.choice-icon {
  width: 60px; height: 60px; border-radius: 18px;
  display: grid; place-items: center;
  background: var(--surface-warm); color: var(--ink);
  transition: background 0.2s var(--ease-soft);
}
.choice[data-space="personal"] .choice-icon { background: var(--blush); }
.choice-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.choice-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; font-size: 24px; font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; }
.choice-method { font-size: 14px; color: var(--text2); }
.choice-badge {
  display: none; align-items: center; padding: 2px 8px; border-radius: var(--radius-pill);
  background: var(--disabled-fill); color: var(--text2);
  font-size: 12px; font-weight: 500;
}
body[data-closed="1"] .choice[data-space="personal"] .choice-badge { display: inline-flex; }
.choice-go {
  width: 48px; height: 48px; border-radius: var(--radius-pill);
  display: grid; place-items: center;
  background: var(--action); color: var(--ink);
  box-shadow: 0 2px 6px rgb(47 107 85 / 20%), 0 10px 20px rgb(47 107 85 / 14%);
  transition: background 0.16s var(--ease-soft), transform 0.3s var(--ease-soft), box-shadow 0.3s var(--ease-soft);
}
.choice-go svg { color: var(--ink); stroke: var(--ink); }
.choice:hover .choice-go { transform: translateX(2px) scale(1.03); background: var(--action-pressed); }
.choice:focus-visible .choice-go { box-shadow: 0 0 0 3px rgb(158 211 190 / 45%), 0 10px 20px rgb(47 107 85 / 16%); }
.choice[aria-disabled="true"] { cursor: default; box-shadow: none; background: var(--disabled-fill); }
.choice[aria-disabled="true"] .choice-go { display: none; }
.choice[aria-disabled="true"]:hover { transform: none; box-shadow: none; }

/* ---------- 过渡态：暖色光晕 + 按压（评审用 ?state=leaving） ---------- */
body[data-state="leaving"] .choice[data-space="personal"] {
  transform: scale(0.99);
  background: var(--selected-fill);
  box-shadow: var(--shadow-lift), 0 0 0 4px rgb(158 211 190 / 26%), 0 18px 46px 6px rgb(158 211 190 / 24%);
}
body[data-state="leaving"] .choice[data-space="personal"] .choice-icon { background: #f6e3d8; }
body[data-state="leaving"] .choice[data-space="personal"] .choice-go { background: var(--action-pressed); }
body[data-state="leaving"] .choice[data-space="enterprise"] { opacity: 0.82; }
body[data-state="leaving"] .gate-head { opacity: 0.94; }

/* ---------- 一行短错误 ---------- */
.gate-error {
  display: none;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  background: #f9e9e4;
  color: var(--ink);
  font-size: 14px;
}
.gate-error[data-visible] { display: inline-flex; }
.gate-error svg { color: var(--danger); }
.gate-error a {
  color: var(--jade-deep); font-weight: 700; text-decoration: none;
  border-bottom: 1px solid currentColor;
  min-height: 32px; padding: 0 2px; display: inline-flex; align-items: center;
}
.gate-error a:hover { color: #24553f; }

/* ---------- 底部一行极小说明 ---------- */
.gate-foot {
  width: 100%; max-width: 1240px; margin: 0 auto;
  padding: 0 40px 30px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 10px;
  font-size: 13px; color: var(--text2);
}
.gate-foot .foot-dot { color: var(--separator); }
.gate-foot a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 6px; color: var(--text2); font-size: 13px; }
.gate-foot a:hover { color: var(--ink); }
.gate-foot a:hover { color: var(--ink); }
.gate-foot .foot-hint { display: inline-flex; align-items: center; gap: 7px; }
.gate-foot svg { opacity: 0.7; }

/* ---------- 移动 ---------- */
@media (max-width: 720px) {
  .brand img { width: 30px; height: 30px; }
  .brand-text strong { font-size: 16px; }
  .brand-text span { font-size: 11px; }
  .gate { padding: 40px 20px 32px; }
  .gate h1 { font-size: 40px; }
  .gate-sub { font-size: 15px; }
  .choices { margin-top: 34px; gap: 14px; }
  .choice {
    grid-template-columns: 52px minmax(0, 1fr) 48px;
    gap: 14px;
    min-height: 104px;
    padding: 20px 18px;
    border-radius: 20px;
  }
  .choice-icon { width: 52px; height: 52px; border-radius: 15px; }
  .choice-title { font-size: 20px; }
  .choice-method { font-size: 13px; }
  .choice-go { width: 48px; height: 48px; }
  .gate-foot { padding: 0 20px calc(22px + env(safe-area-inset-bottom)); flex-direction: column; align-items: center; gap: 0; text-align: center; }
  .gate-foot .foot-hint { gap: 6px; }
}
@media (max-width: 380px) {
  .gate h1 { font-size: 36px; }
  .choice { grid-template-columns: 46px minmax(0, 1fr) 44px; gap: 12px; padding: 16px; }
  .choice-icon { width: 46px; height: 46px; }
  .choice-title { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .choice:hover { transform: none; }
}
/* ============================================================
   Production layer — minimal adaptations on top of the concept.
   ============================================================ */

/* Server-rendered disabled state must never look tappable. */
.choice[aria-disabled="true"] { pointer-events: none; }

/* Server-rendered one-line error reuses the concept's pill. */
.gate-error[data-visible] { display: inline-flex; }
