/* RBAC 共享登录组件 · 样式
 *
 * 🔴 色板与元件几何**逐字取自** web/partner-hub/style.css 的 :root 一段
 *   （那份文件是画布 0 的既有实现，本设计基线画布 0 明写「继承
 *   web/partner-hub/style.css / web/adminhub/style.css 现有视觉变量，
 *   不新增设计令牌」）。核对表见 design/reference/rbac-00-design-baseline-v2.png。
 *
 * 🔴 这是内部工具的中性灰 + 石墨青（#0E7490），刻意不是消费端 App 的
 *   奶油白 + 蜜桃橙。不要把品牌橙搬进来。
 */

:root {
  --w: #FFFFFF;
  --g-50: #FBFBFC;
  --g-100: #F7F8F9;
  --g-150: #F1F3F5;
  --g-200: #E4E7EA;
  --g-300: #D6DAE0;
  --g-400: #B4BAC2;
  --g-500: #8A9099;
  --g-550: #7A828C;
  --g-600: #5A6270;
  --ink: #16191D;

  --accent: #0E7490;
  --accent-d: #0A5A6E;
  --accent-l: #E8F1F3;
  --accent-b: #B8D6DD;

  --pending-bg: #FDF4E3;  --pending-fg: #96620B;  --pending-bd: #EFDCB4;  --pending-dot: #C8891A;
  --approved-bg: #EAF4EE; --approved-fg: #1B6B3D; --approved-bd: #C2E0CD; --approved-dot: #2A8A52;
  --rejected-bg: #FCEDEB; --rejected-fg: #A3271C; --rejected-bd: #F0CDC8; --rejected-dot: #C2402F;
  --withdrawn-bg: #F1F3F5;--withdrawn-fg: #5A6270;--withdrawn-bd: #DDE1E6; --withdrawn-dot: #8A9099;

  --radius: 7px;
  --radius-sm: 5px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--g-200);
  color: var(--ink);
  font-family: 'Public Sans', 'Noto Sans SC', -apple-system, 'PingFang SC', system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.num { font-variant-numeric: tabular-nums; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-d); text-decoration: underline; }
[hidden] { display: none !important; }

/* ═══════════════ 按钮（画布 0：高 30 · 圆角 5）═══════════════ */

.btn {
  height: 30px;
  padding: 0 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  transition: background 0.1s ease, border-color 0.1s ease;
}
.btn:hover:not(:disabled) { background: var(--accent-d); border-color: var(--accent-d); }

.btn.secondary { border-color: var(--g-300); background: var(--w); color: var(--ink); }
.btn.secondary:hover:not(:disabled) { background: var(--g-100); border-color: var(--g-300); }

.btn.text { border-color: transparent; background: transparent; color: var(--accent); padding: 0 7px; }
.btn.text:hover:not(:disabled) { background: var(--accent-l); border-color: transparent; color: var(--accent-d); }

.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.block { width: 100%; }

/* ═══════════════ 表单元件（画布 0）═══════════════ */

.field { display: flex; flex-direction: column; gap: 5px; }
.field > .label { font-size: 12px; color: var(--g-600); display: flex; align-items: center; gap: 4px; }
.field .hint { font-size: 11px; color: var(--g-550); line-height: 1.6; }
.field .err { font-size: 11px; color: #A3271C; line-height: 1.6; }

input[type="text"], input[type="password"], input[type="email"] {
  height: 32px;
  padding: 0 9px;
  border: 1px solid var(--g-300);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 13px;
  background: var(--w);
  color: var(--ink);
  width: 100%;
  outline: none;
  transition: border-color 0.1s ease, box-shadow 0.1s ease;
  letter-spacing: normal;
}
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(14, 116, 144, 0.14); }
input:disabled { background: var(--g-100); color: var(--g-550); cursor: not-allowed; }
::placeholder { color: var(--g-500); }

/* OTP 验证码输入：等宽数字、留出视觉间距，但仍是一个普通 input（不做六格拆分，
   拆分格会让粘贴/自动填充体验变差，画布 1 没有要求逐格样式）。 */
input.otp-code { font-variant-numeric: tabular-nums; letter-spacing: 0.3em; font-size: 16px; text-align: center; }

/* ═══════════════ 提示条（登录页 / 表单共用）═══════════════ */

.notice {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 1.6;
  border: 1px solid;
  margin-bottom: 16px;
}
.notice .icon {
  width: 15px; height: 15px; border-radius: 50%;
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex: none; margin-top: 1px; color: #fff;
}
/* 错误：口令错、验证码错、提交失败。 */
.notice.error { background: var(--rejected-bg); border-color: var(--rejected-bd); color: var(--rejected-fg); }
.notice.error .icon { background: var(--rejected-dot); }
/* 中性：账号停用/角色不匹配/锁定/网络问题——这些是事实陈述，不是用户的错。
   🔴 「角色不匹配」必须走这一档而不是 .error（本组件设计基线明写：
      这是账号的一个既有事实，不是这次输入错了）。 */
.notice.neutral { background: var(--g-100); border-color: var(--g-200); color: var(--g-600); }
.notice.neutral .icon { background: var(--g-500); }
.notice.success { background: var(--approved-bg); border-color: var(--approved-bd); color: var(--approved-fg); }
.notice.success .icon { background: var(--approved-dot); }
.notice .body { flex: 1; min-width: 0; }
.notice .t { font-weight: 600; }

/* ═══════════════ 登录页布局（画布 1）═══════════════
 *
 * 🔴 画布 1 的登录屏是**全出血双栏**（design/reference/rbac-01-login-v2.png）：
 *   左栏是一块贴边到视口上下左边界的深色（--ink）实心面板，右栏是浅灰
 *   页面背景上居中的白卡片——不是「两个元素在一个居中的浅灰容器里并排
 *   摆放」。之前的实现把 .auth-intro 也放在 --g-200 背景上，丢了截图里
 *   最显眼的深色板视觉——按截图实测像素（左栏采样点 RGB(22,25,30) ≈
 *   --ink）改回全出血结构，用 `.auth-page.split`（仅登录屏）区分于
 *   其余四个单卡片屏（强制改密/邀请兑换/忘记密码申请与兑换），
 *   后者维持原来的「居中单卡片」布局，不受此规则影响。 */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: var(--g-200);
}
.auth-wrap { display: flex; gap: 48px; align-items: center; max-width: 900px; width: 100%; }

.auth-page.split {
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
}
.auth-page.split .auth-wrap {
  gap: 0;
  max-width: none;
  align-items: stretch;
}

.auth-intro { flex: 1; min-width: 0; }
.auth-page.split .auth-intro {
  flex: 1 1 50%;
  background: var(--ink);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 56px 64px;
}
.auth-intro .mark { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.auth-page.split .auth-intro .mark { margin-bottom: 48px; }
.auth-intro .mark .logo {
  width: 28px; height: 28px; border-radius: 6px;
  background: var(--accent); color: #fff;
  font-size: 14px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex: none;
}
.auth-intro .mark .name { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.auth-page.split .auth-intro .mark .name { color: #fff; }
.auth-intro .mark .sub { font-size: 12px; color: var(--g-550); }
.auth-page.split .auth-intro .mark .sub { color: var(--g-400); }
.auth-intro h1 { font-size: 24px; font-weight: 600; margin: 0 0 10px; letter-spacing: -0.01em; }
.auth-page.split .auth-intro h1 { color: #fff; }
.auth-intro .domain-url { font-size: 12px; color: var(--g-550); margin: 0 0 16px; }
.auth-page.split .auth-intro .domain-url { color: var(--g-400); }
.auth-intro p { font-size: 13px; color: var(--g-600); line-height: 1.75; margin: 0 0 10px; max-width: 420px; }
.auth-page.split .auth-intro p { color: var(--g-400); }

.auth-page.split .auth-wrap > .auth-card {
  flex: 1 1 50%;
  width: auto;
  max-width: 340px;
  margin: auto 64px;
}

.auth-card {
  width: 340px; flex: none;
  background: var(--w);
  border: 1px solid var(--g-300);
  border-radius: 8px;
  padding: 26px 24px;
}
.auth-card h1 { font-size: 17px; font-weight: 600; margin: 0 0 4px; letter-spacing: -0.01em; }
.auth-card .lede { font-size: 12px; color: var(--g-550); margin: 0 0 20px; }
.auth-card .field + .field { margin-top: 14px; }
.auth-card .btn.block { margin-top: 20px; }
.auth-card .links { margin-top: 12px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.auth-card .links a { font-size: 12px; }

/* 账号发放说明：内容硬约束，不是装饰——没有注册入口、没有自助重置。 */
.auth-note {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--g-200);
  display: flex;
  gap: 8px;
  font-size: 12px;
  color: var(--g-600);
  line-height: 1.65;
}
.auth-note .i {
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--g-150); color: var(--g-600);
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex: none; margin-top: 2px;
}
.auth-note .contact { display: block; margin-top: 3px; font-size: 11px; color: var(--g-550); }

/* 已登录成功后的占位工作区（非 admin 域，Admin 控制台是 Phase 2b） */
.work-placeholder {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 40px 24px; background: var(--g-200);
}
.work-placeholder .card {
  background: var(--w); border: 1px solid var(--g-300); border-radius: 8px;
  padding: 32px; max-width: 460px; width: 100%; text-align: center;
}
.work-placeholder h1 { font-size: 17px; font-weight: 600; margin: 0 0 8px; }
.work-placeholder p { font-size: 12.5px; color: var(--g-600); line-height: 1.7; margin: 0 0 18px; }
.work-placeholder .who { font-size: 11px; color: var(--g-550); margin-top: 16px; }

@media (max-width: 760px) {
  .auth-wrap { flex-direction: column; gap: 28px; }
  .auth-intro { text-align: center; }
  .auth-intro p { margin-left: auto; margin-right: auto; }

  /* 窄屏把双栏折叠成上下堆叠：深色板收窄内边距、卡片回到居中单卡片的
     几何（与其余四个单卡片屏窄屏下一致），避免 --auth-wrap gap:0 在
     纵向堆叠时让卡片贴死在深色板下缘。 */
  .auth-page.split { padding: 0; }
  .auth-page.split .auth-wrap { gap: 0; }
  .auth-page.split .auth-intro { padding: 40px 24px; }
  .auth-page.split .auth-wrap > .auth-card {
    max-width: 340px;
    width: 100%;
    margin: 32px auto;
  }
}
