.referral-page {
  background:
    linear-gradient(180deg, #071122 0, #0d1a31 1180px, #f7fbff 1181px),
    var(--paper);
}

.referral-header {
  margin-bottom: 0;
}

.referral-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(390px, 0.78fr);
  gap: 54px;
  width: min(calc(100% - 36px), var(--max));
  min-height: 760px;
  margin: 0 auto;
  padding: 172px 0 90px;
  color: #f8fafc;
}

.referral-copy {
  align-self: center;
}

.referral-copy h1 {
  max-width: 780px;
  margin-bottom: 24px;
  font-size: clamp(3.8rem, 7vw, 6.9rem);
  line-height: 0.9;
  letter-spacing: 0;
}

.referral-lede {
  max-width: 650px;
  margin-bottom: 34px;
  color: #dbeafe;
  font-size: 1.2rem;
  line-height: 1.7;
}

.referral-points {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 790px;
}

.referral-points div,
.earnings-card,
.builder-panel,
.dashboard-shell,
.step-grid article,
.referral-final {
  border: 1px solid rgba(191, 219, 254, 0.24);
  box-shadow: 0 28px 70px rgba(2, 6, 23, 0.22);
}

.referral-points div {
  min-height: 150px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(12px);
}

.referral-points span {
  display: block;
  margin-bottom: 10px;
  color: #67e8f9;
  font-size: 1.75rem;
  line-height: 1;
  font-weight: 950;
}

.referral-points strong,
.card-heading h2,
.builder-copy h2,
.dashboard-topline h3,
.stat-card strong,
.payout-card strong {
  color: #ffffff;
}

.referral-points strong {
  display: block;
  margin-bottom: 8px;
  font-weight: 950;
}

.referral-points p {
  margin: 0;
  color: #bfd5ee;
  font-size: 0.91rem;
}

.earnings-card {
  align-self: center;
  padding: 28px;
  border-radius: 28px;
  background:
    linear-gradient(145deg, rgba(15, 31, 56, 0.92), rgba(10, 20, 38, 0.96)),
    var(--navy);
}

.card-heading,
.dashboard-topline,
.chart-heading,
.range-control span,
.estimate-output,
.share-box div {
  display: flex;
  align-items: center;
}

.card-heading,
.dashboard-topline,
.estimate-output {
  justify-content: space-between;
  gap: 16px;
}

.card-heading {
  margin-bottom: 28px;
}

.card-heading h2 {
  margin: 0;
  font-size: 1.55rem;
}

.card-heading span,
.chart-heading span {
  color: #93c5fd;
  font-size: 0.82rem;
  font-weight: 950;
  text-transform: uppercase;
}

.range-control {
  display: grid;
  gap: 12px;
  margin-bottom: 24px;
}

.range-control span {
  justify-content: space-between;
  gap: 18px;
  color: #cbd5e1;
}

.range-control output {
  color: #ffffff;
  font-size: 1.35rem;
  font-weight: 950;
}

.range-control input[type="range"] {
  width: 100%;
  height: 16px;
  border: 1px solid rgba(147, 197, 253, 0.36);
  border-radius: 999px;
  outline: 0;
  appearance: none;
  background:
    linear-gradient(90deg, #60a5fa var(--value, 50%), rgba(51, 65, 85, 0.9) 0);
}

.range-control input[type="range"]::-webkit-slider-thumb {
  width: 24px;
  height: 24px;
  border: 3px solid #0b1730;
  border-radius: 50%;
  appearance: none;
  background: #67e8f9;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.4);
}

.range-control input[type="range"]::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border: 3px solid #0b1730;
  border-radius: 50%;
  background: #67e8f9;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.4);
}

.estimate-output {
  margin: 30px 0 18px;
}

.estimate-output div {
  flex: 1;
  min-height: 112px;
  padding: 18px;
  border: 1px solid rgba(147, 197, 253, 0.22);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.55);
}

.estimate-output span,
.stat-card span,
.payout-card span {
  display: block;
  margin-bottom: 8px;
  color: #a7b7ca;
  font-size: 0.84rem;
  font-weight: 900;
}

.estimate-output strong {
  display: block;
  color: #ffffff;
  font-size: 2rem;
  line-height: 1;
}

.fine-print {
  margin: 0;
  color: #94a3b8;
  font-size: 0.88rem;
}

.referral-builder {
  padding-top: 46px;
}

.builder-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(360px, 0.72fr);
  gap: 42px;
  padding: 44px;
  border-color: #dbeafe;
  border-radius: 28px;
  background:
    linear-gradient(135deg, #ffffff 0%, #f3fbff 100%);
  box-shadow: 0 22px 54px rgba(15, 23, 42, 0.1);
}

.builder-copy h2,
.dashboard-section h2,
.how-it-works h2,
.referral-final h2 {
  color: var(--ink);
}

.builder-copy h2 {
  max-width: 620px;
  margin-bottom: 16px;
  font-size: 3rem;
  line-height: 1;
}

.builder-copy p,
.builder-copy li {
  color: var(--ink-soft);
}

.builder-copy ul {
  display: grid;
  gap: 12px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.builder-copy li {
  position: relative;
  padding-left: 26px;
}

.builder-copy li::before {
  content: "";
  position: absolute;
  top: 0.72em;
  left: 0;
  width: 13px;
  height: 3px;
  border-radius: 999px;
  background: #2dd4bf;
}

.code-form {
  display: grid;
  gap: 12px;
  padding: 22px;
  border: 1px solid #dbe7f5;
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.08);
}

.code-form label {
  color: #334155;
  font-weight: 900;
}

.code-form input {
  min-height: 50px;
  width: 100%;
  padding: 0 15px;
  border: 1px solid #cbddec;
  border-radius: 14px;
  background: #f8fbff;
  color: var(--ink);
  font: inherit;
  font-weight: 760;
}

.code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.button.small {
  min-height: 50px;
  padding: 10px 15px;
}

.button.full {
  width: 100%;
  margin-top: 8px;
}

.form-status {
  min-height: 24px;
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.form-status.is-error {
  color: #be123c;
}

.form-status.is-success {
  color: #0f766e;
}

.share-box {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid #bfdbfe;
  border-radius: 16px;
  background: #eff6ff;
}

.share-box span {
  color: #1e3a8a;
  font-size: 0.82rem;
  font-weight: 950;
  text-transform: uppercase;
}

.share-box div {
  gap: 10px;
}

.dashboard-section {
  padding-bottom: 58px;
}

.dashboard-shell {
  padding: 28px;
  border-color: #dbe7f5;
  border-radius: 28px;
  background: #0d1a31;
}

.dashboard-topline {
  margin-bottom: 22px;
}

.dashboard-topline h3 {
  margin-bottom: 4px;
  font-size: 1.4rem;
}

.dashboard-topline p {
  margin: 0;
  color: #a7b7ca;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.stat-card,
.chart-card,
.payout-card {
  border: 1px solid rgba(147, 197, 253, 0.18);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.62);
}

.stat-card {
  min-height: 150px;
  padding: 18px;
}

.stat-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 2.1rem;
  line-height: 1;
}

.stat-card small {
  color: #93a7bd;
}

.performance-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, 0.45fr);
  gap: 14px;
}

.chart-card,
.payout-card {
  padding: 20px;
}

.chart-heading {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  color: #ffffff;
}

.bar-chart {
  display: flex;
  align-items: end;
  gap: 10px;
  height: 190px;
  padding: 12px;
  border-radius: 16px;
  background:
    repeating-linear-gradient(
      to top,
      rgba(148, 163, 184, 0.1) 0,
      rgba(148, 163, 184, 0.1) 1px,
      transparent 1px,
      transparent 38px
    );
}

.bar-chart span {
  flex: 1;
  min-width: 16px;
  height: var(--h);
  border-radius: 999px 999px 8px 8px;
  background: linear-gradient(180deg, #67e8f9, #3b82f6);
}

.payout-card strong {
  display: block;
  margin-bottom: 12px;
  font-size: 1.6rem;
  line-height: 1.12;
}

.payout-card p {
  margin: 0;
  color: #a7b7ca;
}

.step-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.step-grid article {
  min-height: 250px;
  padding: 28px;
  border-color: #dbe7f5;
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 20px 46px rgba(15, 23, 42, 0.08);
}

.step-grid span {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 28px;
  border-radius: 16px;
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 950;
}

.step-grid h3 {
  margin-bottom: 12px;
  font-size: 1.45rem;
}

.step-grid p {
  color: var(--ink-soft);
}

.referral-final {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
  margin-bottom: 72px;
  padding: 44px;
  border-color: rgba(96, 165, 250, 0.32);
  border-radius: 28px;
  background:
    linear-gradient(120deg, #ffffff 0%, #eff6ff 100%);
  box-shadow: 0 22px 54px rgba(15, 23, 42, 0.1);
}

.referral-final h2 {
  max-width: 760px;
  margin-bottom: 10px;
  font-size: 2.4rem;
  line-height: 1.08;
}

.referral-final p {
  max-width: 740px;
  margin: 0;
  color: var(--ink-soft);
}

@media (max-width: 980px) {
  .referral-page {
    background:
      linear-gradient(180deg, #071122 0, #0d1a31 1040px, #f7fbff 1041px),
      var(--paper);
  }

  .referral-hero,
  .builder-panel,
  .performance-grid {
    grid-template-columns: 1fr;
  }

  .referral-hero {
    min-height: auto;
    padding-top: 96px;
  }

  .referral-points,
  .stat-grid,
  .step-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .referral-hero {
    width: min(calc(100% - 28px), var(--max));
    padding-bottom: 54px;
  }

  .referral-copy h1 {
    font-size: clamp(2.55rem, 12vw, 3.08rem);
    line-height: 0.98;
  }

  .referral-lede {
    font-size: 1.02rem;
  }

  .earnings-card,
  .builder-panel,
  .dashboard-shell,
  .referral-final {
    padding: 24px;
    border-radius: 20px;
  }

  .estimate-output,
  .dashboard-topline,
  .referral-final {
    align-items: stretch;
    flex-direction: column;
  }

  .builder-copy h2,
  .dashboard-section h2,
  .how-it-works h2,
  .referral-final h2 {
    font-size: 2.1rem;
  }

  .code-row,
  .share-box div {
    grid-template-columns: 1fr;
  }

  .referral-points div {
    min-height: 0;
  }
}
