@font-face {
  font-family: Geist;
  src: url('/static/fonts/geist-latin.woff2') format('woff2');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

/* Bitget Dark Mode Canonical Login Page (#070808 canvas, centered 400px borderless column, zero wireframe lines) */
:root {
  color-scheme: dark;
  --bg-canvas: #070808;
  --bg-base: #070808;
  --bg-primary: #151517;
  --bg-hover: #1f2023;
  --bg-input: #252629;
  --border-subtle: #27282b;
  --border-strong: #38393d;
  --text: #f4f5f7;
  --text-2: #eaeaed;
  --muted: #8e8e92;
  --disabled: #57585c;
  --brand: #ff7300;
  --brand-hover: #ff851a;
  --up: #26c99b;
  --up-dim: rgba(38, 201, 155, 0.12);
  --up-line: rgba(38, 201, 155, 0.34);
  --error: #f1493f;
  --sans: "Geist", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-canvas);
  color: var(--text);
  font: 400 14px/1.5 var(--sans);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: wait; opacity: 0.55; }
:focus-visible { outline: 1px solid #ffffff; outline-offset: 2px; }

/* Unified 64px Pure-Black Masthead (matches /markets, /trade, /settings) */
.masthead {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 64px;
  background: var(--bg-canvas);
}
.masthead-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 30px;
}
.masthead-left {
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: var(--brand);
}
.brand-mark svg { width: 24px; height: 24px; }
.brand-name {
  font: 600 16px/20px var(--sans);
  letter-spacing: -0.02em;
}
.masthead-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}
.masthead-nav a {
  display: inline-flex;
  align-items: center;
  height: 32px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color 140ms ease;
}
.masthead-nav a:hover { color: var(--text); }
.masthead-back {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 140ms ease, color 140ms ease;
}
.masthead-back:hover {
  background: var(--bg-hover);
  color: var(--text);
}

/* Single-Column Centered 400px Borderless Form (Bitget /zh-CN/login exact geometry) */
main {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 56px 20px 64px;
}

.login-card {
  width: 100%;
  max-width: 400px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.card-header h1 {
  margin: 0;
  font: 700 32px/38px var(--sans);
  letter-spacing: -0.025em;
  color: var(--text);
}
.card-header p {
  margin: 8px 0 0;
  color: var(--muted);
  font: 400 14px/22px var(--sans);
}
.card-header .next-hint {
  margin: 12px 0 0;
  padding: 8px 12px;
  border: 1px solid #222428;
  border-radius: 8px;
  background: transparent;
  color: var(--brand-hover);
  font: 400 12.5px/18px var(--sans);
}

/* Bitget Signature Underline Tabs (16px x 3px centered #FFFFFF bar) */
.auth-tabs {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 40px;
  margin: 24px 0 18px;
}
.auth-tab {
  position: relative;
  height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: 600 14px/16px var(--sans);
  transition: color 140ms ease;
}
.auth-tab:hover { color: var(--text); }
.auth-tab.is-active { color: var(--text); }
.auth-tab.is-active::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 16px;
  height: 3px;
  border-radius: 1px;
  background: #ffffff;
}

.field { margin-bottom: 16px; }
label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font: 400 12.5px/18px var(--sans);
}

/* Exact Bitget `/zh-CN/login` 48px Pure-Black Transparent Input + 1px Crisp Outline -> #FFFFFF Focus */
input {
  display: block;
  width: 100%;
  height: 48px;
  padding: 11px 14px;
  border: 1px solid #303237;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: 400 15px/24px var(--sans);
  outline: none;
  transition: border-color 140ms ease;
}
input:hover { border-color: #52555c; }
input:focus, input:focus-visible {
  outline: none;
  border-color: #ffffff;
  background: transparent;
  box-shadow: none;
}
input:user-invalid { border-color: var(--error); }
input:user-invalid:focus, input:user-invalid:focus-visible {
  border-color: var(--error);
  box-shadow: 0 0 0 1px var(--error);
}
input::placeholder { color: #6e727a; }

.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 60px; }
.pw-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: 500 12px/16px var(--sans);
  transition: color 120ms ease;
}
.pw-toggle:hover { color: var(--text); }

/* Live Password Rule Pills (Sign-up Mode — transparent outlined pills) */
.pw-rules {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -6px 0 16px;
}
.pw-rule {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border: 1px solid #222428;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font: 500 11px/14px var(--sans);
  transition: border-color 140ms ease, color 140ms ease;
}
.pw-rule::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--disabled);
}
.pw-rule.is-ok {
  border-color: var(--up-line);
  background: transparent;
  color: var(--up);
}
.pw-rule.is-ok::before { background: var(--up); }

.field-help {
  margin: 0 0 14px;
  color: var(--muted);
  font: 400 12px/18px var(--sans);
}
.field-help:empty { display: none; }

.notice {
  margin: 0 0 16px;
  padding: 10px 12px;
  border: 1px solid #222428;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: 400 12.5px/18px var(--sans);
}

/* Bitget Iconic Solid Pure-White Primary CTA (#FFFFFF bg / #151517 ink, 48px, 12px radius) */
.primary {
  width: 100%;
  height: 48px;
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  background: #ffffff;
  color: #151517;
  font: 600 15px/22px var(--sans);
  transition: background-color 140ms ease, opacity 140ms ease;
}
.primary:hover:not(:disabled) { background: #eaeaed; }
.primary:active:not(:disabled) { background: #dedfe0; }
.primary:disabled { background: #1e2024; color: var(--disabled); opacity: 1; }

.secondary {
  width: 100%;
  height: 48px;
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid #26282d;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: 500 14px/20px var(--sans);
  transition: border-color 140ms ease, background-color 140ms ease;
}
.secondary:hover:not(:disabled) { border-color: #f4f5f7; background: #111215; }
.secondary svg { width: 18px; height: 18px; }

.text-switch {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 6px 0;
  border: 0;
  background: transparent;
  color: var(--brand-hover);
  font: 500 13px/18px var(--sans);
  text-align: center;
}
.text-switch:hover { text-decoration: underline; }

.text-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--brand-hover);
  font: 500 13px/18px var(--sans);
}
.text-button:hover { text-decoration: underline; }

.email-review {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  margin-bottom: 16px;
  border: 1px solid #222428;
  border-radius: 8px;
  background: transparent;
  font-size: 13.5px;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 16px;
  color: var(--muted);
  font: 400 13px/18px var(--sans);
}
.divider::before, .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #1e2024;
}

.error {
  margin: 14px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(241, 73, 63, 0.35);
  border-radius: 8px;
  background: transparent;
  color: #ff8a84;
  font: 400 12.5px/18px var(--sans);
}

.page-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 28px 20px;
  color: var(--muted);
  font: 400 12px/18px var(--sans);
}
.page-footer .sep { color: var(--border-strong); }
.page-footer .footer-link {
  color: var(--text);
  text-decoration: none;
}
.page-footer .footer-link:hover { text-decoration: underline; }

.legal-consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 14px;
  color: var(--muted);
  font: 400 12.5px/18px var(--sans);
  cursor: pointer;
}
.legal-consent input[type="checkbox"] {
  width: 15px;
  height: 15px;
  margin: 2px 0 0;
  flex: none;
  accent-color: var(--text);
}
.legal-consent a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.legal-consent a:hover { text-decoration: underline; }

/* Dedicated /legal Terms & Risk Disclosure Document */
body.legal-page .legal-main {
  padding: 40px 20px 64px;
}
.legal-doc {
  width: 100%;
  max-width: 760px;
  padding: 32px 36px;
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  background: var(--bg-primary);
}
.legal-head {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 24px;
}
.legal-badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 6px;
  background: #202227;
  border: 0;
  color: #d4d7de;
  font: 600 12px/1 var(--sans);
  margin-bottom: 12px;
}
.legal-head h1 {
  margin: 0;
  font: 700 26px/34px var(--sans);
  letter-spacing: -0.02em;
  color: var(--text);
}
.legal-lead {
  margin: 10px 0 0;
  color: var(--muted);
  font: 400 14px/22px var(--sans);
}
.legal-sec {
  margin-bottom: 22px;
}
.legal-sec h2 {
  margin: 0 0 10px;
  font: 600 16px/24px var(--sans);
  color: var(--text);
}
.legal-sec p {
  margin: 0 0 10px;
  color: var(--text-2);
  font: 400 14px/22px var(--sans);
}
.legal-sec ul {
  margin: 0;
  padding-left: 20px;
  color: var(--text-2);
  font: 400 13.5px/22px var(--sans);
}
.legal-sec li { margin-bottom: 8px; }
.legal-sec strong { color: var(--text); font-weight: 600; }
.legal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
}
.btn-legal-pri,
.btn-legal-sec {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 18px;
  border-radius: 10px;
  font: 600 13.5px/1 var(--sans);
  text-decoration: none;
  transition: background-color 140ms ease, border-color 140ms ease;
}
.btn-legal-pri {
  background: #ffffff;
  color: #151517;
}
.btn-legal-pri:hover { background: #eaeaed; }
.btn-legal-sec {
  border: 1px solid var(--border-strong);
  color: var(--text);
  background: transparent;
}
.btn-legal-sec:hover { background: var(--bg-hover); }

@media (max-width: 640px) {
  .legal-doc { padding: 20px 18px; border-radius: 12px; }
  .legal-head h1 { font-size: 21px; line-height: 28px; }
}

@media (max-width: 640px) {
  .masthead-inner { padding: 0 12px; gap: 8px; }
  .masthead-nav { display: none; }
  .masthead-right { gap: 6px; }
  .masthead-back { white-space: nowrap; font-size: 12px; padding: 0 10px; }
  .masthead .ah-lang-toggle { height: 30px !important; padding: 0 6px !important; font-size: 11px !important; }
  .masthead .ah-lang-toggle .ah-lang-ic { display: none !important; }
  main { padding: 36px 20px 48px; }
  .page-footer { padding: 20px 16px; gap: 6px 12px; text-align: center; }
  .page-footer .sep { display: none; }
}
@media (max-width: 390px) {
  .masthead:has(.ah-lang-toggle) .brand-name { font-size: 14px; }
}
