#authGate {
  --bg-1: #040816;
  --bg-2: #081127;
  --bg-3: #0d1635;
  --card: #08101fcc;
  --card-border: rgba(140, 190, 255, 0.12);
  --text: #eef4ff;
  --muted: #9aa8c7;
  --muted-2: #6c7896;
  --cyan: #3de3ff;
  --blue: #54a8ff;
  --violet: #8a5cff;
  --pink: #c45cff;
  --success: #39e58c;
  --danger: #ff5d7c;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --glow: 0 0 0 1px rgba(61, 227, 255, 0.08), 0 0 40px rgba(97, 120, 255, 0.15);
  --radius: 28px;
  position: relative;
  display: block;
  width: auto;
  min-height: 100vh;
  margin: -20px;
  padding: 0;
  overflow: hidden;
  color: var(--text);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  background:
    radial-gradient(circle at 12% 15%, rgba(90, 90, 255, 0.16), transparent 20%),
    radial-gradient(circle at 87% 10%, rgba(117, 41, 255, 0.18), transparent 20%),
    radial-gradient(circle at 50% 85%, rgba(0, 195, 255, 0.14), transparent 24%),
    linear-gradient(135deg, var(--bg-1), var(--bg-2) 42%, #030611 100%);
}

#authGate * {
  box-sizing: border-box;
}

#authGate,
#authGate button,
#authGate input,
#authGate textarea,
#authGate select {
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

#authGate .scene {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  isolation: isolate;
}

#authGate .grid-bg,
#authGate .chart-bg,
#authGate .orbs,
#authGate .noise {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

#authGate .grid-bg {
  background:
    linear-gradient(rgba(118, 166, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(118, 166, 255, 0.035) 1px, transparent 1px),
    radial-gradient(circle at center, rgba(61, 227, 255, 0.10), transparent 58%);
  background-size: 44px 44px, 44px 44px, 100% 100%;
  background-position: 0 0, 0 0, center;
  -webkit-mask-image: radial-gradient(circle at center, black 35%, transparent 85%);
  mask-image: radial-gradient(circle at center, black 35%, transparent 85%);
  opacity: 0.34;
  animation: authGridShift 26s linear infinite;
}

#authGate .chart-bg {
  overflow: hidden;
  opacity: 0.86;
  mix-blend-mode: screen;
}

#authGate .chart-bg::before,
#authGate .chart-bg::after {
  content: "";
  position: absolute;
  inset: -12%;
}

#authGate .chart-bg::before {
  background: linear-gradient(110deg, transparent 18%, rgba(61, 227, 255, 0.14) 42%, transparent 68%);
  filter: blur(18px);
  opacity: 0.55;
  animation: authBeamSweep 12s ease-in-out infinite;
}

#authGate .chart-bg::after {
  background: radial-gradient(circle at 50% 50%, rgba(138, 92, 255, 0.16), transparent 55%);
  filter: blur(60px);
  opacity: 0.48;
  animation: authPulseField 9s ease-in-out infinite;
}

#authGate .chart-bg svg {
  width: 100%;
  height: 100%;
  opacity: 0.62;
  transform: scale(1.04);
  filter: drop-shadow(0 0 10px rgba(106, 130, 255, 0.16));
  animation: authWaveDrift 20s ease-in-out infinite;
}

#authGate .chart-bg path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 16 20;
  animation: authEnergyFlow 18s linear infinite;
}

#authGate .chart-bg .energy-line--primary {
  opacity: 0.95;
}

#authGate .chart-bg .energy-line--secondary {
  opacity: 0.58;
  animation-duration: 22s;
}

#authGate .chart-bg .energy-line--pulse {
  opacity: 0.72;
  animation-duration: 14s;
}

#authGate .chart-bg .energy-line--trace {
  opacity: 0.36;
  animation-duration: 26s;
}

#authGate .orbs::before,
#authGate .orbs::after {
  content: "";
  position: absolute;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.16;
  animation: authFloat 10s ease-in-out infinite;
}

#authGate .orbs::before {
  left: -140px;
  bottom: -120px;
  background: linear-gradient(135deg, var(--cyan), transparent 55%);
}

#authGate .orbs::after {
  right: -120px;
  top: -120px;
  background: linear-gradient(135deg, var(--violet), transparent 60%);
  animation-delay: -4s;
}

#authGate .noise {
  background-image: radial-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 5px 5px;
  opacity: 0.06;
  mix-blend-mode: screen;
}

#authGate .login-shell {
  position: relative;
  width: min(100%, 1180px);
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 28px;
  align-items: center;
  z-index: 2;
}

#authGate .hero {
  padding: 30px 10px 30px 10px;
}

#authGate .eyebrow,
#authGate .panel-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(130, 160, 255, 0.14);
  background: rgba(10, 18, 40, 0.46);
  color: #c9d5f7;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  backdrop-filter: blur(16px);
  box-shadow: var(--glow);
}

#authGate .eyebrow .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  box-shadow: 0 0 18px rgba(61, 227, 255, 0.55);
}

#authGate .panel-label {
  margin-bottom: 14px;
}

#authGate .hero h1 {
  margin: 22px 0 12px;
  font-size: clamp(38px, 5vw, 68px);
  font-weight: 700;
  line-height: 0.96;
  letter-spacing: -0.04em;
  max-width: 680px;
}

#authGate .hero h1 .gradient {
  background: linear-gradient(90deg, #ffffff, #9ccfff 42%, #8a5cff 82%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 18px rgba(111, 139, 255, 0.08);
}

#authGate .hero p {
  max-width: 620px;
  font-size: 17px;
  line-height: 1.75;
  color: var(--muted);
  margin: 0 0 28px;
}

#authGate .stats {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

#authGate .stat {
  min-width: 155px;
  padding: 16px 18px;
  border-radius: 20px;
  background: rgba(8, 14, 30, 0.5);
  border: 1px solid rgba(140, 190, 255, 0.11);
  box-shadow: var(--glow);
  backdrop-filter: blur(16px);
}

#authGate .stat strong {
  display: block;
  font-size: 18px;
  margin-bottom: 6px;
  color: #f2f6ff;
}

#authGate .stat span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

#authGate .panel {
  position: relative;
  padding: 22px;
  border-radius: 32px;
  background: linear-gradient(180deg, rgba(10, 17, 36, 0.82), rgba(7, 12, 26, 0.92));
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow), var(--glow);
  backdrop-filter: blur(22px);
  overflow: hidden;
}

#authGate .panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(61, 227, 255, 0.08), transparent 22%, transparent 72%, rgba(138, 92, 255, 0.08)),
    radial-gradient(circle at top right, rgba(94, 127, 255, 0.11), transparent 28%);
  pointer-events: none;
}

#authGate .panel-inner {
  position: relative;
  z-index: 1;
}

#authGate .brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

#authGate .brand-icon {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  position: relative;
  background: linear-gradient(145deg, rgba(18, 29, 58, 0.95), rgba(8, 13, 28, 0.95));
  border: 1px solid rgba(149, 182, 255, 0.12);
  display: grid;
  place-items: center;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 12px 35px rgba(0, 0, 0, 0.35),
    0 0 32px rgba(96, 119, 255, 0.13);
}

#authGate .candles {
  position: relative;
  width: 34px;
  height: 34px;
}

#authGate .candles span {
  position: absolute;
  bottom: 3px;
  width: 8px;
  border-radius: 8px;
  background: linear-gradient(180deg, var(--cyan), #5f7dff);
  box-shadow: 0 0 14px rgba(61, 227, 255, 0.4);
}

#authGate .candles span::before {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  border-radius: 2px;
  background: rgba(185, 225, 255, 0.9);
  box-shadow: 0 0 10px rgba(185, 225, 255, 0.35);
}

#authGate .candles .c1 {
  left: 0;
  height: 18px;
}

#authGate .candles .c1::before {
  height: 28px;
  bottom: -5px;
}

#authGate .candles .c2 {
  left: 13px;
  height: 25px;
  background: linear-gradient(180deg, var(--pink), var(--violet));
}

#authGate .candles .c2::before {
  height: 34px;
  bottom: -5px;
}

#authGate .candles .c3 {
  left: 26px;
  height: 14px;
}

#authGate .candles .c3::before {
  height: 23px;
  bottom: -5px;
}

#authGate .brand-copy small {
  display: block;
  color: #9eb4dc;
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  margin-bottom: 5px;
}

#authGate .brand-copy strong {
  display: block;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

#authGate .segment {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 18px 0 22px;
  padding: 5px;
  border-radius: 16px;
  background: rgba(8, 14, 30, 0.58);
  border: 1px solid rgba(140, 190, 255, 0.1);
}

#authGate .segment button,
#authGate .panel-back {
  appearance: none;
  border: 0;
  padding: 12px 10px;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-family: inherit;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 11px;
  cursor: pointer;
  transition: 0.25s ease;
}

#authGate .segment button.active,
#authGate .segment button.auth-tab--active,
#authGate .segment button[aria-selected="true"] {
  background: linear-gradient(135deg, rgba(61, 227, 255, 0.15), rgba(138, 92, 255, 0.18));
  color: #eff6ff;
  box-shadow: inset 0 0 0 1px rgba(110, 199, 255, 0.15), 0 0 18px rgba(98, 120, 255, 0.16);
}

#authGate .panel-back {
  width: 100%;
  margin-bottom: 16px;
  border: 1px solid rgba(140, 190, 255, 0.1);
  background: rgba(8, 14, 30, 0.58);
}

#authGate .title {
  margin: 0;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

#authGate .subtitle {
  margin: 10px 0 24px;
  color: var(--muted);
  line-height: 1.7;
  font-size: 14px;
  max-width: 420px;
}

#authGate .auth-form {
  display: flex;
  flex-direction: column;
}

#authGate .auth-form.hidden {
  display: none;
}

#authGate .form-note {
  margin-bottom: 18px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(8, 14, 30, 0.52);
  border: 1px solid rgba(141, 173, 255, 0.1);
}

#authGate .form-note strong {
  display: block;
  color: #eef4ff;
  font-size: 12px;
  margin-bottom: 6px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

#authGate .form-note p {
  margin: 0;
  color: #a8b4cf;
  font-size: 13px;
  line-height: 1.65;
}

#authGate .form-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

#authGate .field {
  margin-bottom: 14px;
}

#authGate .field label {
  display: block;
  margin: 0 0 8px;
  color: #dbe6ff;
  font-size: 13px;
  font-weight: 600;
}

#authGate .input-wrap {
  position: relative;
}

#authGate .input-wrap.auth-field {
  display: block;
  min-height: 0;
  padding: 0;
  gap: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#authGate .input-wrap.auth-field:hover,
#authGate .input-wrap.auth-field:focus-within {
  border: 0;
  background: transparent;
  box-shadow: none;
  transform: none;
}

#authGate .input-wrap svg {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  stroke: #7382a6;
  transition: 0.2s ease;
  pointer-events: none;
}

#authGate .input-wrap input {
  width: 100%;
  height: 56px;
  border-radius: 17px;
  border: 1px solid rgba(141, 173, 255, 0.1);
  outline: none;
  padding: 0 18px 0 48px;
  background: rgba(10, 17, 34, 0.7);
  color: #eef4ff;
  font-size: 15px;
  font-weight: 400;
  font-family: inherit;
  transition: 0.25s ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

#authGate .input-wrap input::placeholder {
  color: #6f7da0;
}

#authGate .input-wrap input:hover {
  border-color: rgba(118, 161, 255, 0.18);
  background: rgba(12, 20, 38, 0.82);
}

#authGate .input-wrap input:focus {
  border-color: rgba(61, 227, 255, 0.5);
  box-shadow: 0 0 0 4px rgba(61, 227, 255, 0.08), 0 0 22px rgba(61, 227, 255, 0.08);
  background: rgba(12, 20, 38, 0.94);
}

#authGate .input-wrap:focus-within svg {
  stroke: #cbefff;
}

#authGate .input-wrap.auth-field.is-invalid input {
  border-color: rgba(255, 93, 124, 0.5);
  box-shadow: 0 0 0 4px rgba(255, 93, 124, 0.08), 0 0 22px rgba(255, 93, 124, 0.08);
}

#authGate .input-wrap.auth-field.is-invalid svg {
  stroke: #ff9cb2;
}

#authGate .input-wrap.auth-field.is-valid input {
  border-color: rgba(57, 229, 140, 0.45);
  box-shadow: 0 0 0 4px rgba(57, 229, 140, 0.07), 0 0 20px rgba(57, 229, 140, 0.08);
}

#authGate .input-wrap.auth-field.is-valid svg {
  stroke: #aef3cf;
}

#authGate .field-hint.auth-field__hint {
  min-height: 16px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

#authGate .field-hint.auth-field__hint--error {
  color: #ffc2d0;
}

#authGate .field-hint.auth-field__hint--success {
  color: #b8f6d6;
}

#authGate .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin: 8px 0 20px;
  flex-wrap: wrap;
}

#authGate .row-note {
  color: var(--muted);
  font-size: 13px;
}

#authGate .check {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

#authGate .check input {
  accent-color: #66c7ff;
}

#authGate .link,
#authGate .auth-link-button {
  color: #9edcff;
  text-decoration: none;
  font-size: 13px;
  transition: 0.2s ease;
}

#authGate .auth-link-button {
  padding: 0;
  border: 0;
  background: transparent;
  font-family: inherit;
  cursor: pointer;
}

#authGate .link:hover,
#authGate .auth-link-button:hover {
  color: #dff7ff;
  text-shadow: 0 0 10px rgba(61, 227, 255, 0.2);
}

#authGate .cta {
  width: 100%;
  height: 58px;
  border: 0;
  border-radius: 18px;
  color: #06111f;
  font-weight: 900;
  font-family: inherit;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 12px;
  cursor: pointer;
  background: linear-gradient(90deg, var(--cyan), var(--blue) 50%, var(--violet));
  box-shadow: 0 14px 30px rgba(69, 130, 255, 0.26), 0 0 28px rgba(61, 227, 255, 0.14);
  transition: transform 0.18s ease, box-shadow 0.25s ease, filter 0.25s ease;
}

#authGate .cta:hover {
  transform: translateY(-2px);
  filter: brightness(1.04);
  box-shadow: 0 18px 34px rgba(69, 130, 255, 0.3), 0 0 38px rgba(61, 227, 255, 0.18);
}

#authGate .cta:active {
  transform: translateY(0);
}

#authGate .cta:disabled,
#authGate .segment button:disabled,
#authGate .panel-back:disabled,
#authGate .auth-link-button:disabled {
  opacity: 0.72;
  cursor: not-allowed;
}

#authGate .auth-inline-message {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(141, 173, 255, 0.1);
  background: rgba(8, 14, 30, 0.52);
  color: #deebff;
  font-size: 13px;
  line-height: 1.65;
}

#authGate .auth-inline-message--success {
  border-color: rgba(57, 229, 140, 0.18);
  background: rgba(57, 229, 140, 0.08);
  color: #baf4d5;
}

#authGate .auth-inline-message--error {
  border-color: rgba(255, 93, 124, 0.18);
  background: rgba(255, 93, 124, 0.08);
  color: #ffd0da;
}

#authGate .auth-inline-message--info {
  border-color: rgba(84, 168, 255, 0.18);
  background: rgba(84, 168, 255, 0.08);
  color: #d6e9ff;
}

#authGate .auth-code-grid {
  display: none;
}

#authGate .divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 18px;
  color: #657392;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

#authGate .divider::before,
#authGate .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(140, 190, 255, 0.13), transparent);
}

#authGate .footer-box {
  padding: 16px 16px 14px;
  border-radius: 18px;
  background: rgba(8, 14, 30, 0.52);
  border: 1px solid rgba(141, 173, 255, 0.1);
  color: #a8b4cf;
  font-size: 13px;
  line-height: 1.65;
}

#authGate .footer-box strong {
  display: block;
  color: #eef4ff;
  font-size: 12px;
  margin-bottom: 6px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

#authGate .footer-box p {
  margin: 0;
}

#authGate .badge-line {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

#authGate .badge {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(138, 92, 255, 0.14);
  background: rgba(13, 20, 38, 0.7);
  color: #c9d4ee;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

#authGate .copyright {
  text-align: center;
  margin-top: 16px;
  color: var(--muted-2);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

#authGate .cta:focus-visible,
#authGate .segment button:focus-visible,
#authGate .panel-back:focus-visible,
#authGate .auth-link-button:focus-visible,
#authGate .input-wrap input:focus-visible {
  outline: none;
}

@keyframes authFloat {
  0%, 100% {
    transform: translateY(0) translateX(0);
  }
  50% {
    transform: translateY(-18px) translateX(10px);
  }
}

@keyframes authGridShift {
  0% {
    background-position: 0 0, 0 0, center;
  }
  100% {
    background-position: 44px 44px, -44px -44px, center;
  }
}

@keyframes authWaveDrift {
  0%, 100% {
    transform: scale(1.04) translateY(0);
  }
  50% {
    transform: scale(1.06) translateY(-10px);
  }
}

@keyframes authEnergyFlow {
  0% {
    stroke-dashoffset: 0;
    opacity: 0.24;
  }
  50% {
    opacity: 0.92;
  }
  100% {
    stroke-dashoffset: -180;
    opacity: 0.24;
  }
}

@keyframes authBeamSweep {
  0%, 100% {
    transform: translateX(-18%) skewX(-14deg);
    opacity: 0.18;
  }
  50% {
    transform: translateX(18%) skewX(-14deg);
    opacity: 0.62;
  }
}

@keyframes authPulseField {
  0%, 100% {
    transform: scale(0.94);
    opacity: 0.28;
  }
  50% {
    transform: scale(1.08);
    opacity: 0.52;
  }
}

@media (max-width: 1040px) {
  #authGate .login-shell {
    grid-template-columns: 1fr;
    max-width: 680px;
  }

  #authGate .hero {
    padding: 0;
  }

  #authGate .hero h1 {
    max-width: 100%;
  }

  #authGate .stats {
    margin-bottom: 8px;
  }
}

@media (max-width: 640px) {
  #authGate {
    overflow: auto;
  }

  #authGate .scene {
    padding: 18px;
  }

  #authGate .panel {
    padding: 18px;
    border-radius: 26px;
  }

  #authGate .title {
    font-size: 28px;
  }

  #authGate .hero h1 {
    font-size: 40px;
  }

  #authGate .hero p {
    font-size: 15px;
  }

  #authGate .stat {
    min-width: calc(50% - 7px);
  }

  #authGate .brand {
    gap: 12px;
  }

  #authGate .brand-icon {
    width: 64px;
    height: 64px;
  }

  #authGate .form-split {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  #authGate .orbs::before,
  #authGate .orbs::after,
  #authGate .segment button,
  #authGate .panel-back,
  #authGate .input-wrap input,
  #authGate .cta,
  #authGate .auth-link-button {
    animation: none !important;
    transition: none !important;
  }
}
