*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --login-bg: #070a10;
  --login-canvas: #0b111b;
  --login-panel: #111923;
  --login-panel-raised: #171d26;
  --login-cyan: #57dce9;
  --login-cyan-bright: #81e8f0;
  --login-white: #f4f8fc;
  --login-copy: #c9d5e1;
  --login-muted: #9aa6b5;
  --login-faint: #8491a0;
  --login-line: rgba(226, 232, 240, 0.15);
  --login-line-cyan: rgba(87, 220, 233, 0.35);
  --login-danger: #fecdd3;
  --login-danger-bg: rgba(190, 24, 93, 0.12);
  --login-font-display: "Saira Extra Condensed", "Arial Narrow", sans-serif;
  --login-font-heading: "Space Grotesk", "Avenir Next", system-ui, sans-serif;
  --login-font-body: "Manrope", "Avenir Next", system-ui, sans-serif;
  --login-font-mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: var(--login-bg);
  color: var(--login-white);
  font-family: var(--login-font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

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

.page {
  min-height: 100svh;
  background: var(--login-bg);
}

.login-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.16fr) minmax(430px, 0.84fr);
  min-width: 0;
  min-height: 100svh;
}

.intro-panel {
  position: sticky;
  top: 0;
  isolation: isolate;
  display: grid;
  align-content: space-between;
  min-width: 0;
  height: 100svh;
  padding: clamp(32px, 4vw, 64px);
  overflow: hidden;
  border-right: 1px solid var(--login-line);
  background: var(--login-bg);
}

.login-brand,
.mobile-brand {
  position: relative;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  width: fit-content;
  gap: 12px;
  color: #fff;
  font-family: var(--login-font-heading);
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.login-brand__mark,
.mobile-brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  overflow: hidden;
}

.login-brand__mark img,
.mobile-brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.3);
}

.intro-copy {
  position: relative;
  z-index: 4;
  width: min(610px, 66%);
  margin-block: auto;
  padding-block: clamp(40px, 7vh, 88px);
}

.intro-h1 {
  max-width: 10ch;
  margin: 0;
  color: #fff;
  font-family: var(--login-font-display);
  font-size: clamp(4.5rem, 7.2vw, 7.1rem);
  font-weight: 700;
  letter-spacing: -0.028em;
  line-height: 0.9;
  text-wrap: balance;
}

.intro-sub {
  max-width: 54ch;
  margin: 28px 0 0;
  color: var(--login-copy);
  font-size: clamp(0.96rem, 1.15vw, 1.08rem);
  line-height: 1.65;
}

.login-boundary {
  width: min(570px, 100%);
  margin: clamp(32px, 5vh, 52px) 0 0;
  border-block: 1px solid var(--login-line);
}

.login-boundary > div {
  display: grid;
  grid-template-columns: 105px minmax(0, 1fr);
  align-items: baseline;
  gap: 18px;
  padding: 13px 0;
}

.login-boundary > div + div {
  border-top: 1px solid var(--login-line);
}

.login-boundary dt {
  color: var(--login-muted);
  font-family: var(--login-font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-boundary dd {
  margin: 0;
  color: var(--login-white);
  font-size: 0.88rem;
  font-weight: 600;
}

.login-boundary code {
  color: var(--login-cyan-bright);
  font-family: var(--login-font-mono);
  font-size: 0.8rem;
  font-weight: 500;
}

.login-world {
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
}

.login-world::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(7, 10, 16, 0.36);
}

.login-world__earth {
  position: absolute;
  inset: 0;
  background-image: url("/og-clay-city.png?v=20260814earth1");
  background-repeat: no-repeat;
  background-position: right center;
  background-size: auto 100%;
  opacity: 0.88;
}

.login-world__routes {
  position: absolute;
  z-index: 2;
  right: -2%;
  bottom: 3%;
  width: min(68vw, 780px);
  height: auto;
  overflow: visible;
  opacity: 0.88;
}

.login-route {
  fill: none;
  stroke: var(--login-cyan);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-dasharray: 5 12;
  vector-effect: non-scaling-stroke;
  animation: login-route-flow 12s linear infinite;
}

.login-route--two {
  animation-delay: -4s;
  opacity: 0.68;
}

.login-route--three {
  animation-delay: -8s;
  opacity: 0.5;
}

.login-route__node {
  fill: var(--login-cyan-bright);
  stroke: var(--login-bg);
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
}

.login-world__caption {
  position: relative;
  z-index: 4;
  width: min(54ch, 68%);
  margin: 0;
  color: var(--login-muted);
  font-family: var(--login-font-mono);
  font-size: 0.68rem;
  line-height: 1.55;
}

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 100svh;
  padding: clamp(34px, 5vw, 72px);
  background: var(--login-canvas);
}

.auth-wrap {
  width: min(100%, 460px);
  min-width: 0;
}

.mobile-brand {
  display: none;
  margin-bottom: 28px;
}

.auth-heading {
  margin-bottom: 24px;
}

.auth-kicker,
.auth-subtitle,
.legal {
  display: none;
}

.auth-title {
  margin: 0;
  color: #fff;
  font-family: var(--login-font-heading);
  font-size: clamp(1.9rem, 2.6vw, 2.35rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.auth-card {
  padding: clamp(20px, 2.5vw, 28px);
  border: 1px solid var(--login-line);
  border-radius: 14px;
  background: var(--login-panel);
}

.promo-block {
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--login-line);
}

.promo-toggle,
.text-button {
  min-height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--login-muted);
  font-size: 0.76rem;
  font-weight: 700;
  text-align: left;
}

.promo-toggle:hover,
.text-button:hover {
  color: var(--login-cyan-bright);
}

.promo-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 10px;
}

.oauth-stack,
.form-stack {
  display: grid;
  gap: 12px;
}

.oauth-stack {
  margin-bottom: 20px;
}

.btn {
  position: relative;
  z-index: 0;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 18px;
  overflow: hidden;
  border: 1px solid var(--login-line);
  border-radius: 999px;
  font-family: var(--login-font-body);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1;
  transition: color 260ms ease, border-color 260ms ease, transform 260ms ease, background 260ms ease;
}

.btn svg {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
}

.btn:disabled {
  cursor: wait;
  opacity: 0.58;
}

.btn-primary {
  width: 100%;
  border-color: #fff;
  background: #fff;
  color: #070a10;
}

.btn-primary::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -50% 52%;
  background: var(--login-bg);
  transform: rotate(18deg);
  transition: inset 520ms cubic-bezier(0.83, 0, 0.17, 1);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  color: #fff;
  transform: translateY(-2px);
}

.btn-primary:hover::before,
.btn-primary:focus-visible::before {
  inset: -50% -20%;
}

.btn-primary:active {
  transform: translateY(0) scale(0.99);
}

.btn-secondary {
  width: 100%;
  border-color: var(--login-line);
  background: transparent;
  color: var(--login-copy);
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  border-color: var(--login-line-cyan);
  background: var(--login-panel-raised);
  color: #fff;
}

.btn-small {
  min-height: 44px;
  border-radius: 999px;
  border-color: var(--login-line-cyan);
  background: transparent;
  color: var(--login-cyan-bright);
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--login-faint);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--login-line);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 18px;
  padding: 4px;
  border: 1px solid var(--login-line);
  border-radius: 10px;
  background: var(--login-bg);
}

.auth-tabs button {
  min-height: 40px;
  border: 0 !important;
  border-radius: 7px !important;
  background: transparent !important;
  color: var(--login-muted) !important;
  font-family: var(--login-font-body) !important;
  font-size: 0.76rem !important;
  font-weight: 700 !important;
}

.auth-tabs #loginTab[class*="bg-"],
.auth-tabs #registerTab[class*="bg-"] {
  background: var(--login-panel-raised) !important;
  color: #fff !important;
}

.form-input {
  width: 100%;
  min-width: 0;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--login-line);
  border-radius: 8px;
  outline: none;
  background: var(--login-bg);
  color: var(--login-white);
  font-size: 0.86rem;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.form-input::placeholder {
  color: var(--login-faint);
  opacity: 1;
}

.form-input:focus {
  border-color: var(--login-cyan);
  background: #0d1520;
  box-shadow: 0 0 0 3px rgba(87, 220, 233, 0.14);
}

.input-icon {
  position: relative;
}

.input-icon svg {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 14px;
  width: 16px;
  height: 16px;
  color: var(--login-muted);
  pointer-events: none;
  transform: translateY(-50%);
}

.input-icon .form-input {
  padding-left: 42px;
}

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.reset-copy,
.account-record-note,
.form-stack > p,
.form-stack > label:not(.consent-row) {
  margin: 0;
  color: var(--login-muted) !important;
  font-size: 0.78rem !important;
  line-height: 1.55;
}

.signup-field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.signup-field-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: var(--login-copy);
  font-size: 0.76rem;
  font-weight: 700;
}

.signup-field-label span {
  color: var(--login-faint);
  font-family: var(--login-font-mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.consent-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  color: var(--login-muted);
  font-size: 0.75rem;
  line-height: 1.55;
  cursor: pointer;
}

.consent-row input {
  width: 17px;
  height: 17px;
  margin: 2px 0 0;
  accent-color: var(--login-cyan);
}

.consent-row a,
.back-link a {
  color: var(--login-cyan-bright);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

#authError,
#loginError,
#regError,
#resetStatus,
#recoveryStatus {
  padding: 11px 12px !important;
  border: 1px solid rgba(251, 113, 133, 0.28) !important;
  border-radius: 8px !important;
  background: var(--login-danger-bg) !important;
  color: var(--login-danger) !important;
  font-size: 0.78rem !important;
  line-height: 1.5;
}

#promoCodeMsg {
  display: block;
  margin: 8px 0 0;
  color: var(--login-muted);
  font-size: 0.72rem;
}

#promoCodeMsg.text-indigo-400 {
  color: var(--login-cyan-bright) !important;
}

#promoCodeMsg.text-amber-400 {
  color: var(--login-danger) !important;
}

.back-link {
  margin: 20px 0 0;
  color: var(--login-muted);
  font-size: 0.76rem;
  text-align: center;
}

.auth-footnote {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  color: var(--login-faint);
  font-family: var(--login-font-mono);
  font-size: 0.66rem;
}

:where(a, button, input, select):focus-visible {
  outline: 2px solid var(--login-cyan-bright);
  outline-offset: 3px;
}

@keyframes login-route-flow {
  to {
    stroke-dashoffset: -68;
  }
}

@media (min-width: 769px) and (max-height: 940px) {
  .intro-panel {
    padding: 28px clamp(28px, 3.5vw, 50px);
  }

  .intro-copy {
    padding-block: 12px;
  }

  .intro-h1 {
    font-size: clamp(3.75rem, 5.2vw, 4.85rem);
  }

  .intro-sub {
    margin-top: 18px;
    line-height: 1.5;
  }

  .login-boundary {
    margin-top: 22px;
  }

  .login-boundary > div {
    padding-block: 9px;
  }
}

@media (max-width: 1080px) {
  .login-layout {
    grid-template-columns: minmax(0, 1fr) minmax(400px, 0.9fr);
  }

  .intro-panel {
    padding: 34px;
  }

  .intro-copy {
    width: 72%;
  }

  .intro-h1 {
    font-size: clamp(4rem, 7.4vw, 5.7rem);
  }
}

@media (max-width: 768px) {
  .login-layout {
    display: block;
    min-height: 100svh;
  }

  .intro-panel {
    position: relative;
    display: block;
    width: 100%;
    height: 180px;
    min-height: 180px;
    padding: 18px;
    border-right: 0;
    border-bottom: 1px solid var(--login-line);
  }

  .intro-copy,
  .login-boundary,
  .login-world__caption {
    display: none;
  }

  .login-brand {
    font-size: 1.22rem;
  }

  .login-brand__mark {
    width: 36px;
    height: 36px;
  }

  .login-world__earth {
    inset: 0 0 0 auto;
    width: 62%;
    background-position: right center;
    background-size: auto 420px;
    opacity: 0.82;
  }

  .login-world::after {
    background: rgba(7, 10, 16, 0.18);
  }

  .login-world__routes {
    right: -8%;
    bottom: -54%;
    width: 112%;
    opacity: 0.64;
  }

  .auth-panel {
    align-items: flex-start;
    min-height: calc(100svh - 180px);
    padding: 30px 18px 48px;
  }

  .auth-wrap {
    width: min(100%, 520px);
  }

  .auth-heading {
    margin-bottom: 17px;
  }

  .mobile-brand {
    display: none;
  }

  .auth-title {
    font-size: 1.85rem;
  }
}

@media (max-width: 480px) {
  .intro-panel {
    height: 138px;
    min-height: 138px;
    padding: 14px 16px;
  }

  .login-world__earth {
    background-size: auto 320px;
  }

  .auth-panel {
    min-height: calc(100svh - 138px);
    padding: 24px 12px 40px;
  }

  .auth-card {
    padding: 18px 14px;
    border-radius: 12px;
  }

  .promo-row {
    grid-template-columns: 1fr;
  }

  .btn-small {
    width: 100%;
  }

  .form-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .auth-footnote {
    flex-direction: column;
    gap: 5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-route {
    animation: none;
  }

  .btn,
  .btn::before,
  .form-input,
  .auth-tabs button,
  .promo-toggle,
  .text-button {
    transition-duration: 0.01ms !important;
  }
}

@media (forced-colors: active) {
  .auth-card,
  .auth-tabs,
  .form-input,
  .btn {
    border: 1px solid CanvasText;
  }

  .login-world {
    display: none;
  }
}
