/* ============================================================================
   RideNest gamified waitlist modal (rn-waitlist.css) — 2026-07-11
   Self-contained styles for the branching "Who are you?" waitlist experience.
   Tokens are declared locally (--wl-*) so the modal renders identically on
   pages that load rn-s2c-clean.css (homepage) OR rn-theme.css (sub-pages).
   Palette + hard-offset shadow language mirror the RideNest design system.
   Motion follows Emil Kowalski / Apple principles: ease-out entrances, custom
   curves, scale(0.9x) never scale(0), transforms+opacity only, reduced-motion
   honored. Modal is a position:fixed overlay => zero CLS on the page beneath.
   ============================================================================ */

.rn-wl {
  /* palette — matched to rn-theme.css tokens */
  --wl-navy: #071943;
  --wl-muted: #4a637a;
  --wl-orange: #F27255;
  --wl-orange-deep: #C8443A;
  --wl-orange-hover: #D95241;
  --wl-sky: #4ebdf7;
  --wl-sky-deep: #4EBDF7;
  --wl-sky-soft: #bfe9fe;
  --wl-cream: #fff9ee;
  --wl-card: #fffdfa;
  --wl-line: rgba(7, 25, 67, .14);
  --wl-err: #C8443A;
  --wl-font: "Pally", "Segoe UI", system-ui, Arial, sans-serif;

  /* motion — strong custom curves (built-in CSS easings are too weak) */
  --wl-ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --wl-ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);

  /* Top-anchored (not vertically centered): keeps the header fixed in place
     when a short step (selector) switches to a tall one (form), so the dialog
     never re-centers => ~0 CLS on path switches. Content grows downward only. */
  inset: clamp(24px, 7vh, 88px) 0 auto 0;
  margin: 0 auto;
  width: min(680px, calc(100vw - 32px));
  max-height: min(84vh, 860px);
  padding: 0;
  border: none;
  border-radius: 30px;
  background: transparent;
  color: var(--wl-navy);
  font-family: var(--wl-font);
  overflow: visible;
}
.rn-wl[open] { display: block; }

/* Native dialog backdrop — navy wash + blur */
.rn-wl::backdrop {
  background: rgba(4, 14, 38, 0.52);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 260ms ease;
}
.rn-wl[open]::backdrop { opacity: 1; }

/* Panel — floating card with brand hairline + soft depth */
.rn-wl__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  max-height: inherit;
  background: var(--wl-card);
  border: 2px solid var(--wl-navy);
  border-radius: 28px;
  box-shadow: 0 34px 80px rgba(6, 20, 48, .34);
  overflow: hidden;
  /* entrance */
  opacity: 0;
  transform: scale(0.965) translateY(6px);
  transition: opacity 280ms var(--wl-ease-out), transform 280ms var(--wl-ease-out);
}
.rn-wl.is-open .rn-wl__panel { opacity: 1; transform: none; }

/* soft sky wash header band + hand doodle motif */
.rn-wl__panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 148px;
  background: linear-gradient(180deg, rgba(78, 189, 247, .22), rgba(78, 189, 247, 0));
  pointer-events: none;
}

/* ---------------------------------------------------------------- Header */
.rn-wl__head {
  position: relative;
  padding: 26px 30px 8px;
  flex: none;
}
.rn-wl__close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 2px solid var(--wl-navy);
  border-radius: 50%;
  background: #fff;
  color: var(--wl-navy);
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--wl-navy);
  transition: transform 140ms var(--wl-ease-out), box-shadow 140ms var(--wl-ease-out);
}
.rn-wl__close:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--wl-navy); }
.rn-wl__close:active { transform: scale(0.94); box-shadow: 1px 1px 0 var(--wl-navy); }
.rn-wl__close svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2.6; fill: none; stroke-linecap: round; }

.rn-wl__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--wl-sky-deep);
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: 12px;
  margin-bottom: 8px;
  min-height: 16px;
}
.rn-wl__eyebrow::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--wl-orange);
}
.rn-wl__title {
  font-size: clamp(24px, 4.4vw, 32px);
  font-weight: 800;
  line-height: 1.06;
  color: var(--wl-navy);
  max-width: 22ch;
  /* reserve 2 lines so a 1-line title ("Who are you?") vs a 2-line title
     ("Join the founding-member waitlist") doesn't shift the rows below => 0 CLS */
  min-height: 2.12em;
}
.rn-wl__title[hidden] { min-height: 0; }
.rn-wl__blurb {
  margin-top: 10px;
  color: var(--wl-muted);
  font-size: 15.5px;
  line-height: 1.5;
  max-width: 52ch;
  min-height: 3em; /* reserve 2 lines to stabilize the progress rail position */
}
.rn-wl__blurb[hidden] { min-height: 0; margin-top: 0; }

/* Progress rail — segmented, fills as you advance */
.rn-wl__progress {
  display: flex;
  gap: 6px;
  margin-top: 18px;
}
.rn-wl__progress span {
  height: 5px;
  flex: 1;
  border-radius: 999px;
  background: rgba(7, 25, 67, .12);
  overflow: hidden;
}
.rn-wl__progress span::after {
  content: "";
  display: block;
  height: 100%;
  width: 100%;
  border-radius: inherit;
  background: var(--wl-orange);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 320ms var(--wl-ease-out);
}
.rn-wl__progress span.is-done::after,
.rn-wl__progress span.is-active::after { transform: scaleX(1); }

/* ---------------------------------------------------------------- Body / steps */
.rn-wl__body {
  position: relative;
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 14px 30px 30px;
  -webkit-overflow-scrolling: touch;
}
.rn-wl__step { }
.rn-wl__step[hidden] { display: none; }

/* step transition: cross-fade + slight slide, blur to bridge the swap */
.rn-wl__step {
  opacity: 1;
  transform: none;
  filter: blur(0);
}
.rn-wl__step.is-entering {
  animation: rnWlStepIn 300ms var(--wl-ease-out) both;
}
@keyframes rnWlStepIn {
  from { opacity: 0; transform: translateX(14px); filter: blur(3px); }
  to   { opacity: 1; transform: none; filter: blur(0); }
}
.rn-wl__step.is-entering.is-back {
  animation-name: rnWlStepInBack;
}
@keyframes rnWlStepInBack {
  from { opacity: 0; transform: translateX(-14px); filter: blur(3px); }
  to   { opacity: 1; transform: none; filter: blur(0); }
}

/* ---------------------------------------------------------------- Path selector */
.rn-wl__lead {
  color: var(--wl-muted);
  font-size: 15px;
  margin: 2px 0 18px;
}
.rn-wl__paths {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.rn-wl-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
  padding: 22px 20px 20px;
  background: var(--wl-cream);
  border: 2px solid var(--wl-navy);
  border-radius: 22px;
  box-shadow: 4px 4px 0 var(--wl-navy);
  cursor: pointer;
  font-family: inherit;
  color: var(--wl-navy);
  transition: transform 150ms var(--wl-ease-out), box-shadow 150ms var(--wl-ease-out);
  /* stagger entrance */
  opacity: 0;
  animation: rnWlCardIn 320ms var(--wl-ease-out) forwards;
}
.rn-wl-card:nth-child(1) { animation-delay: 40ms; }
.rn-wl-card:nth-child(2) { animation-delay: 90ms; }
.rn-wl-card:nth-child(3) { animation-delay: 140ms; }
@keyframes rnWlCardIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
@media (hover: hover) and (pointer: fine) {
  .rn-wl-card:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--wl-navy); }
}
.rn-wl-card:focus-visible {
  outline: 4px solid rgba(242, 114, 85, .32);
  outline-offset: 3px;
}
.rn-wl-card:active { transform: scale(0.985); box-shadow: 2px 2px 0 var(--wl-navy); }

.rn-wl-card__icon {
  width: 56px; height: 56px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: #fff;
  border: 2px solid var(--wl-navy);
}
.rn-wl-card__icon img { width: 34px; height: 34px; object-fit: contain; }
.rn-wl-card__body { display: flex; flex-direction: column; gap: 5px; }
.rn-wl-card__labelrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rn-wl-card__label { font-size: 19px; font-weight: 800; line-height: 1.1; }
.rn-wl-card__desc { font-size: 13.5px; color: var(--wl-muted); line-height: 1.4; }
.rn-wl-card__go {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  font-size: 13.5px;
  color: var(--wl-orange-deep);
}
.rn-wl-card__go b { font-size: 1.2em; line-height: 0; transition: transform 180ms var(--wl-ease-out); }
@media (hover: hover) and (pointer: fine) {
  .rn-wl-card:hover .rn-wl-card__go b { transform: translateX(3px); }
}
.rn-wl-card__badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--wl-sky-deep);
  background: var(--wl-sky-soft);
  border: 1.5px solid var(--wl-sky-deep);
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
}
/* the partner card spans full width; a slimmer secondary row on desktop,
   a normal stacked card on mobile (below) */
.rn-wl-card--wide {
  grid-column: 1 / -1;
  padding: 20px 20px 18px;
  box-shadow: 3px 3px 0 var(--wl-navy);
}
@media (min-width: 561px) {
  .rn-wl-card--wide {
    flex-direction: row;
    align-items: center;
    gap: 16px;
    padding: 15px 20px;
  }
  .rn-wl-card--wide .rn-wl-card__icon { width: 46px; height: 46px; flex: none; }
  .rn-wl-card--wide .rn-wl-card__icon img { width: 26px; height: 26px; }
  .rn-wl-card--wide .rn-wl-card__go { margin: 0 0 0 auto; }
  .rn-wl-card--wide .rn-wl-card__label { font-size: 17px; }
}

/* ---------------------------------------------------------------- Form */
.rn-wl__form { }
.rn-wl__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  padding: 6px 12px 6px 8px;
  background: none;
  border: 1.5px solid var(--wl-line);
  border-radius: 999px;
  color: var(--wl-muted);
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 140ms ease, color 140ms ease, transform 140ms var(--wl-ease-out);
}
.rn-wl__back:hover { color: var(--wl-navy); border-color: var(--wl-navy); }
.rn-wl__back:active { transform: scale(0.97); }
.rn-wl__back svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2.6; fill: none; stroke-linecap: round; stroke-linejoin: round; }

.rn-wl__offer {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  padding: 14px 16px;
  margin-bottom: 20px;
  background: var(--wl-cream);
  border: 2px solid var(--wl-navy);
  border-radius: 16px;
  box-shadow: 3px 3px 0 var(--wl-orange);
}
.rn-wl__offer svg { flex: none; width: 22px; height: 22px; margin-top: 1px; }
.rn-wl__offer p { font-size: 13.5px; line-height: 1.45; color: var(--wl-navy); }
.rn-wl__offer b { color: var(--wl-orange-deep); }

.rn-wl__fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px 16px;
}
.rn-wl-field { display: flex; flex-direction: column; gap: 6px; }
.rn-wl-field--full { grid-column: 1 / -1; }
.rn-wl-field label {
  font-weight: 800;
  font-size: 13.5px;
  color: var(--wl-navy);
}
.rn-wl-field label .req { color: var(--wl-orange-deep); }
.rn-wl-field .hint { font-weight: 600; font-size: 12px; color: var(--wl-muted); }
.rn-wl-field input,
.rn-wl-field select {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--wl-navy);
  background: #fff;
  border: 2px solid var(--wl-line);
  border-radius: 13px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
  appearance: none;
}
.rn-wl-field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23071943' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}
.rn-wl-field input::placeholder { color: #9aabb8; font-weight: 500; }
.rn-wl-field input:focus,
.rn-wl-field select:focus {
  outline: none;
  border-color: var(--wl-sky-deep);
  box-shadow: 0 0 0 4px rgba(78, 189, 247, .22);
}
.rn-wl-field.is-invalid input,
.rn-wl-field.is-invalid select {
  border-color: var(--wl-err);
  box-shadow: 0 0 0 4px rgba(200, 68, 58, .16);
}
.rn-wl-field__err {
  min-height: 0;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--wl-err);
  display: none;
}
.rn-wl-field.is-invalid .rn-wl-field__err { display: block; }

/* Consent gate — required checkbox linking Privacy + Terms */
.rn-wl-consent {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  column-gap: 11px;
  row-gap: 4px;
  margin-top: 20px;
  padding: 14px 16px;
  background: var(--wl-cream);
  border: 2px solid var(--wl-line);
  border-radius: 14px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.rn-wl-consent input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  flex: none;
  accent-color: var(--wl-orange-deep);
  cursor: pointer;
}
.rn-wl-consent label {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--wl-navy);
  cursor: pointer;
}
.rn-wl-consent a {
  color: var(--wl-sky-deep);
  font-weight: 800;
  text-decoration: underline;
}
.rn-wl-consent a:hover { color: var(--wl-orange-deep); }
.rn-wl-consent .rn-wl-field__err { grid-column: 1 / -1; }
.rn-wl-consent.is-invalid {
  border-color: var(--wl-err);
  box-shadow: 0 0 0 4px rgba(200, 68, 58, .16);
}
.rn-wl-consent.is-invalid .rn-wl-field__err { display: block; }

/* Disabled submit — clearly inert until consent is given */
.rn-wl__submit:disabled,
.rn-wl__submit[aria-disabled="true"] {
  opacity: .45;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.rn-wl__actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
}
.rn-wl__submit {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 54px;
  padding: 0 26px;
  border: 2px solid var(--wl-orange-deep);
  border-radius: 999px;
  background: var(--wl-orange);
  color: var(--wl-navy);
  font-family: inherit;
  font-weight: 800;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(242, 114, 85, .28);
  transition: transform 150ms var(--wl-ease-out), background 200ms ease, box-shadow 150ms var(--wl-ease-out);
}
.rn-wl__submit b { font-size: 1.2em; line-height: 0; }
@media (hover: hover) and (pointer: fine) {
  .rn-wl__submit:not(:disabled):hover { background: var(--wl-orange-hover); transform: translateY(-1px); box-shadow: 0 14px 26px rgba(242, 114, 85, .34); }
}
.rn-wl__submit:active { transform: scale(0.97); }
.rn-wl__submit:focus-visible { outline: 4px solid rgba(242, 114, 85, .34); outline-offset: 3px; }
.rn-wl__note { font-size: 12px; color: var(--wl-muted); line-height: 1.35; flex: 1; }

/* ---------------------------------------------------------------- Success */
.rn-wl__success {
  text-align: center;
  padding: 22px 6px 8px;
}
.rn-wl__success-mark {
  width: 76px; height: 76px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--wl-sky-soft);
  border: 2px solid var(--wl-navy);
  box-shadow: 4px 4px 0 var(--wl-navy);
  animation: rnWlPop 420ms var(--wl-ease-out) both;
}
.rn-wl__success-mark svg { width: 40px; height: 40px; stroke: var(--wl-sky-deep); stroke-width: 3.2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
@keyframes rnWlPop {
  from { opacity: 0; transform: scale(0.6); }
  60%  { transform: scale(1.06); }
  to   { opacity: 1; transform: scale(1); }
}
.rn-wl__success h3 { font-size: 26px; font-weight: 800; }
.rn-wl__success p { margin: 10px auto 0; color: var(--wl-muted); font-size: 15.5px; max-width: 40ch; line-height: 1.5; }
.rn-wl__success .rn-wl__submit { margin-top: 24px; }

/* ---------------------------------------------------------------- Responsive */
@media (max-width: 560px) {
  .rn-wl { inset: 16px 0 auto 0; width: calc(100vw - 20px); max-height: 88vh; }
  .rn-wl__head { padding: 22px 20px 6px; }
  .rn-wl__body { padding: 12px 20px 24px; }
  .rn-wl__paths { grid-template-columns: 1fr; }
  .rn-wl__fields { grid-template-columns: 1fr; }
  .rn-wl__actions { flex-direction: column; align-items: stretch; }
  .rn-wl__submit { justify-content: center; }
}

/* ---------------------------------------------------------------- Reduced motion
   Keep opacity/comprehension fades; drop all movement, blur, and stagger. */
@media (prefers-reduced-motion: reduce) {
  .rn-wl::backdrop { transition: none; }
  .rn-wl__panel { transition: opacity 200ms ease; transform: none; }
  .rn-wl.is-open .rn-wl__panel { transform: none; }
  .rn-wl__step.is-entering,
  .rn-wl__step.is-entering.is-back { animation: rnWlFade 200ms ease both; }
  @keyframes rnWlFade { from { opacity: 0; } to { opacity: 1; } }
  .rn-wl-card { animation: rnWlFade 200ms ease both; opacity: 1; }
  .rn-wl-card:hover,
  .rn-wl-card:active,
  .rn-wl__submit:hover,
  .rn-wl__close:hover { transform: none; }
  .rn-wl__success-mark { animation: rnWlFade 200ms ease both; }
  .rn-wl__progress span::after { transition: none; }
}
