:root {
  color-scheme: dark;
  --auth-black: #020403;
  --auth-amber: #ff8a3d;
  --auth-amber-soft: rgba(255, 138, 61, 0.24);
  --auth-cream: #fff4dc;
  --auth-line: rgba(255, 244, 220, 0.5);
  --auth-panel: rgba(7, 7, 5, 0.58);
}

body {
  overflow: hidden;
  background: #030302;
}

.auth-page {
  background:
    radial-gradient(ellipse at 50% 43%, rgba(255, 138, 61, 0.12), transparent 39%),
    radial-gradient(ellipse at 52% 58%, rgba(255, 244, 220, 0.045), transparent 46%),
    radial-gradient(ellipse at 50% 50%, rgba(18, 20, 17, 0.42), transparent 64%),
    repeating-linear-gradient(90deg, rgba(255, 138, 61, 0.014) 0 1px, transparent 1px 132px),
    var(--auth-black);
  animation: none;
}

.auth-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.22;
  background:
    linear-gradient(90deg, transparent 0 19%, rgba(255, 138, 61, 0.11) 19.1%, transparent 19.35%),
    linear-gradient(90deg, transparent 0 63%, rgba(255, 244, 220, 0.08) 63.1%, transparent 63.28%),
    repeating-linear-gradient(0deg, rgba(255, 244, 220, 0.018) 0 1px, transparent 1px 5px);
  background-size: 360px 100%, 520px 100%, 100% 100%;
  mix-blend-mode: screen;
  animation: authSignalDrift 54s linear infinite;
}

.auth-page::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.16;
  background-image:
    radial-gradient(circle at 24% 18%, rgba(255, 244, 220, 0.18), transparent 1px),
    radial-gradient(circle at 68% 72%, rgba(255, 138, 61, 0.14), transparent 1px);
  background-size: 8px 8px, 11px 11px;
  mix-blend-mode: overlay;
}

.crt-overlay {
  background:
    radial-gradient(ellipse at center, transparent 0 60%, rgba(0, 0, 0, 0.32) 82%, rgba(0, 0, 0, 0.7) 100%),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.22) 0 1px, transparent 1px 4px),
    linear-gradient(90deg, rgba(255, 244, 220, 0.035), transparent 18% 82%, rgba(255, 138, 61, 0.04));
  animation: none;
  box-shadow: inset 0 0 38px rgba(255, 244, 220, 0.03), inset 0 0 120px rgba(0, 0, 0, 0.72);
}

.scanline-sweep {
  display: none;
}

.auth-return {
  position: fixed;
  top: clamp(16px, 3vw, 34px);
  right: clamp(16px, 3vw, 38px);
  z-index: 20;
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 7px 18px 8px;
  overflow: hidden;
  border: 1px solid var(--auth-line);
  outline: 1px solid rgba(255, 244, 220, 0.14);
  outline-offset: -5px;
  background: rgba(7, 7, 5, 0.68);
  color: var(--auth-cream);
  box-shadow: inset 0 0 12px rgba(255, 244, 220, 0.045), 0 0 14px rgba(255, 138, 61, 0.1);
  font-family: var(--font-pixel);
  font-size: clamp(20px, 2.2vw, 30px);
  letter-spacing: 0.12em;
  line-height: 1;
  text-decoration: none;
  text-shadow: 1px 0 0 rgba(255, 138, 61, 0.34), 0 0 10px rgba(255, 244, 220, 0.42);
  text-transform: uppercase;
  transition: border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.auth-return::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 244, 220, 0.16), transparent);
  transform: translateX(-120%);
  animation: none;
}

.auth-return:hover,
.auth-return:focus-visible {
  border-color: var(--orange);
  color: var(--auth-amber);
  transform: translateY(-1px);
}

.auth-terminal {
  width: min(100%, 560px);
  padding: clamp(24px, 4vw, 48px);
  animation: none;
}

.public-terminal {
  width: min(100%, 760px);
  padding: clamp(24px, 5vw, 60px) clamp(18px, 4vw, 46px);
  animation: none;
}

.auth-terminal::after,
.public-terminal::after {
  content: "";
  position: absolute;
  inset: clamp(10px, 2vw, 18px);
  z-index: -1;
  border: 1px solid rgba(255, 244, 220, 0.34);
  background:
    linear-gradient(180deg, rgba(255, 244, 220, 0.026), transparent 42%),
    var(--auth-panel);
  box-shadow:
    inset 0 0 18px rgba(255, 244, 220, 0.035),
    inset 0 0 58px rgba(255, 138, 61, 0.025),
    0 0 18px rgba(255, 138, 61, 0.075);
}

.public-terminal::after {
  inset: clamp(8px, 1.6vw, 16px);
}

.auth-brand {
  min-width: min(100%, 320px);
  min-height: 54px;
  font-size: clamp(34px, 5vw, 52px);
}

.brand-accent {
  color: var(--auth-amber);
  text-shadow:
    1px 0 0 rgba(255, 244, 220, 0.16),
    0 0 12px rgba(255, 138, 61, 0.36);
}

.auth-microline {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 16px;
  color: rgba(255, 244, 220, 0.78);
  font-family: var(--font-pixel);
  font-size: clamp(18px, 2.4vw, 24px);
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.public-microline {
  flex-wrap: wrap;
  margin-top: clamp(16px, 2vw, 22px);
}

.auth-microline span {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.auth-microline span::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--auth-amber);
  box-shadow: 0 0 10px var(--auth-amber-soft);
  animation: none;
}

.auth-kicker,
.auth-note,
.terminal-field span,
.terminal-error {
  font-family: var(--font-pixel);
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.auth-kicker {
  margin: clamp(22px, 4vw, 34px) 0 0;
  color: var(--auth-amber);
  font-size: clamp(22px, 3.2vw, 30px);
}

.auth-title {
  margin: 8px 0 clamp(18px, 3vw, 30px);
  color: var(--auth-cream);
  font-family: var(--font-pixel);
  font-size: clamp(52px, 8vw, 86px);
  font-weight: 400;
  letter-spacing: 0.08em;
  line-height: 0.82;
  text-transform: uppercase;
}

.public-headline {
  margin: clamp(24px, 4vw, 40px) 0 0;
  color: var(--auth-cream);
  font-size: clamp(45px, 7vw, 78px);
  line-height: 0.82;
  text-shadow:
    1px 0 0 rgba(255, 138, 61, 0.16),
    -1px 0 0 rgba(255, 255, 255, 0.06),
    0 0 5px rgba(255, 232, 194, 0.22),
    0 0 10px rgba(255, 138, 61, 0.08);
}

.public-runner {
  position: relative;
  width: min(100%, 520px);
  height: clamp(104px, 14vw, 140px);
  margin: clamp(18px, 3.5vw, 30px) auto clamp(18px, 3vw, 28px);
}

.pet-canvas {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.public-return {
  color: var(--auth-cream);
}

.public-footer {
  display: grid;
  grid-template-columns: minmax(0, auto) auto;
  justify-content: space-between;
  width: min(100%, 700px);
  margin-top: clamp(24px, 4vw, 44px);
  column-gap: clamp(16px, 3vw, 34px);
}

.public-footer .prompt-stack {
  min-width: 0;
}

.public-footer .prompt-stack strong {
  max-width: 100%;
  color: var(--auth-amber);
  overflow: visible;
  font-size: clamp(18px, 2vw, 25px);
  letter-spacing: 0.04em;
  text-overflow: clip;
  white-space: nowrap;
}

.public-footer a {
  white-space: nowrap;
}

.terminal-form {
  display: grid;
  gap: 14px;
  width: min(100%, 420px);
  margin-inline: auto;
  text-align: left;
}

.terminal-field {
  display: grid;
  gap: 6px;
}

.terminal-field span {
  color: rgba(255, 244, 220, 0.82);
  font-size: 21px;
}

.terminal-field input {
  width: 100%;
  height: 48px;
  border: 1px solid rgba(255, 244, 220, 0.5);
  border-radius: 0;
  outline: 1px solid rgba(255, 244, 220, 0.12);
  outline-offset: -5px;
  background: rgba(0, 0, 0, 0.4);
  color: var(--auth-cream);
  box-shadow: inset 0 0 18px rgba(255, 244, 220, 0.04);
  font-family: var(--font-pixel);
  font-size: 28px;
  letter-spacing: 0.04em;
  padding: 6px 14px;
}

.terminal-field input:focus {
  border-color: var(--orange);
  box-shadow: inset 0 0 20px rgba(255, 138, 61, 0.16), 0 0 18px rgba(255, 138, 61, 0.13);
}

.terminal-error {
  min-height: 26px;
  margin: 0;
  color: var(--auth-amber);
  font-size: 21px;
}

.terminal-button {
  min-height: 54px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 244, 220, 0.68);
  outline: 1px solid rgba(255, 244, 220, 0.16);
  outline-offset: -6px;
  background:
    linear-gradient(90deg, rgba(255, 244, 220, 0.05), rgba(255, 138, 61, 0.22), rgba(255, 244, 220, 0.05)),
    rgba(255, 138, 61, 0.1);
  color: var(--auth-cream);
  box-shadow: inset 0 0 22px rgba(255, 244, 220, 0.04), 0 0 26px rgba(255, 138, 61, 0.16);
  cursor: pointer;
  font-family: var(--font-pixel);
  font-size: 32px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.terminal-button::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 244, 220, 0.16), transparent);
  transform: translateX(-120%);
  animation: authButtonSweep 4.6s cubic-bezier(0.16, 1, 0.3, 1) infinite;
  animation: none;
}

.terminal-button:hover,
.terminal-button:focus-visible {
  border-color: var(--orange);
  color: var(--auth-amber);
}

.terminal-button:active {
  transform: translateY(1px);
}

.auth-note {
  width: min(100%, 480px);
  margin: clamp(18px, 3vw, 26px) auto 0;
  color: rgba(255, 244, 220, 0.72);
  font-size: clamp(18px, 2.4vw, 24px);
  line-height: 1;
}

@keyframes authSignalDrift {
  from {
    transform: translate3d(-2%, 0, 0);
  }
  to {
    transform: translate3d(2%, 0, 0);
  }
}

@keyframes authStatusPulse {
  0%, 100% {
    opacity: 0.72;
    transform: scale(0.92);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

@keyframes authButtonSweep {
  0%, 58% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(120%);
  }
}

@media (max-width: 680px) {
  body {
    overflow-y: auto;
  }

  .auth-return {
    top: 14px;
    right: 14px;
    min-height: 36px;
    padding-inline: 13px;
    font-size: 20px;
  }

  .auth-terminal {
    padding: 56px 16px 24px;
  }

  .public-terminal {
    width: 100%;
    padding: 54px 14px 28px;
  }

  .auth-microline {
    flex-direction: column;
    align-items: center;
    gap: 5px;
  }

  .public-runner {
    width: min(100%, 340px);
  }

  .public-footer {
    grid-template-columns: 1fr;
  }

  .public-footer .prompt-stack strong {
    white-space: normal;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-page,
  .auth-page::before,
  .auth-terminal,
  .auth-microline span::before,
  .terminal-button::before,
  .auth-return::before {
    animation: none !important;
  }

  .pet-canvas {
    display: none;
  }
}
