/* 统一登录服务的样式。
 *
 * 设计口径：与门户 / ai-gateway / ops-console 共用同一套薄荷色板（事实源在
 * 根仓 platform/ui/mint-tokens.css）。本服务是独立进程，运行时共享不了一份 CSS，
 * 所以 :root 里内嵌一份原样拷贝，靠 scripts/harness/verify-ui-tokens.sh 的
 * 「逐字符比对」发现漂移——只改某一仓会静默回退成旧配色，四个页面不在同一屏上，
 * 肉眼基本发现不了。
 *
 * 只写登录页与状态页要用的类，不引外链字体/CDN：
 *   - 登录页只有一个输入框和一个按钮，样式总行数不到百行；
 *   - 外链字体在集群内网（Pod 无外网）会一直卡在加载中，首屏反而更慢。
 */

/* === MINT TOKENS BEGIN (同步自 platform/ui/mint-tokens.css，勿手改) === */
:root {
  color-scheme: light;

  /* 底与面 */
  --bg: #f5f8f7;
  --bg-deep: #eef3f2;
  --surface: #ffffff;
  --surface-2: #f0f6f4;
  --line: #dde5e3;
  --line-soft: #eaf0ee;

  /* 文字 */
  --ink: #1b2b28;
  --ink-dim: #52645f;
  --ink-faint: #6f807b;

  /* 强调：薄荷绿 */
  --accent: #12a08c;
  --accent-ink: #0b7a6b;
  --accent-dim: #8ecfc5;
  --accent-tint: #e6f6f3;
  --accent-line: #b7e3db;

  /* 第二强调：雾蓝，只做次要标记 */
  --accent2: #5b8def;
  --accent2-tint: #e9f0fd;

  /* 语义色 */
  --ok: #2e9e6b;
  --ok-tint: #e7f6ee;
  --ok-line: #a9dfc3;

  --warn: #c47a13;
  --warn-tint: #fdf3e3;
  --warn-line: #f0d3a3;

  --bad: #cf3f45;
  --bad-tint: #fdeced;
  --bad-line: #f3bfc1;

  /* 层次与圆角 */
  --shadow: 0 1px 2px rgba(24, 51, 45, 0.04), 0 4px 14px rgba(24, 51, 45, 0.05);
  --shadow-lift: 0 2px 6px rgba(24, 51, 45, 0.07), 0 10px 24px rgba(24, 51, 45, 0.07);

  /* 字体与圆角 */
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  --r: 12px;
  --r-sm: 8px;
}
/* === MINT TOKENS END === */

* { box-sizing: border-box; }

/* 页面底色：两团极淡的光晕，避免纯平白底显得生硬（与另外三个前端同款） */
body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background:
    radial-gradient(1100px 520px at 12% -8%, #e8f5f1 0%, transparent 62%),
    radial-gradient(800px 460px at 96% 0%, #eaf1fd 0%, transparent 58%),
    var(--bg);
}

.card {
  width: 100%;
  max-width: 380px;
  padding: 28px 26px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}

h1 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 4px;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

/* 品牌圆点：与门户 .brand::before、网关 .dot 同款 */
.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-tint);
}

.sub {
  margin: 0 0 20px;
  color: var(--ink-dim);
  font-size: 13px;
}

.field { display: block; margin-bottom: 14px; }

.field > .lbl {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--ink-dim);
}

/* 输入框 + 小眼睛叠在一行：眼睛是绝对定位，不占文档流，切换时不会把按钮挤动 */
.pw-wrap { position: relative; display: block; }

/* 用 .pw-wrap input 而不是 input[type="password"]：小眼睛会把 type 切成 text，
   按属性选择器写的话一显示明文，整套描边/底色就全丢了 */
.pw-wrap input {
  width: 100%;
  /* 右侧留出眼睛的位置，免得文字压在图标底下 */
  padding: 10px 40px 10px 12px;
  font: inherit;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  /* 只给 accent 描边，不做放大/发光：登录页的视觉焦点应该是「下一步做什么」 */
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}

.pw-wrap input:focus {
  background: var(--surface);
  border-color: var(--accent);
}

.pw-wrap input:disabled { opacity: 0.55; }

.pw-eye {
  position: absolute;
  top: 0;
  right: 0;
  width: 40px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  /* 叠在 input 上，默认按钮样式（width:100% 等）全部作废 */
  background: none;
  border: 0;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  color: var(--ink-faint);
  cursor: pointer;
}

.pw-eye:hover { color: var(--ink-dim); }

.pw-eye:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.pw-eye:disabled { cursor: not-allowed; opacity: 0.55; }

/* 两张眼睛图叠在同一点，靠 .on 切换可见性（默认露「闭眼」，即当前是密文） */
.pw-eye .ic { position: absolute; transition: opacity 0.12s; }
.pw-eye .ic-eye { opacity: 0; }
.pw-eye .ic-eye-off { opacity: 1; }
.pw-eye.on .ic-eye { opacity: 1; }
.pw-eye.on .ic-eye-off { opacity: 0; }

button {
  width: 100%;
  padding: 10px 14px;
  font: inherit;
  font-weight: 600;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}

button:disabled { cursor: not-allowed; opacity: 0.55; }

.primary {
  color: #fff;
  background: var(--accent);
}

.primary:hover:not(:disabled) { background: var(--accent-ink); }

.ghost {
  color: var(--ink-dim);
  background: var(--surface);
  border-color: var(--line);
}

.ghost:hover:not(:disabled) {
  color: var(--accent-ink);
  border-color: var(--accent-line);
  background: var(--accent-tint);
}

/* 错误提示：一句话 + 浅红底，不抖动不加动画——抖动的登录框更像在嘲笑用户 */
.msg {
  margin-bottom: 12px;
  padding: 8px 10px;
  font-size: 13px;
  color: var(--bad);
  background: var(--bad-tint);
  border: 1px solid var(--bad-line);
  border-radius: var(--r-sm);
}

.facts {
  margin: 18px 0 20px;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
}

.facts dt {
  font-size: 12px;
  color: var(--ink-faint);
}

.facts dd {
  margin: 2px 0 10px;
  font-family: var(--mono);
  font-size: 14px;
  word-break: break-all;
}

.facts dd:last-child { margin-bottom: 0; }

.hint,
.meta {
  margin: 14px 0 0;
  font-size: 12px;
  color: var(--ink-faint);
}

.meta { margin-top: 10px; font-family: var(--mono); }
