/* ==========================================================================
   /referral/ page-local styles
   Scoped under .ref-* so nothing here leaks into other pages.
   Uses the site tokens from variables.css. No new colors introduced.
   ========================================================================== */

.ref-wrap { --ref-gutter: clamp(1.25rem, 4vw, 2rem); }

/* ---------- shared ---------- */
.ref-section { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.ref-container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--ref-gutter);
}
.ref-container--narrow { max-width: 940px; }

.ref-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-pill);
  background: var(--color-teal-soft);
  color: var(--brand-3);
}
.ref-eyebrow--dark { background: rgba(0, 40, 107, 0.08); color: var(--primary); }

.ref-h2 {
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  line-height: 1.05;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--primary);
  margin: 0;
}
/* when an eyebrow sits above it, give the heading its offset back */
.ref-eyebrow + .ref-h2 { margin-top: 0.85rem; }
.ref-lede {
  font-size: clamp(1.05rem, 0.4vw + 1rem, 1.25rem);
  line-height: 1.6;
  color: var(--color-text-muted);
  max-width: 62ch;
  margin: 1rem 0 0;
}

/* ---------- hero ---------- */
.ref-hero {
  background: var(--primary);
  color: var(--white);
  padding: calc(var(--nav-height) + clamp(2.5rem, 6vw, 4.5rem)) 0 clamp(3rem, 7vw, 5rem);
  position: relative;
  overflow: hidden;
}
/* soft off-center glow so the navy isn't a flat slab */
.ref-hero::after {
  content: "";
  position: absolute;
  width: 46rem;
  height: 46rem;
  right: -14rem;
  top: -18rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(146, 202, 205, 0.22) 0%, rgba(146, 202, 205, 0) 68%);
  pointer-events: none;
}
.ref-hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.ref-hero h1 {
  font-family: var(--font-display);
  font-size: var(--fs-hero);
  line-height: 1.02;
  letter-spacing: -0.015em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--white);
  margin: 1rem 0 0;
}
.ref-hero__sub {
  font-size: clamp(1.05rem, 0.4vw + 1rem, 1.3rem);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.82);
  max-width: 48ch;
  margin: 1.15rem 0 0;
}
.ref-hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin-top: 2rem;
}
.ref-hero__note {
  font-size: var(--fs-xs);
  color: rgba(255, 255, 255, 0.6);
}

/* mascot standing next to the number card, feet aligned to the card's base */
.ref-hero__aside {
  display: flex;
  align-items: flex-end;
  gap: clamp(0.5rem, 1.5vw, 1.25rem);
}
.ref-hero__mascot {
  width: clamp(92px, 11vw, 165px);
  height: auto;
  flex-shrink: 0;
  display: block;
}

/* the number card */
.ref-figure {
  flex: 1;
  min-width: 0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-lg);
  padding: clamp(1.75rem, 3vw, 2.5rem);
  backdrop-filter: blur(2px);
}
.ref-figure__amount {
  font-family: var(--font-display);
  font-size: clamp(3.75rem, 7vw, 5.5rem);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.03em;
  color: var(--brand-secondary);
  display: block;
}
.ref-figure__label {
  display: block;
  margin-top: 0.6rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.62);
}
.ref-figure__rule {
  height: 1px;
  background: rgba(255, 255, 255, 0.16);
  margin: 1.4rem 0;
  border: 0;
}
.ref-figure__or {
  font-size: 1rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.86);
  margin: 0;
}
.ref-figure__or strong { color: var(--white); font-weight: 700; }

/* ---------- steps ---------- */
.ref-steps { background: var(--cream); }
.ref-steps__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.25rem, 2.5vw, 2rem);
}
.ref-step {
  background: var(--white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 2.5vw, 2rem);
}
.ref-step__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--brand-secondary);
  color: var(--primary);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
}
.ref-step h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--primary);
  margin: 1.1rem 0 0;
}
.ref-step p {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--color-text-muted);
  margin: 0.6rem 0 0;
}

/* ---------- payout ladder ---------- */
.ref-ladder { margin-top: clamp(2rem, 4vw, 3rem); }
.ref-rung {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.5rem;
  padding: clamp(1.15rem, 2vw, 1.5rem) clamp(1.25rem, 2.5vw, 1.9rem);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--white);
  position: relative;
  overflow: hidden;
}
.ref-rung + .ref-rung { margin-top: 0.75rem; }
/* proportional fill so the ladder reads as a scale, not a table */
.ref-rung::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--fill, 30%);
  background: linear-gradient(90deg, rgba(146, 202, 205, 0.5) 0%, rgba(146, 202, 205, 0.1) 100%);
  pointer-events: none;
}
.ref-rung > * { position: relative; z-index: 1; }
.ref-rung__signs {
  font-size: clamp(1rem, 0.35vw + 0.95rem, 1.15rem);
  font-weight: 600;
  color: var(--primary);
  line-height: 1.4;
}
.ref-rung__signs span {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-dim);
  margin-top: 0.2rem;
}
.ref-rung__pay {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 2.5vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--primary);
  white-space: nowrap;
}
.ref-ladder__foot {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--color-text-muted);
  margin: 1.5rem 0 0;
  max-width: 62ch;
}

/* ---------- fit ---------- */
.ref-fit { background: var(--cream); }
.ref-fit__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1rem, 2vw, 1.5rem);
  margin-top: clamp(1.75rem, 3vw, 2.5rem);
}
.ref-note {
  background: var(--white);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--brand-secondary);
  border-radius: var(--radius);
  padding: clamp(1.25rem, 2vw, 1.6rem);
}
.ref-note h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary);
  margin: 0;
}
.ref-note p {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--color-text-muted);
  margin: 0.5rem 0 0;
}
.ref-fit__kicker {
  font-size: clamp(1.05rem, 0.4vw + 1rem, 1.2rem);
  font-weight: 600;
  color: var(--primary);
  margin: clamp(1.75rem, 3vw, 2.25rem) 0 0;
}

/* ---------- form ---------- */
.ref-form-section { background: var(--white); }
.ref-formcard {
  background: var(--cream);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 3.5vw, 2.75rem);
  max-width: 780px;
  margin: clamp(2rem, 4vw, 2.75rem) auto 0;
}
/* flex column + gap so nothing needs sibling margins that would
   double up against the grid gap inside a row */
.ref-form { display: flex; flex-direction: column; gap: 1rem; }
.ref-form__row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.ref-form__field { display: block; }
.ref-form__label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 0.4rem;
}
.ref-form__field input,
.ref-form__field textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-text);
  background: var(--white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.8rem 0.9rem;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.ref-form__field textarea { resize: vertical; min-height: 6.5rem; }
.ref-form__field input:focus-visible,
.ref-form__field textarea:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 40, 107, 0.12);
}
.ref-form__field input::placeholder,
.ref-form__field textarea::placeholder { color: var(--color-text-dim); }
.ref-form__divider {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin: 0.75rem 0 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-dim);
}
.ref-form__divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--color-border);
}
.ref-form__turnstile { margin-top: 0.25rem; }
.ref-form__submit { align-self: flex-start; }
.ref-form__reassure {
  font-size: var(--fs-xs);
  color: var(--color-text-dim);
  margin: 0;
}
/* honeypot */
.ref-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- fine print (collapsed by default) ---------- */
.ref-fine {
  max-width: 780px;
  margin: clamp(1.5rem, 3vw, 2.25rem) auto 0;
  border-top: 1px solid var(--color-border);
  padding-top: 1.25rem;
}
.ref-fine > summary {
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-text-muted);
  transition: color var(--dur) var(--ease);
}
.ref-fine > summary::-webkit-details-marker { display: none; }
.ref-fine > summary::after {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform var(--dur) var(--ease);
}
.ref-fine[open] > summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.ref-fine > summary:hover { color: var(--primary); }
.ref-fine > summary:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 3px;
}
.ref-fine ul {
  margin: 1.1rem 0 0;
  padding-left: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.ref-fine li {
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--color-text-muted);
}

@media (prefers-reduced-motion: reduce) {
  .ref-fine > summary,
  .ref-fine > summary::after { transition: none; }
}

/* ---------- close ---------- */
.ref-close {
  background: var(--primary);
  color: var(--white);
  padding: clamp(3rem, 6vw, 4.5rem) 0;
  text-align: center;
}
.ref-close p {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 1.6vw + 1rem, 2rem);
  font-weight: 700;
  line-height: 1.35;
  max-width: 30ch;
  margin: 0 auto;
  color: var(--white);
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .ref-hero__inner { grid-template-columns: minmax(0, 1fr); }
  .ref-steps__grid { grid-template-columns: minmax(0, 1fr); }
  .ref-fit__grid { grid-template-columns: minmax(0, 1fr); }
  /* one column: the mascot gets room to grow back up next to the card */
  .ref-hero__mascot { width: clamp(110px, 26vw, 165px); }
}

@media (max-width: 600px) {
  /* side by side squeezes the card under ~250px and wraps its label,
     so stack and let the mascot stand on the card's top edge instead */
  .ref-hero__aside {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
  }
  .ref-hero__mascot {
    width: 118px;
    margin-left: 1.25rem;
    margin-bottom: -0.6rem;
    position: relative;
    z-index: 1;
  }
  .ref-figure { width: 100%; flex: none; }

  .ref-rung {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.5rem;
  }
  .ref-rung__pay { font-size: 2rem; }
  .ref-form__row { grid-template-columns: minmax(0, 1fr); }
  .ref-form__submit { align-self: stretch; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .ref-form__field input,
  .ref-form__field textarea { transition: none; }
}

/* inline "(optional)" qualifier on a form label */
.ref-form__opt {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  color: var(--color-text-dim);
}

/* secondary path under the form: the warm intro, offered but never required */
.ref-alt {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--color-text-muted);
  max-width: 780px;
  margin: 1.25rem auto 0;
}
.ref-alt__link {
  color: var(--primary);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.ref-alt__link:hover { color: var(--color-navy-light); }
