/*
 * Referral Program page (/referral-program/).
 * Loaded only by that page, after rgab.css, using its brand tokens. No inline styles (the site policy forbids them).
 * Motion is small, transform and opacity only, and switched off in the reduced-motion block at the end.
 */

.rf-root { overflow-x: clip; }

/* ---------- Hero ---------- */
.rf-hero {
  background:
    url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2288%22%20height%3D%2288%22%3E%3Cpath%20d%3D%22M0%2022%20H32%20V54%20H64%20V88%22%20stroke%3D%22%23D7B85E%22%20stroke-width%3D%222%22%20fill%3D%22none%22%20opacity%3D%220.14%22/%3E%3Cpath%20d%3D%22M22%200%20V32%20H54%20V64%20H88%22%20stroke%3D%22%23D7B85E%22%20stroke-width%3D%222%22%20fill%3D%22none%22%20opacity%3D%220.14%22/%3E%3C/svg%3E") repeat,
    var(--navy);
  color: var(--soft-white);
  padding: 56px 0 56px;
}
.rf-hero .eyebrow { color: var(--gold); }
.rf-hero h1 { color: var(--soft-white); margin-bottom: 0.4em; font-size: clamp(2rem, 4.6vw, 3.25rem); }
.rf-hero-grid { display: grid; gap: 28px; align-items: center; }
.rf-lede { max-width: 560px; font-size: 1.05rem; opacity: 0.92; margin-bottom: 24px; }
.rf-motif { max-width: 440px; width: 100%; margin: 0 auto; }
.rf-motif svg { display: block; width: 100%; height: auto; overflow: visible; }
.rf-link-base { fill: none; stroke: rgba(215, 184, 94, 0.28); stroke-width: 2; }
.rf-link { fill: none; stroke: var(--gold); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 3 10; }
.rf-disc { fill: #223660; stroke: var(--gold); stroke-width: 2; }
.rf-disc-gold { fill: var(--gold); }
.rf-glyph { fill: var(--soft-white); }
.rf-star { fill: var(--navy); }
.rf-halo { fill: none; stroke: var(--gold); stroke-width: 1.5; opacity: 0.5; transform-box: fill-box; transform-origin: center; }

@media (prefers-reduced-motion: no-preference) {
  .rf-link { animation: rf-dash 1.6s linear infinite; }
  .rf-halo { animation: rf-pulse 3s ease-out infinite; }
  .rf-node-2 .rf-halo { animation-delay: 1s; }
  .rf-node-3 .rf-halo { animation-delay: 2s; }
  .rf-node-3 .rf-star { transform-box: fill-box; transform-origin: center; animation: rf-twinkle 3s ease-in-out infinite; }
}
@keyframes rf-dash { to { stroke-dashoffset: -26; } }
@keyframes rf-pulse { 0% { transform: scale(0.85); opacity: 0.6; } 75%, 100% { transform: scale(1.5); opacity: 0; } }
@keyframes rf-twinkle { 0%, 100% { transform: scale(1) rotate(0deg); } 50% { transform: scale(1.18) rotate(12deg); } }

@media (min-width: 860px) {
  .rf-hero { padding: 80px 0 72px; }
  .rf-hero-grid { grid-template-columns: 1.2fr 0.8fr; gap: 40px; }
  .rf-motif { margin: 0; }
}

/* ---------- How it works ---------- */
.rf-how { padding: 72px 0; }
.rf-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 28px; }
.rf-step { position: relative; padding-left: 76px; min-height: 56px; }
.rf-step::before {
  content: ""; position: absolute; left: 27px; top: 56px; bottom: -28px; width: 2px; background: rgba(215, 184, 94, 0.9);
  transform-origin: top; transform: scaleY(0); transition: transform 500ms ease 250ms;
}
.rf-step:last-child::before { display: none; }
.rf-step.rf-in::before { transform: scaleY(1); }
.rf-num {
  position: absolute; left: 0; top: 0; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  background: var(--navy); color: var(--gold); font-family: var(--font-headline); font-size: 1.6rem; font-weight: 600;
  box-shadow: 0 0 0 4px rgba(215, 184, 94, 0.25);
}
.rf-step h3 { margin-bottom: 0.25em; font-size: 1.2rem; }
.rf-step p { margin: 0; font-size: 0.95rem; color: var(--charcoal); }
@media (min-width: 860px) {
  .rf-steps { grid-template-columns: repeat(4, 1fr); gap: 24px; }
  .rf-step { padding: 72px 0 0; }
  .rf-step::before { left: 56px; right: -24px; top: 27px; bottom: auto; width: auto; height: 2px; transform-origin: left; transform: scaleX(0); }
  .rf-step.rf-in::before { transform: scaleX(1); }
}

/* ---------- Reward details ---------- */
.rf-reward-sec { padding: 64px 0; }
.rf-reward {
  background: var(--navy); color: var(--soft-white); border-radius: 12px; padding: 32px 24px; text-align: center;
  border-top: 4px solid var(--gold);
}
.rf-reward-text { font-family: var(--font-headline); font-size: clamp(1.3rem, 3vw, 1.75rem); line-height: 1.3; margin: 0 0 8px; color: var(--soft-white); }
.rf-reward-min { margin: 12px auto 0; max-width: 560px; opacity: 0.92; }
.rf-reward-text + .rf-reward-min[hidden] { display: none; }
.rf-count { margin-top: 24px; }
.rf-count[hidden], .rf-ended[hidden] { display: none; }
.rf-count-label { margin: 0 0 12px; font-weight: 700; letter-spacing: 0.04em; color: var(--gold); }
.rf-count-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; max-width: 460px; margin: 0 auto; }
.rf-unit { background: rgba(255, 253, 248, 0.08); border: 1px solid rgba(215, 184, 94, 0.45); border-radius: 10px; padding: 12px 4px; }
.rf-digits { display: block; font-family: var(--font-headline); font-size: clamp(1.4rem, 5vw, 2rem); line-height: 1.1; font-variant-numeric: tabular-nums; }
.rf-unit-l { display: block; font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.85; margin-top: 4px; }
.rf-tick { animation: rf-pop 320ms ease; }
@keyframes rf-pop { 0% { transform: translateY(-6px) scale(1.12); opacity: 0.4; } 100% { transform: none; opacity: 1; } }
.rf-validity {
  display: inline-block; margin: 6px 0 0; padding: 6px 16px; font-weight: 800; letter-spacing: 0.03em;
  color: var(--navy); background: var(--gold); border-radius: 999px;
}
.rf-validity[hidden] { display: none; }
.rf-ended { margin: 4px 0 0; }
.rf-ended-h { color: var(--gold); margin-bottom: 0.3em; }
.rf-ended p { max-width: 520px; margin: 0 auto 20px; opacity: 0.92; }
.rf-reward-text[hidden], .rf-reward-min[hidden] { display: none; }

/* ---------- Eligibility and conditions ---------- */
.rf-lists { padding: 72px 0 40px; }
.rf-two { display: grid; gap: 24px; }
@media (min-width: 860px) { .rf-two { grid-template-columns: 1fr 1fr; gap: 32px; } }
.rf-card { background: var(--soft-white); border: 1px solid rgba(27, 42, 75, 0.1); border-radius: var(--radius); padding: 28px 24px; }
.rf-card-h { font-size: 1.4rem; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 2px solid var(--gold); }
.rf-staff {
  display: flex; gap: 12px; align-items: flex-start; margin: 0 0 18px; padding: 14px 16px;
  background: var(--sand); border-left: 5px solid var(--navy); border-radius: 6px;
}
.rf-staff svg { flex: none; width: 26px; height: 26px; margin-top: 1px; fill: none; stroke: var(--navy); stroke-width: 2; stroke-linecap: round; }
.rf-staff p { margin: 0; color: var(--navy); }
.rf-checks { list-style: none; margin: 0; padding: 0; }
.rf-checks li { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.rf-checks li:last-child { margin-bottom: 0; }
.rf-checks svg { flex: none; width: 24px; height: 24px; margin-top: 1px; fill: none; stroke: var(--gold-text); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.rf-checks svg path { stroke-dasharray: 20; stroke-dashoffset: 0; }
.rf-checks span { color: var(--navy); }

/* ---------- Quick check ---------- */
.rf-quiz-sec { padding: 72px 0; }
.rf-quiz { max-width: 640px; margin: 0 auto; background: var(--porcelain); border: 1px solid rgba(27, 42, 75, 0.12); border-radius: 12px; padding: 24px 20px; }
.rf-q-prog { margin: 0 0 8px; font-size: 0.85rem; font-weight: 700; color: var(--charcoal); }
.rf-q { border: 0; margin: 0; padding: 0; }
.rf-q-text { font-family: var(--font-headline); font-size: clamp(1.15rem, 3vw, 1.45rem); font-weight: 600; line-height: 1.3; margin: 0 0 16px; }
.rf-q-text:focus, .rf-q-res:focus { outline: none; }
.rf-q-opts { display: flex; gap: 12px; }
.rf-q-opt {
  flex: 1; min-height: 52px; font: inherit; font-weight: 800; font-size: 1rem; color: var(--navy); background: var(--soft-white);
  border: 1.5px solid rgba(27, 42, 75, 0.35); border-radius: 10px; cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, transform 160ms ease, border-color 160ms ease;
}
.rf-q-opt:hover { background: var(--navy); color: var(--soft-white); border-color: var(--navy); transform: translateY(-1px); }
.rf-q-back { margin-top: 14px; padding: 8px 2px; min-height: 40px; font: inherit; font-weight: 700; font-size: 0.85rem; color: var(--navy); background: none; border: 0; border-bottom: 1px solid var(--gold); cursor: pointer; }
.rf-q-res h3 { margin-bottom: 8px; }
.rf-q-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.rf-q-actions .btn { cursor: pointer; font-family: var(--font-body); }
.rf-q-in { animation: rf-slide 260ms ease backwards; }
@keyframes rf-slide { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }

/* ---------- Terms accordion ---------- */
.rf-terms { padding: 72px 0 40px; }
.rf-acc-item { border-bottom: 1px solid rgba(27, 42, 75, 0.15); }
.rf-acc-item:first-child { border-top: 1px solid rgba(27, 42, 75, 0.15); }
.rf-acc-h { margin: 0; font-family: var(--font-body); font-size: 1rem; }
.rf-acc-btn {
  display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; padding: 14px 4px;
  font: inherit; font-weight: 800; font-size: 1.02rem; text-align: left; color: var(--navy); background: none; border: 0; cursor: pointer;
}
.rf-acc-btn:hover { color: var(--gold-text); }
.rf-acc-btn::after {
  content: ""; flex: none; width: 10px; height: 10px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg); transition: transform 220ms ease;
}
.rf-acc-btn[aria-expanded="true"]::after { transform: rotate(-135deg); }
.rf-acc-panel { display: grid; grid-template-rows: 1fr; }
.rf-acc-in { min-height: 0; overflow: hidden; }
.rf-acc-in p { margin: 0 0 16px; padding: 0 4px; color: var(--charcoal); }
.rf-acc-in a { color: var(--navy); font-weight: 700; }
/* With script running the panels start closed and slide open; without it every panel simply stays open. */
.rf-js .rf-acc-panel { grid-template-rows: 0fr; visibility: hidden; transition: grid-template-rows 260ms ease, visibility 0s linear 260ms; }
.rf-js .rf-acc-item.is-open .rf-acc-panel { grid-template-rows: 1fr; visibility: visible; transition-delay: 0s; }

.rf-cta { padding: 72px 0; scroll-margin-top: 84px; }
.rf-cta:focus { outline: none; }
.rf-legal { padding: 48px 0 64px; }
.rf-legal-h { font-size: 1.25rem; font-family: var(--font-headline); margin-bottom: 0.5em; }
.rf-legal .compliance-box a { color: var(--navy); font-weight: 700; }

/* ---------- Scroll rise ---------- */
.rf-js .rf-rise { opacity: 0; }
.rf-js .rf-rise.rf-in { opacity: 1; animation: rf-rise 520ms ease backwards; animation-delay: calc(var(--rf-i, 0) * 80ms); }
@keyframes rf-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
/* the ticks draw themselves, one after another, when their card arrives */
.rf-js .rf-card:not(.rf-in) .rf-checks svg path { stroke-dashoffset: 20; }
.rf-js .rf-card.rf-in .rf-checks svg path { animation: rf-draw 420ms ease backwards; }
.rf-js .rf-card.rf-in .rf-checks li:nth-child(1) path { animation-delay: 250ms; }
.rf-js .rf-card.rf-in .rf-checks li:nth-child(2) path { animation-delay: 450ms; }
.rf-js .rf-card.rf-in .rf-checks li:nth-child(3) path { animation-delay: 650ms; }
.rf-js .rf-card.rf-in .rf-checks li:nth-child(4) path { animation-delay: 850ms; }
@keyframes rf-draw { from { stroke-dashoffset: 20; } to { stroke-dashoffset: 0; } }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .rf-link, .rf-halo, .rf-star { animation: none; }
  .rf-js .rf-rise, .rf-js .rf-rise.rf-in { opacity: 1; animation: none; }
  .rf-js .rf-card:not(.rf-in) .rf-checks svg path, .rf-js .rf-card.rf-in .rf-checks svg path { stroke-dashoffset: 0; animation: none; }
  .rf-step::before { transition: none; transform: none; }
  .rf-q-opt, .rf-acc-btn::after, .rf-js .rf-acc-panel { transition: none; }
  .rf-q-opt:hover { transform: none; }
  .rf-q-in, .rf-tick { animation: none; }
}

/* ======================================================================================================
   Interactive tools: reward toggle, qualification checker, referral composer
   ====================================================================================================== */
.rf-hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.rf-hero-actions .btn { text-align: center; }

.rf-sub-h { font-family: var(--font-body); font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold-text); margin: 22px 0 10px; }
.rf-nots svg { stroke: var(--charcoal); }
.rf-staff { margin: 18px 0 0; }

/* fields shared by the checker, the example and the composer */
.rf-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.rf-field label { font-weight: 700; font-size: 0.9rem; color: var(--navy); }
.rf-field input[type="text"], .rf-field input[type="tel"], .rf-field input[type="number"] {
  width: 100%; min-height: 48px; padding: 10px 14px; font: inherit; font-size: 1rem; color: var(--navy); background: #fff;
  border: 1.5px solid rgba(27, 42, 75, 0.4); border-radius: 10px; transition: border-color 160ms ease, box-shadow 160ms ease;
}
.rf-field input:hover { border-color: var(--navy); }
.rf-hint { margin: 0; font-size: 0.8rem; color: var(--charcoal); }

/* reward toggle */
.rf-rtool-sec { padding: 72px 0; }
.rf-seg { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 20px; }
.rf-seg-btn {
  min-height: 48px; padding: 10px 20px; font: inherit; font-weight: 800; font-size: 0.95rem; color: var(--navy);
  background: var(--soft-white); border: 1.5px solid rgba(27, 42, 75, 0.35); border-radius: 999px; cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease;
}
.rf-seg-btn:hover { border-color: var(--navy); }
.rf-seg-btn[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: var(--soft-white); }
.rf-case { background: var(--soft-white); border: 1px solid rgba(27, 42, 75, 0.12); border-radius: 12px; padding: 24px 20px; }
.rf-case[hidden] { display: none; }
.rf-case h3 { margin-bottom: 8px; }
.rf-case-in { animation: rf-slide 280ms ease backwards; }
.rf-promo-note { margin: 16px 0 0; padding: 12px 14px; background: var(--sand); border-radius: 6px; font-size: 0.9rem; }

.rf-example { margin-top: 18px; padding: 16px; background: var(--porcelain); border: 1px dashed rgba(27, 42, 75, 0.35); border-radius: 10px; }
.rf-example-tag {
  display: inline-block; margin: 0 0 12px; padding: 2px 10px; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--navy); background: var(--sand); border: 1px solid var(--gold-text); border-radius: 999px;
}
.rf-example-fields { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.rf-insts { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 7.5rem), 1fr)); }
.rf-inst {
  position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; min-height: 64px;
  background: var(--soft-white); border: 1px solid rgba(27, 42, 75, 0.2); border-radius: 8px; font-size: 0.8rem;
}
.rf-inst-cut {
  position: absolute; top: 0; right: 0; bottom: 0; width: 0; background: rgba(215, 184, 94, 0.55);
  transition: width 520ms ease; transition-delay: calc(var(--rf-k, 0) * 140ms);
}
.rf-inst-cut[data-on="on"] { width: var(--rf-pct, 0%); }
.rf-inst > span { position: relative; }
.rf-inst > .rf-inst-cut { position: absolute; }
.rf-inst-n { font-weight: 700; color: var(--charcoal); overflow-wrap: anywhere; }
.rf-inst { min-width: 0; overflow-wrap: anywhere; }
.rf-inst-amt { font-family: var(--font-headline); font-size: 1rem; color: var(--navy); }
.rf-inst-minus { font-weight: 800; color: var(--navy); font-size: 0.75rem; }
.rf-inst.has-cut { border-color: var(--gold-text); }
.rf-example-note { margin: 14px 0 6px; font-weight: 600; }
.rf-example-foot { margin: 0; color: var(--charcoal); }

/* checker */
.rf-check-sec { padding: 72px 0; }
.rf-check { background: var(--soft-white); border: 1px solid rgba(27, 42, 75, 0.12); border-radius: 12px; padding: 24px 20px; }
.rf-check-fields { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .rf-check-fields { grid-template-columns: 1fr 1fr; } .rf-field-wide { grid-column: 1 / -1; } }
.rf-yn { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rf-yn legend { float: left; width: 100%; padding: 0; margin: 0 0 6px; font-weight: 700; font-size: 0.9rem; color: var(--navy); }
.rf-yn-opt { position: relative; flex: 1 1 0; min-width: 80px; }
.rf-yn-opt input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.rf-yn-opt span {
  display: flex; align-items: center; justify-content: center; min-height: 48px; font-weight: 800; background: var(--porcelain);
  border: 1.5px solid rgba(27, 42, 75, 0.35); border-radius: 10px; transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}
.rf-yn-opt:hover span { border-color: var(--navy); }
.rf-yn-opt input:checked + span { background: var(--navy); color: var(--soft-white); border-color: var(--navy); }
.rf-yn-opt input:focus-visible + span { outline: 2px solid var(--midnight); outline-offset: 2px; box-shadow: 0 0 0 2px var(--soft-white); }

.rf-verdict {
  margin-top: 22px; display: flex; gap: 14px; align-items: flex-start; padding: 18px 16px; border-radius: 10px;
  border: 2px solid rgba(27, 42, 75, 0.2); background: var(--porcelain); transition: background-color 240ms ease, border-color 240ms ease;
}
.rf-verdict-ico { flex: none; width: 40px; height: 40px; }
.rf-verdict-ico svg { display: none; width: 40px; height: 40px; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.rf-verdict[data-state="idle"] .rf-ico-idle { display: block; stroke: var(--charcoal); }
.rf-verdict[data-state="ok"] .rf-ico-ok { display: block; stroke: #1c6b3a; }
.rf-verdict[data-state="no"] .rf-ico-no { display: block; stroke: #9b2c2c; }
.rf-verdict[data-state="ok"] { background: #eaf5ee; border-color: #1c6b3a; }
.rf-verdict[data-state="no"] { background: #faeded; border-color: #9b2c2c; }
.rf-verdict-h { margin: 0 0 4px; font-family: var(--font-headline); font-size: 1.2rem; font-weight: 600; line-height: 1.3; color: var(--navy); }
.rf-verdict-list { margin: 6px 0 0; padding-left: 1.1em; color: var(--navy); }
.rf-verdict-list:empty { display: none; }
.rf-verdict-foot { margin: 8px 0 0; color: var(--charcoal); }
.rf-verdict-foot:empty { display: none; }
.rf-verdict-pop .rf-verdict-ico { animation: rf-bounce 420ms ease; }
.rf-verdict-pop .rf-verdict-body { animation: rf-slide 260ms ease backwards; }
@keyframes rf-bounce { 0% { transform: scale(0.5); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }

/* composer */
.rf-send-sec { padding: 72px 0; }
.rf-send-sec:focus { outline: none; }
.rf-send { background: var(--soft-white); border: 1px solid rgba(27, 42, 75, 0.12); border-radius: 12px; padding: 24px 20px; }
.rf-send-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .rf-send-grid { grid-template-columns: 1fr 1fr; } }
.rf-consent { display: flex; gap: 12px; align-items: flex-start; margin: 20px 0 0; padding: 12px 14px; background: var(--sand); border-radius: 8px; }
.rf-consent input { flex: none; width: 24px; height: 24px; margin: 1px 0 0; accent-color: var(--navy); cursor: pointer; }
.rf-consent label { font-weight: 700; cursor: pointer; }
.rf-send-missing { margin: 14px 0 0; font-size: 0.9rem; font-weight: 600; color: var(--charcoal); }
.rf-send-missing.is-ready { color: #1c6b3a; }
.rf-send-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.rf-send-actions .btn { text-align: center; }
.rf-send-actions .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.rf-send-foot { margin: 14px 0 0; color: var(--charcoal); }

.rf-approvals { margin-top: 28px; padding: 16px 18px; background: var(--soft-white); border-left: 5px solid var(--gold); border-radius: 6px; }
.rf-approvals p { margin: 0 0 10px; }

@media (prefers-reduced-motion: reduce) {
  .rf-seg-btn, .rf-inst-cut, .rf-yn-opt span, .rf-verdict, .rf-field input { transition: none; }
  .rf-case-in, .rf-verdict-pop .rf-verdict-ico, .rf-verdict-pop .rf-verdict-body { animation: none; }
}
