/*
 * Pre-auth public shell (Stage 1).
 * Scoped entirely under #auth-screen / .preauth-* so it cannot leak into the
 * authenticated graph UI. Loaded after index-app.css — see the small
 * .auth-screen override there (scroll vs. legacy center alignment).
 */

#auth-screen {
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  #auth-screen {
    scroll-behavior: auto;
  }
}

.preauth-shell {
  width: 100%;
  min-height: 100%;
  /* #auth-screen is display:flex; flex-direction:column, so .preauth-shell
   * is a column flex item. Default flex-shrink:1 lets the browser shrink
   * this item down to its min-height (100% = one #auth-screen viewport)
   * whenever content is taller than the viewport, which is exactly the bug:
   * the shell (and its sticky header child) gets capped at ~1 viewport tall
   * while the rendered content overflows past that capped box. flex-shrink:0
   * keeps the shell sized to its content (flex-basis: auto) instead. */
  flex: 0 0 auto;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  color: #eaf5ff;
  font-family: Arial, sans-serif;
  --preauth-desktop-max: 1760px;
  --preauth-desktop-gutter: 48px;
  --preauth-page-gutter: 20px;
}

/* Shared outer alignment for header / hero / sections / entry / footer.
 * Parent sections keep horizontal page gutters; inners cap at the desktop max. */
.preauth-header__inner,
.preauth-hero__inner,
.preauth-section__inner,
.preauth-entry__inner,
.preauth-footer__inner {
  width: min(100%, var(--preauth-desktop-max));
  max-width: var(--preauth-desktop-max);
  margin-inline: auto;
  box-sizing: border-box;
}

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

.preauth-shell :focus-visible {
  outline: 2px solid rgba(130, 200, 255, 0.85);
  outline-offset: 3px;
  border-radius: 4px;
}
.preauth-auth-modal :focus-visible {
  outline: 2px solid rgba(130, 200, 255, 0.85);
  outline-offset: 3px;
}

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

/* ---------- Header ---------- */
.preauth-header {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: calc(14px + env(safe-area-inset-top, 0px)) max(var(--preauth-page-gutter), env(safe-area-inset-left, 0px))
    14px max(var(--preauth-page-gutter), env(safe-area-inset-right, 0px));
  background: linear-gradient(180deg, rgba(6, 4, 16, 0.92) 0%, rgba(6, 4, 16, 0.72) 78%, rgba(6, 4, 16, 0) 100%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.preauth-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.preauth-logo {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #f4f0ff;
  text-shadow: 0 0 18px rgba(155, 89, 182, 0.55);
}
.preauth-header__login-btn {
  min-height: 40px;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid rgba(180, 220, 255, 0.32);
  background: rgba(255, 255, 255, 0.06);
  color: #eaf5ff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease,
    color 0.18s ease, opacity 0.18s ease;
}
/* ---------- Main / sections shared ---------- */
.preauth-main {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
}
.preauth-section {
  padding: 56px max(var(--preauth-page-gutter), env(safe-area-inset-left, 0px)) 0
    max(var(--preauth-page-gutter), env(safe-area-inset-right, 0px));
  /* 16px scroll-margin + ~56px section padding-top ≈ 72px total offset,
   * which clears the ~68px-tall sticky header (14px top padding +
   * env(safe-area-inset-top) + ~40px content row from the min-height: 40px
   * login button + 14px bottom padding) with a small remaining gap. */
  scroll-margin-top: calc(16px + env(safe-area-inset-top, 0px));
}
.preauth-section__title {
  margin: 0 0 8px;
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 800;
  text-align: center;
  color: #f4f0ff;
}
.preauth-section__lead {
  margin: 0 auto 32px;
  max-width: 640px;
  text-align: center;
  color: rgba(220, 234, 248, 0.78);
  font-size: 15px;
  line-height: 1.55;
}

/* ---------- Hero ---------- */
.preauth-hero {
  padding: 28px max(var(--preauth-page-gutter), env(safe-area-inset-left, 0px)) 48px
    max(var(--preauth-page-gutter), env(safe-area-inset-right, 0px));
}
.preauth-hero__inner {
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.preauth-hero__content {
  display: flex;
  flex-direction: column;
  gap: 18px;
  text-align: center;
}
.preauth-hero__title {
  margin: 0;
  font-size: clamp(28px, 5.5vw, 44px);
  line-height: 1.16;
  font-weight: 800;
  color: #f8f4ff;
  text-shadow: 0 0 34px rgba(120, 90, 220, 0.35);
}
.preauth-hero__subtitle {
  margin: 0 auto;
  max-width: 560px;
  font-size: 16px;
  line-height: 1.6;
  color: rgba(224, 236, 250, 0.86);
}
.preauth-hero__actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
  margin-top: 4px;
}
.preauth-hero__disclaimer {
  margin: 6px auto 0;
  max-width: 480px;
  font-size: 12.5px;
  line-height: 1.5;
  color: rgba(190, 205, 225, 0.62);
}
.preauth-hero__visual {
  display: flex;
  justify-content: center;
}

/* ---------- Buttons ---------- */
.preauth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 13px 26px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  font-family: Arial, sans-serif;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease,
    color 0.18s ease, opacity 0.18s ease;
}
.preauth-btn--primary {
  border-color: rgba(155, 89, 182, 0.6);
  background: linear-gradient(135deg, rgba(0, 180, 220, 0.55), rgba(155, 89, 182, 0.65));
  color: #fdfaff;
  box-shadow: 0 10px 30px rgba(120, 70, 200, 0.35);
}
.preauth-btn--ghost {
  border-color: rgba(180, 220, 255, 0.28);
  background: rgba(255, 255, 255, 0.05);
  color: #eaf5ff;
}
.preauth-btn--secondary {
  border-color: rgba(0, 200, 255, 0.35);
  background: rgba(0, 200, 255, 0.1);
  color: #d9f6ff;
}
/* ---------- Hero visual: real image + CSS-only decorative fallback ---------- */
.preauth-hero__media {
  position: relative;
  width: 100%;
  max-width: 560px;
  aspect-ratio: 16 / 10;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(155, 130, 220, 0.28);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45);
  background: linear-gradient(160deg, #140b2e 0%, #0a0620 60%, #05030f 100%);
  transition: transform 0.22s ease, opacity 0.22s ease;
}
.preauth-hero__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.preauth-hero__media--ready .preauth-hero__img {
  opacity: 1;
}
.preauth-hero__media--ready .preauth-hero__fallback {
  opacity: 0;
}
.preauth-hero__fallback {
  position: absolute;
  inset: 0;
  transition: opacity 0.4s ease;
}
.preauth-hero__fallback-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(50% 55% at 22% 28%, rgba(155, 89, 182, 0.42), transparent 70%),
    radial-gradient(45% 50% at 78% 62%, rgba(0, 190, 220, 0.32), transparent 70%);
}
.preauth-hero__fallback-grid {
  position: absolute;
  inset: 0;
  opacity: 0.5;
  background-image: linear-gradient(rgba(160, 190, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(160, 190, 255, 0.08) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(120% 100% at 50% 45%, #000 55%, transparent 100%);
  -webkit-mask-image: radial-gradient(120% 100% at 50% 45%, #000 55%, transparent 100%);
}
.preauth-hero__fallback-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.preauth-hero__fallback-lines line {
  stroke: rgba(190, 210, 255, 0.34);
  stroke-width: 0.5;
}
.preauth-hero__node {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, #fff 0%, rgba(180, 210, 255, 0.9) 45%, rgba(180, 210, 255, 0) 75%);
  box-shadow: 0 0 16px 4px rgba(150, 190, 255, 0.55);
}
.preauth-hero__node--1 {
  left: 15%;
  top: 30%;
  width: 16px;
  height: 16px;
  background: radial-gradient(circle, #fff 0%, rgba(155, 89, 182, 0.95) 45%, rgba(155, 89, 182, 0) 75%);
  box-shadow: 0 0 20px 5px rgba(155, 89, 182, 0.55);
}
.preauth-hero__node--2 {
  left: 45%;
  top: 15%;
}
.preauth-hero__node--3 {
  left: 75%;
  top: 35%;
  width: 14px;
  height: 14px;
  background: radial-gradient(circle, #fff 0%, rgba(0, 200, 220, 0.95) 45%, rgba(0, 200, 220, 0) 75%);
  box-shadow: 0 0 18px 4px rgba(0, 200, 220, 0.55);
}
.preauth-hero__node--4 {
  left: 35%;
  top: 65%;
}
.preauth-hero__node--5 {
  left: 68%;
  top: 78%;
  width: 14px;
  height: 14px;
}
@media (prefers-reduced-motion: reduce) {
  .preauth-hero__img,
  .preauth-hero__fallback {
    transition: none;
  }
}

/* ---------- How it works ---------- */
.preauth-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.preauth-step {
  padding: 22px;
  border-radius: 16px;
  background: rgba(20, 20, 34, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease,
    opacity 0.2s ease;
}
.preauth-step__index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  margin-bottom: 12px;
  font-weight: 800;
  font-size: 13px;
  color: #f8f4ff;
  background: linear-gradient(135deg, rgba(0, 180, 220, 0.55), rgba(155, 89, 182, 0.65));
}
.preauth-step__title {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 700;
  color: #f4f0ff;
}
.preauth-step__text {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: rgba(220, 234, 248, 0.78);
}

/* ---------- Benefits ---------- */
.preauth-benefits-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.preauth-benefit {
  padding: 20px;
  border-radius: 16px;
  background: rgba(16, 18, 30, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.07);
  text-align: center;
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease,
    opacity 0.2s ease;
}
.preauth-benefit__title {
  margin: 0 0 6px;
  font-size: 15.5px;
  font-weight: 700;
  color: #eaf5ff;
}
.preauth-benefit__text {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: rgba(210, 224, 240, 0.72);
}

/* ---------- Archive entry ---------- */
.preauth-entry {
  padding-bottom: 56px;
}
.preauth-entry__heading {
  margin: 0 0 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-sizing: border-box;
}
.preauth-pilot {
  scroll-margin-top: calc(16px + env(safe-area-inset-top, 0px));
}
.preauth-entry__surface {
  width: 100%;
  box-sizing: border-box;
}
.preauth-pilot__card {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px;
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  text-align: center;
  background:
    radial-gradient(circle at 10% 0%, rgba(0, 200, 255, 0.1), transparent 38%),
    linear-gradient(145deg, rgba(18, 20, 36, 0.86), rgba(11, 10, 24, 0.9));
  border: 1px solid rgba(112, 196, 255, 0.22);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.035);
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease,
    opacity 0.2s ease;
  box-sizing: border-box;
}
.preauth-pilot__body {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 0;
  align-items: stretch;
}
.preauth-pilot__title {
  margin: 0 0 18px;
  font-size: clamp(20px, 2.4vw, 26px);
  font-weight: 700;
  color: #eaf5ff;
}
.preauth-pilot__lead {
  margin: 0;
  font-size: 17px;
  font-weight: 750;
  line-height: 1.35;
  color: #eaf5ff;
}
.preauth-pilot__text {
  margin: 5px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(220, 234, 248, 0.78);
}
.preauth-pilot__intro {
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
}
.preauth-pilot__copy {
  min-width: 0;
}
.preauth-pilot__highlight {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-width: 122px;
  padding: 12px 15px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(0, 200, 255, 0.13), rgba(98, 78, 180, 0.12));
  border: 1px solid rgba(88, 211, 255, 0.24);
}
.preauth-pilot__stat {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #7fe9ff;
  line-height: 1;
}
.preauth-pilot__stat-label {
  max-width: 54px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.15;
  color: rgba(220, 234, 248, 0.86);
  text-align: left;
}
.preauth-pilot__howto {
  text-align: left;
  padding-top: 18px;
  border-top: 1px solid rgba(160, 205, 255, 0.11);
}
.preauth-pilot__howto-title {
  margin: 0 0 11px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(187, 215, 245, 0.62);
}
.preauth-pilot__steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 9px;
}
.preauth-pilot__steps li {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(7, 12, 26, 0.42);
  border: 1px solid rgba(143, 195, 240, 0.1);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
  color: rgba(225, 237, 249, 0.86);
}
.preauth-pilot__step-index {
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(0, 200, 255, 0.28), rgba(155, 89, 182, 0.35));
  color: #effaff;
  font-size: 12px;
  font-weight: 800;
}
.preauth-pilot__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}
.preauth-pilot__card .preauth-btn {
  max-width: 100%;
  box-sizing: border-box;
  gap: 10px;
  padding-inline: 20px;
  border-color: rgba(89, 213, 255, 0.38);
  background: linear-gradient(135deg, rgba(0, 177, 219, 0.2), rgba(111, 75, 173, 0.22));
}

@media (max-width: 520px) {
  .preauth-pilot__card {
    padding: 22px;
  }
  .preauth-pilot__intro {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  .preauth-pilot__highlight {
    min-width: 0;
  }
  .preauth-pilot__copy {
    width: 100%;
  }
}

/* ---------- Pre-auth modal ---------- */
#auth-screen.preauth-auth-modal-open {
  overflow: hidden;
}
.preauth-auth-modal[hidden] {
  display: none;
}
.preauth-auth-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: max(20px, env(safe-area-inset-top, 0px)) max(20px, env(safe-area-inset-right, 0px))
    max(20px, env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: rgba(3, 2, 10, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.preauth-auth-modal__surface {
  position: relative;
  width: min(100%, 540px);
  margin: auto;
}
.preauth-auth-modal .auth-card {
  width: 100%;
  max-width: none;
  padding: 30px;
  box-sizing: border-box;
  background: rgba(15, 14, 27, 0.96);
  border-color: rgba(151, 188, 255, 0.34);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.62), 0 0 42px rgba(105, 60, 170, 0.16);
}
.preauth-auth-modal .auth-card > h2 {
  padding-inline: 32px;
}
.preauth-auth-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(180, 220, 255, 0.2);
  border-radius: 50%;
  background: rgba(10, 12, 24, 0.72);
  color: rgba(234, 245, 255, 0.86);
  font: inherit;
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}
.preauth-auth-modal__close:hover {
  transform: translateY(-1px);
  border-color: rgba(180, 220, 255, 0.46);
  background: rgba(28, 30, 50, 0.92);
}

@media (min-width: 960px) {
  .preauth-shell {
    --preauth-page-gutter: var(--preauth-desktop-gutter);
  }
  .preauth-pilot__body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "intro actions"
      "howto howto";
    column-gap: 24px;
    row-gap: 20px;
    align-items: center;
  }
  .preauth-pilot__card {
    padding: 26px 28px;
    text-align: left;
  }
  .preauth-pilot__intro {
    grid-area: intro;
  }
  .preauth-pilot__howto {
    grid-area: howto;
  }
  .preauth-pilot__steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
  }
  .preauth-pilot__steps li {
    position: relative;
    min-height: 48px;
  }
  .preauth-pilot__steps li:not(:last-child)::after {
    content: "→";
    position: absolute;
    top: 50%;
    right: -20px;
    transform: translateY(-50%);
    color: rgba(107, 210, 242, 0.42);
    font-size: 16px;
  }
  .preauth-pilot__actions {
    grid-area: actions;
    align-items: stretch;
    margin-top: 0;
  }
  .preauth-pilot__card .preauth-btn {
    min-width: 220px;
    justify-content: center;
  }
}

/* ---------- Footer ---------- */
.preauth-footer {
  margin-top: auto;
  padding: 24px max(var(--preauth-page-gutter), env(safe-area-inset-left, 0px))
    calc(20px + env(safe-area-inset-bottom, 0px)) max(var(--preauth-page-gutter), env(safe-area-inset-right, 0px));
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.preauth-footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}
.preauth-footer__name {
  font-weight: 800;
  color: #eaf5ff;
  letter-spacing: 0.02em;
}
.preauth-footer__disclaimer {
  margin: 0;
  max-width: 520px;
  font-size: 12px;
  line-height: 1.5;
  color: rgba(190, 205, 225, 0.62);
}
.preauth-footer .project-social-links-mount {
  min-height: 0;
}

.preauth-footer .project-social-links__item {
  transition: transform 0.18s ease, color 0.18s ease, background-color 0.18s ease,
    opacity 0.18s ease;
}
.preauth-footer .project-social-links__item:focus-visible {
  outline: 2px solid rgba(130, 200, 255, 0.9);
  outline-offset: 3px;
}

/* ---------- Progressive motion ---------- */
@keyframes preauth-hero-enter {
  from {
    opacity: 0;
    transform: translateY(var(--preauth-enter-y, 12px));
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes preauth-hero-visual-enter {
  from {
    opacity: 0;
    transform: translateY(var(--preauth-enter-y, 12px)) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.preauth-hero__title {
  animation: preauth-hero-enter 0.46s ease 0ms backwards;
}
.preauth-hero__subtitle {
  animation: preauth-hero-enter 0.46s ease 60ms backwards;
}
.preauth-hero__actions .preauth-btn:first-child {
  animation: preauth-hero-enter 0.46s ease 120ms backwards;
}
.preauth-hero__visual {
  animation: preauth-hero-visual-enter 0.46s ease 140ms backwards;
}
.preauth-hero__disclaimer {
  animation: preauth-hero-enter 0.46s ease 180ms backwards;
}
.preauth-hero__actions .preauth-btn:nth-child(2) {
  animation: preauth-hero-enter 0.46s ease 190ms backwards;
}

.preauth-motion-ready .preauth-reveal {
  opacity: 0;
  transform: translateY(var(--preauth-enter-y, 12px));
  transition: opacity 0.46s ease var(--preauth-reveal-delay, 0ms),
    transform 0.46s ease var(--preauth-reveal-delay, 0ms);
}
.preauth-motion-ready .preauth-reveal--visible {
  opacity: 1;
  transform: none;
}

/* Hover movement is limited to precise pointing devices. */
@media (hover: hover) and (pointer: fine) {
  .preauth-shell .preauth-header__login-btn:hover {
    border-color: rgba(155, 89, 182, 0.7);
    background: rgba(155, 89, 182, 0.2);
  }
  .preauth-shell .preauth-btn--primary:hover {
    border-color: rgba(200, 160, 255, 0.85);
  }
  .preauth-shell .preauth-btn--ghost:hover {
    border-color: rgba(180, 220, 255, 0.55);
    background: rgba(180, 220, 255, 0.12);
  }
  .preauth-shell .preauth-btn--secondary:hover {
    border-color: rgba(0, 200, 255, 0.6);
    background: rgba(0, 200, 255, 0.18);
  }
  .preauth-shell .preauth-header__login-btn:hover,
  .preauth-shell .preauth-btn:hover,
  .preauth-shell .preauth-footer .project-social-links__item:hover {
    transform: translateY(-1px);
  }
  .preauth-shell .preauth-header__login-btn:active,
  .preauth-shell .preauth-btn:active,
  .preauth-shell .preauth-footer .project-social-links__item:active {
    transform: scale(0.98);
  }
  .preauth-shell .preauth-step:hover,
  .preauth-shell .preauth-benefit:hover,
  .preauth-shell .preauth-pilot__card:hover {
    transform: translateY(-2px);
    border-color: rgba(170, 205, 255, 0.18);
  }
  .preauth-shell .preauth-hero__media:hover {
    transform: scale(1.006);
  }
}

@media (hover: none) {
  .preauth-footer .project-social-links__item:hover {
    color: rgba(220, 234, 248, 0.52);
    background: transparent;
    transform: none;
  }
}

@media (max-width: 767px) {
  .preauth-shell {
    --preauth-enter-y: 8px;
  }
  .preauth-motion-ready .preauth-reveal {
    transition-duration: 0.38s;
  }
  .preauth-motion-ready .preauth-reveal--visible {
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .preauth-hero__title,
  .preauth-hero__subtitle,
  .preauth-hero__actions .preauth-btn:first-child,
  .preauth-hero__actions .preauth-btn:nth-child(2),
  .preauth-hero__disclaimer,
  .preauth-hero__visual {
    animation: none;
    opacity: 1;
    transform: none;
  }
  .preauth-motion-ready .preauth-reveal,
  .preauth-motion-ready .preauth-reveal--visible {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .preauth-header__login-btn,
  .preauth-auth-modal__close,
  .preauth-btn,
  .preauth-step,
  .preauth-benefit,
  .preauth-pilot__card,
  .preauth-hero__media,
  .preauth-footer .project-social-links__item {
    transition: none;
  }
  .preauth-shell .preauth-header__login-btn:hover,
  .preauth-shell .preauth-header__login-btn:active,
  .preauth-shell .preauth-btn:hover,
  .preauth-shell .preauth-btn:active,
  .preauth-shell .preauth-step:hover,
  .preauth-shell .preauth-benefit:hover,
  .preauth-shell .preauth-pilot__card:hover,
  .preauth-shell .preauth-hero__media:hover,
  .preauth-shell .preauth-footer .project-social-links__item:hover,
  .preauth-shell .preauth-footer .project-social-links__item:active {
    transform: none;
  }
}

/* ---------- Tablet ---------- */
@media (min-width: 768px) {
  .preauth-hero__actions {
    flex-direction: row;
    justify-content: center;
  }
  .preauth-steps {
    grid-template-columns: repeat(3, 1fr);
  }
  .preauth-benefits-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ---------- Desktop ---------- */
@media (min-width: 1024px) {
  .preauth-hero__inner {
    flex-direction: row;
    align-items: center;
    gap: clamp(48px, 5vw, 80px);
  }
  .preauth-hero__content {
    flex: 1 1 0;
    max-width: 560px;
    text-align: left;
    align-items: flex-start;
  }
  .preauth-hero__subtitle {
    margin-left: 0;
  }
  .preauth-hero__actions {
    justify-content: flex-start;
  }
  .preauth-hero__disclaimer {
    margin-left: 0;
    text-align: left;
  }
  .preauth-hero__visual {
    flex: 1 1 0;
    justify-content: flex-end;
  }
  .preauth-hero__media {
    max-width: min(720px, 100%);
  }
}

/* ---------- Narrow phones ---------- */
@media (max-width: 340px) {
  .preauth-section {
    padding-left: 14px;
    padding-right: 14px;
  }
  .preauth-hero {
    padding-left: 14px;
    padding-right: 14px;
  }
  .preauth-hero__title {
    font-size: 26px;
  }
}
