:root {
  color-scheme: dark;
  --auth-bg: #101b2e;
  --auth-panel: rgba(22, 35, 56, 0.9);
  --auth-panel-edge: rgba(157, 186, 218, 0.16);
  --auth-text: #eef4fb;
  --auth-muted: #a7b7cb;
  --auth-subtle: #768ba7;
  --auth-accent: #78cce4;
  --auth-accent-strong: #99deea;
  --auth-danger: #ff969c;
  --auth-radius: 20px;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; margin: 0; }

body.terminal-auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  overflow-x: hidden;
  padding: 38px 24px;
  color: var(--auth-text);
  background:
    radial-gradient(ellipse at 16% 8%, rgba(42, 91, 126, 0.22), transparent 38%),
    radial-gradient(ellipse at 92% 92%, rgba(49, 104, 111, 0.14), transparent 36%),
    var(--auth-bg);
}

.terminal-auth-glow {
  position: fixed;
  z-index: 0;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .17;
  pointer-events: none;
}

.terminal-auth-glow--one { left: -160px; top: 14%; background: #397fac; }
.terminal-auth-glow--two { right: -140px; bottom: 0; background: #458e83; }

.terminal-auth-layout {
  position: relative;
  z-index: 1;
  width: min(1080px, 100%);
  min-height: 624px;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(370px, .92fr);
  overflow: hidden;
  border: 1px solid rgba(171, 197, 224, .14);
  border-radius: 26px;
  background: rgba(16, 27, 46, .42);
  box-shadow: 0 28px 84px rgba(2, 9, 21, .32);
  backdrop-filter: blur(18px);
}

.terminal-auth-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: clamp(36px, 6vw, 68px);
  background: linear-gradient(145deg, rgba(27, 46, 70, .72), rgba(17, 31, 50, .42));
}

.terminal-auth-logo {
  display: inline-flex;
  align-items: center;
  max-width: 220px;
  min-height: 44px;
  margin-bottom: 56px;
  text-decoration: none;
}

.terminal-auth-logo img {
  display: block;
  width: auto;
  height: 44px;
  max-width: 210px;
  object-fit: contain;
}

.terminal-auth-eyebrow,
.terminal-auth-market-caption,
.terminal-auth-card-kicker {
  letter-spacing: .14em;
  text-transform: uppercase;
}

.terminal-auth-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  color: #8fa9c3;
  font-size: 11px;
  font-weight: 700;
}

.terminal-auth-eyebrow span,
.terminal-auth-foot-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--auth-accent);
  box-shadow: 0 0 14px rgba(120, 204, 228, .55);
}

.terminal-auth-brand h1 {
  margin: 0;
  font-size: clamp(37px, 4.2vw, 54px);
  line-height: 1.2;
  letter-spacing: -.045em;
  font-weight: 720;
}

.terminal-auth-brand h1 em {
  color: var(--auth-accent-strong);
  font-style: normal;
}

.terminal-auth-brand-copy {
  max-width: 380px;
  margin: 18px 0 0;
  color: #adbed1;
  font-size: 15px;
  line-height: 1.8;
}

.terminal-auth-market-visual {
  width: 100%;
  margin-top: 40px;
  padding: 12px 0 0;
  border-top: 1px solid rgba(169, 196, 223, .13);
}

.terminal-auth-market-visual svg { display: block; width: 100%; height: auto; }
.terminal-chart-grid { fill: none; stroke: #a6c0d9; stroke-opacity: .1; stroke-width: 1; }

.terminal-auth-market-caption {
  display: flex;
  justify-content: space-between;
  color: #8198b3;
  font-size: 9px;
  font-weight: 700;
}

.terminal-auth-brand-foot {
  margin: auto 0 0;
  padding-top: 32px;
  color: #8194ad;
  font-size: 12px;
  line-height: 1.65;
}

.terminal-auth-card {
  align-self: center;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: clamp(32px, 4.8vw, 58px) clamp(28px, 4.6vw, 52px);
}

.terminal-auth-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.terminal-auth-card-kicker {
  margin: 0 0 9px;
  color: var(--auth-accent);
  font-size: 10px;
  font-weight: 750;
}

.terminal-auth-card h2 {
  margin: 0;
  color: var(--auth-text);
  font-size: 30px;
  line-height: 1.25;
  letter-spacing: -.025em;
}

.terminal-auth-lock {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: var(--auth-accent);
  border: 1px solid rgba(120, 204, 228, .18);
  border-radius: 14px;
  background: rgba(120, 204, 228, .065);
}

.terminal-auth-lock svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.terminal-auth-card-copy {
  margin: 12px 0 30px;
  color: var(--auth-muted);
  font-size: 13px;
  line-height: 1.7;
}

.terminal-auth-form { display: flex; flex-direction: column; }
.terminal-auth-form label { margin: 0 0 9px; color: #dbe6f2; font-size: 13px; font-weight: 650; }
.terminal-auth-form > input,
.terminal-auth-password-wrap input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  color: var(--auth-text);
  font: inherit;
  font-size: 14px;
  border: 1px solid rgba(168, 193, 220, .21);
  border-radius: 12px;
  outline: none;
  background: rgba(9, 18, 32, .34);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.terminal-auth-form > input::placeholder,
.terminal-auth-password-wrap input::placeholder { color: #71849d; }
.terminal-auth-form > input:focus,
.terminal-auth-password-wrap input:focus { border-color: #78cce4; box-shadow: 0 0 0 3px rgba(120, 204, 228, .12); background: rgba(9, 18, 32, .62); }
.terminal-auth-form > input + label { margin-top: 21px; }

.terminal-auth-password-wrap { position: relative; }
.terminal-auth-password-wrap input { padding-right: 62px; }
.terminal-auth-password-wrap button {
  position: absolute;
  top: 50%;
  right: 12px;
  padding: 7px 5px;
  transform: translateY(-50%);
  color: #a9bed4;
  font: inherit;
  font-size: 12px;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.terminal-auth-password-wrap button:hover { color: var(--auth-accent-strong); }

.terminal-auth-captcha-head { display: flex; align-items: center; justify-content: space-between; margin-top: 22px; }
.terminal-auth-captcha-head label { margin: 0; }
.terminal-auth-refresh { padding: 5px 0 5px 10px; color: #a3b5ca; font: inherit; font-size: 12px; border: 0; background: transparent; cursor: pointer; }
.terminal-auth-refresh:hover { color: var(--auth-accent-strong); }

.terminal-auth-captcha {
  --captcha-knob: 14.375%;
  position: relative;
  width: 100%;
  height: 48px;
  margin-top: 11px;
  overflow: hidden;
  border: 1px solid rgba(143, 172, 203, .22);
  border-radius: 13px;
  background: rgba(9, 18, 32, .45);
  touch-action: none;
  user-select: none;
}

.terminal-auth-captcha-track {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: 100% 100%;
}

.terminal-auth-captcha-handle {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  width: var(--captcha-knob);
  height: 46px;
  place-items: center;
  padding: 0;
  color: #dff9ff;
  border: 1px solid rgba(144, 223, 240, .62);
  border-radius: 11px;
  background: linear-gradient(160deg, #2b7796, #235b79);
  box-shadow: 0 4px 15px rgba(0, 8, 20, .25);
  cursor: grab;
  touch-action: none;
}

.terminal-auth-captcha-handle:active { cursor: grabbing; }
.terminal-auth-captcha-handle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.terminal-auth-captcha-handle:focus-visible { outline: 2px solid #b3eff8; outline-offset: -4px; }
.terminal-auth-captcha.is-verified .terminal-auth-captcha-handle { color: #d7fae5; border-color: rgba(151, 222, 177, .78); background: linear-gradient(160deg, #397d65, #2d6656); cursor: default; }
.terminal-auth-captcha.is-verified .terminal-auth-captcha-handle svg { display: none; }
.terminal-auth-captcha.is-verified .terminal-auth-captcha-handle::after { content: "✓"; font-size: 21px; font-weight: 750; }

.terminal-auth-captcha-hint { min-height: 18px; margin: 8px 0 0; color: #91a4bb; font-size: 11px; line-height: 1.55; }
.terminal-auth-captcha-hint.is-error { color: var(--auth-danger); }
.terminal-auth-captcha-hint.is-success { color: #a2ddb7; }
.terminal-auth-status { margin: 8px 0 0; color: var(--auth-danger); font-size: 12px; line-height: 1.6; }

.terminal-auth-submit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 50px;
  margin-top: 20px;
  padding: 0 17px;
  color: #102236;
  font: inherit;
  font-size: 14px;
  font-weight: 750;
  border: 1px solid rgba(164, 228, 237, .68);
  border-radius: 12px;
  background: linear-gradient(105deg, #92d5e5, #83c8d4);
  box-shadow: 0 8px 22px rgba(72, 157, 180, .14);
  cursor: pointer;
  transition: transform 150ms ease, filter 150ms ease, opacity 150ms ease;
}

.terminal-auth-submit:hover:not(:disabled) { filter: brightness(1.05); transform: translateY(-1px); }
.terminal-auth-submit:active:not(:disabled) { transform: translateY(0) scale(.99); }
.terminal-auth-submit:disabled { opacity: .43; cursor: not-allowed; box-shadow: none; }
.terminal-auth-submit:focus-visible, .terminal-auth-refresh:focus-visible, .terminal-auth-password-wrap button:focus-visible { outline: 2px solid #b3eff8; outline-offset: 3px; }

.terminal-auth-card-foot { display: flex; align-items: flex-start; gap: 9px; margin-top: 24px; padding-top: 16px; border-top: 1px solid rgba(163, 189, 217, .13); }
.terminal-auth-card-foot p { margin: -3px 0 0; color: #8296af; font-size: 11px; line-height: 1.6; }
.terminal-auth-card-foot .terminal-auth-foot-dot { flex: 0 0 6px; width: 6px; height: 6px; margin-top: 4px; opacity: .8; }

@media (max-width: 760px) {
  body.terminal-auth-page { padding: 18px 14px; }
  .terminal-auth-layout { min-height: 0; max-width: 460px; display: block; border-radius: 22px; }
  .terminal-auth-brand { padding: 26px 25px 12px; background: transparent; }
  .terminal-auth-logo { min-height: 36px; margin-bottom: 28px; }
  .terminal-auth-logo img { height: 36px; max-width: 170px; }
  .terminal-auth-eyebrow { margin-bottom: 10px; font-size: 9px; }
  .terminal-auth-brand h1 { font-size: 30px; }
  .terminal-auth-brand-copy { margin-top: 10px; font-size: 12px; }
  .terminal-auth-market-visual { display: none; }
  .terminal-auth-brand-foot { margin-top: 18px; padding-top: 0; font-size: 10px; }
  .terminal-auth-card { padding: 25px 25px 27px; }
  .terminal-auth-card h2 { font-size: 25px; }
  .terminal-auth-card-copy { margin: 9px 0 23px; font-size: 12px; }
}

@media (max-width: 380px) {
  body.terminal-auth-page { padding: 12px 10px; }
  .terminal-auth-brand { padding: 22px 19px 9px; }
  .terminal-auth-card { padding: 23px 19px 22px; }
  .terminal-auth-logo { margin-bottom: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
