/*
 * /refer-patient redesign (PAWC-384), from the Figma "Refer" frame.
 *
 * Everything is prefixed rp- and scoped under .rp-page so it can't reach other pages through
 * style.css's shared classes. The tokens sit on .rp-page; the 1100px column is .rp-container, so
 * the hero and the CTA band can be wider than it. Breakpoints: 1199 (tablet), 991 (two-column
 * sections stack) and 767 (phone).
 */

.rp-page {
  --rp-heading: #111827;
  --rp-text: #3f4a63;
  --rp-text-muted: #4b5875;
  --rp-text-dark: #1f2937;
  --rp-green: var(--bg-base-green, #10393e);
  --rp-green-hover: #0b2a2e;
  --rp-sage: var(--button-primary-bg, #5c7a5a);
  --rp-sage-hover: #4b6649;
  --rp-sage-light: #cfdccf;
  --rp-surface-badge: #e6ebe7;
  --rp-surface-card: #eaefe9;
  --rp-border: #dfe3df;
  --rp-white-84: rgba(255, 255, 255, 0.84);
  --rp-radius-xl: 22px;
  --rp-radius-lg: 18px;
  --rp-radius-md: 12px;

  font-family: var(--font-intel);
}

.rp-container {
  max-width: 1100px;
  margin-inline: auto;
}

.rp-section {
  margin-top: 120px;
}

/* :where() keeps these resets at zero specificity, so each component's own margin wins. */
:where(.rp-page) p {
  margin: 0;
}

:where(.rp-page) ul,
:where(.rp-page) ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.rp-icon {
  flex-shrink: 0;
}

/* DM Serif ships only weight 400; inside the 500-weight headings the browser would fake a bold.
   (style.css already sets its family and italic with !important.) */
.rp-page .dm-style-text {
  font-weight: 400;
}

/* ---------- Shared pieces ---------- */

.rp-badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--rp-surface-badge);
  color: var(--rp-green);
  font-size: 12px;
  font-weight: 500;
}

.rp-badge-dark {
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: transparent;
  color: #fff;
}

.rp-h2 {
  margin: 12px 0 0;
  color: var(--rp-heading);
  font-family: var(--font-intel);
  font-size: 38px;
  font-weight: 500;
  line-height: 48px;
  letter-spacing: -0.4px;
}

.rp-link {
  color: var(--rp-green);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.rp-link:hover {
  color: var(--rp-sage);
}

.rp-link-light,
.rp-link-light:hover {
  color: #fff;
}

.rp-link-light:hover {
  text-decoration-thickness: 2px;
}

.rp-page a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
  border-radius: 4px;
}

.rp-button {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.rp-button:hover,
.rp-button:focus-visible {
  color: #fff;
}

.rp-button-sage {
  min-height: 44px;
  padding: 0 26px;
  background: var(--rp-sage);
  font-size: 14.5px;
}

.rp-button-sage:hover,
.rp-button-sage:focus-visible {
  background: var(--rp-sage-hover);
}

.rp-button-dark {
  min-height: 42px;
  padding: 0 24px;
  background: var(--rp-green);
  font-size: 14px;
}

.rp-button-dark:hover,
.rp-button-dark:focus-visible {
  background: var(--rp-green-hover);
}

/* ---------- Hero ---------- */

.rp-hero {
  display: grid;
  grid-template-columns: minmax(0, 696fr) minmax(0, 680fr);
  max-width: 1376px;
  margin: 8px 32px 0;
  overflow: hidden;
  border-radius: var(--rp-radius-xl);
  background: var(--rp-green);
}

@media (min-width: 1440px) {
  .rp-hero {
    margin-inline: auto;
  }
}

.rp-hero-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 89px 48px;
}

.rp-hero-title {
  max-width: 580px;
  margin: 22px 0 0;
  color: #fff;
  font-family: var(--font-intel);
  font-size: 46px;
  font-weight: 500;
  line-height: 56px;
  letter-spacing: -0.5px;
}

.rp-hero-lead {
  max-width: 500px;
  margin-top: 25px;
  color: #fff;
  font-size: 17px;
  line-height: 27px;
}

.rp-hero-text {
  max-width: 500px;
  margin-top: 19px;
  color: var(--rp-white-84);
  font-size: 16px;
  line-height: 26px;
}

.rp-hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 29px;
}

.rp-hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 999px;
  color: #fff;
  font-size: 12.5px;
  font-weight: 500;
}

.rp-hero .rp-button {
  margin-top: 28px;
}

.rp-hero-media {
  position: relative;
  min-height: 100%;
}

.rp-hero-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}

/* ---------- Who can refer ---------- */

.rp-who {
  display: grid;
  grid-template-columns: minmax(0, 420px) minmax(0, 608px);
  justify-content: space-between;
  column-gap: 72px;
}

.rp-who-text {
  margin-top: 24px;
  color: var(--rp-text);
  font-size: 17px;
  line-height: 28px;
}

.rp-who-list-title {
  margin-top: 12px;
  color: var(--rp-text-dark);
  font-size: 17px;
  font-weight: 500;
  line-height: 28px;
}

.rp-who-list {
  margin-top: 24px;
  border-top: 1px solid var(--rp-border);
}

.rp-who-item {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 77px;
  padding: 12px 0;
  border-bottom: 1px solid var(--rp-border);
  color: var(--rp-green);
  font-size: 18px;
  font-weight: 500;
  line-height: 24px;
}

.rp-who-icon {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--rp-surface-badge);
  color: var(--rp-green);
}

/* ---------- Steps ---------- */

.rp-steps-section {
  margin-top: 130px;
}

.rp-steps-heading {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.rp-steps-heading .rp-h2 {
  margin-top: 30px;
}

.rp-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 44px;
}

.rp-step {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 30px 32px 0;
  border-radius: var(--rp-radius-lg);
  background: var(--rp-surface-card);
}

/* Sage on this surface is ~4.1:1, enough only for large text like these numbers. */
.rp-step-number {
  color: var(--rp-sage);
  font-family: var(--font-dm-serif);
  font-size: 42px;
  line-height: 44px;
}

.rp-step-title {
  margin: 14px 0 0;
  color: var(--rp-heading);
  font-family: var(--font-intel);
  font-size: 20px;
  font-weight: 600;
  line-height: 26px;
  letter-spacing: -0.2px;
}

.rp-step-text {
  margin-top: 12px;
  color: var(--rp-text);
  font-size: 15.5px;
  line-height: 24px;
}

.rp-step-image {
  display: block;
  width: calc(100% + 24px);
  height: auto;
  aspect-ratio: 502 / 230;
  margin: auto -12px 0;
  padding-top: 27px;
  box-sizing: content-box;
  object-fit: cover;
  border-radius: var(--rp-radius-md) var(--rp-radius-md) 0 0;
}

/* ---------- Why PAWC ---------- */

.rp-why {
  padding: 72px 64px 64px;
  border-radius: var(--rp-radius-xl);
  background: var(--rp-green);
}

.rp-why .rp-badge-dark {
  height: 26px;
  border-color: rgba(255, 255, 255, 0.55);
}

.rp-why-intro {
  display: grid;
  grid-template-columns: minmax(0, 400px) minmax(0, 512px);
  justify-content: space-between;
  column-gap: 64px;
}

.rp-why-title {
  margin-top: 18px;
  color: #fff;
}

.rp-why-title .dm-style-text {
  display: block;
}

.rp-why-lead {
  margin-top: 44px;
  color: #fff;
  font-size: 18px;
  line-height: 29px;
}

.rp-why-text {
  margin-top: 21px;
  color: var(--rp-white-84);
  font-size: 16.5px;
  line-height: 27px;
}

.rp-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 56px;
}

.rp-stat {
  display: flex;
  flex-direction: column;
  min-height: 293px;
  padding: 28px 26px 30px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--rp-radius-lg);
  background: rgba(255, 255, 255, 0.06);
}

.rp-stat-value {
  color: var(--rp-sage-light);
  font-size: 35px;
  font-weight: 500;
  line-height: 46px;
  letter-spacing: -0.8px;
}

.rp-stat-title {
  margin: 20px 0 0;
  color: #fff;
  font-family: var(--font-intel);
  font-size: 18px;
  font-weight: 600;
  line-height: 25px;
}

.rp-stat-text {
  margin-top: 12px;
  color: var(--rp-white-84);
  font-size: 15.5px;
  line-height: 24px;
}

.rp-stat-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: auto;
  padding-top: 20px;
  color: #fff;
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
}

.rp-stat-link:hover {
  color: #fff;
  text-decoration: underline;
}

/* ---------- Privacy ---------- */

.rp-privacy {
  display: grid;
  grid-template-columns: minmax(0, 544px) minmax(0, 500px);
  justify-content: space-between;
  column-gap: 56px;
  align-items: start;
}

.rp-privacy .rp-h2 {
  margin-top: 18px;
}

.rp-privacy-lead {
  margin-top: 16px;
  color: var(--rp-green);
  font-family: var(--font-dm-serif);
  font-size: 24px;
  line-height: 33px;
}

.rp-privacy-text {
  margin-top: 20px;
  color: var(--rp-text-dark);
  font-size: 17px;
  line-height: 28px;
}

.rp-privacy-note {
  margin-top: 25px;
  color: var(--rp-text-muted);
  font-size: 15.5px;
  line-height: 25px;
}

.rp-privacy-signoff {
  margin-top: 23px;
  color: var(--rp-text-dark);
  font-size: 15px;
  line-height: 23px;
}

.rp-privacy-signoff strong {
  font-weight: 600;
}

/* Sage text on white is ~4.8:1 (AA). */
.rp-hipaa {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  margin-top: 22px;
  padding: 0 12px;
  border: 1px solid var(--rp-border);
  border-radius: 8px;
  background: #fff;
  color: var(--rp-sage);
  font-size: 13px;
  font-weight: 500;
}

.rp-privacy-media img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 20px;
}

/* ---------- CTA band ---------- */

.rp-cta {
  display: grid;
  grid-template-columns: minmax(0, 455fr) minmax(0, 498fr);
  align-items: center;
  max-width: 1278px;
  margin: 120px 32px 0;
  padding: 80px 131px 80px 194px;
  border-radius: var(--rp-radius-xl);
  background: linear-gradient(90deg, #6a8462 0%, #4a6a58 40%, #10393e 100%);
}

/* Same 32px side margins as the hero until the band reaches its max width (1278 + 64). */
@media (min-width: 1342px) {
  .rp-cta {
    margin-inline: auto;
  }
}

.rp-cta-title {
  margin: 0;
  color: #fff;
  font-family: var(--font-intel);
  font-size: 32px;
  font-weight: 500;
  line-height: 40px;
  letter-spacing: -0.3px;
}

.rp-cta-title .dm-style-text {
  display: block;
}

.rp-cta-body p {
  margin-bottom: 20px;
  color: #fff;
  font-size: 16.5px;
  line-height: 26px;
}

/* ---------- FAQ ---------- */

.rp-faq {
  display: grid;
  grid-template-columns: minmax(0, 380px) minmax(0, 664px);
  justify-content: space-between;
  column-gap: 56px;
  align-items: start;
  margin-bottom: 110px;
}

.rp-faq .rp-h2 {
  max-width: 300px;
}

.rp-faq-list .accordion-item {
  margin-bottom: 12px;
  overflow: hidden;
  border: 0;
  border-radius: var(--rp-radius-md);
  background: #fff;
}

.rp-faq-list .accordion-item:last-child {
  margin-bottom: 0;
}

.rp-faq-list .accordion-header {
  margin: 0;
}

/* style.css gives .customfaq-button a 20px bottom margin the design doesn't have. */
.customfaq-button.rp-faq-list {
  margin-bottom: 0;
}

.customfaq-button.rp-faq-list button.accordion-button,
.customfaq-button.rp-faq-list button.accordion-button.collapsed,
.customfaq-button.rp-faq-list .accordion-button:not(.collapsed) {
  min-height: 64px;
  padding: 20px 22px;
  border-radius: 0 !important;
  background: #fff;
  color: var(--rp-heading);
  font-size: 16.5px;
  line-height: 24px;
}

/* The +/- icons are the sitewide ones (style.css), only resized, as on /find-your-provider. */
.rp-faq-list .accordion-button::after {
  width: 18px;
  height: 18px;
  background-size: 18px;
}

.rp-faq-list .accordion-button:not(.collapsed)::after {
  transform: none;
}

.rp-faq-list .accordion-button:focus-visible {
  outline: 2px solid var(--rp-green);
  outline-offset: -2px;
}

.customfaq-button.rp-faq-list .accordion-body {
  padding: 0 22px 22px;
  color: var(--rp-text);
  font-size: 16px;
  line-height: 26px;
}

/* ---------- Tablet ---------- */

@media (max-width: 1199px) {
  .rp-container {
    margin-inline: 32px;
  }

  .rp-hero-content {
    padding: 64px 40px;
  }

  .rp-hero-title {
    font-size: 40px;
    line-height: 48px;
  }

  .rp-who,
  .rp-privacy,
  .rp-faq {
    column-gap: 40px;
  }

  .rp-who {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  }

  .rp-privacy {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  }

  .rp-faq {
    grid-template-columns: minmax(0, 0.6fr) minmax(0, 1fr);
  }

  .rp-why {
    padding: 56px 40px 40px;
  }

  .rp-why-intro {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    column-gap: 40px;
  }

  .rp-cta {
    padding: 64px 56px;
    column-gap: 48px;
  }
}

@media (max-width: 991px) {
  .rp-hero,
  .rp-who,
  .rp-privacy,
  .rp-faq,
  .rp-why-intro,
  .rp-cta {
    grid-template-columns: minmax(0, 1fr);
  }

  .rp-hero-media {
    aspect-ratio: 4 / 3;
  }

  .rp-hero-media img {
    object-position: center 35%;
  }

  .rp-who-list-wrap,
  .rp-privacy-media,
  .rp-faq-list,
  .rp-cta-body {
    margin-top: 32px;
  }

  .rp-privacy-media {
    max-width: 500px;
  }

  .rp-why-lead {
    margin-top: 24px;
  }

  .rp-stats {
    grid-template-columns: minmax(0, 1fr);
  }

  .rp-stat {
    min-height: 0;
  }

  .rp-faq .rp-h2 {
    max-width: none;
  }
}

/* ---------- Phone ---------- */

@media (max-width: 767px) {
  .rp-section,
  .rp-steps-section,
  .rp-cta {
    margin-top: 72px;
  }

  .rp-container,
  .rp-cta {
    margin-inline: 16px;
  }

  .rp-hero {
    margin-inline: 16px;
    border-radius: var(--rp-radius-lg);
  }

  .rp-hero-content {
    padding: 40px 24px;
  }

  .rp-hero-title {
    font-size: 34px;
    line-height: 42px;
  }

  .rp-h2 {
    font-size: 30px;
    line-height: 38px;
  }

  .rp-who-item {
    font-size: 16px;
    min-height: 64px;
  }

  .rp-steps {
    grid-template-columns: minmax(0, 1fr);
  }

  .rp-step {
    padding: 24px 20px 0;
  }

  .rp-step-image {
    width: calc(100% + 16px);
    margin-inline: -8px;
  }

  .rp-why {
    padding: 40px 20px 20px;
    border-radius: var(--rp-radius-lg);
  }

  .rp-stats {
    margin-top: 32px;
  }

  .rp-cta {
    padding: 40px 24px;
    border-radius: var(--rp-radius-lg);
  }

  .rp-cta-title {
    font-size: 28px;
    line-height: 36px;
  }

  .rp-faq {
    margin-bottom: 72px;
  }
}

/* Windows high-contrast: the dark panels lose their background, keep the outlines. */
@media (forced-colors: active) {
  .rp-hero,
  .rp-why,
  .rp-stat,
  .rp-cta,
  .rp-step,
  .rp-badge,
  .rp-faq-list .accordion-item {
    border: 1px solid CanvasText;
  }

  /* Without their fill the pill links read as plain text; outline them like the navbar's. */
  .rp-button {
    border: 1px solid LinkText;
  }
}
