:root {
  --auth-ink: #080d0c;
  --auth-surface: #101817;
  --auth-raised: #15211f;
  --auth-raised-2: #1b2926;
  --auth-line: #263633;
  --auth-line-soft: #1a2825;
  --auth-text: #eff8f5;
  --auth-muted: #9aada8;
  --auth-dim: #657873;
  --auth-mint: #11d0a2;
  --auth-mint-soft: #75eed0;
  --auth-blue: #2823f8;
  --auth-amber: #f4bd6a;
  --auth-red: #ee786b;
  --auth-radius: 10px;
  --auth-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }

html { min-width: 320px; scroll-behavior: smooth; }

body.auth-page {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(680px 460px at 9% 14%, rgba(40, 35, 248, .12), transparent 68%),
    radial-gradient(720px 520px at 92% 86%, rgba(17, 208, 162, .08), transparent 72%),
    var(--auth-ink);
  color: var(--auth-text);
  font-family: "DM Sans", "PingFang SC", "Hiragino Sans GB", system-ui, sans-serif;
  line-height: 1.4;
  letter-spacing: 0;
}

body.auth-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .4;
  background-image:
    linear-gradient(rgba(117, 238, 208, .028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(117, 238, 208, .028) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, black, transparent 88%);
}

a { color: inherit; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.auth-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(420px, .92fr);
  min-height: 100vh;
  max-width: none;
  margin: 0 auto;
  padding: 28px 104px 34px;
  gap: clamp(48px, 7vw, 118px);
}

@media (min-width: 981px) {
  .auth-shell {
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
    padding-top: 24px;
    padding-bottom: 24px;
  }

  .auth-visual {
    height: calc(100dvh - 48px);
    min-height: 0 !important;
  }

  .auth-form-side {
    height: calc(100dvh - 48px) !important;
    align-items: center;
    padding: 0 !important;
  }
}

.auth-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 62px);
  padding: 4px 0 8px;
  overflow: hidden;
}

.auth-visual::after {
  content: "";
  position: absolute;
  right: -15%;
  bottom: -10%;
  width: 68%;
  height: 56%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(17, 208, 162, .08), transparent 67%);
}

.auth-brand {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  width: fit-content;
  text-decoration: none;
}

.auth-brand img { display: block; width: 168px; height: auto; }
.auth-brand-token { display: inline-flex; align-items: center; min-height: 20px; padding: 0 7px; border: 1px solid rgba(117,238,208,.28); border-radius: 999px; background: rgba(17,208,162,.06); color: #75eed0; font: 600 11px/1 "IBM Plex Mono", monospace; letter-spacing: .04em; white-space: nowrap; }

.auth-visual-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  padding: 70px 0 42px;
  transform: translateY(-56px);
}

.auth-kicker,
.auth-panel-kicker {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--auth-mint-soft);
  font: 600 11px/1.2 var(--auth-mono);
  letter-spacing: .12em;
  text-transform: uppercase;
}

.auth-kicker::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--auth-mint);
  box-shadow: 0 0 0 5px rgba(17, 208, 162, .1), 0 0 18px rgba(17, 208, 162, .45);
}

.auth-visual h1 {
  max-width: 760px;
  margin: 21px 0 0;
  color: var(--auth-text);
  font: 600 64px/.98 "Inter Tight", "PingFang SC", sans-serif;
  letter-spacing: -.06em;
  text-wrap: balance;
}

.auth-visual h1 span { color: var(--auth-mint); }

.auth-visual-copy {
  max-width: 510px;
  margin: 28px 0 0;
  color: var(--auth-muted);
  font-size: 15px;
  line-height: 1.75;
}

.auth-rail {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: 690px;
  margin-top: 48px;
  border-top: 1px solid var(--auth-line);
  border-bottom: 1px solid var(--auth-line);
}

.auth-rail-item {
  position: relative;
  min-height: 104px;
  padding: 18px 18px 16px 0;
}

.auth-rail-item + .auth-rail-item { padding-left: 18px; border-left: 1px solid var(--auth-line-soft); }

.auth-rail-value {
  color: var(--auth-text);
  font: 600 23px/1.2 var(--auth-mono);
  letter-spacing: -.05em;
}

.auth-rail-label {
  margin-top: 8px;
  color: var(--auth-dim);
  font-size: 12px;
}

.auth-network {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  max-width: 690px;
  margin-top: 34px;
}

.auth-network-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 12px;
  border-left: 2px solid var(--auth-mint);
  background: rgba(16, 24, 23, .56);
  color: var(--auth-muted);
  font-size: 12px;
}

.auth-network-item .auth-icon { color: var(--auth-mint-soft); }

.auth-footnote {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--auth-dim);
  font-size: 11px;
}

.auth-footnote .auth-icon { color: var(--auth-mint); }

.auth-icon {
  display: block;
  width: 16px;
  height: 16px;
  object-fit: contain;
  flex: 0 0 auto;
  filter: brightness(0) saturate(100%) invert(80%) sepia(12%) saturate(778%) hue-rotate(123deg) brightness(91%);
}

.auth-icon-muted {
  filter: brightness(0) saturate(100%) invert(48%) sepia(8%) saturate(550%) hue-rotate(124deg) brightness(89%);
}

.auth-icon-white {
  filter: brightness(0) invert(1);
}

.auth-form-side {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 0;
}

.auth-form-wrap {
  width: min(100%, 472px);
  margin-left: auto;
}

.auth-form-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 34px;
}

.auth-form-top-copy { min-width: 0; }

.auth-panel-kicker { color: var(--auth-dim); letter-spacing: .09em; }

.auth-panel-kicker .auth-icon { width: 15px; height: 15px; color: var(--auth-mint); }

.auth-form-title {
  margin: 0;
  color: var(--auth-text);
  font: 600 24px/1.2 "Inter Tight", "PingFang SC", sans-serif;
  letter-spacing: -.04em;
  text-wrap: balance;
}

.auth-form-subtitle {
  max-width: 330px;
  margin: 10px 0 0;
  color: var(--auth-muted);
  font-size: 13px;
  line-height: 1.65;
}

.auth-cross-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding-top: 3px;
  color: var(--auth-muted);
  font-size: 12px;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
}

.auth-cross-link strong { color: var(--auth-text); font-weight: 600; }
.auth-cross-link:hover strong { color: var(--auth-mint); }

.auth-form-card {
  padding: 24px 26px 23px;
  background: rgba(16, 24, 23, .9);
  border: 1px solid var(--auth-line);
  border-top: 2px solid rgba(17, 208, 162, .46);
  box-shadow: 0 24px 64px rgba(0, 0, 0, .24), inset 1px 0 rgba(117, 238, 208, .035);
}

.auth-tabs {
  display: flex;
  align-items: center;
  gap: 22px;
  min-height: 39px;
  margin: -2px 0 24px;
  border-bottom: 1px solid var(--auth-line);
}

.auth-tab {
  position: relative;
  padding: 0 0 11px;
  border: 0;
  background: transparent;
  color: var(--auth-dim);
  cursor: pointer;
  font-size: 13px;
}

.auth-tab::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: transparent;
  transform: scaleX(.5);
  transition: background .2s ease, transform .2s ease;
}

.auth-tab:hover, .auth-tab.active { color: var(--auth-text); }
.auth-tab.active::after { background: var(--auth-mint); transform: scaleX(1); }

.auth-form { display: grid; gap: 17px; }
.auth-form[hidden] { display: none; }
.auth-sms-spacer { height: 2px; }

.auth-register-shell .auth-form { gap: 12px; }
.auth-register-shell .auth-field { gap: 6px; }
.auth-register-shell .auth-form-card { padding-top: 20px; padding-bottom: 18px; }

.auth-field { display: grid; gap: 8px; }

.auth-label,
.auth-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--auth-muted);
  font-size: 12px;
  line-height: 1.4;
}

.auth-label .required { color: var(--auth-red); }

.auth-label-row a,
.auth-legal a,
.auth-form-footer a { color: var(--auth-mint-soft); text-decoration: none; }
.auth-label-row a:hover, .auth-legal a:hover, .auth-form-footer a:hover { color: var(--auth-text); }

.auth-control-wrap { position: relative; }

.auth-control,
.auth-country {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--auth-line);
  border-radius: 7px;
  outline: none;
  background: rgba(8, 13, 12, .62);
  color: var(--auth-text);
  font-size: 13px;
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

.auth-control::placeholder { color: #5f746f; }
.auth-control:hover { border-color: #36504a; }
.auth-control:focus { border-color: var(--auth-mint); background: rgba(17, 208, 162, .035); box-shadow: 0 0 0 3px rgba(17, 208, 162, .1); }

.auth-control.has-leading { padding-left: 43px; }
.auth-control.has-trailing { padding-right: 43px; }

.auth-control-icon {
  position: absolute;
  top: 50%;
  left: 14px;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  pointer-events: none;
}

.auth-control-icon.trailing { right: 14px; left: auto; }

.auth-password-toggle {
  position: absolute;
  top: 50%;
  right: 11px;
  display: grid;
  width: 28px;
  height: 28px;
  padding: 0;
  place-items: center;
  border: 0;
  background: transparent;
  cursor: pointer;
  transform: translateY(-50%);
}

.auth-password-toggle:hover .auth-icon { filter: brightness(0) saturate(100%) invert(78%) sepia(40%) saturate(668%) hue-rotate(117deg) brightness(97%); }

.auth-split { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 8px; }

.auth-country { display: flex; align-items: center; justify-content: center; color: var(--auth-muted); white-space: nowrap; }

.auth-code-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }

.auth-secondary-button {
  min-width: 106px;
  height: 46px;
  padding: 0 13px;
  border: 1px solid var(--auth-line);
  border-radius: 7px;
  background: transparent;
  color: var(--auth-muted);
  cursor: pointer;
  font-size: 12px;
  white-space: nowrap;
  transition: border-color .2s ease, color .2s ease, background .2s ease, transform .15s ease;
}

.auth-secondary-button:hover:not(:disabled) { border-color: var(--auth-mint); background: rgba(17, 208, 162, .06); color: var(--auth-text); }
.auth-secondary-button:active, .auth-submit:active, .auth-demo-toggle:active { transform: translateY(1px); }
.auth-secondary-button:disabled { opacity: .48; cursor: not-allowed; }

.auth-check {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--auth-muted);
  cursor: pointer;
  font-size: 12px;
  user-select: none;
}

.auth-check input { width: 14px; height: 14px; margin: 0; accent-color: var(--auth-mint); }

.auth-check.top { align-items: flex-start; padding-top: 1px; line-height: 1.55; }
.auth-check.top input { margin-top: 2px; flex: 0 0 auto; }

.auth-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  height: 48px;
  margin-top: 2px;
  padding: 0 18px;
  border: 1px solid rgba(117, 238, 208, .26);
  border-radius: 7px;
  background: var(--auth-mint);
  color: #06231d;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  transition: transform .15s ease, background .2s ease, box-shadow .2s ease;
}

.auth-submit:hover { background: var(--auth-mint-soft); box-shadow: 0 10px 28px rgba(17, 208, 162, .16); transform: translateY(-1px); }
.auth-submit .auth-icon { filter: brightness(0) saturate(100%) invert(11%) sepia(21%) saturate(1104%) hue-rotate(122deg) brightness(93%); }

.auth-legal {
  margin: 17px 0 0;
  color: var(--auth-dim);
  font-size: 11px;
  line-height: 1.7;
}

.auth-demo {
  margin-top: 21px;
  padding-top: 18px;
  border-top: 1px solid var(--auth-line-soft);
}

.auth-demo-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.auth-demo-title { display: flex; align-items: center; gap: 9px; color: var(--auth-muted); font-size: 12px; }

.auth-demo-badge {
  padding: 3px 6px;
  border: 1px solid rgba(244, 189, 106, .38);
  color: var(--auth-amber);
  font: 600 10px/1 var(--auth-mono);
  letter-spacing: .08em;
}

.auth-demo-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--auth-dim);
  cursor: pointer;
  font-size: 11px;
}
.auth-demo-toggle:hover { color: var(--auth-mint-soft); }
.auth-demo-toggle .auth-icon { width: 13px; height: 13px; transition: transform .2s ease; }

.auth-demo-panel { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-top: 14px; }
.auth-demo-panel[hidden] { display: none; }

.auth-demo-link {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 35px;
  padding: 0 9px;
  border: 1px solid var(--auth-line-soft);
  color: var(--auth-muted);
  font-size: 11px;
  text-decoration: none;
  transition: border-color .2s ease, color .2s ease, background .2s ease;
}
.auth-demo-link:hover { border-color: rgba(17, 208, 162, .42); background: rgba(17, 208, 162, .045); color: var(--auth-text); }
.auth-demo-link .auth-icon { width: 13px; height: 13px; }

.auth-demo-hint { margin: 11px 0 0; color: #536863; font-size: 10px; line-height: 1.5; }
.auth-demo-hint[hidden] { display: none; }

.auth-form-footer { margin: 18px 0 0; color: var(--auth-dim); font-size: 12px; text-align: center; }

.auth-meter { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.auth-meter-bar { height: 4px; flex: 1; background: rgba(117, 238, 208, .08); transition: background .2s ease; }
.auth-meter-label { width: 28px; color: var(--auth-dim); font-size: 10px; text-align: right; }
.auth-meter-bar.weak { background: var(--auth-red); }
.auth-meter-bar.mid { background: var(--auth-amber); }
.auth-meter-bar.strong { background: var(--auth-mint); }
.auth-meter-label.weak { color: var(--auth-red); }
.auth-meter-label.mid { color: var(--auth-amber); }
.auth-meter-label.strong { color: var(--auth-mint-soft); }

.auth-error { margin: -3px 0 0; color: var(--auth-red); font-size: 11px; line-height: 1.4; }
.auth-error[hidden] { display: none; }

.auth-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 980px) {
  .auth-shell { grid-template-columns: 1fr; max-width: 620px; gap: 0; padding: 24px 24px 36px; height: auto; min-height: 100vh; overflow: visible; }
  .auth-visual { min-height: auto; padding-bottom: 10px; }
  .auth-visual-content { transform: none; }
  .auth-visual-content { padding: 72px 0 38px; }
  .auth-visual h1 { max-width: 570px; font-size: clamp(46px, 10vw, 70px); }
  .auth-form-side { padding: 0; }
  .auth-form-wrap { width: 100%; margin: 0; }
  .auth-form-top { margin-bottom: 22px; }
  .auth-network { margin-top: 25px; }
}

@media (min-width: 981px) and (max-height: 900px) {
  .auth-shell { padding-top: 18px; padding-bottom: 18px; }
  .auth-visual,
  .auth-form-side { height: calc(100dvh - 36px) !important; }
  .auth-visual-content { padding-top: 42px; padding-bottom: 26px; }
  .auth-visual-copy { margin-top: 20px; }
  .auth-rail { margin-top: 28px; }
  .auth-network { margin-top: 20px; }
  .auth-form-top { margin-bottom: 20px; }
  .auth-form-card { padding-top: 18px; padding-bottom: 17px; }
  .auth-register-shell .auth-form { gap: 9px; }
  .auth-register-shell .auth-field { gap: 5px; }
  .auth-register-shell .auth-control,
  .auth-register-shell .auth-country,
  .auth-register-shell .auth-secondary-button { height: 42px; }
  .auth-register-shell .auth-submit { height: 44px; }
}

@media (max-width: 620px) {
  .auth-shell { padding: 20px 17px 28px; }
  .auth-brand img { width: 148px; }
  .auth-visual-content { padding: 54px 0 28px; }
  .auth-visual h1 { font-size: clamp(42px, 13vw, 60px); }
  .auth-visual-copy { margin-top: 20px; font-size: 13px; line-height: 1.7; }
  .auth-rail { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 30px; }
  .auth-rail-item { min-height: 88px; padding: 15px 12px 13px 0; }
  .auth-rail-item:nth-child(3) { border-top: 1px solid var(--auth-line-soft); }
  .auth-rail-item:nth-child(4) { border-top: 1px solid var(--auth-line-soft); }
  .auth-rail-item + .auth-rail-item { padding-left: 12px; }
  .auth-network { grid-template-columns: 1fr; gap: 7px; }
  .auth-footnote { margin-top: 26px; }
  .auth-form-top { display: block; }
  .auth-cross-link { margin-top: 13px; }
  .auth-form-card { padding: 20px 16px 19px; }
  .auth-demo-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

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