/* The closing call to action on the night surface, with the early-access
   form always showing under it (Tom, 15 Nov 2026). */
.early {
  padding: clamp(calc(72px * var(--s, 1)), calc(9vw * var(--s, 1)), calc(136px * var(--s, 1))) 0;
  background: var(--paper-dark);
  color: var(--paper);
}
.early__wrap { display: flex; flex-direction: column; align-items: center; }
.early__head {
  display: flex; flex-direction: column; align-items: center;
  gap: clamp(calc(28px * var(--s, 1)), calc(3vw * var(--s, 1)), calc(40px * var(--s, 1)));
  text-align: center;
}
.early__head .h-1 { line-height: 1.06; color: var(--paper); max-width: 14em; }
.early__lede { margin: 0; max-width: 40em; font-size: clamp(calc(17px * var(--s, 1)), calc(1.4vw * var(--s, 1)), calc(20px * var(--s, 1))); line-height: 1.55; color: var(--on-night-2, rgb(255 255 255 / 0.82)); }
/* A partner referral link shows this section alone, so it fills the screen. */
html[data-referral="1"] .early { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; }

.early__form[hidden] { display: none; }
.early__form {
  display: flex;
  flex-direction: column;
  gap: calc(12px * var(--s, 1));
  width: 100%;
  max-width: calc(720px * var(--s, 1));
  margin-top: clamp(calc(32px * var(--s, 1)), calc(4vw * var(--s, 1)), calc(48px * var(--s, 1)));
  text-align: left;
}
.early__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: calc(12px * var(--s, 1));
}
.early__field { display: flex; flex-direction: column; gap: calc(4px * var(--s, 1)); }
.early__field--full { grid-column: 1 / -1; }
.early__label {
  font-family: var(--sans);
  font-size: calc(15px * var(--s, 1));
  letter-spacing: 0;
  color: rgba(255,255,255,0.72);
}
.early__field input,
.early__field select,
.early__field textarea {
  font: inherit;
  /* 16px: anything smaller and iOS zooms the page when the field takes focus. */
  font-size: calc(16px * var(--s, 1));
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.18);
  color: var(--bg);
  padding: calc(11px * var(--s, 1)) calc(12px * var(--s, 1));
  border-radius: calc(8px * var(--s, 1));
  transition: border-color 0.15s, background 0.15s;
}
.early__field input:focus,
.early__field select:focus,
.early__field textarea:focus {
  outline: none;
  border-color: var(--sun);
  /* background-color (not the `background` shorthand) so the select's chevron
     background-image/repeat/size survive focus - otherwise the caret tiles into
     a zigzag across the field. */
  background-color: rgba(255,255,255,0.12);
}
.early__field textarea { resize: vertical; min-height: calc(56px * var(--s, 1)); }

/* Reset native <select> chrome and replace with a styled caret. The native
 * select on dark backgrounds was rendering with a chrome gradient, light
 * background and a default focus ring that ignored our theme. */
.early__field select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'><path d='M1 1l5 5 5-5' stroke='%23ffffff' stroke-opacity='0.7' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 8px;
  padding-right: calc(36px * var(--s, 1));
  color: var(--bg);
}
.early__field select::-ms-expand { display: none; }
/* Default-state (empty value) shows the placeholder colour to mimic an input::placeholder. */
.early__field select:invalid,
.early__field select[data-placeholder="true"] { color: rgba(255,255,255,0.55); }
.early__field select option { background: var(--ink); color: var(--bg); }
.early__field select option[value=""] { color: rgba(255,255,255,0.55); }
.early__field select:focus {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'><path d='M1 1l5 5 5-5' stroke='%23FFC842' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}

/* Honeypot - hide off-screen but stay focusable for accessibility tools */
.early__pot {
  position: absolute;
  left: calc(-9999px * var(--s, 1));
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.early__submit-row {
  display: flex;
  /* row-reverse so the submit button anchors hard-right and the status
     message (2nd child in the DOM) sits to its left, keeping the button
     right-justified even while an error/status message is showing. */
  flex-direction: row-reverse;
  align-items: center;
  gap: calc(18px * var(--s, 1));
  margin-top: calc(6px * var(--s, 1));
  flex-wrap: wrap;
}
.early__submit { height: calc(48px * var(--s, 1)); padding: 0 calc(22px * var(--s, 1)); font-size: calc(15px * var(--s, 1)); }
.early__submit { background: var(--coral-fill); color: var(--on-coral); }
.early__submit:disabled { opacity: 0.6; cursor: wait; }
.early__status {
  font-family: var(--sans);
  font-size: calc(13px * var(--s, 1));
  margin: 0;
  color: rgba(255,255,255,0.7);
}
.early__status[data-state="ok"]    { color: var(--lime); }
.early__status[data-state="error"] { color: #FF8B7A; }

/* Privacy notice at point of PII collection (GDPR Art.13). On the dark form
   card; white-on-dark stays well above 4.5:1. */
.early__consent {
  margin: calc(14px * var(--s, 1)) 0 0;
  font-size: calc(13px * var(--s, 1));
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.72);
}
.early__consent a { color: var(--bg); text-decoration: underline; text-underline-offset: 2px; }
.early__consent a:hover { color: var(--sun); }

@media (max-width: 700px) {
  .early { padding: calc(80px * var(--s, 1)) 0; }
  .early__row { grid-template-columns: 1fr; }
  .early__nav { flex-wrap: wrap; }
  .early__next { margin-left: 0; }
  .early__nav--submit .early__submit-row { margin-left: 0; }
}

/* Step progress: "Step X of 3" + 3 segment dots. Filled segments (active or
   completed) read coral; the rest stay a faint rule. */
.early__progress {
  display: flex;
  align-items: center;
  gap: calc(12px * var(--s, 1));
  margin-bottom: calc(4px * var(--s, 1));
}
.early__progress-label {
  font-family: var(--sans);
  font-size: calc(13px * var(--s, 1));
  color: rgba(255, 255, 255, 0.62);
  margin: 0;
  min-width: calc(84px * var(--s, 1));
}
.early__progress-track {
  display: flex;
  gap: calc(6px * var(--s, 1));
}
.early__progress-seg {
  width: calc(32px * var(--s, 1));
  height: calc(3px * var(--s, 1));
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.18);
  transition: background 0.15s ease;
}
.early__progress-seg.is-active,
.early__progress-seg.is-complete {
  background: var(--coral);
}

/* One step visible at a time. A short fade-in on the incoming step; no
   transition at all under reduced motion. */
.early__step:not(.is-active) { display: none; }
.early__step.is-active { animation: earlyStepIn 0.18s ease; }
@keyframes earlyStepIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .early__step.is-active { animation: none; }
}

/* Back / Next row. Next reuses .btn--coral; Back is a quiet text button. */
.early__nav {
  display: flex;
  align-items: center;
  gap: calc(16px * var(--s, 1));
  margin-top: calc(10px * var(--s, 1));
}
.early__nav--submit { flex-wrap: wrap; }
.early__back {
  font-family: var(--sans);
  font-size: calc(14.5px * var(--s, 1));
  color: rgba(255, 255, 255, 0.7);
  background: transparent;
  border: none;
  padding: calc(8px * var(--s, 1)) calc(4px * var(--s, 1));
  cursor: pointer;
  transition: color 0.15s ease;
}
.early__back:hover { color: var(--bg); }
.early__back[hidden] { display: none; }
.early__next { height: calc(48px * var(--s, 1)); padding: 0 calc(22px * var(--s, 1)); font-size: calc(15px * var(--s, 1)); margin-left: auto; }
.early__nav--submit .early__submit-row { margin-left: auto; }

/* Per-field error state. Highlights the offending input + shows an
   inline hint underneath. Toggled by runtime.js after client-side
   validation. Cleared on the next 'input' or 'change' event. */
.early__field--error input,
.early__field--error select,
.early__field--error textarea {
  border-color: var(--coral, #EC6B4F);
  background: rgba(236, 107, 79, 0.10);
}
.early__field-error {
  font-size: calc(12px * var(--s, 1));
  color: var(--coral, #EC6B4F);
  margin: calc(4px * var(--s, 1)) 2px 0;
  display: block;
}

/* Partner referral confirmation. Shown when a partner link (?ref=CODE)
   prefills the optional partner-code field. */
.early__ref-note {
  display: inline-block;
  margin-top: calc(6px * var(--s, 1));
  font-family: var(--sans);
  font-size: calc(13px * var(--s, 1));
  color: var(--lime);
}
.early__ref-note::before { content: "\2713\00a0"; }

/* Clean submit success state. Replaces the fields with a confirmation so a
   submitted form never sits next to blanked-out inputs. */
.early__success {
  display: flex;
  align-items: center;
  gap: calc(14px * var(--s, 1));
  padding: calc(8px * var(--s, 1)) 0;
  min-height: calc(96px * var(--s, 1));
}
.early__success-tick {
  flex: none;
  width: calc(44px * var(--s, 1));
  height: calc(44px * var(--s, 1));
  border-radius: calc(999px * var(--s, 1));
  display: grid;
  place-items: center;
  background: var(--lime);
  color: var(--ink);
  font-size: calc(22px * var(--s, 1));
  font-weight: 700;
}
.early__success-tick::before { content: "\2713"; }
.early__success-msg {
  margin: 0;
  font-size: calc(18px * var(--s, 1));
  color: var(--bg);
}

/* Referral landing: a partner-link visitor gets a focused form + the code
   confirmed at the top of the first screen. */
.early__ref-banner {
  display: flex;
  align-items: center;
  gap: calc(10px * var(--s, 1));
  flex-wrap: wrap;
  margin: 0 0 calc(22px * var(--s, 1));
  padding: calc(12px * var(--s, 1)) calc(16px * var(--s, 1));
  border-radius: calc(12px * var(--s, 1));
  background: rgba(180, 230, 90, 0.1);
  border: 1px solid rgba(180, 230, 90, 0.32);
}
.early__ref-banner-code {
  font-weight: 700;
  font-size: calc(17px * var(--s, 1));
  color: var(--bg);
  padding: calc(3px * var(--s, 1)) calc(10px * var(--s, 1));
  border-radius: calc(6px * var(--s, 1));
  background: rgba(255, 255, 255, 0.1);
}
.early__ref-banner-msg {
  font-size: calc(17px * var(--s, 1));
  color: var(--lime);
}
.early__ref-banner-msg::before { content: "\2713\00a0"; }
/* In focused referral mode the code is already confirmed in the banner, so the
   optional in-form partner-code field is redundant. */
:root[data-referral] .early__field--ref { display: none; }

/* Age confirmation (FANTENNA-1291): a tick row, not a stacked text field. */
.early__field.early__age {
  flex-direction: row; align-items: center; gap: calc(10px * var(--s, 1));
  font-family: var(--sans); font-size: calc(14px * var(--s, 1)); color: rgba(255,255,255,0.82); cursor: pointer;
}
.early__field.early__age input {
  width: calc(18px * var(--s, 1)); height: calc(18px * var(--s, 1)); flex: 0 0 auto; padding: 0; margin: 0;
  background: none; border: 0; accent-color: var(--coral); cursor: pointer;
}

/* A failed chat carries the visitor's goal into this form. */
.early__chat-fallback { margin: 0 0 calc(20px * var(--s, 1)); color: var(--paper); font-size: calc(17px * var(--s, 1)); line-height: 1.45; }
