/* Referral programme page (public website).
   Builds on the tokens defined in index.css (:root) - do not redefine brand colours here.
   Only the turquoise success accent is introduced as a local token because index.css
   has no success variable; the value matches --success-color from the backend style guide. */
.referral-page {
  --referral-success: #1bc5bd;
}

/* 1. Hero -------------------------------------------------------------- */
.referral-hero {
  position: relative;
  /* The generous bottom padding is the runway the benefits bar overlaps into,
     so the bar sits on the hero band without covering the hero content. */
  padding-block: clamp(2.4rem, 5.5vw, 4.2rem) clamp(5.5rem, 9vw, 8rem);
  background: linear-gradient(180deg, var(--color-surface-soft) 0%, #fff 92%);
  overflow: hidden;
}
.referral-hero::before,
.referral-hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}
.referral-hero::before {
  width: 300px;
  height: 300px;
  left: -140px;
  bottom: 14%;
  background: color-mix(in srgb, var(--brand-blue) 18%, transparent);
}
.referral-hero::after {
  width: 340px;
  height: 340px;
  right: -150px;
  top: 6%;
  background: color-mix(in srgb, var(--brand-purple-light) 16%, transparent);
}
.referral-hero > .site-container {
  position: relative;
  z-index: 1;
}
.referral-hero__grid {
  align-items: center;
  gap: clamp(2.5rem, 6vw, 5.5rem);
}

/* 2. Hero copy --------------------------------------------------------- */
.referral-hero__content {
  max-width: 620px;
}
.referral-eyebrow {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin: 0 0 1.25rem;
  flex-wrap: wrap;
}
.referral-eyebrow__badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: var(--color-primary);
  color: var(--color-white);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.4;
}
.referral-eyebrow__text {
  color: var(--color-primary);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  line-height: 1.4;
}
.referral-headline__accent {
  color: var(--color-primary);
}
.referral-hero__lead {
  margin: 1.375rem 0 0;
  max-width: 30rem;
  color: var(--color-text);
  font-size: 1.0625rem;
  line-height: 1.6;
}
.referral-hero__lead strong {
  color: var(--color-heading);
  font-weight: 700;
}

/* 3. Bonus figure ------------------------------------------------------ */
.referral-bonus {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.75rem;
}
.referral-bonus__amount {
  color: var(--color-heading);
  font-size: clamp(1.9rem, 3vw, 2.4rem);
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1;
  white-space: nowrap;
}
.referral-bonus__label {
  margin: 0;
  padding-left: 1rem;
  border-left: 1px solid var(--color-border);
  color: var(--color-muted);
  font-size: 0.875rem;
  line-height: 1.45;
}

/* 4. Actions ----------------------------------------------------------- */
.referral-actions {
  margin-top: 1.75rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.referral-actions__link {
  color: var(--color-heading);
  font-size: 0.9375rem;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 6px;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--color-border);
  transition: color 160ms ease, text-decoration-color 160ms ease;
}
.referral-actions__link:hover {
  color: var(--color-primary);
  text-decoration-color: var(--color-primary);
}
.referral-hero__note {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 1.125rem 0 0;
  color: var(--color-muted);
  font-size: 0.8125rem;
  line-height: 1.5;
}
.referral-hero__note i {
  color: var(--referral-success);
  font-size: 0.75rem;
}

/* 5. Hero visual with floating status cards ---------------------------- */
.referral-hero__visual {
  position: relative;
  display: flex;
  justify-content: center;
}
.referral-figure {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0;
  padding: 0.75rem;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-md);
}
.referral-figure__media {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3.4;
  object-fit: cover;
  border-radius: 22px;
}
/* Placeholder shown until the real photo is dropped into wwwroot/assets/referral/ */
.referral-figure__placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #eef4fb 0%, #e2ebf6 100%);
  color: var(--color-muted);
  font-size: 0.875rem;
  text-align: center;
}
.referral-figure__placeholder i {
  font-size: 2.25rem;
  opacity: 0.35;
}

.referral-status {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius-md);
  background: var(--color-white);
  box-shadow: 0 10px 28px rgba(38, 51, 103, 0.16);
}
.referral-status--registered {
  top: 12%;
  left: -1.25rem;
}
.referral-status--credit {
  bottom: 12%;
  right: -1.25rem;
}
.referral-status__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 8px;
  font-size: 0.8125rem;
}
.referral-status--registered .referral-status__icon {
  background: color-mix(in srgb, var(--color-primary) 12%, transparent);
  color: var(--color-primary);
}
.referral-status--credit .referral-status__icon {
  background: color-mix(in srgb, var(--referral-success) 14%, transparent);
  color: var(--referral-success);
}
.referral-status__text {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  line-height: 1.2;
}
.referral-status__label {
  color: var(--color-muted);
  font-size: 0.6875rem;
}
.referral-status__value {
  color: var(--color-heading);
  font-size: 0.875rem;
  font-weight: 700;
}
.referral-status__dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  margin-left: 0.25rem;
  border-radius: 50%;
  background: var(--referral-success);
}

/* 6. Overlapping benefits bar ------------------------------------------ */
.referral-benefits {
  position: relative;
  z-index: 2;
  /* Negative margin pulls the bar up so it overlaps the hero, as in the design. */
  margin-top: clamp(-4.5rem, -5vw, -2.5rem);
  padding-bottom: var(--section-space);
}
.referral-benefits__bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  padding: 1.75rem clamp(1.5rem, 3vw, 2.5rem);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-white);
  box-shadow: var(--shadow-md);
}
.referral-benefit {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding-left: clamp(1rem, 2vw, 2rem);
  border-left: 1px solid var(--color-border);
}
.referral-benefit:first-child {
  padding-left: 0;
  border-left: 0;
}
.referral-benefit__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--color-primary) 10%, transparent);
  color: var(--color-primary);
  font-size: 1rem;
}
.referral-benefit__title {
  margin: 0;
  color: var(--color-heading);
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.35;
}
.referral-benefit__text {
  margin: 0.125rem 0 0;
  color: var(--color-muted);
  font-size: 0.8125rem;
  line-height: 1.45;
}

/* 7. Requirements section ----------------------------------------------- */
.referral-requirements {
  padding-block: var(--section-space);
  background: var(--color-surface-soft);
}
.referral-requirements__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(3rem, 7vw, 7rem);
  align-items: start;
}
.referral-requirements__eyebrow {
  margin: 0 0 1.25rem;
  color: var(--color-primary);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  line-height: 1.4;
}
.referral-requirements__headline {
  margin: 0;
  color: var(--color-heading);
  font-size: clamp(2.2rem, 4.2vw, 3.9rem);
  font-weight: 750;
  line-height: 1.06;
  letter-spacing: -0.045em;
}
.referral-requirements__text {
  margin: 1.375rem 0 0;
  max-width: 28rem;
  color: var(--color-text);
  font-size: 1.0625rem;
  line-height: 1.6;
}
.referral-info-box {
  margin-top: 2.5rem;
  padding: 1.5rem 1.75rem;
  border-left: 4px solid var(--color-primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background: var(--color-white);
  box-shadow: var(--shadow-sm);
  max-width: 28rem;
}
.referral-info-box__title {
  margin: 0 0 0.5rem;
  color: var(--color-heading);
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.35;
}
.referral-info-box__text {
  margin: 0;
  color: var(--color-text);
  font-size: 0.9375rem;
  line-height: 1.6;
}
.referral-requirements__card {
  padding: 1.75rem 2rem;
  border-radius: var(--radius-lg);
  background: var(--color-white);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
}
.referral-requirements__card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
}
.referral-requirements__card-title {
  margin: 0;
  color: var(--color-heading);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.35;
}
.referral-requirements__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--referral-success) 10%, transparent);
  color: var(--referral-success);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}
.referral-requirements__badge i {
  font-size: 0.625rem;
}
.referral-requirements__list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.referral-requirements__item {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
}
.referral-requirements__item-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--referral-success) 14%, transparent);
  color: var(--referral-success);
  font-size: 0.75rem;
  margin-top: 0.125rem;
}
.referral-requirements__item-title {
  margin: 0 0 0.25rem;
  color: var(--color-heading);
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.35;
}
.referral-requirements__item-text {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.8125rem;
  line-height: 1.45;
}
.referral-requirements__footer {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
  color: var(--color-muted);
  font-size: 0.75rem;
  line-height: 1.5;
}

/* 8. FAQ accordion ------------------------------------------------------ */
.referral-faq {
  padding-block: var(--section-space);
  background: var(--color-page);
}
.referral-faq__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(3rem, 7vw, 7rem);
  align-items: start;
}
.referral-faq__copy {
  position: sticky;
  top: var(--header-offset);
}
.referral-faq__eyebrow {
  margin: 0 0 1.25rem;
  color: var(--color-primary);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  line-height: 1.4;
}
.referral-faq__headline {
  margin: 0;
  color: var(--color-heading);
  font-size: clamp(2.2rem, 4.2vw, 3.9rem);
  font-weight: 750;
  line-height: 1.06;
  letter-spacing: -0.045em;
}
.referral-faq__text {
  margin: 1.375rem 0 0;
  max-width: 28rem;
  color: var(--color-text);
  font-size: 1.0625rem;
  line-height: 1.6;
}

/* Override Bootstrap accordion defaults to match the clean design */
.referral-faq .accordion-item {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--color-border);
}
.referral-faq .accordion-item:first-of-type {
  border-top: 1px solid var(--color-border);
}
.referral-faq .accordion-button {
  padding: 1.25rem 0;
  background: transparent;
  color: var(--color-heading);
  font-size: 1rem;
  font-weight: 700;
  box-shadow: none;
  line-height: 1.35;
  gap: 1rem;
}
.referral-faq .accordion-button::after {
  /* Replace Bootstrap chevron with a custom plus/minus via CSS */
  content: "+";
  background-image: none;
  width: auto;
  height: auto;
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--color-primary);
  transition: transform 200ms ease;
  flex-shrink: 0;
  margin-left: auto;
}
.referral-faq .accordion-button:not(.collapsed)::after {
  content: "\00d7"; /* multiplication sign */
  transform: none;
  color: var(--color-primary);
}
.referral-faq .accordion-button:focus {
  box-shadow: none;
  border-color: transparent;
}
.referral-faq .accordion-body {
  padding: 0 0 1.25rem 0;
  color: var(--color-text);
  font-size: 1rem;
  line-height: 1.6;
}

/* 9. Steps section ------------------------------------------------------ */
.referral-steps {
  padding-bottom: var(--section-space);
  background: var(--color-page);
}
.referral-steps__header {
  text-align: center;
  max-width: 42rem;
  margin: 0 auto 3.5rem;
}
.referral-steps__eyebrow {
  margin: 0 0 1rem;
  color: var(--color-primary);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  line-height: 1.4;
}
.referral-steps__headline {
  margin: 0;
  color: var(--color-heading);
  font-size: clamp(2rem, 3.5vw, 3.2rem);
  font-weight: 750;
  line-height: 1.12;
  letter-spacing: -0.035em;
}
.referral-steps__text {
  margin: 1rem auto 0;
  max-width: 34rem;
  color: var(--color-text);
  font-size: 1.0625rem;
  line-height: 1.6;
}
.referral-steps__grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 1rem;
  align-items: stretch;
}
.referral-step {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-white);
  box-shadow: var(--shadow-sm);
}
.referral-step__number {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  color: var(--color-muted);
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1;
}
.referral-step__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--color-primary) 10%, transparent);
  color: var(--color-primary);
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
}
.referral-step__title {
  margin: 0 0 0.625rem;
  color: var(--color-heading);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.35;
}
.referral-step__text {
  margin: 0;
  color: var(--color-text);
  font-size: 0.9375rem;
  line-height: 1.6;
}

/* Arrow between step cards (desktop only) */
.referral-step + .referral-step-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  font-size: 1.25rem;
  align-self: center;
  padding: 0;
  border: none;
  background: transparent;
}
.referral-step-arrow i {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--color-primary) 8%, transparent);
  color: var(--color-primary);
  font-size: 0.875rem;
}

/* 10. Responsive -------------------------------------------------------- */
@media (max-width: 991px) {
  .referral-hero__grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .referral-hero__content {
    max-width: 100%;
    order: 1;
  }
  .referral-hero__visual {
    order: 2;
  }
  .referral-figure {
    max-width: 440px;
  }
  .referral-status--registered {
    left: 0;
  }
  .referral-status--credit {
    right: 0;
  }
  .referral-benefits {
    margin-top: -2.5rem;
  }
  .referral-benefits__bar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 1.5rem;
  }
}

@media (max-width: 767px) {
  .referral-benefits__bar {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
  }
  .referral-benefit {
    padding-left: 0;
    padding-top: 1.25rem;
    border-left: 0;
    border-top: 1px solid var(--color-border);
  }
  .referral-benefit:first-child {
    padding-top: 0;
    border-top: 0;
  }
  .referral-requirements__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5rem;
  }
  .referral-info-box {
    max-width: 100%;
  }
  .referral-faq__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5rem;
  }
  .referral-faq__copy {
    position: static;
  }
  .referral-steps__grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .referral-step-arrow {
    display: none !important;
  }
}

@media (max-width: 575px) {
  .referral-bonus {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  .referral-bonus__label {
    padding-left: 0;
    border-left: 0;
  }
  .referral-actions {
    align-items: flex-start;
    flex-direction: column;
    gap: 1rem;
  }
  .referral-actions .btn-brand {
    width: 100%;
  }
  .referral-status--registered,
  .referral-status--credit {
    position: static;
    width: fit-content;
    max-width: 100%;
  }
  .referral-figure {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }
  .referral-status--credit {
    align-self: flex-end;
  }
}
