/* ============================================================
   Container — shared responsive layout constraint
   Provides 1024px max content width with responsive side padding.
   Import this in any component that uses the .container class.
   ============================================================ */

.container {
  position:   relative;
  width:      100%;
  max-width:  calc(1024px + 160px); /* 1024px content + 80px × 2 */
  padding:    0 80px;
  margin:     0 auto;
  box-sizing: border-box;
}

/* Tablet (≤991px): 60px sides */
@media (max-width: 991px) {
  .container {
    padding: 0 60px;
  }
}

/* Landscape mobile (≤767px): 2rem sides */
@media (max-width: 767px) {
  .container {
    padding: 0 2rem;
  }
}



/* ============================================================
   Wide container — 1360px content + 48px side padding
   Used for full-bleed section content blocks (slider, big cards)
   that need to be wider than the standard 1024px text container.
   ============================================================ */

.container-wide {
  width:      100%;
  max-width:  calc(1384px + 96px);   /* 1384px content + 48px × 2 */
  padding:    0 3rem;                /* 48px sides */
  margin:     0 auto;
  box-sizing: border-box;
}

/* Tablet (≤991px): 16px less than .container (60px → 44px) */
@media (max-width: 991px) {
  .container-wide {
    padding: 0 44px;
  }
}

/* Landscape mobile (≤767px): 16px less than .container (2rem → 1rem) */
@media (max-width: 767px) {
  .container-wide {
    padding: 0 1rem;
  }
}


/* ============================================================
   ReferralsRewardsSection — Figma bbBZfM3MEfbBCKzElufLvw, node 661:5688.
   Spec: ReferralsRewardsSection.figma.md.
   ============================================================ */

.referrals-rewards {
  /* White ground — NOT `var(--background)`; the redesign's pages invert the
     site's scheme. See `--background-white` (src/styles/tokens.css). */
  background: var(--background-white);
}

/* The section-header + sticky-badge convention: THIS stack owns the
   header → content gap (Figma's 64). See docs/conventions.md. */
.referrals-rewards__content {
  display:        flex;
  flex-direction: column;
  gap:            4rem;                       /* 64px */
}

/* Cards, then the fine print. Figma: a 12px gap and the fine-print frame's
   own 12px top padding — one 24px gap here. */
.referrals-rewards__details {
  display:        flex;
  flex-direction: column;
  gap:            var(--spacing-6);           /* 24px */
}

/* 672 | 16 | 336 at 1024; both cards stretch to the taller one. */
.referrals-rewards__cards {
  display:               grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.5fr);
  gap:                   var(--spacing-4);    /* 16px */
}

/* Hidden but read: the table caption and the en dash's "No reward". */
.referrals-rewards__sr-only {
  position:    absolute;
  width:       1px;
  height:      1px;
  margin:      -1px;
  padding:     0;
  overflow:    hidden;
  clip:        rect(0 0 0 0);
  white-space: nowrap;
  border:      0;
}


/* ---- Reward table (661:5701) ------------------------------ */

.referrals-rewards__table-card {
  /* How far the total's white pill reaches past the table on each side:
     Figma insets it 14px from the card's edge, so 32 - 14. */
  --referrals-pill-bleed:  18px;
  --referrals-pill-radius: var(--radius-full);

  padding:          var(--spacing-8) var(--spacing-8) var(--spacing-5);   /* 32 / 32 / 20 */
  background-color: var(--secondary);
  border-radius:    var(--radius-lg);         /* 24px */
  box-sizing:       border-box;
}

/* A real table, laid out as Figma's 2fr | 1fr | 1fr grid with 24px column
   gaps (280 | 140 | 140 at 608): fixed layout, each column's gap carried as
   right padding on the column before it, so 304 | 164 | 140 = 50 | 27 | 23%.
   Row gaps are cell padding for the same reason — a table has no `gap`. */
.referrals-rewards__table {
  width:           100%;
  table-layout:    fixed;
  border-collapse: separate;
  border-spacing:  0;
  font-family:     var(--font-family-default);
  font-size:       var(--font-size-lg);       /* 18px */
  line-height:     var(--line-height-lg);     /* 28px */
  color:           var(--foreground);
  text-align:      left;
}

.referrals-rewards__table th,
.referrals-rewards__table td {
  padding:        var(--spacing-6) var(--spacing-6) 0 0;   /* 24px row gap above, 24px column gap after */
  vertical-align: top;
  font-weight:    var(--font-weight-regular);
}

.referrals-rewards__table th:first-child,
.referrals-rewards__table td:first-child { width: 50%; }
.referrals-rewards__table th:nth-child(2),
.referrals-rewards__table td:nth-child(2) { width: 27%; }
.referrals-rewards__table th:last-child,
.referrals-rewards__table td:last-child   { width: 23%; padding-right: 0; }

/* Column heads: 12/16 muted, 4px block padding. The rule sits 11px under
   them and 12px above the first row (Figma: text ends y=72, line at 83, first
   row at 96) — so the 24px row gap is split around it. */
.referrals-rewards__table thead th {
  padding-top:    var(--spacing-1);           /* 4px */
  padding-bottom: 15px;                       /* 4 + 11 to the rule */
  border-bottom:  1px solid var(--border);
  font-size:      var(--font-size-xs);        /* 12px */
  line-height:    var(--line-height-xs);      /* 16px */
  color:          var(--muted-foreground);
}

.referrals-rewards__table tbody tr:first-child > * {
  padding-top: var(--spacing-3);              /* 12px — the rest of the 24 */
}

/* Figma breaks "Meets with our Sales team / by Dec 31, 2026" and "90-day
   bonus: stays a client / for 90 days after signing up" short of the 280px
   column: its text boxes are ~217 and ~240 wide. One measure that gives both
   breaks (the first lines run 205 and 221px). */
.referrals-rewards__milestone {
  display:   block;
  max-width: 14rem;                           /* 224px */
}

/* Total row: 18/28 bold blue on a white pill 48 tall — the 28px line plus
   10px above and below — that the last body row stops 14px short of. */
.referrals-rewards__table tbody tr:last-child > * {
  padding-bottom: 14px;                       /* 24px row gap - the pill's 10 */
}

.referrals-rewards__table tfoot th,
.referrals-rewards__table tfoot td {
  position:         relative;
  z-index:          0;                        /* own stacking context, so the pill paints under the text */
  padding-block:    10px;
  font-weight:      var(--font-weight-bold);
  color:            var(--color-brand-blue-700);
  background-color: var(--background-white);
}

/* The pill's two rounded ends reach past the table into the card's padding.
   Drawn on the end cells (not the row: positioned table rows are the least
   portable part of table layout), each covering its cell plus the bleed. */
.referrals-rewards__table tfoot th:first-child,
.referrals-rewards__table tfoot td:last-child {
  background-color: transparent;
}

.referrals-rewards__table tfoot th:first-child::before,
.referrals-rewards__table tfoot td:last-child::before {
  content:          '';
  position:         absolute;
  z-index:          -1;
  inset-block:      0;
  background-color: var(--background-white);
}

.referrals-rewards__table tfoot th:first-child::before {
  left:          calc(var(--referrals-pill-bleed) * -1);
  right:         0;
  border-radius: var(--referrals-pill-radius) 0 0 var(--referrals-pill-radius);
}

.referrals-rewards__table tfoot td:last-child::before {
  left:          0;
  right:         calc(var(--referrals-pill-bleed) * -1);
  border-radius: 0 var(--referrals-pill-radius) var(--referrals-pill-radius) 0;
}


/* ---- What their firm gets (661:5721) ---------------------- */

/* The label is pinned top-left; the figure + line are centred in the card's
   content box. One grid cell holds both, so neither is taken out of flow. */
.referrals-rewards__offer {
  display:               grid;
  grid-template-areas:   'offer';
  padding:               var(--spacing-8) var(--spacing-8) var(--spacing-6);   /* 32 / 32 / 24 */
  background-color:      var(--color-brand-blue-50);
  border-radius:         var(--radius-lg);    /* 24px */
  box-sizing:            border-box;
  color:                 var(--color-brand-blue-700);
}

.referrals-rewards__offer-label {
  grid-area:   offer;
  align-self:  start;
  margin:      0;
  padding:     var(--spacing-1) 0;            /* 4px */
  font-size:   var(--font-size-xs);           /* 12px */
  line-height: var(--line-height-xs);         /* 16px */
  color:       var(--color-brand-blue-500);
}

.referrals-rewards__offer-main {
  grid-area:      offer;
  align-self:     center;
  display:        flex;
  flex-direction: column;
  gap:            var(--spacing-3);           /* 12px */
}

.referrals-rewards__offer-main > p {
  margin: 0;
}

.referrals-rewards__offer-figure {
  font-family: var(--font-family-serif);
  font-size:   4.5rem;                        /* 72px — no token */
  line-height: 1;
  font-weight: var(--font-weight-light);
  white-space: nowrap;
}

.referrals-rewards__offer-text {
  font-size:   var(--font-size-lg);           /* 18px */
  line-height: var(--line-height-lg);         /* 28px */
}


/* ---- Fine print (661:5842) -------------------------------- */

.referrals-rewards__fine-print {
  margin:       0;
  padding-left: var(--spacing-8);             /* 32px — the table's text edge */
  font-size:    var(--font-size-xs);          /* 12px */
  line-height:  var(--line-height-xs);        /* 16px */
  color:        var(--muted-foreground);
}


/* ---- Responsive (no mobile frame) ------------------------- */

/* Stacked, table first. The offer card hugs its content now, so the label
   goes back into flow above the figure. */
@media (max-width: 991px) {
  .referrals-rewards__cards {
    grid-template-columns: minmax(0, 1fr);
  }

  .referrals-rewards__offer {
    grid-template-areas: 'label' 'main';
    gap:                 var(--spacing-6);    /* 24px */
  }

  .referrals-rewards__offer-label { grid-area: label; }
  .referrals-rewards__offer-main  { grid-area: main; }
}

/* Narrower: 24 of padding, 12 between columns, and the total is a white TILE,
   not a pill (as ComparisonTable's phone tiles): the card's own 24 radius
   (owner, 2026-11-23), 12 from the card's edges and 12 of padding, so its text
   stays on the rows' edge. */
@media (max-width: 767px) {
  .referrals-rewards__content {
    gap: 3rem;                                /* 48px */
  }

  /* The cards sit on the 16px media inset, out of the 32px text inset
     (docs/redesign-design-language.md §5). On the group, so the fine print
     keeps the cards' text edge. */
  .referrals-rewards__details {
    margin-inline: -1rem;
  }

  .referrals-rewards__table-card {
    --referrals-pill-bleed:  var(--spacing-3);   /* 12px */
    --referrals-pill-radius: var(--radius-lg);   /* 24px, the card's */

    padding: var(--spacing-6) var(--spacing-6) var(--spacing-3);   /* 24 / 24 / 12 */
  }

  .referrals-rewards__offer {
    padding: var(--spacing-6);                /* 24px */
  }

  .referrals-rewards__table th,
  .referrals-rewards__table td {
    padding-right: var(--spacing-3);          /* 12px column gap */
    font-size:     var(--font-size-base);     /* 16px */
    line-height:   var(--line-height-base);   /* 24px */
  }

  .referrals-rewards__table thead th {
    font-size:   var(--font-size-xs);
    line-height: var(--line-height-xs);
  }

  .referrals-rewards__table th:first-child,
  .referrals-rewards__table td:first-child { width: 40%; }
  .referrals-rewards__table th:nth-child(2),
  .referrals-rewards__table td:nth-child(2) { width: 32%; }
  .referrals-rewards__table th:last-child,
  .referrals-rewards__table td:last-child   { width: 28%; }

  .referrals-rewards__table tfoot th,
  .referrals-rewards__table tfoot td {
    padding-block: 12px;                      /* 24px line + 24 = the same 48 tall */
  }

  .referrals-rewards__offer-figure {
    font-size: 3.5rem;                        /* 56px */
  }

  .referrals-rewards__fine-print {
    padding-left: var(--spacing-6);           /* the card's mobile text edge */
  }
}

/* Phones: three columns leave the milestones a five-line sliver beside empty
   space, so each one takes the full width with its two rewards under it. The
   table's display changes, so the markup carries ARIA table roles. */
@media (max-width: 479px) {
  .referrals-rewards__table,
  .referrals-rewards__table thead,
  .referrals-rewards__table tbody,
  .referrals-rewards__table tfoot {
    display: block;
  }

  .referrals-rewards__table tr {
    display:               grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap:            var(--spacing-4);  /* 16px */
    row-gap:               var(--spacing-1);  /* 4px */
    padding-block:         var(--spacing-4);  /* 16px */
  }

  /* `:nth-child(n)` only outranks the per-column widths and paddings above. */
  .referrals-rewards__table tr > :is(th, td):nth-child(n) {
    width:   auto;
    padding: 0;
  }

  .referrals-rewards__table tr > :first-child {
    grid-column: 1 / -1;
  }

  /* One rule under the heads and between milestones; none above the total. */
  .referrals-rewards__table thead tr {
    padding-top: 0;
  }

  .referrals-rewards__table thead tr > th {
    border-bottom: 0;
  }

  .referrals-rewards__table tbody tr {
    border-top: 1px solid var(--border);
  }

  /* Milestone muted, rewards at the card's reading size. */
  .referrals-rewards__table tbody th {
    font-size:   var(--font-size-sm);         /* 14px */
    line-height: var(--line-height-sm);       /* 20px */
    color:       var(--muted-foreground);
  }

  .referrals-rewards__table tbody td {
    font-size:   var(--font-size-lg);         /* 18px */
    line-height: var(--line-height-lg);       /* 28px */
  }

  .referrals-rewards__milestone {
    max-width: none;
  }

  /* The total: one white block, its text on the rows' edge. */
  .referrals-rewards__table tfoot tr {
    margin-inline:    calc(var(--referrals-pill-bleed) * -1);
    padding:          var(--spacing-3) var(--referrals-pill-bleed);   /* 12px */
    background-color: var(--background-white);
    border-radius:    var(--referrals-pill-radius);
  }

  .referrals-rewards__table tfoot th:first-child::before,
  .referrals-rewards__table tfoot td:last-child::before {
    content: none;
  }

  .referrals-rewards__table tfoot td {
    font-size:   var(--font-size-lg);
    line-height: var(--line-height-lg);
  }
}

