/* ReferralLoop — app overlay on rv-theme.css.
 *
 * Do NOT hardcode --rv-accent / --bs-primary here. Unbranded pages keep
 * rv-theme defaults; PV team primary_color is injected as --rv-accent
 * (+ --rv-accent-rgb) via an inline <style> in base.html when present.
 */

.rb-nav-business-logo {
  object-fit: contain;
  vertical-align: -0.2em;
}


.fw-extrabold {
  font-weight: 700;
}

/* ------------------------------------------------------------------ */
/* Polish layer                                                        */
/* ------------------------------------------------------------------ */
body {
  background: var(--bs-body-bg);
  font-feature-settings: "ss01", "cv01";
  -webkit-font-smoothing: antialiased;
}

/* Borderless white cards — match ReviewLoop / rv-theme defaults.
   Do not force a border here; kiosk cards keep their own frame below. */
.card {
  --bs-card-border-width: 0;
  border-radius: 1rem;
}

.logo-icon { color: #bdc0c9; }


/* Dashboard / metric tiles — ReviewLoop stat-card pattern */
.stat-card { height: 100%; }
.stat-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
  height: 100%;
}
.stat-card-link .stat-card {
  transition: transform .15s, box-shadow .15s;
}
.stat-card-link:hover .stat-card {
  transform: translateY(-2px);
  box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .1) !important;
}

/* Promotion cards (operator/dashboard.html) — the whole card is one click
   target: a .stretched-link on the title covers it. Bootstrap gives that
   overlay z-index 1, so anything else clickable in the card has to be lifted
   above it (.promo-action) or the card's link swallows the click. */
.promo-card {
  transition: transform .15s, box-shadow .15s;
}
/* focus-within as well as hover: the stretched link's own focus ring is
   invisible (the anchor is just the title), so keyboard tabbing needs the
   whole card to answer. */
.promo-card:hover,
.promo-card:focus-within {
  transform: translateY(-2px);
  box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .1) !important;
}
.promo-link {
  color: inherit;
  text-decoration: none;
}
.promo-card:hover .promo-link,
.promo-card:focus-within .promo-link {
  text-decoration: underline;
}
/* Above the stretched link's overlay — see the note at the top of this block.
   Put it on the control itself, never on a wrapper row: a full-width wrapper
   would lift its empty space too and punch a dead strip through the card. */
.promo-action {
  position: relative;
  z-index: 2;
}

/* Detailed funnel bars (operator/_funnel_bars.html, on the reporting page): each
   step's bar is as wide as its share of its population's first step, so the
   stack narrows like a funnel. min-width keeps the count readable near zero. */
.rb-funnel-label { font-size: .7rem; margin-bottom: .15rem; }
.rb-funnel-bar {
  min-width: 4.75rem;
  max-width: 100%;
  padding: .3rem .5rem;
  border-radius: .5rem;
  background: color-mix(in srgb, var(--rv-accent) 22%, transparent);
  border: 1px solid color-mix(in srgb, var(--rv-accent) 45%, transparent);
  white-space: nowrap;
}
.rb-funnel-sub { font-size: .75rem; margin-top: .1rem; }
/* Referee bars: a second tint so the two kinds of people read as two parts. */
.rb-funnel-bar-referee {
  background: color-mix(in srgb, var(--bs-success) 18%, transparent);
  border-color: color-mix(in srgb, var(--bs-success) 40%, transparent);
}
.rb-funnel-break {
  font-size: .75rem;
  font-weight: 600;
  margin: .5rem 0 .25rem;
  padding-top: .5rem;
  border-top: 1px dashed var(--bs-border-color);
}
.rb-funnel-step { font-size: .75rem; padding: .2rem 0; }

/* Promotion Performance Overview (operator/_promotion_perf_row.html): one
   compact row per promotion, referrer stages + boundary + referee stages.
   Layout, colours and borders are Bootstrap utilities in the template; this
   only covers the small type sizes and the wide-screen column widths. */
.rb-perf-name { min-width: 8rem; max-width: 12rem; }
.rb-perf-stage { min-width: 3rem; }
.rb-perf-stage-count { font-size: 1.05rem; line-height: 1.25; }
.rb-perf-stage-pct { font-size: .7rem; }
.rb-perf-arrow { font-size: .75rem; }
.rb-perf-boundary { --bs-border-style: dashed; }
.rb-perf-boundary-label { font-size: .55rem; line-height: 1.05; max-width: 4.5rem; }
/* Large screens: name + drop chip on the first line, the stat boxes on their
   own line at a fixed width so every row's boxes line up under each other. */
@media (min-width: 992px) {
  .rb-perf-journey { order: 3; flex: 0 0 100%; flex-wrap: nowrap !important; }
  .rb-perf-stage { flex: 0 0 6rem; }
  .rb-perf-name { max-width: none; }
}

/* Nested mini-stats inside campaign cards */
.stat {
  background: var(--bs-tertiary-bg);
  border-radius: .85rem;
  padding: .65rem .75rem;
  transition: transform .12s ease, box-shadow .12s ease;
}

.stat .sub {
  font-size: .7rem;
  color: var(--bs-secondary-color);
}


.rb-hero {
  padding: 4rem 0 2.5rem;
  border-bottom: 1px solid var(--bs-border-color);
  background: linear-gradient(180deg, var(--bs-tertiary-bg) 0%, var(--bs-body-bg) 100%);
}

.rb-title {
  font-size: clamp(2.4rem, 4.5vw, 3.8rem);
  font-weight: 800; line-height: 1.05; margin: .75rem 0 1rem;
}
.rb-tagline { font-size: 1.25rem; color: var(--bs-secondary-color); max-width: 42rem; }

.rb-meta-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem; margin-top: 2rem;
}
.rb-meta {
  border: 1px solid var(--bs-border-color); border-radius: 1rem;
  padding: 1rem 1.1rem; background: var(--bs-body-bg);
}
.rb-meta .label {
  font-size: .75rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--bs-secondary-color);
}
.rb-meta .value { font-weight: 600; margin-top: .3rem; }

section.rb-section { padding: 3rem 0; border-bottom: 1px solid var(--bs-border-color); }
section.rb-section:last-of-type { border-bottom: 0; }
.rb-section h2 { font-size: 1.85rem; font-weight: 700; margin-bottom: 1.5rem; }
.rb-section h3 {
  font-size: 1.15rem; font-weight: 700; margin: 1.5rem 0 .6rem;
  color: var(--bs-emphasis-color);
}

.rb-loop {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem;
}
.rb-loop-step {
  border: 1px solid var(--bs-border-color); border-radius: 1rem;
  padding: 1rem 1.1rem; background: var(--bs-tertiary-bg);
}
.rb-loop-step .num {
  font-size: .75rem; font-weight: 700;
  color: var(--rv-accent, var(--bs-primary)); letter-spacing: .1em;
}
.rb-loop-step .txt { font-weight: 600; margin-top: .25rem; }

ol.rb-steps { counter-reset: rb; list-style: none; padding-left: 0; }
ol.rb-steps > li {
  counter-increment: rb; position: relative;
  padding: 1rem 1rem 1rem 3.25rem; margin-bottom: .6rem;
  background: var(--bs-tertiary-bg); border-radius: .85rem;
  border: 1px solid var(--bs-border-color);
}
ol.rb-steps > li::before {
  content: counter(rb); position: absolute; left: 1rem; top: 1rem;
  width: 1.75rem; height: 1.75rem; border-radius: 50%;
  background: var(--rv-accent, var(--bs-primary)); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .9rem;
}

/* Hub gate: compact numbered steps; .is-current fills the circle. */
ol.gate-steps {
  counter-reset: gs; list-style: none; text-align: start;
  margin-bottom: 0; padding: .9rem 1rem;
  background: var(--bs-tertiary-bg); border-radius: .85rem;
}
ol.gate-steps > li {
  counter-increment: gs; position: relative; padding-left: 2.1rem;
}
ol.gate-steps > li + li { margin-top: .5rem; }
ol.gate-steps > li::before {
  content: counter(gs); position: absolute; left: 0; top: .1rem;
  width: 1.4rem; height: 1.4rem; border-radius: 50%;
  border: 1.5px solid var(--bs-secondary-color); color: var(--bs-secondary-color);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .8rem;
}
ol.gate-steps > li.is-current::before {
  background: var(--rv-accent, var(--bs-primary));
  border-color: var(--rv-accent, var(--bs-primary)); color: #fff;
}

.rb-econ {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem;
}
.rb-econ .card { border-radius: 1rem; }
.rb-econ .card-header {
  font-weight: 700; background: var(--bs-tertiary-bg);
  border-bottom: 1px solid var(--bs-border-color);
}
.rb-econ .example {
  font-family: var(--bs-font-monospace); font-size: .92rem;
  background: var(--bs-body-bg); border: 1px dashed var(--bs-border-color);
  padding: .55rem .75rem; border-radius: .5rem; color: var(--bs-secondary-color);
}

.rb-pill {
  display: inline-block; padding: .2rem .6rem; border-radius: 999px;
  background: var(--bs-secondary-bg); color: var(--bs-secondary-color);
  font-size: .8rem; font-weight: 600;
  margin-right: .35rem; margin-bottom: .35rem;
}

.rb-talk q {
  display: block; padding: 1rem 1.1rem;
  background: var(--bs-tertiary-bg);
  border-left: 3px solid var(--rv-accent, var(--bs-primary));
  border-radius: .25rem .85rem .85rem .25rem;
  font-style: italic; margin-bottom: .35rem; quotes: none;
}
.rb-talk q::before, .rb-talk q::after { content: none; }
.rb-talk .answer { padding: 0 1.1rem 1rem; color: var(--bs-secondary-color); margin-bottom: 1rem; }

footer.rb-footer {
  padding: 2.5rem 0; text-align: center;
  color: var(--bs-secondary-color); font-size: .9rem;
  background: var(--bs-tertiary-bg);
  border-top: 1px solid var(--bs-border-color);
}

.anchor-nav {
  position: sticky; top: 0; z-index: 10;
  background: rgba(var(--bs-body-bg-rgb), .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--bs-border-color); padding: .5rem 0;
}
.anchor-nav .nav-link {
  font-size: .9rem; font-weight: 600;
  color: var(--bs-secondary-color);
  padding: .25rem .75rem; border-radius: .5rem;
}
.anchor-nav .nav-link:hover { color: var(--rv-accent, var(--bs-primary)); }

/* Kiosk pages — same treatment as ReviewLoop: accent-tinted page
   gradient, borderless card with theme large shadow, soft footer. */
.kiosk-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: linear-gradient(
    180deg,
    #ffffff 3rem,
    color-mix(in srgb, var(--rv-accent), white 90%) 100%
  );
}
.kiosk-card {
  --bs-card-border-width: 0;
  max-width: 480px;
  margin: auto;
  width: 100%;
  box-shadow: var(--bs-box-shadow-lg);
  overflow: hidden;
}
.kiosk-card .card-body { padding: 1.75rem; }
.kiosk-card .card-footer {
  border-top: 0;
}
.kiosk-logo {
  max-height: 60px;
  max-width: 80%;
  object-fit: contain;
}
/* Pale brand tints, lighter than rv-theme's .bg-primary-subtle (80% white). */
.bg-accent-very-subtle {
  background: color-mix(in srgb, var(--rv-accent), white 90%);
}
.bg-accent-extra-subtle {
  background: color-mix(in srgb, var(--rv-accent), white 95%);
}

/* Stat grid helper (marketing / detail pages) */
.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: .75rem;
}

/* Referrer-hub QR — responsive size */
.qr-image { width: 180px; }
@media (max-width: 575.98px) {
  .qr-image { width: 140px; }
}

/* Clickable nested .stat (campaign detail etc.) */
.stat-link { display: block; color: inherit; text-decoration: none; }
.stat-link:hover .stat,
.stat-link:focus-visible .stat {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,.08);
  cursor: pointer;
}
.stat-link:hover .stat .value { color: var(--rv-accent, var(--bs-primary)); }

/* Leaderboard */
.leader { display: flex; align-items: center; gap: .75rem; padding: .6rem 0;
  border-bottom: 1px solid var(--bs-border-color); }
.leader .rank {
  width: 2rem; height: 2rem; border-radius: 50%;
  background: var(--bs-tertiary-bg); display: flex;
  align-items: center; justify-content: center; font-weight: 700;
}
.leader .meta { flex: 1; }
/* Size rows to their content so .table-responsive scrolls on narrow screens
   instead of squashing the columns; min-width keeps full width on desktop. */
.leaderboard { width: max-content; min-width: 100%; }
.leader > * { flex-shrink: 0; }
.leader .meta { min-width: 16rem; }
.leader .text-primary { white-space: nowrap; }
.leader .meta .name { font-weight: 600; }
.leader .meta .sub { font-size: .8rem; color: var(--bs-secondary-color); }
/* .leader .count {
  font-weight: 800; color: var(--rv-accent, var(--bs-primary));
} */

/* Reward tiles */
.reward-tile {
  border: 1px solid var(--bs-border-color); border-radius: 1rem;
  padding: 1rem 1.1rem; background: var(--bs-tertiary-bg);
}
/* .reward-tile .text-primary fw-bold {
  font-size: .7rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--rv-accent, var(--bs-primary));
} */
.reward-tile .face { font-size: 1.5rem; font-weight: 700; margin-top: .15rem; line-height: 1.2; }
/* Custom reward: the offer text is the headline, so it can be a sentence. */
.reward-tile .face.face-custom { font-size: 1rem; font-weight: 600; }
.reward-tile .desc { color: var(--bs-secondary-color); }

/* Referrer hub header logo — small, unlike the full-width .kiosk-logo */
.hub-logo { max-height: 48px; max-width: 160px; object-fit: contain; }

/* Chain tree — nested list of referrers with visual indentation */
.chain-tree, .chain-children {
  list-style: none;
  padding-left: 0;
  margin: 0;
}
.chain-children {
  border-left: 2px dashed var(--bs-border-color);
  margin-left: 1.35rem;
  padding-left: 1rem;
  margin-top: .35rem;
}
.chain-node { padding: .35rem 0; }
.chain-row {
  display: flex; align-items: center; gap: .75rem;
  padding: .5rem .75rem;
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: .65rem;
}
.chain-row:hover { background: var(--bs-tertiary-bg); }
.chain-badge {
  width: 2rem; height: 2rem;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: .9rem;
  flex-shrink: 0;
  background: var(--rv-accent, var(--bs-primary));
}
.chain-depth-1 { background: color-mix(in srgb, var(--rv-accent, var(--bs-primary)) 75%, #fff); }
.chain-depth-2 { background: color-mix(in srgb, var(--rv-accent, var(--bs-primary)) 60%, #fff); }
.chain-depth-3 { background: color-mix(in srgb, var(--rv-accent, var(--bs-primary)) 50%, #fff); }
.chain-depth-4 { background: color-mix(in srgb, var(--rv-accent, var(--bs-primary)) 40%, #fff); }
.chain-depth-5 { background: color-mix(in srgb, var(--rv-accent, var(--bs-primary)) 30%, #fff); color: #2b1700; }
.chain-meta { flex: 1; min-width: 0; }

/* ── Shared six-box OTP input ─────────────────────────────────────────────
   Pairs with templates/common/_otp_input.html. Keep this block identical in
   leadsvault.css, referralboost.css and momentum.css so every satellite's
   code entry looks the same: six separate soft-grey rounded boxes, one digit
   each, in a single centred row that never wraps (fits a 320px phone). */
.otp-boxes {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: .5rem;
  margin: 1.25rem 0 .5rem;
}
.otp-box {
  flex: 0 0 auto;
  width: 3rem;
  height: 3.5rem;
  padding: 0;
  border: 1px solid var(--bs-border-color);
  border-radius: .5rem;
  background: var(--bs-tertiary-bg);
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--bs-emphasis-color);
  caret-color: var(--rv-accent, var(--bs-primary));
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.otp-box:focus {
  outline: none;
  background: var(--bs-body-bg);
  border-color: var(--rv-accent, var(--bs-primary));
  box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--rv-accent, var(--bs-primary)) 20%, transparent);
}
.otp-box.is-filled {
  background: var(--bs-body-bg);
  border-color: var(--rv-accent, var(--bs-primary));
}
.otp-boxes.is-invalid .otp-box:not(.is-filled) {
  border-color: var(--bs-danger);
}
@media (max-width: 380px) {
  .otp-boxes { gap: .35rem; }
  .otp-box { width: 2.5rem; height: 3rem; font-size: 1.25rem; }
}

/* Scratch card */
.scratch-wrap {
  position: relative;
  width: 100%;
  height: 220px;
  margin: 1.5rem 0 .5rem;
  border-radius: 1rem;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.scratch-prize {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: linear-gradient(135deg, #ffd76a 0%, #ff9844 100%);
  color: #2b1700;
  text-align: center;
}
.scratch-prize .prize-face { font-size: 3rem; font-weight: 800; line-height: 1; }
.scratch-prize .prize-desc { font-weight: 600; margin-top: .25rem; padding: 0 1rem; }
.scratch-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  cursor: grab;
}
.scratch-canvas:active { cursor: grabbing; }
.scratch-hint {
  position: absolute; bottom: .5rem; left: 0; right: 0;
  text-align: center; color: #fff; font-weight: 600;
  text-shadow: 0 1px 3px rgba(0,0,0,.4);
  pointer-events: none;
}

/* Code reveal box (dev-only) */
.dev-code-box {
  border: 1px dashed var(--bs-warning); background: var(--bs-warning-bg-subtle);
  border-radius: .75rem; padding: .75rem 1rem; margin-top: 1rem;
  font-family: var(--bs-font-monospace);
}
.dev-code-box .code {
  font-size: 1.5rem; font-weight: 800; letter-spacing: .4rem;
  color: var(--bs-warning-text-emphasis);
}

/* ---- Journey preview: screenshot flow (operator) ---- */
/* A left-to-right flow of the real customer screens as phone thumbnails; each
 * is a scaled live iframe of the branded page, tap to enlarge in the lightbox. */
.shot-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 1rem;
  align-items: flex-start;
}
.shot-card { width: 200px; text-align: center; }
.shot-thumb-btn {
  position: relative;
  display: block;
  width: 200px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.shot-phone {
  position: relative;
  display: block;
  width: 200px;
  height: 355px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 0 0 1px var(--bs-border-color), 0 6px 20px rgba(0, 0, 0, .10);
  transition: box-shadow .15s, transform .15s;
}
.shot-thumb-btn:hover .shot-phone,
.shot-thumb-btn:focus-visible .shot-phone {
  transform: translateY(-2px);
  box-shadow: 0 0 0 2px #0e8fce, 0 10px 28px rgba(0, 0, 0, .16);
}
.is-referee .shot-thumb-btn:hover .shot-phone,
.is-referee .shot-thumb-btn:focus-visible .shot-phone {
  box-shadow: 0 0 0 2px #6c4ad6, 0 10px 28px rgba(0, 0, 0, .16);
}
.shot-thumb {
  position: absolute;
  top: 0;
  left: 0;
  width: 390px;      /* phone-width render... */
  height: 692px;
  border: 0;
  transform: scale(.5128);   /* ...scaled to the 200px thumbnail */
  transform-origin: top left;
  pointer-events: none;      /* clicks belong to the button, not the iframe */
}
.shot-num {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  width: 1.6em;
  height: 1.6em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #0e8fce;
  color: #fff;
  font-size: .8rem;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .3);
}
.is-referee .shot-num { background: #6c4ad6; }
.shot-side {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  font-size: .62rem;
  font-weight: 600;
  background: rgba(14, 143, 206, .12);
  color: #0b6fa0;
}
.is-referee .shot-side { background: rgba(108, 74, 214, .14); color: #5635b0; }
.shot-zoom {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.4rem;
  background: rgba(9, 14, 20, 0);
  opacity: 0;
  transition: opacity .15s, background .15s;
}
.shot-thumb-btn:hover .shot-zoom,
.shot-thumb-btn:focus-visible .shot-zoom {
  opacity: 1;
  background: rgba(9, 14, 20, .22);
}
.shot-cap { margin-top: .5rem; }
.shot-cap-text { font-size: .78rem; line-height: 1.35; }

/* ---- Journey preview: connected flow timeline (operator) ---- */
.journey-flow { margin: 0; padding: 0; }
.flow-step {
  position: relative;
  margin-left: .75rem;
  padding: 0 0 1.5rem 2.25rem;
  border-left: 2px solid var(--bs-border-color);
}
.flow-step:last-child { border-left-color: transparent; padding-bottom: 0; }
.flow-num {
  position: absolute;
  left: -0.95rem;
  top: 0;
  width: 1.8rem;
  height: 1.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #0e8fce;
  color: #fff;
  font-size: .85rem;
  font-weight: 700;
  box-shadow: 0 0 0 3px var(--bs-body-bg);
}
.flow-body { padding-top: .15rem; }
/* Staff steps get a green (success) accent on the screen thumbnail. */
.is-staff .shot-thumb-btn:hover .shot-phone,
.is-staff .shot-thumb-btn:focus-visible .shot-phone {
  box-shadow: 0 0 0 2px #2a8540, 0 10px 28px rgba(0, 0, 0, .16);
}
