:root {
  --hn-auth-void: #06111f;
  --hn-auth-ink: #0d1d32;
  --hn-auth-ink-raised: #122741;
  --hn-auth-panel: rgba(10, 23, 40, 0.94);
  --hn-auth-field: rgba(5, 15, 28, 0.68);
  --hn-auth-ice: #f4f8ff;
  --hn-auth-text: #c4cede;
  --hn-auth-muted: #8493aa;
  --hn-auth-line: rgba(147, 169, 198, 0.18);
  --hn-auth-line-strong: rgba(147, 169, 198, 0.3);
  --hn-auth-teal: #67d9ca;
  --hn-auth-teal-strong: #42c8b6;
  --hn-auth-blue: #7892ff;
  --hn-auth-amber: #ffb45d;
  --hn-auth-coral: #ff6d79;
  --hn-auth-shadow: 0 34px 90px rgba(0, 0, 0, 0.42);
}

html[data-theme="light"] {
  --hn-auth-void: #eef3f9;
  --hn-auth-ink: #ffffff;
  --hn-auth-ink-raised: #f7faff;
  --hn-auth-panel: rgba(255, 255, 255, 0.96);
  --hn-auth-field: #f6f8fc;
  --hn-auth-ice: #102033;
  --hn-auth-text: #43546a;
  --hn-auth-muted: #718198;
  --hn-auth-line: rgba(35, 64, 95, 0.13);
  --hn-auth-line-strong: rgba(35, 64, 95, 0.23);
  --hn-auth-teal: #209f90;
  --hn-auth-teal-strong: #128777;
  --hn-auth-blue: #526dd5;
  --hn-auth-amber: #c97818;
  --hn-auth-coral: #c84c5b;
  --hn-auth-shadow: 0 30px 80px rgba(44, 69, 98, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--hn-auth-void);
}

body.hn-auth-workspace {
  display: flow-root;
  min-width: 320px;
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  color: var(--hn-auth-text);
  background:
    radial-gradient(circle at 12% 14%, rgba(58, 184, 168, 0.12), transparent 28rem),
    radial-gradient(circle at 88% 86%, rgba(94, 116, 223, 0.12), transparent 32rem),
    var(--hn-auth-void);
  font-family: "DM Sans", sans-serif;
  text-rendering: optimizeLegibility;
}

.hn-auth-atmosphere {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(139, 164, 193, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 164, 193, 0.035) 1px, transparent 1px);
  background-size: 70px 70px;
  mask-image: radial-gradient(circle at center, black, transparent 78%);
}

.hn-auth-gateway {
  position: relative;
  z-index: 1;
  width: min(1240px, calc(100% - 40px));
  min-height: calc(100svh - 40px);
  margin: 20px auto;
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(430px, 0.94fr);
  overflow: hidden;
  border: 1px solid var(--hn-auth-line);
  border-radius: 28px;
  background: rgba(6, 17, 31, 0.78);
  box-shadow: var(--hn-auth-shadow);
}

html[data-theme="light"] .hn-auth-gateway {
  background: rgba(247, 250, 255, 0.9);
}

.hn-auth-story,
.hn-auth-panel {
  position: relative;
  min-width: 0;
}

.hn-auth-story {
  display: flex;
  flex-direction: column;
  padding: clamp(34px, 5vw, 64px);
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 42%, rgba(103, 217, 202, 0.11), transparent 25rem),
    linear-gradient(145deg, rgba(13, 31, 52, 0.94), rgba(4, 13, 25, 0.96));
}

html[data-theme="light"] .hn-auth-story {
  background:
    radial-gradient(circle at 50% 42%, rgba(55, 175, 159, 0.12), transparent 25rem),
    linear-gradient(145deg, #f5f9fc, #eaf1f8);
}

.hn-auth-story::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  right: -210px;
  bottom: -210px;
  border: 1px solid rgba(103, 217, 202, 0.14);
  border-radius: 50%;
  box-shadow:
    0 0 0 48px rgba(103, 217, 202, 0.025),
    0 0 0 96px rgba(103, 217, 202, 0.018);
}

.hn-auth-brand {
  position: relative;
  z-index: 1;
  align-self: flex-start;
  color: var(--hn-auth-ice);
  font: 800 25px/1 "Plus Jakarta Sans", sans-serif;
  letter-spacing: -0.07em;
  text-decoration: none;
}

.hn-auth-brand strong {
  color: var(--hn-auth-teal);
  font-weight: 800;
}

.hn-auth-story__copy {
  position: relative;
  z-index: 1;
  max-width: 590px;
  margin: clamp(54px, 8vh, 96px) 0 34px;
}

.hn-auth-kicker {
  margin: 0 0 12px;
  color: var(--hn-auth-teal);
  font: 700 11px/1.4 "IBM Plex Mono", monospace;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.hn-auth-story__copy h1 {
  max-width: 560px;
  margin: 0;
  color: var(--hn-auth-ice);
  font: 750 clamp(38px, 4.7vw, 64px)/1.04 "Plus Jakarta Sans", sans-serif;
  letter-spacing: -0.06em;
}

.hn-auth-story__copy > p:last-child {
  max-width: 520px;
  margin: 20px 0 0;
  color: var(--hn-auth-text);
  font-size: 16px;
  line-height: 1.65;
}

.hn-auth-signal-card {
  position: relative;
  z-index: 1;
  margin-top: auto;
  overflow: hidden;
  border: 1px solid rgba(103, 217, 202, 0.18);
  border-radius: 20px;
  background: rgba(4, 14, 27, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

html[data-theme="light"] .hn-auth-signal-card {
  background: rgba(255, 255, 255, 0.68);
}

.hn-auth-signal-card__header,
.hn-auth-signal-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 18px;
  color: var(--hn-auth-muted);
  font: 600 9px/1.3 "IBM Plex Mono", monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hn-auth-signal-card__header {
  border-bottom: 1px solid var(--hn-auth-line);
}

.hn-auth-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--hn-auth-teal);
}

.hn-auth-live i,
.hn-auth-panel__secure i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 12px currentColor;
}

.hn-auth-signal-map {
  display: block;
  width: 100%;
  height: auto;
  color: var(--hn-auth-teal);
}

.hn-auth-signal-map text {
  fill: currentColor;
  font: 600 12px "IBM Plex Mono", monospace;
  letter-spacing: 0.02em;
}

.hn-auth-signal-map__grid {
  fill: none;
  stroke: var(--hn-auth-line);
  stroke-width: 1;
}

.hn-auth-signal-map__routes {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-dasharray: 4 7;
  opacity: 0.58;
  animation: hnAuthSignal 7s linear infinite;
}

.hn-auth-signal-map__pulses {
  fill: var(--hn-auth-amber);
  filter: drop-shadow(0 0 7px var(--hn-auth-amber));
}

.hn-auth-signal-map__pulses circle {
  animation: hnAuthPulse 2.6s ease-in-out infinite;
}

.hn-auth-signal-map__pulses circle:nth-child(2) {
  animation-delay: 0.45s;
}

.hn-auth-signal-map__pulses circle:nth-child(3) {
  animation-delay: 0.9s;
}

.hn-auth-signal-map__source rect {
  fill: var(--hn-auth-field);
  stroke: var(--hn-auth-line-strong);
}

.hn-auth-signal-map__decision circle:first-child {
  fill: rgba(103, 217, 202, 0.06);
  stroke: var(--hn-auth-teal);
  stroke-width: 1.2;
}

.hn-auth-signal-map__decision circle:nth-child(2) {
  fill: rgba(120, 146, 255, 0.09);
  stroke: var(--hn-auth-blue);
  stroke-width: 1;
  stroke-dasharray: 3 5;
}

.hn-auth-signal-map__decision path {
  fill: none;
  stroke: var(--hn-auth-amber);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hn-auth-signal-map__decision text {
  fill: var(--hn-auth-ice);
}

.hn-auth-signal-card__footer {
  justify-content: flex-start;
  border-top: 1px solid var(--hn-auth-line);
}

.hn-auth-signal-card__footer span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.hn-auth-signal-card__footer span::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--hn-auth-teal);
}

.hn-auth-trust {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 20px;
  color: var(--hn-auth-muted);
  font-size: 11px;
}

.hn-auth-trust span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.hn-auth-trust svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: var(--hn-auth-teal);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hn-auth-panel {
  display: flex;
  flex-direction: column;
  padding: clamp(24px, 4vw, 48px);
  border-left: 1px solid var(--hn-auth-line);
  background: var(--hn-auth-panel);
}

.hn-auth-panel__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
}

.hn-auth-panel__secure {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--hn-auth-muted);
  font: 600 9px/1 "IBM Plex Mono", monospace;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.hn-auth-panel__secure i {
  color: var(--hn-auth-teal);
}

.hn-auth-theme {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--hn-auth-muted);
  border: 1px solid var(--hn-auth-line);
  border-radius: 13px;
  background: var(--hn-auth-field);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.hn-auth-theme:hover {
  color: var(--hn-auth-ice);
  border-color: rgba(103, 217, 202, 0.5);
  transform: translateY(-1px);
}

.hn-auth-theme svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hn-auth-theme__sun,
html[data-theme="light"] .hn-auth-theme__moon {
  display: none;
}

html[data-theme="light"] .hn-auth-theme__sun {
  display: block;
}

.hn-auth-form-shell {
  width: min(440px, 100%);
  margin: auto;
  padding: 34px 0 12px;
}

.hn-auth-form-header {
  margin-bottom: 26px;
}

.hn-auth-form-header h2 {
  margin: 0;
  color: var(--hn-auth-ice);
  font: 750 clamp(28px, 3.2vw, 40px)/1.1 "Plus Jakarta Sans", sans-serif;
  letter-spacing: -0.045em;
}

.hn-auth-form-header > p:last-child {
  margin: 12px 0 0;
  color: var(--hn-auth-muted);
  font-size: 14px;
  line-height: 1.6;
}

.hn-auth-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 109, 121, 0.28);
  border-radius: 12px;
  color: #ffc2c8;
  background: rgba(255, 109, 121, 0.09);
  font-size: 13px;
  line-height: 1.45;
}

html[data-theme="light"] .hn-auth-alert {
  color: #a52f3d;
  background: #fff1f2;
}

.hn-auth-alert--success {
  color: #aaf5e8;
  border-color: rgba(103, 217, 202, 0.28);
  background: rgba(103, 217, 202, 0.09);
}

html[data-theme="light"] .hn-auth-alert--success {
  color: #156c61;
  background: #e8f8f5;
}

.hn-auth-form {
  display: grid;
  gap: 17px;
}

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

.hn-auth-field label {
  color: var(--hn-auth-text);
  font-size: 12px;
  font-weight: 700;
}

.hn-auth-field label small {
  color: var(--hn-auth-muted);
  font: 500 9px "IBM Plex Mono", monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hn-auth-input,
.hn-auth-field input {
  width: 100%;
  min-height: 50px;
  margin: 0;
  padding: 0 15px;
  color: var(--hn-auth-ice);
  border: 1px solid var(--hn-auth-line-strong);
  border-radius: 12px;
  outline: none;
  background: var(--hn-auth-field);
  font: 500 14px/1 "DM Sans", sans-serif;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.hn-auth-field input::placeholder {
  color: var(--hn-auth-muted);
  opacity: 0.78;
}

.hn-auth-field input:focus {
  border-color: var(--hn-auth-teal);
  background: color-mix(in srgb, var(--hn-auth-field) 84%, var(--hn-auth-teal) 4%);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--hn-auth-teal) 14%, transparent);
}

.hn-auth-field input:disabled,
.hn-auth-field input[readonly] {
  color: var(--hn-auth-muted);
  cursor: not-allowed;
  opacity: 0.78;
}

.hn-auth-password {
  position: relative;
}

.hn-auth-password input {
  padding-right: 50px;
}

.hn-auth-password button {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--hn-auth-muted);
  border: 0;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
}

.hn-auth-password button:hover {
  color: var(--hn-auth-teal);
  background: rgba(103, 217, 202, 0.08);
}

.hn-auth-password svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hn-auth-password__hide {
  display: none;
}

.hn-auth-password button[aria-pressed="true"] .hn-auth-password__show {
  display: none;
}

.hn-auth-password button[aria-pressed="true"] .hn-auth-password__hide {
  display: block;
}

.hn-auth-form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: -2px;
}

.hn-auth-link {
  color: var(--hn-auth-teal);
  font-size: 12px;
  font-weight: 700;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.hn-auth-link:hover {
  color: var(--hn-auth-ice);
}

.hn-auth-button {
  width: 100%;
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 18px;
  color: #071420;
  border: 1px solid var(--hn-auth-teal);
  border-radius: 12px;
  background: linear-gradient(135deg, #78e2d4, #52cbb9);
  box-shadow: 0 14px 30px rgba(48, 190, 170, 0.14);
  font: 750 14px/1 "Plus Jakarta Sans", sans-serif;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.hn-auth-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(48, 190, 170, 0.22);
  filter: brightness(1.04);
}

.hn-auth-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hn-auth-route {
  margin: 20px 0 0;
  color: var(--hn-auth-muted);
  font-size: 13px;
  text-align: center;
}

.hn-auth-route a {
  color: var(--hn-auth-teal);
  font-weight: 700;
  text-decoration: none;
}

.hn-auth-route a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.hn-auth-note {
  margin: 17px 0 0;
  padding-top: 17px;
  color: var(--hn-auth-muted);
  border-top: 1px solid var(--hn-auth-line);
  font-size: 11px;
  line-height: 1.55;
  text-align: center;
}

.hn-auth-form-footer {
  margin-top: 28px;
  color: var(--hn-auth-muted);
  font: 500 9px/1.5 "IBM Plex Mono", monospace;
  letter-spacing: 0.05em;
  text-align: center;
  text-transform: uppercase;
}

.hn-auth-status {
  display: grid;
  place-items: center;
  padding: 20px 0 8px;
  text-align: center;
}

.hn-auth-status__icon {
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  color: var(--hn-auth-teal);
  border: 1px solid rgba(103, 217, 202, 0.34);
  border-radius: 20px;
  background: rgba(103, 217, 202, 0.08);
  box-shadow: 0 14px 34px rgba(44, 191, 171, 0.1);
}

.hn-auth-status__icon svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hn-auth-status h3 {
  margin: 0;
  color: var(--hn-auth-ice);
  font: 750 22px/1.2 "Plus Jakarta Sans", sans-serif;
}

.hn-auth-status p {
  margin: 10px 0 22px;
  color: var(--hn-auth-muted);
  font-size: 13px;
  line-height: 1.6;
}

@keyframes hnAuthSignal {
  to {
    stroke-dashoffset: -44;
  }
}

@keyframes hnAuthPulse {
  0%, 100% {
    opacity: 0.45;
    transform: scale(0.8);
    transform-origin: center;
  }
  50% {
    opacity: 1;
    transform: scale(1.35);
  }
}

@media (max-width: 960px) {
  .hn-auth-gateway {
    grid-template-columns: 1fr;
    width: min(720px, calc(100% - 32px));
  }

  .hn-auth-story {
    min-height: 350px;
    padding: 30px;
  }

  .hn-auth-story__copy {
    margin: 42px 0 24px;
  }

  .hn-auth-story__copy h1 {
    max-width: 610px;
    font-size: clamp(34px, 7vw, 52px);
  }

  .hn-auth-signal-card {
    display: none;
  }

  .hn-auth-panel {
    min-height: 580px;
    border-top: 1px solid var(--hn-auth-line);
    border-left: 0;
  }

  .hn-auth-trust {
    margin-top: auto;
  }
}

@media (min-width: 961px) and (max-height: 1050px) {
  .hn-auth-gateway {
    height: calc(100svh - 40px);
    min-height: 0;
  }

  .hn-auth-story,
  .hn-auth-panel {
    min-height: 0;
  }

  .hn-auth-panel {
    padding-block: 22px;
  }

  .hn-auth-form-shell {
    padding: 16px 0 4px;
  }

  .hn-auth-form-header {
    margin-bottom: 18px;
  }

  .hn-auth-form {
    gap: 13px;
  }

  .hn-auth-route {
    margin-top: 14px;
  }

  .hn-auth-note {
    margin-top: 12px;
    padding-top: 12px;
  }

  .hn-auth-form-footer {
    margin-top: 16px;
  }
}

@media (max-width: 600px) {
  .hn-auth-gateway {
    width: 100%;
    min-height: 100svh;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  .hn-auth-story {
    min-height: auto;
    padding: 24px 20px 28px;
  }

  .hn-auth-story__copy {
    margin: 34px 0 22px;
  }

  .hn-auth-story__copy h1 {
    font-size: clamp(31px, 11vw, 43px);
  }

  .hn-auth-story__copy > p:last-child {
    margin-top: 14px;
    font-size: 14px;
  }

  .hn-auth-trust {
    gap: 12px;
  }

  .hn-auth-panel {
    min-height: 570px;
    padding: 22px 20px 30px;
  }

  .hn-auth-form-shell {
    padding-top: 30px;
  }

  .hn-auth-form-header h2 {
    font-size: 29px;
  }
}

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

.hn-auth-workspace :focus-visible {
  outline: 3px solid var(--hn-auth-blue);
  outline-offset: 3px;
}
