/* BiznizCard — Referral Program (modern SaaS)
 * @version 20260520-final — dark mode surfaces (locked; do not change light theme) */

.referral-site {
  --ref-ink: #0f172a;
  --ref-muted: #64748b;
  --ref-line: rgba(15, 23, 42, 0.08);
  --ref-brand: #4f46e5;
  --ref-brand-2: #6366f1;
  --ref-brand-dark: #3730a3;
  --ref-emerald: #059669;
  --ref-emerald-soft: #ecfdf5;
  --ref-surface: #ffffff;
  --ref-page-bg: #f6f8fc;
  --ref-radius: 16px;
  --ref-radius-lg: 24px;
  --ref-shadow: 0 4px 6px rgba(15, 23, 42, 0.04), 0 20px 50px rgba(79, 70, 229, 0.08);
  --ref-shadow-lg: 0 25px 60px rgba(15, 23, 42, 0.12);
}

.referral-site {
  background: var(--ref-page-bg);
}

.referral-page {
  overflow-x: hidden;
}

/* Standard site header + logo on affiliate program page */
.referral-site #site-header.site-header {
  display: block;
  visibility: visible;
}

.referral-site .site-nav-brand__mark {
  display: block !important;
  max-width: min(220px, 58vw) !important;
  max-height: min(56px, 12vw) !important;
  object-fit: contain;
  object-position: left center;
  /* White outline — logo readable on dark mode hero + light glass nav pill */
  filter:
    drop-shadow(1px 0 0 rgba(255, 255, 255, 0.95))
    drop-shadow(-1px 0 0 rgba(255, 255, 255, 0.95))
    drop-shadow(0 1px 0 rgba(255, 255, 255, 0.95))
    drop-shadow(0 -1px 0 rgba(255, 255, 255, 0.95))
    drop-shadow(0 0 2px rgba(255, 255, 255, 0.75));
}

.referral-site .site-nav-brand__mark--platform {
  max-height: min(52px, 10vw);
  max-width: min(52px, 10vw);
  border-radius: 12px;
  filter:
    drop-shadow(1px 0 0 rgba(255, 255, 255, 0.95))
    drop-shadow(-1px 0 0 rgba(255, 255, 255, 0.95))
    drop-shadow(0 1px 0 rgba(255, 255, 255, 0.95))
    drop-shadow(0 -1px 0 rgba(255, 255, 255, 0.95))
    drop-shadow(0 0 2px rgba(255, 255, 255, 0.75));
}

.referral-page .container {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
}

/* —— Buttons —— */
.ref-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 1.35rem;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.ref-btn--primary {
  color: #fff;
  background: linear-gradient(135deg, var(--ref-brand) 0%, var(--ref-brand-2) 55%, #4338ca 100%);
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.35);
}

.ref-btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(79, 70, 229, 0.42);
}

.ref-btn--ghost {
  color: var(--ref-brand-dark);
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(79, 70, 229, 0.25);
  backdrop-filter: blur(8px);
}

.ref-btn--ghost:hover {
  background: #fff;
  border-color: var(--ref-brand);
}

.ref-btn--white {
  color: var(--ref-brand-dark);
  background: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
}

.ref-btn--white:hover {
  transform: translateY(-2px);
}

/* —— Hero —— */
.ref-hero {
  position: relative;
  padding: clamp(2rem, 5vw, 4rem) 0 clamp(3rem, 6vw, 5rem);
  overflow: hidden;
}

.ref-hero__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 60% at 20% 0%, rgba(99, 102, 241, 0.18), transparent 55%),
    radial-gradient(ellipse 60% 50% at 90% 20%, rgba(14, 165, 233, 0.1), transparent 50%),
    linear-gradient(180deg, #eef2ff 0%, var(--ref-page-bg) 72%);
}

.ref-hero__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.5;
}

.ref-hero__orb--1 {
  width: 320px;
  height: 320px;
  background: #818cf8;
  top: -80px;
  left: -60px;
}

.ref-hero__orb--2 {
  width: 240px;
  height: 240px;
  background: #38bdf8;
  top: 20%;
  right: 5%;
}

.ref-hero__orb--3 {
  width: 180px;
  height: 180px;
  background: #a78bfa;
  bottom: 10%;
  left: 35%;
}

.ref-hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

@media (min-width: 900px) {
  .ref-hero__inner {
    grid-template-columns: 1.1fr 0.9fr;
    gap: 3rem;
  }
}

.ref-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1rem;
  padding: 0.35rem 0.85rem 0.35rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(79, 70, 229, 0.15);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ref-brand-dark);
}

.ref-hero__eyebrow-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ref-emerald);
  box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.2);
  animation: ref-pulse 2s ease infinite;
}

@keyframes ref-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.ref-hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(2.25rem, 6vw, 3.5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--ref-ink);
}

.ref-hero__gradient {
  background: linear-gradient(135deg, var(--ref-brand) 0%, #7c3aed 50%, var(--ref-emerald) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.ref-hero__lead {
  margin: 0 0 1.5rem;
  max-width: 32rem;
  font-size: clamp(1rem, 2.2vw, 1.12rem);
  line-height: 1.6;
  color: var(--ref-muted);
}

.ref-hero__lead strong {
  color: var(--ref-ink);
}

.ref-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1.5rem;
}

.ref-hero__trust {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.25rem;
}

.ref-hero__trust li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ref-muted);
}

.ref-hero__trust svg {
  color: var(--ref-brand);
  flex-shrink: 0;
}

/* Reward preview card */
.ref-reward-card {
  padding: 1.75rem 1.5rem;
  border-radius: var(--ref-radius-lg);
  background: linear-gradient(145deg, #1e1b4b 0%, #312e81 45%, #4f46e5 100%);
  color: #fff;
  box-shadow: var(--ref-shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.12);
  position: relative;
  overflow: hidden;
}

.ref-reward-card::before {
  content: "";
  position: absolute;
  top: -40%;
  right: -20%;
  width: 60%;
  height: 80%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.15), transparent 70%);
  pointer-events: none;
}

.ref-reward-card__label {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.75;
}

.ref-reward-card__amount {
  margin: 0.25rem 0 0;
  font-size: clamp(3rem, 10vw, 4.25rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
}

.ref-reward-card__sub {
  margin: 0.35rem 0 1.25rem;
  font-size: 0.95rem;
  opacity: 0.85;
}

.ref-reward-card__examples {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.ref-reward-card__ex {
  padding: 0.65rem 0.5rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-align: center;
}

.ref-reward-card__ex span {
  display: block;
  font-size: 0.68rem;
  opacity: 0.75;
  margin-bottom: 0.2rem;
}

.ref-reward-card__ex strong {
  font-size: 1rem;
  font-weight: 800;
}

/* —— Sections —— */
.ref-section {
  padding: clamp(2.5rem, 5vw, 4rem) 0;
}

.ref-section--steps {
  background: var(--ref-surface);
  border-block: 1px solid var(--ref-line);
}

.ref-section--dash {
  background: var(--ref-page-bg);
}

.ref-section--audience {
  background: var(--ref-surface);
}

.ref-section__head {
  text-align: center;
  max-width: 36rem;
  margin: 0 auto 2.25rem;
}

.ref-section__head--left {
  text-align: left;
  margin-left: 0;
  margin-right: 0;
  max-width: 40rem;
}

.ref-section__eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ref-brand);
}

.ref-section__head h2 {
  margin: 0 0 0.65rem;
  font-size: clamp(1.65rem, 3.5vw, 2.15rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--ref-ink);
}

.ref-section__head p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ref-muted);
}

/* Steps */
.ref-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

@media (min-width: 768px) {
  .ref-steps {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
  }
}

.ref-step-card {
  position: relative;
  padding: 1.5rem 1.35rem 1.35rem;
  border-radius: var(--ref-radius);
  background: var(--ref-page-bg);
  border: 1px solid var(--ref-line);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.ref-step-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--ref-shadow);
  border-color: rgba(79, 70, 229, 0.2);
}

.ref-step-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.12), rgba(99, 102, 241, 0.06));
  color: var(--ref-brand);
  margin-bottom: 1rem;
}

.ref-step-card__num {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #c7d2fe;
}

.ref-step-card h3 {
  margin: 0 0 0.45rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ref-ink);
}

.ref-step-card p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--ref-muted);
}

/* Dashboard shell */
.ref-dash-shell {
  border-radius: var(--ref-radius-lg);
  background: var(--ref-surface);
  border: 1px solid var(--ref-line);
  box-shadow: var(--ref-shadow);
  padding: clamp(1.25rem, 3vw, 2rem);
  overflow: hidden;
}

.ref-dash-mount:empty {
  min-height: 0;
}

.ref-guest-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.25rem 1.35rem;
  margin-bottom: 1.25rem;
  border-radius: var(--ref-radius);
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.08), rgba(99, 102, 241, 0.04));
  border: 1px dashed rgba(79, 70, 229, 0.25);
}

/* display:flex above beats the UA [hidden] rule — must hide explicitly when signed in */
.ref-guest-banner[hidden],
.referral-is-authed .ref-guest-banner {
  display: none !important;
  margin: 0;
  padding: 0;
  border: 0;
}

.ref-guest-banner__copy h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.ref-guest-banner__copy p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ref-muted);
  max-width: 28rem;
}

.ref-guest-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.referral-is-authed .ref-dash-footnote {
  display: none;
}

.referral-is-authed .referral-widget__email-row {
  display: none !important;
}

.ref-dash-footnote {
  margin: 1.25rem 0 0;
  text-align: center;
  font-size: 0.88rem;
  color: var(--ref-muted);
}

.ref-dash-footnote a {
  color: var(--ref-brand);
  font-weight: 700;
  text-decoration: none;
}

.ref-dash-footnote a:hover {
  text-decoration: underline;
}

/* Audience */
.ref-audience-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
}

.ref-audience-card {
  padding: 1rem 1.1rem;
  border-radius: 12px;
  background: var(--ref-page-bg);
  border: 1px solid var(--ref-line);
  font-size: 0.9rem;
  font-weight: 600;
  color: #334155;
  text-align: center;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.ref-audience-card:hover {
  background: #eef2ff;
  border-color: rgba(79, 70, 229, 0.2);
  color: var(--ref-brand-dark);
}

/* CTA band */
.ref-cta-band {
  padding: clamp(2.5rem, 5vw, 3.5rem) 0;
  background: linear-gradient(135deg, #3730a3 0%, #4f46e5 50%, #6366f1 100%);
  color: #fff;
}

.ref-cta-band__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.ref-cta-band h2 {
  margin: 0 0 0.4rem;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 800;
}

.ref-cta-band p {
  margin: 0;
  opacity: 0.88;
  font-size: 0.95rem;
  max-width: 28rem;
}

/* —— Dashboard widget (JS-injected) —— */
.referral-widget {
  --rw-brand: var(--ref-brand, #4f46e5);
}

.referral-widget__email-row {
  margin-bottom: 1.25rem;
}

.referral-field label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: #334155;
}

.referral-widget__email-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.referral-widget__email-actions input,
.referral-field input {
  flex: 1;
  min-width: 12rem;
  height: 48px;
  padding: 0 1rem;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  font: inherit;
  font-size: 0.92rem;
  background: #f8fafc;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.referral-widget__email-actions input:focus,
.referral-field input:focus {
  outline: none;
  border-color: var(--rw-brand);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
  background: #fff;
}

.referral-btn {
  min-height: 48px;
  padding: 0 1.25rem;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, var(--rw-brand), #6366f1);
  color: #fff;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.referral-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.3);
}

.referral-btn--ghost {
  background: #fff;
  color: var(--ref-brand-dark);
  border: 1px solid rgba(79, 70, 229, 0.3);
  box-shadow: none;
}

.referral-btn--ghost:hover {
  background: #f5f3ff;
  box-shadow: none;
}

/* Earnings banner */
.referral-widget__hero-stat {
  margin: 0 0 1.5rem;
  padding: 1.5rem 1.5rem 1.35rem;
  border-radius: var(--ref-radius);
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
}

.referral-widget__hero-stat::after {
  content: "";
  position: absolute;
  top: -50%;
  right: -10%;
  width: 50%;
  height: 150%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.35), transparent 65%);
  pointer-events: none;
}

.referral-widget__reward-label {
  position: relative;
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.7;
}

.referral-widget__reward-value {
  position: relative;
  margin: 0;
  font-size: clamp(2.25rem, 6vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}

.referral-widget__reward-hint {
  position: relative;
  margin: 0.5rem 0 0;
  font-size: 0.88rem;
  opacity: 0.8;
}

/* Code + link */
.referral-widget__share-block {
  margin-bottom: 1.25rem;
}

/* Payout preference — after Affiliate activity */
.referral-payout {
  margin: 2rem 0 0;
  padding: 1.5rem 1.35rem 1.35rem;
  border-radius: var(--ref-radius-lg);
  border: 1px solid rgba(79, 70, 229, 0.2);
  background: linear-gradient(165deg, #f5f3ff 0%, #ffffff 42%, #f8fafc 100%);
  box-shadow: 0 12px 40px rgba(79, 70, 229, 0.08);
}

.referral-payout__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.referral-payout__head-copy {
  flex: 1;
  min-width: 0;
}

.referral-payout__eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ref-brand);
}

.referral-payout__title {
  margin: 0 0 0.4rem;
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.25;
  color: #0f172a;
}

.referral-payout__lead {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: #64748b;
}

.referral-payout__badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.25rem;
  height: 3.25rem;
  padding: 0 0.65rem;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--ref-brand), #6366f1);
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.35);
}

.referral-payout__options {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1.1rem;
}

.referral-payout__option {
  display: grid;
  grid-template-columns: auto 2.5rem 1fr;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.referral-payout__option:hover {
  border-color: rgba(79, 70, 229, 0.35);
  background: #fafaff;
}

.referral-payout__option:has(input:checked) {
  border-color: var(--ref-brand);
  background: #eef2ff;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.14);
}

.referral-payout__option input {
  width: 1.1rem;
  height: 1.1rem;
  margin: 0;
  accent-color: var(--ref-brand);
}

.referral-payout__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 12px;
  background: #f1f5f9;
  font-size: 0.65rem;
  font-weight: 800;
  color: #475569;
  letter-spacing: -0.02em;
}

.referral-payout__icon--card::before {
  content: "VISA";
}

.referral-payout__icon--cash {
  background: #00d632;
  color: #fff;
}

.referral-payout__icon--cash::before {
  content: "$";
  font-size: 1.1rem;
}

.referral-payout__icon--venmo {
  background: #008cff;
  color: #fff;
}

.referral-payout__icon--venmo::before {
  content: "V";
  font-size: 1rem;
}

.referral-payout__option-body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  text-align: left;
}

.referral-payout__option-body strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.3;
}

.referral-payout__option-body small {
  display: block;
  font-size: 0.8rem;
  line-height: 1.4;
  color: #64748b;
  font-weight: 500;
}

.referral-payout__form {
  padding: 1.1rem 1rem 1rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(79, 70, 229, 0.12);
}

.referral-payout__form .referral-field label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #334155;
}

.referral-payout__form .referral-field input {
  width: 100%;
  box-sizing: border-box;
}

.referral-payout__detail {
  margin-bottom: 1rem;
}

.referral-payout__detail[hidden] {
  display: none !important;
}

.referral-payout__detail.is-error label {
  color: #b91c1c;
}

.referral-payout__detail.is-error input {
  border-color: #ef4444 !important;
  background: #fff5f5 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}

.referral-payout__status {
  margin: 0 0 0.85rem;
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.45;
}

.referral-payout__status[hidden] {
  display: none !important;
}

.referral-payout__status.is-error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.referral-payout__status.is-ok {
  background: var(--ref-emerald-soft);
  color: #047857;
  border: 1px solid rgba(5, 150, 105, 0.2);
}

.referral-payout__status.is-pending {
  background: #eef2ff;
  color: #4338ca;
  border: 1px solid rgba(79, 70, 229, 0.2);
}

.referral-payout__save {
  width: 100%;
  margin-top: 0.15rem;
}

.referral-payout__saved {
  margin: 0.85rem 0 0;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  font-size: 0.86rem;
  font-weight: 700;
  color: #047857;
  background: var(--ref-emerald-soft);
  border: 1px solid rgba(5, 150, 105, 0.2);
}

.referral-payout__saved[hidden] {
  display: none !important;
}

.referral-payout__note {
  margin: 0.85rem 0 0;
  font-size: 0.8rem;
  line-height: 1.5;
  color: #94a3b8;
}

@media (max-width: 520px) {
  .referral-payout {
    padding: 1.15rem 1rem 1.1rem;
  }

  .referral-payout__head {
    flex-direction: column;
    align-items: stretch;
  }

  .referral-payout__badge {
    align-self: flex-start;
  }

  .referral-payout__option {
    padding: 0.8rem 0.85rem;
    gap: 0.6rem;
  }

  .referral-payout__option-body strong {
    font-size: 0.9rem;
  }

  .referral-payout__option-body small {
    font-size: 0.76rem;
  }
}

.referral-widget__code-line {
  margin: 0 0 0.75rem;
  font-size: 0.88rem;
  color: var(--ref-muted);
}

.referral-widget__code-pill {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.2rem 0.65rem;
  border-radius: 8px;
  background: #eef2ff;
  color: var(--ref-brand-dark);
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
}

.referral-link-row,
.referral-widget__link-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.referral-link-row input,
.referral-widget__link-row input {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0 1rem;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  font-size: 0.85rem;
  background: #f8fafc;
  color: #334155;
}

.referral-link-row input:focus {
  outline: none;
  border-color: var(--rw-brand);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

/* Stat grid */
.referral-stats,
.referral-widget__stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin: 0 0 1rem;
}

@media (min-width: 640px) {
  .referral-stats,
  .referral-widget__stats {
    grid-template-columns: repeat(4, 1fr);
  }
}

.referral-stat {
  padding: 1rem 0.85rem;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid #eef2f7;
  text-align: left;
  transition: border-color 0.2s ease, background 0.2s ease;
  position: relative;
}

.referral-widget__stats .referral-stat::before {
  content: "";
  display: block;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  margin-bottom: 0.65rem;
  background-color: rgba(79, 70, 229, 0.1);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px 18px;
}

.referral-widget__stats .referral-stat:nth-child(1)::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24'%3E%3Cpath stroke='%234f46e5' stroke-width='2' stroke-linecap='round' d='M15 3h4a2 2 0 012 2v14a2 2 0 01-2 2h-4M10 17l5-5-5-5M15 12H3'/%3E%3C/svg%3E");
}

.referral-widget__stats .referral-stat:nth-child(2)::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24'%3E%3Cpath stroke='%234f46e5' stroke-width='2' d='M17 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4' stroke='%234f46e5' stroke-width='2'/%3E%3C/svg%3E");
}

.referral-widget__stats .referral-stat:nth-child(3)::before {
  background-color: #fffbeb;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='10' stroke='%23d97706' stroke-width='2'/%3E%3Cpath stroke='%23d97706' stroke-width='2' stroke-linecap='round' d='M12 6v6l4 2'/%3E%3C/svg%3E");
}

.referral-widget__stats .referral-stat:nth-child(4)::before {
  background-color: #ecfdf5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24'%3E%3Cpath stroke='%23059669' stroke-width='2' d='M22 11.08V12a10 10 0 11-5.93-9.14'/%3E%3Cpath stroke='%23059669' stroke-width='2' stroke-linecap='round' d='M22 4L12 14.01l-3-3'/%3E%3C/svg%3E");
}

.referral-stat:hover {
  background: #fff;
  border-color: rgba(79, 70, 229, 0.15);
}

.referral-stat__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  margin-bottom: 0.65rem;
  background: rgba(79, 70, 229, 0.1);
  color: var(--ref-brand);
}

.referral-stat__icon--green {
  background: var(--ref-emerald-soft);
  color: var(--ref-emerald);
}

.referral-stat__icon--amber {
  background: #fffbeb;
  color: #d97706;
}

.referral-stat strong {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--ref-ink);
  line-height: 1.1;
}

.referral-stat span {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ref-muted);
  line-height: 1.3;
}

.referral-status {
  margin: 0;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  min-height: 0;
}

.referral-status:empty {
  display: none;
}

.referral-status.is-ok {
  background: var(--ref-emerald-soft);
  color: #047857;
}

.referral-status.is-error {
  background: #fef2f2;
  color: #b91c1c;
}

/* History table */
.referral-history {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--ref-line);
}

.referral-history__title {
  margin: 0 0 0.85rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ref-ink);
}

.referral-history__empty {
  margin: 0;
  padding: 2rem 1rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--ref-muted);
  background: #f8fafc;
  border-radius: 12px;
  border: 1px dashed #e2e8f0;
}

.referral-history__table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid #e8eef5;
  background: #fff;
}

.referral-history__table {
  width: 100%;
  min-width: 400px;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.referral-history__table th,
.referral-history__table td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid #f1f5f9;
}

.referral-history__table th {
  background: #f8fafc;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}

.referral-history__table tbody tr:last-child td {
  border-bottom: none;
}

.referral-history__table tbody tr:hover td {
  background: #fafbff;
}

.referral-history__email {
  color: #475569;
  font-size: 0.82rem;
}

.referral-history__badge {
  display: inline-flex;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.referral-history__badge.is-pending {
  background: #fffbeb;
  color: #b45309;
}

.referral-history__badge.is-converted {
  background: var(--ref-emerald-soft);
  color: #047857;
}

/* Compact mode (dashboard panel) */
.referral-widget--compact .referral-widget__hero-stat {
  padding: 1.15rem 1.2rem;
}

.referral-widget--compact .referral-widget__reward-value {
  font-size: 1.85rem;
}

/* Legacy class aliases (dashboard.html) */
.referral-card,
.referral-grid,
.referral-hero,
.referral-guest-cta,
.referral-steps,
.referral-note {
  /* unused on new page — kept for dashboard embed compatibility */
}

/* —— Dark mode only: black surfaces, white text (light theme unchanged) —— */
html[data-theme="dark"] .referral-site {
  --ref-ink: #ffffff;
  --ref-muted: rgba(248, 250, 252, 0.72);
  --ref-line: rgba(248, 250, 252, 0.12);
  --ref-surface: #121212;
  --ref-page-bg: #0a0a0a;
  background: #0a0a0a !important;
  color: #ffffff;
}

html[data-theme="dark"] .ref-hero__bg {
  background:
    radial-gradient(ellipse 80% 60% at 20% 0%, rgba(99, 102, 241, 0.2), transparent 55%),
    radial-gradient(ellipse 60% 50% at 90% 20%, rgba(14, 165, 233, 0.08), transparent 50%),
    linear-gradient(180deg, #0a0a0a 0%, #0a0a0a 72%) !important;
}

html[data-theme="dark"] .ref-hero h1,
html[data-theme="dark"] .ref-section h2,
html[data-theme="dark"] .ref-section h3,
html[data-theme="dark"] .ref-step-card h3,
html[data-theme="dark"] .ref-guest-banner__copy h3,
html[data-theme="dark"] .referral-history__title {
  color: #ffffff !important;
}

html[data-theme="dark"] .ref-hero__lead,
html[data-theme="dark"] .ref-hero__eyebrow,
html[data-theme="dark"] .ref-section__head p,
html[data-theme="dark"] .ref-section p,
html[data-theme="dark"] .ref-step-card p,
html[data-theme="dark"] .ref-guest-banner__copy p,
html[data-theme="dark"] .ref-dash-footnote {
  color: rgba(248, 250, 252, 0.78) !important;
}

html[data-theme="dark"] .ref-hero__lead strong {
  color: #ffffff !important;
}

html[data-theme="dark"] .ref-hero__trust li {
  color: rgba(248, 250, 252, 0.92) !important;
}

html[data-theme="dark"] .ref-hero__trust svg {
  color: #a5b4fc !important;
}

html[data-theme="dark"] .ref-hero__eyebrow {
  background: rgba(24, 24, 28, 0.92) !important;
  border-color: rgba(248, 250, 252, 0.14) !important;
  color: #c7d2fe !important;
}

html[data-theme="dark"] .ref-dash-shell,
html[data-theme="dark"] .ref-step-card,
html[data-theme="dark"] .ref-audience-card {
  background: #121212 !important;
  border-color: rgba(248, 250, 252, 0.12) !important;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45) !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .ref-guest-banner {
  background: rgba(49, 46, 129, 0.22) !important;
  border-color: rgba(129, 140, 248, 0.28) !important;
}

html[data-theme="dark"] .ref-btn--ghost {
  background: #1a1a1f !important;
  color: #ffffff !important;
  border-color: rgba(248, 250, 252, 0.2) !important;
}

html[data-theme="dark"] .ref-btn--ghost:hover {
  background: #24242a !important;
  border-color: rgba(248, 250, 252, 0.28) !important;
}

html[data-theme="dark"] .ref-btn--white {
  background: #1a1a1f !important;
  color: #ffffff !important;
  border: 1px solid rgba(248, 250, 252, 0.18);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35) !important;
}

html[data-theme="dark"] .referral-field label,
html[data-theme="dark"] .referral-widget__code-line {
  color: rgba(248, 250, 252, 0.85) !important;
}

html[data-theme="dark"] .referral-widget__code-pill {
  background: #1a1a1f !important;
  color: #ffffff !important;
  border: 1px solid rgba(248, 250, 252, 0.16);
}

html[data-theme="dark"] .referral-widget__email-actions input,
html[data-theme="dark"] .referral-field input,
html[data-theme="dark"] .referral-link-row input,
html[data-theme="dark"] .referral-widget__link-row input {
  background: #1a1a1f !important;
  border-color: rgba(248, 250, 252, 0.18) !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .referral-widget__email-actions input:focus,
html[data-theme="dark"] .referral-field input:focus,
html[data-theme="dark"] .referral-link-row input:focus {
  background: #24242a !important;
  border-color: rgba(129, 140, 248, 0.45) !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25) !important;
}

html[data-theme="dark"] .referral-btn--ghost {
  background: #1a1a1f !important;
  color: #ffffff !important;
  border: 1px solid rgba(248, 250, 252, 0.2) !important;
}

html[data-theme="dark"] .referral-btn--ghost:hover {
  background: #24242a !important;
}

html[data-theme="dark"] .referral-stat {
  background: #121212 !important;
  border-color: rgba(248, 250, 252, 0.12) !important;
}

html[data-theme="dark"] .referral-stat:hover {
  background: #1a1a1f !important;
  border-color: rgba(129, 140, 248, 0.28) !important;
}

html[data-theme="dark"] .referral-stat strong {
  color: #ffffff !important;
}

html[data-theme="dark"] .referral-stat span {
  color: rgba(248, 250, 252, 0.72) !important;
}

html[data-theme="dark"] .referral-widget__stats .referral-stat::before {
  background-color: rgba(99, 102, 241, 0.22) !important;
}

html[data-theme="dark"] .referral-widget__stats .referral-stat:nth-child(3)::before {
  background-color: rgba(217, 119, 6, 0.22) !important;
}

html[data-theme="dark"] .referral-widget__stats .referral-stat:nth-child(4)::before {
  background-color: rgba(5, 150, 105, 0.22) !important;
}

html[data-theme="dark"] .referral-history__empty {
  background: #121212 !important;
  border-color: rgba(248, 250, 252, 0.14) !important;
  color: rgba(248, 250, 252, 0.78) !important;
}

html[data-theme="dark"] .referral-history__table-wrap {
  background: #121212 !important;
  border-color: rgba(248, 250, 252, 0.12) !important;
}

html[data-theme="dark"] .referral-history__table th {
  background: #1a1a1f !important;
  color: rgba(248, 250, 252, 0.72) !important;
}

html[data-theme="dark"] .referral-history__table td {
  color: #ffffff !important;
  border-bottom-color: rgba(248, 250, 252, 0.08) !important;
}

html[data-theme="dark"] .referral-history__table tbody tr:hover td {
  background: rgba(99, 102, 241, 0.1) !important;
}

html[data-theme="dark"] .referral-history__email {
  color: rgba(248, 250, 252, 0.65) !important;
}

html[data-theme="dark"] .referral-status.is-ok {
  background: rgba(5, 150, 105, 0.2) !important;
  color: #6ee7b7 !important;
}

html[data-theme="dark"] .referral-status.is-error {
  background: rgba(127, 29, 29, 0.35) !important;
  color: #fecaca !important;
}

html[data-theme="dark"] .ref-cta-band {
  background: linear-gradient(135deg, #1e1b4b 0%, #0f172a 55%, #0a0a0a 100%) !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .ref-cta-band p {
  color: rgba(248, 250, 252, 0.82) !important;
}

html[data-theme="dark"] .ref-section__eyebrow {
  color: #a5b4fc !important;
}

html[data-theme="dark"] .referral-link-row input::placeholder,
html[data-theme="dark"] .referral-field input::placeholder {
  color: rgba(248, 250, 252, 0.42) !important;
}

html[data-theme="dark"] .referral-payout {
  background: linear-gradient(165deg, #1a1a2e 0%, #121212 55%, #0f0f12 100%) !important;
  border-color: rgba(129, 140, 248, 0.28) !important;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35) !important;
}

html[data-theme="dark"] .referral-payout__eyebrow {
  color: #a5b4fc !important;
}

html[data-theme="dark"] .referral-payout__title,
html[data-theme="dark"] .referral-payout__option-body strong {
  color: #ffffff !important;
}

html[data-theme="dark"] .referral-payout__lead,
html[data-theme="dark"] .referral-payout__option-body small,
html[data-theme="dark"] .referral-payout__note {
  color: rgba(248, 250, 252, 0.72) !important;
}

html[data-theme="dark"] .referral-payout__form {
  background: #1a1a1f !important;
  border-color: rgba(248, 250, 252, 0.12) !important;
}

html[data-theme="dark"] .referral-payout__option {
  background: #1a1a1f !important;
  border-color: rgba(248, 250, 252, 0.14) !important;
}

html[data-theme="dark"] .referral-payout__option:hover {
  background: #24242a !important;
}

html[data-theme="dark"] .referral-payout__option:has(input:checked) {
  border-color: rgba(129, 140, 248, 0.55) !important;
  background: #1e1b4b !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.22) !important;
}

html[data-theme="dark"] .referral-payout__icon {
  background: #24242a !important;
  color: rgba(248, 250, 252, 0.85) !important;
}

html[data-theme="dark"] .referral-payout__status.is-error {
  background: rgba(127, 29, 29, 0.35) !important;
  color: #fecaca !important;
  border-color: rgba(248, 113, 113, 0.35) !important;
}

html[data-theme="dark"] .referral-payout__status.is-pending {
  background: rgba(49, 46, 129, 0.45) !important;
  color: #c7d2fe !important;
  border-color: rgba(129, 140, 248, 0.35) !important;
}

html[data-theme="dark"] .referral-payout__detail.is-error input {
  border-color: #f87171 !important;
  background: rgba(127, 29, 29, 0.25) !important;
}

html[data-theme="dark"] .referral-payout__saved {
  background: rgba(5, 150, 105, 0.15) !important;
  color: #6ee7b7 !important;
  border-color: rgba(52, 211, 153, 0.25) !important;
}
