/* partner-calculator.css — the partnership page's interactive earnings
   calculator (the "grow" band + the slider card).
   -------------------------------------------------------------------------
   Loaded by views/public/partnership.ejs ONLY, and paired with
   public/js/partner-calculator.js. It is its own file rather than a section
   of partnership.css because that stylesheet is the signed-in dashboard's
   (views/dashboard/partnership.ejs + views/legal/partner-terms.ejs) and a
   public marketing page should not pay for it.
   ------------------------------------------------------------------------- */
/* ══════════════════════════════════════════════════════════════════
   PARTNERSHIP — EARNINGS CALCULATOR
   The "grow / how it works" band and the interactive calculator.
   -------------------------------------------------------------------------
   THIS COMPONENT CARRIES NO PALETTE OF ITS OWN. It reads the landing-family
   token layer the rest of the page is built from (landing.css declares it on
   [data-theme]; it loads after theme.css and paper.css), so the calculator is
   the platform's colour in BOTH themes and a token change lands here for free.
   The card recipe below is .sw-panel's — border --border, ground
   --bg-card-solid, depth --shadow-card + --edge-top — so this card sits at the
   same height as every other card on the page.

   The only non-token values are the per-tier accents, which arrive from the
   admin's partnership-tier config as an inline --pc-tier-accent /
   --pc-seg-accent and are fed through the platform's local-accent helpers
   (--c → --tint-c / --tint-c-edge / --ink-c). See the accent-carrier block at
   the END of this file: it is load-bearing, not decoration.
   ══════════════════════════════════════════════════════════════════ */
.pc-grow,
.pc-card { color: var(--text-primary); }

/* ── Grow band: hero panel + "How it works" card ─────────────────── */
.pc-grow { display: grid; grid-template-columns: 1.15fr .85fr; gap: 16px; margin-bottom: 32px; }
@media (max-width: 860px) { .pc-grow { grid-template-columns: 1fr; } }

/* The platform's panel recipe — the same declarations .sw-panel uses. */
.pc-grow-hero,
.pc-how,
.pc-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card-solid);
  box-shadow: var(--shadow-card), var(--edge-top);
  overflow: hidden;
}

.pc-grow-hero {
  padding: 26px;
  /* One restrained warm aura in the corner instead of a saturated cloud —
     theme.css's own note is that a big bright glow is the loudest "cheap"
     signal a page can emit, and this band is not the page's CTA. --sheen adds
     the same top-down lit edge the landing panels get. */
  background-image:
    radial-gradient(120% 120% at 0% 0%, var(--hero-aura-1), transparent 55%),
    var(--sheen);
}
.pc-grow-eyebrow { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 12px; }
.pc-grow-title { font-size: clamp(20px, 3.4vw, 28px); font-weight: 800; line-height: 1.3; color: var(--text-primary); margin: 0 0 20px; }
.pc-grow-stats { display: flex; gap: 26px; flex-wrap: wrap; }
.pc-grow-stat-num { display: block; font-size: 30px; font-weight: 900; line-height: 1; color: var(--accent); }
.pc-grow-stat-lbl { font-size: 12px; color: var(--text-muted); }

.pc-how { padding: 22px 22px 20px; }
.pc-how-head { font-size: 15px; font-weight: 800; color: var(--text-primary); margin-bottom: 14px; }
.pc-how-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.pc-how-step { display: flex; gap: 12px; align-items: flex-start; }
.pc-how-num {
  flex: 0 0 26px; width: 26px; height: 26px; border-radius: var(--radius-sm);
  display: grid; place-items: center; font-size: 12px; font-weight: 800;
  /* The page's own step badge (.how-num) fill. --brand-fill is the value that
     pairs with --text-on-brand in BOTH themes (5.66:1 on dark, 7.48:1 on
     light), which is why it is a token instead of a hex. */
  color: var(--text-on-brand);
  background: linear-gradient(135deg, var(--brand-fill), var(--accent-2));
}
.pc-how-title { font-size: 14px; font-weight: 700; color: var(--text-primary); margin-bottom: 3px; }
.pc-how-desc { font-size: 12.5px; line-height: 1.6; color: var(--text-muted); }

.pc-link-row { display: flex; gap: 8px; margin-top: 16px; }
.pc-link-input {
  flex: 1 1 auto; min-width: 0;
  background: var(--input-bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--well);
  color: var(--text-primary); font: inherit; font-size: 12.5px; padding: 10px 12px;
}
.pc-link-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.pc-copy {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border-hover); background: var(--accent-tint);
  color: var(--accent); border-radius: var(--radius-sm); font: inherit; font-size: 12.5px; font-weight: 700;
  padding: 10px 14px; cursor: pointer; transition: background .15s, color .15s, border-color .15s;
}
/* Tint → solid brand fill on hover: the same trade the platform's badges make,
   and the only way to write on a brand fill that passes in both themes. */
.pc-copy:hover { background: var(--brand-fill); border-color: var(--brand-fill); color: var(--text-on-brand); }
.pc-copy:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── Calculator card ─────────────────────────────────────────────── */
.pc-card { padding: 24px 24px 20px; margin-bottom: 40px; }
.pc-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.pc-card-title { font-size: clamp(18px, 2.6vw, 22px); font-weight: 800; line-height: 1.25; color: var(--text-primary); margin: 0 0 6px; }
.pc-card-sub { font-size: 13px; color: var(--text-muted); margin: 0; }
.pc-card-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
.pc-ccy-wrap { display: inline-flex; align-items: center; gap: 8px; }
.pc-ccy-label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; color: var(--text-muted); }
.pc-ccy {
  background: var(--input-bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-primary); font: inherit; font-size: 12.5px; font-weight: 700; padding: 6px 10px; cursor: pointer;
}
.pc-ccy:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* The figure stays --text-primary: the page's sibling earn cards (.earn-mo) do
   exactly this, so the calculator reads as their continuation, and the accent
   is left to the places where it carries meaning (tier, fill, badge). */
.pc-amount { font-size: clamp(30px, 5vw, 44px); font-weight: 900; line-height: 1; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.pc-amount-tag {
  font-size: 12px; font-weight: 700; color: var(--accent); background: var(--accent-tint);
  border: 1px solid var(--border-hover); border-radius: var(--radius-pill); padding: 3px 12px;
}
/* It is empty until the script fills it, and a hollow pill is a ghost on the
   card — so it only exists once it has something to say. */
.pc-amount-tag:empty { display: none; }

/* ── Slider ──────────────────────────────────────────────────────── */
.pc-slider { position: relative; height: 40px; margin: 40px 14px 0; cursor: pointer; touch-action: none; }
/* The rail is a WELL, not a highlight: --bg-tertiary + --well is the platform's
   recessed-ground pair, and it is what makes the rail read as a groove the fill
   is sitting in rather than a bar laid on top of the card. */
.pc-rail {
  position: absolute; top: 50%; left: 0; right: 0; height: 8px; transform: translateY(-50%);
  border-radius: var(--radius-pill); background: var(--bg-tertiary); box-shadow: var(--well); overflow: hidden;
}
.pc-segments { position: absolute; inset: 0; }
.pc-seg { position: absolute; top: 0; bottom: 0; border-right: 1px solid var(--border-strong); }
.pc-seg:last-child { border-right: none; }
/* Each band carries its tier's accent faintly, so the transition points read
   even before the fill has reached them. --tint-c resolves against this
   band's own --c — see the accent carriers at the end of this file. */
.pc-seg::after { content: ''; position: absolute; inset: 0; background: var(--tint-c); }
.pc-fill {
  position: absolute; top: 0; bottom: 0; left: 0; border-radius: var(--radius-pill);
  /* Stops are the two theme-aware accent steps, so the bar deepens on the pale
     ground and lifts on the charcoal one instead of freezing at a single hex. */
  background: linear-gradient(90deg, var(--accent-3), var(--accent-strong));
}
.pc-handle {
  position: absolute; top: 50%; width: 22px; height: 22px; margin-left: -11px; transform: translateY(-50%);
  /* --text-primary, not the card ground: the knob has to read against the
     rail in BOTH themes (near-white on dark, near-black on light), and a
     --bg-card-solid knob would vanish into the charcoal rail. The accent
     ring is what carries the brand. */
  border-radius: 50%; background: var(--text-primary); border: 3px solid var(--accent);
  box-shadow: var(--shadow-soft);
}
.pc-handle:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.pc-slider.is-dragging .pc-handle { box-shadow: var(--shadow-soft), 0 0 0 6px var(--accent-tint); }
.pc-bubble {
  position: absolute; top: -32px; transform: translateX(-50%);
  /* --bg-elevated-3 is the platform's "above the card" layer. The bubble hangs
     over both the card ground and the rail, so it must be opaque. */
  background: var(--bg-elevated-3); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 4px 10px; text-align: center; pointer-events: none; white-space: nowrap;
  box-shadow: var(--shadow-soft);
}
.pc-bubble-val { display: block; font-size: 15px; font-weight: 900; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.pc-bubble-lbl { display: block; font-size: 10px; color: var(--text-muted); }

/* ── Tier labels + legend ────────────────────────────────────────── */
.pc-tiers { display: flex; justify-content: space-between; gap: 8px; margin: 22px 0 0; flex-wrap: wrap; }
.pc-tier { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-muted); opacity: .7; transition: opacity .2s; }
/* .ch-rule-dot's idiom: the accent as the marker, its own tint as the halo. */
.pc-tier-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 4px var(--tint-c); }
.pc-tier-name { font-weight: 800; color: var(--text-primary); }
/* --ink-c and not the raw accent: a configured accent has to stay legible as
   TEXT on both grounds, and --ink-c is the theme's own answer to that (lightened
   on dark, darkened on light). */
.pc-tier-pct { font-weight: 700; color: var(--ink-c); }
/* The band the slider is currently in is the one at full strength. Matched on a
   class the script toggles, NOT on the band's slug: the Programme ships a single
   band and any admin can rename it, so slug selectors (bronze/gold/platinum)
   would simply never match — leaving the only band dimmed forever. */
.pc-tier.is-active { opacity: 1; }

/* ── Accent carriers ─────────────────────────────────────────────────
   A tier's colour comes from the admin's partnership-tier config, handed to the
   page as an inline --pc-tier-accent / --pc-seg-accent. Both are mapped onto the
   platform's local --c.

   Redeclaring --tint-c / --ink-c here is NOT optional. landing.css defines them
   on [data-theme] (<html>), and a custom property's value is substituted where
   it is DECLARED — so by the time those helpers reach these elements var(--c)
   has already been resolved to the ROOT accent, and every tier would come out
   russet. landing.css documents exactly this trap for its own chapters; the fix
   is the same one it uses: declare the helpers on an element that carries the
   local --c. The light pair below mirrors landing.css's numbers (10% / 26%
   tints, ink mixed 40% into the dark ground) so a configured accent stays
   readable in either theme rather than only the one it was picked for. */
.pc-tier { --c: var(--pc-tier-accent, var(--accent-3)); }
.pc-seg  { --c: var(--pc-seg-accent, var(--accent-3)); }
.pc-tier,
.pc-seg {
  --tint-c:      color-mix(in srgb, var(--c) 14%, transparent);
  --tint-c-edge: color-mix(in srgb, var(--c) 30%, transparent);
  --ink-c:       color-mix(in srgb, var(--c) 82%, #ffffff);
}
[data-theme="light"] :is(.pc-tier, .pc-seg) {
  --tint-c:      color-mix(in srgb, var(--c) 10%, transparent);
  --tint-c-edge: color-mix(in srgb, var(--c) 26%, transparent);
  --ink-c:       color-mix(in srgb, var(--c) 40%, #1A1712);
}

.pc-foot { font-size: 11.5px; line-height: 1.6; color: var(--text-muted); margin: 18px 0 0; }

@media (max-width: 640px) {
  .pc-card { padding: 18px 16px 16px; }
  .pc-card-right { align-items: flex-start; text-align: left; }
  .pc-tiers { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .pc-handle, .pc-fill, .pc-bubble, .pc-tier { transition: none !important; }
}
