:root {
  --bg: #0a0e14;
  --panel: #0f141c;
  --panel-2: #131923;
  --panel-3: #1a212d;
  --border: #1d2532;
  --border-2: #2a3344;
  --text: #e6ebf2;
  --text-dim: #9aa6b8;
  --text-faint: #5f6b7d;
  --green: #1fc774;
  --red: #ff5168;
  --blue: #4d8df6;
  --blue-strong: #6ea3ff;
  --violet: #9d7df0;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--text-dim); }
.link { color: var(--blue); text-decoration: none; font-weight: 500; }
.link:hover { color: var(--blue-strong); text-decoration: underline; }
.link.sm { font-size: 11.5px; }

.page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
}

/* ───── hero panel ───── */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 15%, rgba(157, 125, 240, 0.22), transparent 45%),
    radial-gradient(circle at 80% 75%, rgba(77, 141, 246, 0.20), transparent 50%),
    linear-gradient(180deg, #0c1119, #0a0e14 60%);
}
.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 30% 50%, black 30%, transparent 75%);
}
.hero-inner {
  position: relative;
  z-index: 2;
  padding: 36px 52px 36px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 36px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  width: 36px; height: 36px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--blue), #3160c4);
  display: grid;
  place-items: center;
  position: relative;
  box-shadow: 0 4px 12px rgba(77, 141, 246, 0.35);
}
.brand-mark::after {
  content: "";
  width: 14px; height: 14px;
  border: 2px solid white;
  border-radius: 3px;
  border-top-color: transparent;
  border-right-color: transparent;
  transform: rotate(-45deg) translate(1px, -1px);
}
.brand-name {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
}
.brand-tag {
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero-copy {
  margin-top: auto;
  max-width: 480px;
}
.eyebrow {
  display: inline-block;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue);
  background: rgba(77, 141, 246, 0.12);
  border: 1px solid rgba(77, 141, 246, 0.3);
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 600;
  margin-bottom: 22px;
}
.hero-copy h1 {
  margin: 0 0 16px;
  font-size: 38px;
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.hero-copy p {
  margin: 0;
  font-size: 15px;
  color: var(--text-dim);
  line-height: 1.55;
  text-wrap: pretty;
  max-width: 440px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 18px 0 0;
  border-top: 1px solid var(--border);
}
.stat-val {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}
.stat-lbl {
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 2px;
}

.hero-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-dim);
}
.hero-foot .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(31, 199, 116, 0.18);
}

/* ───── login pane ───── */
.login-pane {
  background: var(--bg);
  display: flex;
  flex-direction: column;
  padding: 28px 52px 32px;
  min-width: 0;
}

.login-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.lang {
  font-size: 12px;
  color: var(--text-dim);
  cursor: pointer;
}
.lang:hover { color: var(--text); }

.login-card {
  margin: 40px auto 24px;
  width: 100%;
  max-width: 440px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 32px 22px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4), 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}

.login-card-head h2 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.login-card-head p {
  margin: 0 0 22px;
  font-size: 13px;
  color: var(--text-dim);
}

/* SSO */
.sso-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  margin-bottom: 18px;
}
.sso-btn {
  height: 40px;
  border-radius: 8px;
  background: var(--panel-2);
  border: 1px solid var(--border-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  transition: background 120ms, border-color 120ms;
}
.sso-btn:hover { background: var(--panel-3); border-color: var(--blue); }
.sso-row .sso-btn:nth-child(2),
.sso-row .sso-btn:nth-child(3) {
  width: 44px;
  padding: 0;
  font-size: 0;
}

/* divider */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0 18px;
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.04em;
}
.divider::before, .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* form */
.form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field .lbl {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}
.field .opt { color: var(--text-faint); font-weight: 400; }

.field input[type="email"],
.field input[type="password"],
.field input[type="text"] {
  height: 42px;
  background: var(--panel-2);
  border: 1px solid var(--border-2);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 120ms, background 120ms;
  width: 100%;
}
.field input::placeholder { color: var(--text-faint); }
.field input:focus {
  border-color: var(--blue);
  background: var(--panel-3);
  box-shadow: 0 0 0 3px rgba(77, 141, 246, 0.15);
}

.pw-wrap { position: relative; }
.pw-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px; height: 28px;
  display: grid; place-items: center;
  color: var(--text-faint);
  border-radius: 5px;
}
.pw-toggle:hover { color: var(--text); background: var(--panel-3); }

/* OTP */
.otp-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.otp {
  width: 42px;
  height: 42px;
  background: var(--panel-2);
  border: 1px solid var(--border-2);
  border-radius: 8px;
  text-align: center;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 16px;
  color: var(--text);
  outline: none;
  transition: border-color 120ms, background 120ms;
}
.otp:focus {
  border-color: var(--blue);
  background: var(--panel-3);
  box-shadow: 0 0 0 3px rgba(77, 141, 246, 0.15);
}
.otp-sep { color: var(--text-faint); padding: 0 4px; }

/* checks */
.form-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}
.check {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12.5px;
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
}
.check input { display: none; }
.check .box {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid var(--border-2);
  background: var(--panel-2);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: background 120ms, border-color 120ms;
  position: relative;
}
.check input:checked + .box {
  background: var(--blue);
  border-color: var(--blue);
}
.check input:checked + .box::after {
  content: "";
  width: 8px; height: 4px;
  border-left: 2px solid white;
  border-bottom: 2px solid white;
  transform: rotate(-45deg) translate(0px, -1px);
}

/* primary */
.primary-btn {
  margin-top: 8px;
  height: 46px;
  border-radius: 9px;
  background: var(--blue);
  color: white;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: filter 120ms, transform 80ms, box-shadow 200ms;
  box-shadow: 0 8px 24px rgba(77, 141, 246, 0.3), 0 1px 0 rgba(255, 255, 255, 0.18) inset;
}
.primary-btn:hover { filter: brightness(1.06); }
.primary-btn:active { transform: translateY(1px); }
.primary-btn .arr { transition: transform 200ms; }
.primary-btn:hover .arr { transform: translateX(3px); }

/* alt row */
.alt-row {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  margin-top: 6px;
  font-size: 12px;
}
.dot-sep { color: var(--text-faint); }

/* card foot */
.card-foot {
  margin: 22px -32px -22px;
  padding: 12px 32px;
  border-top: 1px solid var(--border);
  background: var(--panel-2);
  border-radius: 0 0 16px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-dim);
}
.status-line { display: flex; align-items: center; gap: 8px; }
.status-line .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(31, 199, 116, 0.18);
}
.latency {
  background: var(--panel-3);
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 11px;
  color: var(--text);
}

.legal {
  margin: auto auto 0;
  font-size: 11.5px;
  color: var(--text-faint);
  text-align: center;
  padding-top: 24px;
}

/* error pill (rendered into #login-err-slot from login.js) */
.err-pill {
  margin-bottom: 16px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 81, 104, 0.10);
  border: 1px solid rgba(255, 81, 104, 0.32);
  color: #ffaab2;
  font-size: 12.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.err-pill::before {
  content: "!";
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--red);
  color: white;
  display: grid; place-items: center;
  font-weight: 700; font-size: 11px;
  flex-shrink: 0;
}

.spin {
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.check input:disabled + .box { opacity: 0.85; cursor: default; }

/* responsive */
@media (max-width: 920px) {
  .page { grid-template-columns: 1fr; }
  .hero { display: none; }
  .login-pane { padding: 24px 20px 28px; }
  .login-card { margin-top: 16px; padding: 24px 22px 16px; }
  .card-foot { margin: 18px -22px -16px; padding: 10px 22px; }
}
