:root {
  --fe-referral-purple: #69427b;
  --fe-referral-purple-dark: #260841;
  --fe-referral-purple-mid: #69427b;
  --fe-referral-purple-deep: #543064;
  --fe-referral-teal: #00B5C8;
  --fe-referral-pink: #E40F74;
  --fe-referral-teal-dark: #009bac;
  --fe-referral-lilac: #f5effa;
  --fe-referral-ink: #27222d;
  --fe-referral-border: #e6dfea;
}

.page-template-referral-campaign .page-header,
.page-template-referral-campaign #subnav-wrapper {
  display: none;
}

.page-template-referral-campaign #main {
  background: #faf9fb;
  padding: 0;
}

.fe-referral-campaign {
  padding: 22px 16px 54px;
}

.fe-referral-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.fe-referral-hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(90deg, var(--fe-referral-purple-mid) 63.426%, var(--fe-referral-purple-deep) 111.61%);
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(38, 8, 65, .16);
  max-width: 1128px;
  margin: 0 auto;
}

.fe-referral-hero::after {
  position: absolute;
  bottom: -52px;
  right: -29px;
  z-index: 1;
  width: 491px;
  height: 327px;
  min-height: 240px;
  content: "";
  background-image: var(--fe-referral-hero-photo);
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: contain;
  filter: drop-shadow(0 0 30px rgba(0, 0, 0, .15));
  pointer-events: none;
}

.fe-referral-hero__deco {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  width: 130px;
  height: 100%;
  pointer-events: none;
}

.fe-referral-hero__ellipse {
  position: absolute;
  top: 50%;
  left: -184px;
  width: 314px;
  height: 314px;
  content: "";
  background: var(--fe-referral-teal);
  border-radius: 50%;
  transform: translateY(-50%);
}

.fe-referral-hero__diapers {
  position: absolute;
  top: 50%;
  left: -64px;
  z-index: 2;
  width: 241px;
  height: auto;
  object-fit: contain;
  transform: translateY(calc(-50% - 3.5px));
  filter: drop-shadow(0 4px 30px rgba(0, 0, 0, .15));
}

img.fe-referral-hero__diapers {
  max-width: none;
}

.fe-referral-hero__content {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  min-height: 284px;
  padding: 24px 300px 24px 197px;
}

.fe-referral-hero h1 {
  margin: 0;
  font-size: clamp(28px, 3.2vw, 40px);
  font-weight: 700;
  line-height: 1.1;
  color: #fff;
  letter-spacing: -0.5px;
  overflow-wrap: break-word;
  word-break: break-word;
  text-transform: capitalize;
  max-width: 591px;
}

.fe-referral-hero__copy p {
  margin: 0;
  font-size: clamp(18px, 1.55vw, 20px);
  line-height: 1.4;
  letter-spacing: -0.5px;
  overflow-wrap: break-word;
  word-break: break-word;
}

.fe-referral-hero__copy p + p {
  margin-top: 0;
}

.fe-referral-hero .fe-referral-accent {
  font-weight: 700;
  color: var(--fe-referral-teal);
}

.fe-referral-hero__reward {
  display: flex;
  gap: 12px;
  align-items: center;
  max-width: 591px;
}

.fe-referral-hero__reward-icon {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
}

.fe-referral-hero__reward p {
  margin: 0;
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: -0.5px;
  overflow-wrap: break-word;
  word-break: break-word;
}

.fe-referral-reward-accent {
  font-weight: 700;
}

.fe-referral-form-card {
  width: min(760px, calc(100% - 32px));
  min-height: 530px;
  padding: 30px 34px 24px;
  margin: 18px auto 0;
  background: #fff;
  border: 1px solid var(--fe-referral-border);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(55, 16, 100, .08);
}

.fe-referral-form-card .gform_wrapper {
  margin: 0;
}

.fe-referral-form-card .gform_heading {
  display: none;
}

.fe-referral-form-card .gform_confirmation_message {
  text-align: center;
}

/* Custom three-step progress indicator generated from the GF page state. */
.fe-referral-form-card .gf_progressbar_wrapper {
  display: none;
}

.fe-referral-steps {
  padding: 0 0 22px;
  margin: 0 0 24px;
  border-bottom: 1px solid var(--fe-referral-border);
}

.fe-referral-steps ol {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 0;
  margin: 0;
  list-style: none;
}

.fe-referral-steps li {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 7px;
  align-items: center;
  margin: 0;
}

.fe-referral-steps li:not(:last-child)::after {
  position: absolute;
  top: 13px;
  left: calc(50% + 17px);
  width: calc(100% - 34px);
  height: 2px;
  content: "";
  background: #d8d3dc;
}

.fe-referral-step__number {
  position: relative;
  z-index: 2;
  display: grid;
  width: 28px;
  height: 28px;
  font-size: 13px;
  font-weight: 700;
  color: #736d77;
  background: #ded9e2;
  border-radius: 50%;
  place-items: center;
}

.fe-referral-step__label {
  font-size: 10px;
  font-weight: 700;
  line-height: 1.15;
  color: #635c67;
  text-align: center;
  text-transform: uppercase;
}

.fe-referral-steps li.is-active .fe-referral-step__number,
.fe-referral-steps li.is-complete .fe-referral-step__number {
  color: #fff;
  background: var(--fe-referral-teal);
}

.fe-referral-steps li.is-active .fe-referral-step__label {
  color: var(--fe-referral-teal);
}

.fe-referral-steps li.is-complete:not(:last-child)::after {
  background: var(--fe-referral-teal);
}

/* Gravity Forms multipage steps */
.fe-referral-form-card .gf_page_steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 0 0 22px;
  margin: 0 0 24px;
  border: 0;
}

.fe-referral-form-card .gf_step {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  margin: 0;
  opacity: 1;
}

.fe-referral-form-card .gf_step:not(:last-child)::after {
  position: absolute;
  top: 13px;
  left: calc(50% + 18px);
  width: calc(100% - 36px);
  height: 2px;
  content: "";
  background: #ded9e2;
}

.fe-referral-form-card .gf_step_number {
  position: relative;
  z-index: 2;
  display: grid;
  width: 28px;
  height: 28px;
  padding: 0;
  font-size: 13px;
  font-weight: 700;
  color: #79727e;
  background: #ded9e2;
  border: 0;
  border-radius: 50%;
  place-items: center;
}

.fe-referral-form-card .gf_step_active .gf_step_number,
.fe-referral-form-card .gf_step_completed .gf_step_number {
  color: #fff;
  background: var(--fe-referral-teal);
}

.fe-referral-form-card .gf_step_label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  color: #5f5864;
  text-align: center;
  text-transform: uppercase;
}

.fe-referral-form-card .gf_step_active .gf_step_label {
  color: var(--fe-referral-teal);
}

/* Form typography and controls */
.fe-referral-form-card .gform_fields {
  gap: 16px 20px;
}

.fe-referral-form-card .gfield_label,
.fe-referral-form-card .gform-field-label {
  margin-bottom: 5px;
  font-size: 14px;
  font-weight: 700;
  color: var(--fe-referral-ink);
}

.fe-referral-form-card .gfield_required {
  color: var(--fe-referral-pink);
}

.fe-referral-form-card input[type="text"],
.fe-referral-form-card input[type="email"],
.fe-referral-form-card input[type="tel"],
.fe-referral-form-card select,
.fe-referral-form-card textarea {
  min-height: 46px;
  padding: 10px 12px;
  font-size: 16px;
  color: var(--fe-referral-ink);
  background: #fff;
  border: 1px solid #d8d1dc;
  border-radius: 5px;
  box-shadow: none;
}

.fe-referral-form-card select.gfield_select {
  height: 46px;
  padding: 0 46px 0 14px !important;
  line-height: 44px;
  text-align: left;
  background-color: #fff !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='8' viewBox='0 0 14 8'%3E%3Cpath d='m1 1 6 6 6-6' fill='none' stroke='%23371064' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 16px center !important;
  background-size: 14px 8px !important;
  appearance: none !important;
  -webkit-appearance: none !important;
}

.fe-referral-form-card select.gfield_select:hover,
.fe-referral-form-card select.gfield_select:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='8' viewBox='0 0 14 8'%3E%3Cpath d='m1 1 6 6 6-6' fill='none' stroke='%23e7174d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 16px center !important;
}

.fe-referral-form-card input:focus,
.fe-referral-form-card select:focus,
.fe-referral-form-card textarea:focus {
  border-color: var(--fe-referral-purple);
  outline: 3px solid rgba(55, 16, 100, .12);
}

.fe-referral-form-card input[type="checkbox"],
.fe-referral-form-card input[type="radio"] {
  accent-color: var(--fe-referral-teal);
}

.fe-referral-form-card .gfield_html h2,
.fe-referral-form-card .gfield_html h3,
.fe-referral-form-card .fe-form-step-title {
  margin: 0 0 8px;
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 700;
  line-height: 1.1;
  color: var(--fe-referral-purple);
  text-transform: uppercase;
}

.fe-referral-form-card .gfield_html p {
  margin-bottom: 12px;
  color: var(--fe-referral-ink);
}

/* Program rules HTML field. See campaign handoff for expected markup. */
.fe-program-rules {
  display: grid;
  gap: 0;
  margin: 8px 0 16px;
}

.fe-program-rule {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f0ebf2;
}

.fe-program-rule:last-child {
  border-bottom: 0;
}

.fe-program-rule__icon {
  display: grid;
  width: 28px;
  height: 28px;
  font-size: 15px;
  color: var(--fe-referral-purple);
  background: var(--fe-referral-lilac);
  border-radius: 50%;
  place-items: center;
}

.fe-program-rule p {
  margin: 0 !important;
  font-size: 14px;
  line-height: 1.35;
}

.fe-program-rule strong {
  color: var(--fe-referral-purple);
}

/* Pink separator above the page-three consent fields. */
.fe-referral-form-card .gfield--type-section,
.fe-referral-form-card .gsection {
  padding-top: 18px;
  margin-top: 8px;
  border-top: 2px solid var(--fe-referral-teal);
  border-bottom: 0;
}

.fe-referral-form-card .gfield--type-section .gsection_title,
.fe-referral-form-card .gsection .gsection_title {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Buttons */
.fe-referral-form-card .gform_page_footer {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 12px;
  padding-top: 22px;
  margin-top: 18px;
  border-top: 1px solid var(--fe-referral-border);
}

.fe-referral-form-card .gform_page_footer input[type="button"],
.fe-referral-form-card .gform_page_footer input[type="submit"],
.fe-referral-form-card .gform_footer input[type="submit"],
.fe-referral-form-card .gform_page_footer button,
.fe-referral-form-card .gform_footer button {
  display: inline-flex !important;
  gap: 10px;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: 12px 20px !important;
  margin: 0 !important;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .025em;
  color: #fff !important;
  text-transform: uppercase;
  background: var(--fe-referral-teal) !important;
  border: 2px solid var(--fe-referral-teal) !important;
  border-radius: 5px !important;
  box-shadow: none !important;
}

.fe-referral-form-card .gform_next_button::after {
  font-size: 20px;
  line-height: 1;
  content: "→";
}

.fe-referral-form-card .gform_page_footer .gform_next_button:only-child,
.fe-referral-form-card .gform_page_footer .gform_button:only-child,
.fe-referral-form-card .gform_page_footer button:only-child {
  grid-column: 1 / -1;
}

.fe-referral-form-card .gform_page_footer .gform_previous_button,
.fe-referral-form-card .gform_page_footer button.gform_previous_button {
  color: var(--fe-referral-teal) !important;
  background: #fff !important;
}

.fe-referral-form-card .gform_page_footer input:hover,
.fe-referral-form-card .gform_footer input[type="submit"]:hover,
.fe-referral-form-card .gform_page_footer button:not(.gform_previous_button):hover,
.fe-referral-form-card .gform_footer button:hover {
  color: #fff !important;
  background: var(--fe-referral-teal-dark) !important;
  border-color: var(--fe-referral-teal-dark) !important;
}

.fe-referral-form-card .gform_page_footer .gform_previous_button:hover {
  color: #fff !important;
  background: var(--fe-referral-teal) !important;
  border-color: var(--fe-referral-teal) !important;
}

.fe-referral-help {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  padding: 13px 20px;
  margin-top: 18px;
  color: var(--fe-referral-ink);
  background: var(--fe-referral-lilac);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(38, 8, 65, .16);
  border: 1px solid var(--fe-referral-border);
}

.fe-referral-help p {
  margin: 0;
  font-size: 15px;
}

.fe-referral-help__icon {
  display: grid;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  font-weight: 700;
  color: #fff;
  background: var(--fe-referral-purple);
  border-radius: 50%;
  place-items: center;
}

.fe-referral-help__links {
  display: none;
}

.fe-referral-admin-notice {
  padding: 20px;
  color: #5d4500;
  background: #fff5cc;
  border-left: 4px solid #e4ae00;
}

@media (max-width: 980px) {
  .fe-referral-hero__content {
    padding: 24px 320px 24px 160px;
  }

  .fe-referral-hero::after {
    right: -12px;
  }

  .fe-referral-hero__diapers {
    width: 190px;
    left: -48px;
  }

  .fe-referral-hero__ellipse {
    width: 250px;
    height: 250px;
    left: -150px;
  }
}

@media (max-width: 700px) {
  .fe-referral-hero {
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, var(--fe-referral-purple-mid) 56.308%, var(--fe-referral-purple-deep) 98.325%);
  }

  .fe-referral-hero::after {
    top: auto;
    right: auto;
    bottom: -30px;
    left: 50%;
    width: min(285px, 84%);
    height: 241px;
    min-height: 0;
    background-position: center bottom;
    transform: translateX(-60%);
  }

  .fe-referral-hero__deco {
    position: relative;
    width: 100%;
    height: 142px;
  }

  .fe-referral-hero__ellipse {
    top: 0;
    left: 50%;
    width: 217px;
    height: 216px;
    transform: translate(-50%, -58%);
  }

  .fe-referral-hero__diapers {
    top: 71px;
    left: 50%;
    width: 142px;
    transform: translate(-50%, -50%);
  }

  .fe-referral-hero__content {
    max-width: none;
    min-height: 0;
    padding: 0 24px 230px;
    text-align: center;
  }

  .fe-referral-hero h1 {
    margin: 0 auto;
    font-size: 28px;
    line-height: 36px;
    max-width: 420px;
  }

  .fe-referral-hero__copy p {
    font-size: 18px;
    line-height: 1.39;
  }

  .fe-referral-hero__reward {
    gap: 8px;
    justify-content: center;
    max-width: 307px;
    margin: 0 auto;
  }

  .fe-referral-hero__reward p {
    font-size: 14px;
    line-height: 1.75;
    text-align: left;
  }

  .fe-referral-form-card {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .fe-referral-campaign {
    padding: 12px 10px 36px;
  }

  .fe-referral-hero,
  .fe-referral-form-card,
  .fe-referral-help {
    border-radius: 9px;
  }

  .fe-referral-hero__content {
    padding: 0 24px 210px;
  }

  .fe-referral-form-card {
    padding: 23px 18px;
  }

  .fe-referral-form-card .gf_step_label {
    font-size: 9px;
  }

  .fe-referral-step__label {
    font-size: 8px;
  }

  .fe-referral-form-card .gform_page_footer {
    grid-template-columns: 1fr;
  }

  .fe-referral-help p {
    font-size: 13px;
    line-height: 1.3;
  }
}
