/* =============================================================================
   The invite card — shared/_rally_invite
   =============================================================================
   Operator, 2026-09-17: "make sure people know they can earn rally points for
   sending their friends invites to sign up. maybe we give them an invite link
   for them to send themselves."

   ── Why this block paints its OWN colours ───────────────────────────────────
   It lands on two layouts that declare two DIFFERENT token families:

     · `member`   → the brand's own sheet (--color-*, --cta-accent)
     · `ruo_pass` → shared/auth (--auth-*, derived from --checkout-*)

   A sheet that reached for either would resolve to nothing on the other, and a
   bare var() with no definition evaluates to nothing rather than complaining —
   which is how a page ships with no colour at all and no error anywhere. So
   this is brand-neutral and self-contained, exactly the posture
   `shared/_rally_points_ladder` already takes for the same reason.

   The second half of that argument is the one measured on 2026-09-16: four of
   five brands painted the auth card at EXACTLY the page colour. Contrast is
   measured foreground against background, so two identical backgrounds are
   never a pair and every AA probe passed the whole time. A card whose surface
   comes from whatever page it lands on cannot promise it will be visible; a
   card that brings its own can.

   ── Every value here is a literal, so the ratio is a FACT ───────────────────
   Measured (rally_invite_contrast_guard_test asserts every one of them):

     light   ink/surface 18.35   subtle/surface  8.72   CTA 7.38   field 17.30
     dark    ink/surface 18.15   subtle/surface 10.40   CTA 11.54  field 18.94

   No `opacity` on anything carrying text: a colour painted with alpha takes
   its value from whatever is behind it, so its contrast stops being a property
   of this rule and every number above becomes a guess.

   ── The cascade rules, each with the defect it prevents ─────────────────────
   · every selector names the block root (`.rally-invite .rally-invite__x`).
     `.peprally p { font-size: 16px }` is (0,1,1) and beats a lone class — it
     takes the TYPOGRAPHY, not only the colour, which is how a 1.9rem headline
     rendered at 16px on the auth page.
   · any anchor carries `a.` (`.rally-invite a.rally-invite__x`).
     `.brand a { color: var(--color-accent) }` on an accent-filled control is
     1:1 invisible text, shipped live on four brands.
   · the modifier is written `.rally-invite.rally-invite--dark`, (0,2,0), so it
     beats the base block on SPECIFICITY rather than on source order — which
     survives a file being reordered only by accident.
   · breakpoints are min-width only, so the base width is the whole layout and
     a narrow phone is never left with a rule that was declared for desktop.
   ========================================================================== */

.rally-invite {
  --ri-surface: #ffffff;
  --ri-panel: #f3f0ea;
  --ri-field: #faf8f4;
  --ri-ink: #14141a;
  --ri-subtle: #4a4a57;
  --ri-edge: #ddd7cc;
  --ri-accent: #1f5f5b;
  --ri-cta-bg: #1f5f5b;
  --ri-cta-ink: #ffffff;

  display: block;
  box-sizing: border-box;
  margin: 0 0 20px;
  padding: 22px 22px 24px;
  border: 1px solid var(--ri-edge);
  border-top: 3px solid var(--ri-accent);
  border-radius: 4px;
  background: var(--ri-surface);
  color: var(--ri-ink);
}

.rally-invite.rally-invite--dark {
  --ri-surface: #15151d;
  --ri-panel: #1e1e28;
  --ri-field: #101017;
  --ri-ink: #ffffff;
  --ri-subtle: #c3c3d0;
  --ri-edge: #2c2c39;
  --ri-accent: #5eead4;
  --ri-cta-bg: #5eead4;
  --ri-cta-ink: #04201e;
}

.rally-invite .rally-invite__eyebrow {
  margin: 0;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ri-accent);
}

.rally-invite .rally-invite__title {
  margin: 6px 0 0;
  font-family: inherit;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ri-ink);
}

.rally-invite .rally-invite__lede {
  margin: 10px 0 0;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ri-subtle);
}

.rally-invite .rally-invite__lede strong {
  color: var(--ri-ink);
  font-weight: 700;
}

/* ── The link itself ─────────────────────────────────────────────────────── */

.rally-invite .rally-invite__share {
  margin: 18px 0 0;
  padding: 16px;
  border: 1px solid var(--ri-edge);
  border-radius: 4px;
  background: var(--ri-panel);
}

.rally-invite .rally-invite__label {
  display: block;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ri-subtle);
  margin: 0 0 6px;
}

.rally-invite .rally-invite__field {
  display: block;
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 14px;
  border: 1px solid var(--ri-edge);
  border-radius: 3px;
  background: var(--ri-field);
  color: var(--ri-ink);
}

.rally-invite .rally-invite__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 0;
}

.rally-invite .rally-invite__btn {
  flex: 1 1 auto;
  padding: 12px 18px;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: 3px;
  border: 1px solid var(--ri-cta-bg);
  background: var(--ri-cta-bg);
  color: var(--ri-cta-ink);
}

/* The second control is the same shape and deliberately not the same weight:
   two identical filled buttons side by side give the member no idea which one
   to press. Ink on the panel is 7.67:1 light / 9.47:1 dark, so the quieter
   control is quieter without being harder to read. */
.rally-invite .rally-invite__btn--share {
  background: var(--ri-surface);
  border-color: var(--ri-edge);
  color: var(--ri-ink);
}

.rally-invite .rally-invite__btn:focus-visible {
  outline: 2px solid var(--ri-accent);
  outline-offset: 2px;
}

.rally-invite .rally-invite__code {
  margin: 12px 0 0;
  font-family: inherit;
  font-size: 13px;
  color: var(--ri-subtle);
}

.rally-invite .rally-invite__code-value {
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--ri-ink);
}

/* ── Two numbers, or the reason there are none yet ───────────────────────── */

.rally-invite .rally-invite__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 18px 0 0;
}

.rally-invite .rally-invite__stat {
  padding: 12px 14px;
  border: 1px solid var(--ri-edge);
  border-radius: 3px;
  background: var(--ri-panel);
}

.rally-invite .rally-invite__stat-label {
  display: block;
  margin: 0;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ri-subtle);
}

.rally-invite .rally-invite__stat-value {
  display: block;
  margin: 4px 0 0;
  font-family: inherit;
  font-size: 22px;
  font-weight: 700;
  color: var(--ri-ink);
}

.rally-invite .rally-invite__first {
  margin: 18px 0 0;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ri-subtle);
}

.rally-invite .rally-invite__fineprint {
  margin: 14px 0 0;
  font-family: inherit;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ri-subtle);
}

@media (min-width: 640px) {
  .rally-invite {
    padding: 26px 28px 28px;
  }

  .rally-invite .rally-invite__title {
    font-size: 28px;
  }

  .rally-invite .rally-invite__btn {
    flex: 0 0 auto;
  }
}
