/* ══════════════════════════════════════════════════════════════════════════
   HoyiPAY · shared auth shell (merchant + operations)
   Colour source: logo pixels — cyan #10c8f8 / mint #28e8a8 / navy #384860.
   ⚠ This page does NOT touch assets/console.css tokens (--brand / --accent):
     docs/verify/brand-check.js asserts their exact values on this page.
     So the auth shell carries its own small token block, scoped to :root here.
   ══════════════════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

:root {
  --cyan: #10c8f8;
  --mint: #28e8a8;
  --grad: linear-gradient(100deg, #10c8f8 0%, #22d8d0 52%, #28e8a8 100%);
  --ease: cubic-bezier(.16,1,.3,1);
}

html[data-theme="light"] {
  --page: #ffffff;
  --panel: #f7fafc;
  --card: #ffffff;
  --line: #e4ecf2;
  --line-2: #cfdde8;
  --ink: #0d1f2d;
  --ink-2: #3d5566;
  --ink-3: #67808f;
  --deep: #0a1a26;
  --on-deep: #f2f8fb;
  --on-deep-2: #9fb6c6;
  --field: #ffffff;
  --field-line: #d8e3ec;
  --err-bg: #fff5f5; --err-line: #ffd4d4; --err-ink: #b42318;
  --shadow: 0 2px 4px rgba(13,31,45,.04), 0 24px 60px -30px rgba(13,31,45,.25);
}
html[data-theme="dark"] {
  --page: #061219;
  --panel: #08161f;
  --card: #0c1f2b;
  --line: #193342;
  --line-2: #22485c;
  --ink: #eaf4f9;
  --ink-2: #a9c2d1;
  --ink-3: #7b96a6;
  --deep: #040d13;
  --on-deep: #eaf4f9;
  --on-deep-2: #93aebd;
  --field: #0a1c27;
  --field-line: #22485c;
  --err-bg: rgba(180,35,24,.14); --err-line: rgba(255,120,110,.4); --err-ink: #ff9d94;
  --shadow: 0 8px 40px -12px rgba(0,0,0,.7);
}

body {
  overflow-x: hidden;
  margin: 0; min-height: 100vh;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang HK",
               "PingFang SC", "Noto Sans TC", "Microsoft JhengHei", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  background: var(--page); color: var(--ink); line-height: 1.6;
}

/* ── split layout: brand panel | form ── */
.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr);
}

/* ══════ Left: brand ══════ */
.brandpane {
  position: relative; overflow: hidden;
  background: var(--deep); color: var(--on-deep);
  display: flex; flex-direction: column;
  padding: 44px 52px;
}
.brandpane::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(72% 62% at 82% 6%, rgba(16,200,248,.26), transparent 62%),
    radial-gradient(64% 56% at 4% 96%, rgba(40,232,168,.16), transparent 64%);
}
.brandpane > * { position: relative; z-index: 1; }

.brandpane .logo {
  display: flex; align-items: center; gap: 11px;
  text-decoration: none; margin-bottom: auto;
}
.brandpane .logo img { width: 36px; height: 36px; display: block; }
.brandpane .logo-word, .brandpane .logo-word-light {
  font-size: 19px; font-weight: 800; letter-spacing: -.035em;
  color: var(--on-deep); line-height: 1;
}
.brandpane .logo-word-light { color: #fff; }
.brandpane .logo-word em {
  font-style: normal; background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

.brandpane .lead { max-width: 26em; padding: 40px 0; }
.brandpane h1 {
  font-size: clamp(26px, 2.7vw, 38px); line-height: 1.16; letter-spacing: -.034em;
  font-weight: 800; margin: 0 0 16px;
}
.brandpane h1 .accent {
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.brandpane p { font-size: 15px; line-height: 1.7; color: var(--on-deep-2); margin: 0; }

.brandpane .pills { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 30px; }
.brandpane .pill {
  display: inline-flex; align-items: center; gap: 7px;
  height: 30px; padding: 0 13px; border-radius: 99px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
  font-size: 12px; font-weight: 600; color: var(--on-deep-2);
}
.brandpane .pill i {
  width: 5px; height: 5px; border-radius: 50%; background: var(--mint);
  box-shadow: 0 0 8px var(--mint); flex: none;
}

.brandpane .foot { display: flex; flex-wrap: wrap; gap: 8px 20px; padding-top: 32px; font-size: 12px; color: var(--on-deep-2); }
.brandpane .foot a { color: var(--on-deep-2); text-decoration: none; }
.brandpane .foot a:hover { color: var(--cyan); }

/* ══════ Right: form ══════ */
.formpane {
  display: flex; flex-direction: column;
  padding: 36px 40px;
  background: var(--page);
}
.formpane .top { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }

.tbtn {
  width: 36px; height: 36px; flex: none; display: grid; place-items: center;
  border: 1px solid var(--line); background: var(--card); color: var(--ink-2);
  border-radius: 10px; cursor: pointer; padding: 0;
  transition: color .18s, border-color .18s, transform .25s var(--ease);
}
.tbtn:hover { color: var(--ink); border-color: var(--line-2); }
.tbtn:active { transform: scale(.94); }
.tbtn svg { width: 17px; height: 17px; display: block; }
html[data-theme="light"] .icon-moon { display: none; }
html[data-theme="dark"]  .icon-sun  { display: none; }

.formpane .mid { margin: auto 0; width: 100%; max-width: 384px; align-self: center; padding: 32px 0; }

/* mobile-only logo */
.mlogo { display: none; align-items: center; gap: 10px; margin-bottom: 26px; }
.mlogo img { width: 32px; height: 32px; display: block; }
.mlogo img.logo-full { width: auto; height: 32px; max-width: 180px; object-fit: contain; }
.mlogo span { font-size: 18px; font-weight: 800; letter-spacing: -.035em; color: var(--ink); }
.mlogo em {
  font-style: normal; background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

h2.title { font-size: 25px; font-weight: 780; letter-spacing: -.03em; margin: 0 0 7px; color: var(--ink); }
.leadline { font-size: 14px; color: var(--ink-2); margin: 0 0 28px; }

.err {
  display: none; margin-bottom: 18px; padding: 11px 14px;
  border-radius: 10px; background: var(--err-bg);
  border: 1px solid var(--err-line); color: var(--err-ink);
  font-size: 13px; line-height: 1.55;
}

.field { margin-bottom: 16px; }
.field label {
  display: block; font-size: 12.5px; font-weight: 650;
  color: var(--ink-2); margin-bottom: 7px; letter-spacing: .005em;
}
.inpwrap { position: relative; }
input[type=email], input[type=password], input[type=text] {
  width: 100%; height: 46px; padding: 0 14px;
  border: 1px solid var(--field-line); border-radius: 11px;
  background: var(--field); color: var(--ink);
  font-size: 14.5px; font-family: inherit; outline: none;
  transition: border-color .16s, box-shadow .16s, background .16s;
}
input[type=password] { padding-right: 46px; }
input::placeholder { color: var(--ink-3); opacity: .75; }
input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3.5px rgba(16,200,248,.16);
}
input:disabled { opacity: .6; }

.eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; display: grid; place-items: center;
  border: none; background: transparent; color: var(--ink-3);
  cursor: pointer; border-radius: 8px; padding: 0;
  transition: color .16s, background .16s;
}
.eye:hover { color: var(--ink); background: var(--panel); }
.eye svg { width: 17px; height: 17px; }

.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.remember { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); cursor: pointer; user-select: none; }
.remember input { width: 15px; height: 15px; accent-color: var(--cyan); cursor: pointer; margin: 0; }
.link { font-size: 13px; color: var(--ink-2); text-decoration: none; font-weight: 550; }
.link:hover { color: var(--cyan); }

.submit {
  width: 100%; height: 48px; border: none; border-radius: 12px;
  background: var(--grad); color: #04121a;
  font-size: 15px; font-weight: 750; font-family: inherit; letter-spacing: -.01em;
  cursor: pointer; position: relative; overflow: hidden;
  box-shadow: 0 10px 26px -12px rgba(16,200,248,.8);
  transition: transform .22s var(--ease), box-shadow .22s var(--ease), opacity .16s;
}
.submit:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 18px 40px -14px rgba(16,200,248,.9); }
.submit:active:not(:disabled) { transform: translateY(0); }
.submit:disabled { opacity: .65; cursor: not-allowed; box-shadow: none; }

.altline { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line);
           font-size: 13px; color: var(--ink-2); text-align: center; }
.altline a { color: var(--cyan); text-decoration: none; font-weight: 650; }
.altline a:hover { text-decoration: underline; }

.backlink {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 18px; font-size: 12.5px; color: var(--ink-3); text-decoration: none;
}
.backlink:hover { color: var(--ink-2); }

/* demo hint box */
.who-box, .demo {
  margin-top: 22px; padding: 13px 15px; border-radius: 11px;
  background: var(--panel); border: 1px solid var(--line);
  font-size: 12.5px; color: var(--ink-2); line-height: 1.6;
}
.demo b { color: var(--ink); font-weight: 700; }
.demo code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px;
  background: var(--card); border: 1px solid var(--line);
  padding: 1px 5px; border-radius: 4px; color: var(--ink);
}


/* language switch — always visible on the auth top bar, including 390px */
.lang-switch {
  display: inline-flex; align-items: center; height: 36px; padding: 3px;
  border: 1px solid var(--line); background: var(--card);
  border-radius: 10px; flex: none; flex-shrink: 0; gap: 0;
}
.lang-switch button {
  height: 28px; padding: 0 8px; border: 0; background: transparent;
  color: var(--ink-3); font-size: 11.5px; font-weight: 750; letter-spacing: .04em;
  border-radius: 7px; cursor: pointer; font-family: inherit; line-height: 1;
}
.lang-switch button.is-on { background: var(--ink); color: var(--page); }
@media (max-width: 420px) {
  .lang-switch { height: 32px; padding: 2px; }
  .lang-switch button { height: 26px; padding: 0 7px; font-size: 11px; }
}

/* ── responsive ── */
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .brandpane { display: none; }
  .formpane { padding: 24px 22px 40px; }
  .mlogo { display: flex; }
  .formpane .mid { padding: 8px 0 0; max-width: 420px; }
}
@media (max-width: 420px) {
  h2.title { font-size: 22px; }
  .row { flex-wrap: wrap; }
}

/* ══════════════════════════════════════════════════════════════════════════
   触控目标（移动端）
   ─────────────────────────────────────────────────────────────────────────
   实测：390px 宽度下 `Forgot password?` 只有 21px 高、`Back to hoyipay.com`
   只有 15px、记住我复选框只有 15px —— 手指点不准，容易误触到旁边。
   WCAG 2.2 的 2.5.8（Target Size Minimum）要求 ≥ 24×24；
   我们做到 40px 竖向，明显更好按，且不改变视觉大小（只加内边距/行高）。
   ⚠ 复选框本身不能撑到 40px（会变成一个巨大的方块），
     所以撑它的**标签**（.remember 已经是整块 label，点哪都行）。
   ══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .link { display: inline-flex; align-items: center; min-height: 40px; padding: 0 2px; }
  .remember { min-height: 40px; }
  .remember input { width: 18px; height: 18px; }
  .altline { line-height: 2.1; }
  .altline a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 2px; }
  .backlink { min-height: 40px; }
  .foot a { display: inline-flex; align-items: center; min-height: 40px; }
}
