.bp-host { position: relative; overflow: hidden; }

/* Beside the provider rail the shell still capped this page at the marketing
   1240px, so on a wide screen the four cards stayed narrow while empty gutter
   sat either side. Same full-bleed treatment the admin workspace already
   takes, keeping its own gutter rather than touching the rail. */
@media (min-width: 1100px) {
  body.has-rail:has(.bp-host) .shell {
    width: 100%;
    max-width: none;
    margin: 0;
    padding-inline: var(--space-6);
  }
}

/* ── Layered brand background (scoped inside the page host) ── */

.bp-stage { position: relative; z-index: 1; display: grid; gap: var(--space-6, 24px); }

/* ── Welcome banner (approved, unsubscribed provider landing here) ── */
.bp-welcome {
  display: flex; align-items: center; gap: var(--space-3, 14px);
  padding: var(--space-4, 16px) clamp(16px, 3vw, 22px);
  background: rgba(13, 155, 110, 0.08);
  border: 1px solid rgba(13, 155, 110, 0.22);
  border-radius: 18px;
  box-shadow: var(--shadow-soft, 0 1px 3px rgba(15, 23, 42, 0.05));
}
.bp-welcome-ic {
  width: 44px; height: 44px; border-radius: 12px; flex: 0 0 auto;
  display: grid; place-items: center;
  background: rgba(13, 155, 110, 0.14); color: var(--green-500); font-size: 1.4rem;
}
.bp-welcome-tx { display: grid; gap: 2px; }
.bp-welcome-title { margin: 0; font-size: 1.02rem; font-weight: 800; color: #086b4b; }
.bp-welcome-line { margin: 0; font-size: 0.88rem; line-height: 1.5; color: var(--fg-1, #111); }

/* Returning lapsed subscriber: amber attention tone, not a fresh-approval celebration. */
.bp-welcome--returning { background: rgba(201, 130, 26, 0.08); border-color: rgba(201, 130, 26, 0.24); }
.bp-welcome--returning .bp-welcome-ic { background: rgba(201, 130, 26, 0.14); color: #c9821a; }
.bp-welcome--returning .bp-welcome-title { color: #9a6410; }

/* ── Page heading ── */
/* Page head: shared widget — .pg-head / .pg-head-center in app.css. */

/* ── Plans grid: 4 -> 2 -> 1 ── */
/* Four across only while each card can still hold its price and perk list
   comfortably, otherwise 2x2 — a clean grid for four plans, and far better
   than four columns squeezed to ~235px.
   The breakpoints are rail-aware on purpose: this page is provider-only, so
   the collapsed workspace rail is always taking ~255px out of the viewport.
   A plain 1180px breakpoint measured the viewport and let 1280px through as
   "wide", which is where the ~235px card came from. 1550px viewport is the
   first width that leaves each of four cards ~300px. */
.bp-plans {
  display: grid; gap: var(--space-4, 16px); align-items: stretch;
  justify-content: center;
  /* Capped, not stretched: free to grow to a comfortable pricing-card measure
     and no further. Without the cap, 2x2 swung from a 235px squeeze to a
     ~480px sprawl where every perk line trailed off into empty space. */
  grid-template-columns: repeat(4, minmax(0, 380px));
}
@media (max-width: 1550px) { .bp-plans { grid-template-columns: repeat(2, minmax(0, 380px)); } }
@media (max-width: 720px)  { .bp-plans { grid-template-columns: minmax(0, 380px); } }

/* ── Card (flex column so the CTA can pin to the bottom) ── */
.bp-card {
  background: white;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 22px;
  padding: var(--pad-card, 24px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  box-shadow: var(--shadow-soft, 0 1px 3px rgba(15, 23, 42, 0.05));
  transition: transform 0.2s var(--ease-out, cubic-bezier(0.22, 0.61, 0.36, 1)),
              box-shadow 0.2s var(--ease-out, cubic-bezier(0.22, 0.61, 0.36, 1));
  animation: bp-rise 0.5s var(--ease-out, cubic-bezier(0.22, 0.61, 0.36, 1)) both;
}
.bp-card:nth-child(1) { animation-delay: 0.04s; }
.bp-card:nth-child(2) { animation-delay: 0.10s; }
.bp-card:nth-child(3) { animation-delay: 0.16s; }
.bp-card:nth-child(4) { animation-delay: 0.22s; }
.bp-card:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(15, 23, 42, 0.09); }

.bp-card--featured {
  border-color: rgba(232, 167, 45, 0.55);
  background: radial-gradient(circle at 100% 0%, rgba(232, 167, 45, .12), transparent 55%),
              linear-gradient(180deg, #fffbe8, white);
  box-shadow: 0 0 0 4px rgba(232, 167, 45, 0.10), 0 12px 30px rgba(13, 155, 110, 0.08);
}
.bp-card--featured::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  /* The sheen moves inside the card (its background slides), never the layer
     itself: a layer translated past the card stuck out of the page, and the
     page scrolled sideways while the cards loaded (Arabic, 1280 to 1440). */
  background: linear-gradient(120deg, transparent 32%, rgba(255, 255, 255, 0.55) 50%, transparent 68%) no-repeat;
  background-size: 300% 100%;
  background-position: 100% 0;
  animation: bp-sheen 1.5s 0.6s var(--ease-out, cubic-bezier(0.22, 0.61, 0.36, 1)) 1 both;
}

.bp-ribbon {
  position: absolute;
  top: -12px; inset-inline-end: 22px;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 11px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold-500), #b07a10);
  /* Ink, not white: the same pairing as the gold confirm button. White on gold
     reads 2.10 at the light stop, and gold has to stay gold. */
  color: var(--fg-1);
  font-size: 0.7rem; font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: 0 4px 12px rgba(232, 167, 45, 0.35);
  z-index: 1;
}

/* ── Discount (active-sale) card: rose accent, distinct from gold featured ── */
.bp-card--sale {
  border-color: rgba(225, 29, 72, 0.45);
  box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.08), var(--shadow-soft, 0 1px 3px rgba(15, 23, 42, 0.05));
}
.bp-sale-badge {
  position: absolute;
  top: -12px; inset-inline-start: 22px;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 11px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f43f5e, #e11d48);
  color: white;
  font-size: 0.7rem; font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.35);
  z-index: 1;
}

.bp-name { margin: 0; text-align: center; font-size: 1.15rem; font-weight: 800; letter-spacing: -0.015em; }

/* ── Price (centered, hairline divider under it) ── */
.bp-price-block {
  display: grid; gap: 4px; justify-items: center; text-align: center;
  padding-bottom: 14px; border-bottom: 1px solid var(--color-border, #e5e7eb);
}
.bp-price-row { display: inline-flex; align-items: baseline; gap: var(--space-2, 8px); flex-wrap: wrap; justify-content: center; }
.bp-price { font-size: 1.75rem; font-weight: 800; color: var(--fg-1, #111); letter-spacing: -0.03em; line-height: 1.1; }
/* Struck "before discount" price. The riyal glyph wraps the number in an
   inline-flex span, which blocks a normal text-decoration line-through, so we
   draw the strike as a real centered line across the number + symbol. */
.bp-price-was { position: relative; width: fit-content; margin-inline: auto; color: var(--fg-2, #9ca3af); font-size: 1rem; font-weight: 700; }
.bp-price-was::after { content: ""; position: absolute; inset-inline: 0; top: 50%; height: 1.6px; background: currentColor; transform: translateY(-50%); border-radius: 2px; }
.bp-per-month { color: var(--fg-2, #6b7280); font-size: 0.85rem; font-weight: 700; }
.bp-sale-until { color: var(--fg-2, #6b7280); font-size: 0.78rem; font-weight: 600; }

/* ── Chips ── */
.bp-badges { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.bp-badges:empty { display: none; }
.bp-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 0.74rem; font-weight: 800;
}
.bp-chip--save  { background: rgba(13, 155, 110, .12); color: #065f46; }
.bp-chip--trial { background: rgba(232, 167, 45, .16); color: #8a5a08; }
/* Gold: bonus months are a membership perk, not a price cut. Rose is the sale. */
.bp-chip--bonus { background: rgba(232, 167, 45, .22); color: #7a4f06; }

/* ── Perks ── */
.bp-perks { margin: 0; padding: 0; list-style: none; display: grid; gap: 9px; }
.bp-perks li { display: grid; grid-template-columns: 19px minmax(0, 1fr); gap: 9px; font-size: 0.88rem; line-height: 1.45; color: var(--fg-1, #111); align-items: start; }
.bp-perks li .chk { width: 19px; height: 19px; border-radius: 999px; background: var(--green-500); color: white; display: grid; place-items: center; font-size: 0.66rem; margin-top: 1px; }
.bp-card--featured .bp-perks li .chk { background: var(--gold-500); }

/* ── CTA (pinned to the bottom of the card) ── */
.bp-cta {
  width: 100%; padding: 12px var(--space-5, 20px); border-radius: 12px;
  color: white; border: 0; cursor: pointer; text-decoration: none;
  font: inherit; font-weight: 800; font-size: 0.94rem;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(135deg, var(--green-500), #086b4b);
  margin-top: auto;
  transition: transform 0.18s var(--ease-out, cubic-bezier(0.22, 0.61, 0.36, 1)),
              box-shadow 0.18s var(--ease-out, cubic-bezier(0.22, 0.61, 0.36, 1));
}
.bp-cta:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(13, 155, 110, 0.24); }
.bp-card--featured .bp-cta { background: linear-gradient(135deg, var(--gold-500), #b07a10); }
.bp-card--featured .bp-cta:hover:not(:disabled) { box-shadow: 0 6px 16px rgba(232, 167, 45, 0.30); }
.bp-cta:disabled { opacity: .6; cursor: default; }
/* Loading: CTA click navigates to checkout — show busy and block re-clicks. */
.bp-cta.is-busy { opacity: .7; pointer-events: none; cursor: wait; }
/* Current-plan marker (subscribed provider viewing their own plan). */
.bp-cta.bp-cta--current,
.bp-card--featured .bp-cta.bp-cta--current {
  background: var(--brand-50, #e9f7f1);
  color: var(--brand-700, #086b4b);
  border: 1px solid var(--brand-200, #b9e2d3);
  cursor: default;
}
/* Change-to-this-plan action (subscribed provider, other plans). */
.bp-cta.bp-cta--change,
.bp-card--featured .bp-cta.bp-cta--change {
  background: #fff;
  color: var(--brand-700, #086b4b);
  border: 1px solid var(--brand-200, #b9e2d3);
}
.bp-cta.bp-cta--change:hover:not(:disabled) {
  background: var(--brand-50, #e9f7f1);
  box-shadow: none;
}
/* Scheduled next-plan marker (a plan change takes effect at next renewal). */
.bp-cta.bp-cta--pending,
.bp-card--featured .bp-cta.bp-cta--pending {
  background: rgba(232, 167, 45, 0.12);
  color: var(--gold-700);
  border: 1px solid rgba(232, 167, 45, 0.30);
  cursor: default;
}

/* ── Trial reassurance line (unsubscribed viewers) ── */
.bp-trial-note { margin: 0; text-align: center; color: var(--fg-2, #6b7280); font-size: 0.85rem; }

/* ── The subscribe dialog (saved-card providers) ──────────────────────────
   One button on the card opens this: plan, the card on file, a visible promo
   field, the charge button and the other-card way out. It replaced a text
   confirm plus an underlined link under every button. */
.sdlg {
  border: 1px solid var(--color-border, #e5e7eb); border-radius: 18px;
  padding: var(--space-7, 28px); max-inline-size: min(92vw, 400px);
  inline-size: 100%;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
  display: none; grid-template-columns: 1fr; gap: var(--space-4, 14px);
}
.sdlg[open] { display: grid; }
.sdlg::backdrop { background: rgba(15, 23, 42, 0.45); }
.sdlg-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2, 8px); }
.sdlg-bar strong { display: inline-flex; align-items: center; gap: var(--space-2, 8px); font-size: 1rem; }
.sdlg-bar strong i { color: var(--green-600, #0b8a61); }
/* 44px, measured on a phone rather than counted in the source: this button was
   24x25 rendered, on a screen whose next tap spends money. The icon keeps its
   size; the target around it grows. */
.sdlg-x {
  border: 0; background: none; cursor: pointer; color: var(--fg-2, #6b7280);
  padding: var(--space-1, 4px); line-height: 1; border-radius: var(--radius-sm, 8px);
  min-width: 44px; min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  margin: calc(var(--space-1, 4px) * -1);
}
.sdlg-x:hover { color: var(--fg-1, #111); }
.sdlg-plan {
  display: flex; justify-content: space-between; align-items: baseline;
  background: var(--ink-50, #f9fafb); border-radius: 12px;
  padding: var(--space-3, 12px) var(--space-4, 14px);
}
.sdlg-plan-name { font-weight: 700; font-size: 0.9rem; }
/* The card on file: a fact of this confirm, not a control. Changing it is a
   choice, and choices live on the checkout page. */
/* The day arithmetic, under the end date it explains. Tabular figures so the
   three numbers line up as a sum rather than drifting with the glyph widths. */
.sdlg-days {
  margin: calc(var(--space-2, 8px) * -1) 0 0;
  color: var(--fg-2, #6b7280); font-size: .9rem;
  font-variant-numeric: tabular-nums;
}
/* The refund position, sitting under the numbers it qualifies. Quieter than
   the day count and the date: it is the term you check, not the figure you
   came for. */
.sdlg-refund {
  margin: calc(var(--space-2, 8px) * -1) 0 0;
  color: var(--fg-2, #6b7280); font-size: .82rem; line-height: 1.5;
}
.sdlg-card-line {
  margin: 0; display: flex; align-items: center; gap: var(--space-2, 8px);
  font-size: 0.88rem; color: var(--fg-2, #6b7280);
}
.sdlg-card-line i { color: var(--green-600, #0b8a61); }
.sdlg-plan-price { font-weight: 800; font-size: 1.05rem; }
/* Gold: bonus months are a membership perk. */
.sdlg-payform { margin: 0; display: grid; }
.sdlg-pay {
  border: 0; cursor: pointer; color: white; border-radius: 12px;
  padding: var(--space-3, 12px); font: inherit; font-weight: 800; font-size: 0.92rem;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2, 8px);
  background: linear-gradient(135deg, var(--green-500), #086b4b);
}
.sdlg-renews {
  margin: 0; font-size: 0.78rem; color: var(--fg-2, #6b7280);
  display: flex; gap: var(--space-2, 8px); align-items: flex-start;
}
.sdlg-renews i { color: var(--green-600, #0b8a61); margin-top: 2px; }
.sdlg-other { margin: 0; text-align: center; font-size: 0.82rem; }
.sdlg-other a { color: var(--green-700, #146644); font-weight: 800; }

/* ── Trust strip ── */
.bp-trust {
  padding: var(--space-4, 16px) clamp(16px, 3vw, 26px);
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 20px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  box-shadow: var(--shadow-soft, 0 1px 3px rgba(15, 23, 42, 0.05));
}
@media (max-width: 820px) { .bp-trust { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 420px) { .bp-trust { grid-template-columns: 1fr; } }
.bp-trust-item { display: flex; align-items: center; gap: 11px; padding-inline: 10px; }
.bp-trust-item + .bp-trust-item { border-inline-start: 1px solid var(--color-border, #e5e7eb); }
@media (max-width: 820px) { .bp-trust-item + .bp-trust-item { border-inline-start: 0; } }
.bp-trust-ic { width: 40px; height: 40px; border-radius: 12px; flex: 0 0 auto; display: grid; place-items: center;
  background: rgba(13, 155, 110, 0.10); color: var(--green-700); font-size: 1.1rem; }
.bp-trust-tx { display: grid; gap: 1px; }
.bp-trust-tx b { font-size: 0.9rem; font-weight: 800; color: var(--fg-1, #111); }
.bp-trust-tx span { font-size: 0.78rem; color: var(--fg-2, #6b7280); }

@keyframes bp-rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes bp-sheen { from { background-position: 100% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) {
  .bp-card, .bp-cta { animation: none !important; transition: none !important; }
  .bp-card--featured::after { animation: none !important; }
}

/* Free trial not open to this account: the chip states it instead of advertising it. */
.bp-chip--trial-spent { background: var(--ink-100, rgba(15, 23, 42, .06)); color: var(--fg-2, #475569); }

/* The upgrade sentence, and the end date under it. Both sit between the plan
   line and the card line, because they answer the two questions a provider has
   before they press pay: what happens to the days I already bought, and when
   does this one run out.

   The upgrade sentence is the only body text in this dialog, so it is given
   normal reading weight rather than the small muted treatment the surrounding
   facts use. */
.sdlg-upgrade {
  margin: 0; font-size: 0.88rem; line-height: 1.65; color: var(--fg-1, #111827);
}
.sdlg-until {
  margin: 0; display: flex; align-items: center; gap: var(--space-2, 8px);
  font-size: 0.88rem; color: var(--fg-2, #6b7280);
}
.sdlg-until i { color: var(--green-600, #0b8a61); flex: none; }

/* ── Phone: one swipe row (owner, 2026-10-23) ──
   Four cards stacked made a page four screens long, each card opening with the
   same two lines. On a phone those two lines are said once in .bp-common, the
   cards keep only what differs and sit side by side in one row that snaps card
   by card; the next card shows at the edge so the row reads as swipeable.
   Wider screens keep the grid above, and .bp-common stays hidden there. */
.bp-common { display: none; }
@media (max-width: 720px) {
  .bp-common {
    display: block;
    background: white;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 20px;
    padding: var(--space-4, 16px) var(--space-5, 20px);
    box-shadow: var(--shadow-soft, 0 1px 3px rgba(15, 23, 42, 0.05));
  }
  .bp-common-h { margin: 0 0 var(--space-2, 8px); font-size: 0.95rem; font-weight: 800; color: var(--fg-1, #111); }

  /* flex-start, not the grid's center: a centred row that overflows puts its
     first card out of reach of the scroll. Cards stretch to the longest, as
     in the grid, so every button sits at the same height while swiping (left
     to their own height, a short card left an empty band under it). Top
     padding is the room the ribbon and the sale badge (top: -12px) need inside
     a scrolling box. */
  .bp-plans--row {
    display: flex; gap: var(--space-3, 12px); justify-content: flex-start;
    overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
    padding: var(--space-4, 16px) 4px var(--space-3, 12px);
    scroll-padding-inline: 4px;
  }
  /* The phone's card sides, not the card's usual 40: at 82% of a 320px screen the 40px
     sides left the button 157px and broke its label in two. */
  .bp-plans--row > .bp-card { flex: 0 0 min(82%, 340px); scroll-snap-align: start; padding-inline: var(--pad-card-phone); }
  .bp-plans--row > .bp-card:hover { transform: none; }
  .bp-plans--row .bp-perk-every { display: none; }
}
