.pricing {
  border-top: 1px solid #e6efe9;
  background:
    radial-gradient(900px 440px at 42% 0%, #fbe9f3 0%, rgba(251, 233, 243, 0) 70%),
    radial-gradient(820px 420px at 88% 8%, #eceffc 0%, rgba(236, 239, 252, 0) 70%),
    radial-gradient(700px 380px at 6% 20%, #f6f1fb 0%, rgba(246, 241, 251, 0) 70%),
    var(--opt-white);
}

.pricing__wrap {
  display: flex;
  flex-direction: column;
  gap: 64px;
  max-width: 1128px;
  width: 100%;
  min-width: 0;
}

.pricing__body {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.pricing__billing-grid {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.pricing__billing-grid[hidden] {
  display: none;
}

.pricing__fallback-wrap {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.pricing__head {
  display: flex;
  justify-content: center;
}

.pricing__title {
  max-width: 900px;
  margin: 0;
  text-align: center;
}

.pricing__title-muted {
  color: #6b7280;
}

.pricing__plans {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  align-items: stretch;
}

.pricing-plan {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 30px 30px 28px;
  border: 1px solid #dce1e4;
  border-radius: 16px;
  background-color: var(--opt-white);
}

.pricing-plan--popular {
  padding-top: 42px;
  box-shadow: 0 24px 50px -36px rgba(22, 22, 29, 0.35);
}

.pricing-plan__badge {
  position: absolute;
  top: -14px;
  left: 50%;
  padding: 6px 14px;
  border-radius: 999px;
  background-color: var(--opt-ink);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  white-space: nowrap;
  color: var(--opt-white);
  transform: translateX(-50%);
}

.pricing-plan__top {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pricing-plan__intro {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pricing-plan__offer {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pricing-plan__terms {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pricing-plan__features {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.pricing-plan__body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pricing-plan__name {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--opt-ink);
}

.pricing-plan__star {
  font-size: 16px;
  color: #00a651;
}

.pricing-plan__desc {
  display: -webkit-box;
  min-height: 45px;
  margin: 0;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.5;
  color: #5f6b66;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.pricing-plan__price {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  margin: 0;
  color: var(--opt-ink);
}

.pricing-plan__currency {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
}

.pricing-plan__amount {
  font-size: 42px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
}

.pricing-plan__was {
  align-self: flex-end;
  padding-left: 4px;
  font-size: 16px;
  line-height: 1.6;
  text-decoration: line-through;
  color: #9ca3af;
}

.pricing-plan__period {
  padding-left: 6px;
  font-size: 14px;
  line-height: 1.6;
  color: #6b7280;
}

.pricing-plan__trial {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 6px;
  padding: 4px 12px;
  border: 1px solid #a7ddbe;
  border-radius: 999px;
  background-color: #eef8f2;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--opt-green-dark);
}

.pricing-plan__trial svg {
  fill: none;
  stroke: var(--opt-green-dark);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pricing-plan__billed {
  margin: 0;
  font-size: 15px;
  color: #5f6b66;
}

.pricing-plan__sites {
  margin: 0;
  font-size: 15px;
  color: var(--opt-green);
}

.pricing-plan__sites strong {
  font-weight: 700;
}

.pricing-plan__cta {
  width: 100%;
}

.pricing-plan__cta.button-outline {
  background-color: var(--opt-white);
  color: var(--hf-ink);
}

.pricing-plan__cta.button-outline .button-icon-span {
  background-color: var(--hf-ink);
  color: #fff;
}

.pricing-plan__count {
  margin: 0;
  padding-bottom: 16px;
  border-bottom: 1px solid #e5e8ea;
  font-size: 15px;
  font-weight: 700;
  color: var(--opt-ink);
}

.pricing-plan__list {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pricing-plan__item {
  display: flex;
  gap: 12px;
  font-size: 15px;
  line-height: 1.45;
  color: var(--opt-ink);
}

.pricing-plan__item svg,
.pricing-plan__agency-row svg {
  flex: 0 0 auto;
  margin-top: 2px;
  fill: none;
  stroke: var(--opt-green);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pricing--collapsed .pricing-plan__item--more {
  display: none;
}

.pricing-plan__agency {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--opt-line-green);
  border-radius: 10px;
  background-color: #f1f9f4;
}

.pricing-plan__agency-title {
  margin: 0;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--opt-green);
}

.pricing-plan__agency-row {
  display: flex;
  gap: 10px;
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--opt-ink);
}

.pricing-plan__toggle {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 6px;
  padding: 0;
  border: 0;
  background-color: transparent;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--opt-green);
  cursor: pointer;
}

.pricing-plan__toggle[hidden] {
  display: none;
}

.pricing__note {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.6;
  text-align: center;
  color: #3e4943;
}

@media (max-width: 995.98px) {
  .pricing__plans {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 671.98px) {
  .pricing__plans {
    grid-template-columns: minmax(0, 1fr);
  }
}

.pricing__billing {
  display: flex;
  justify-content: center;
}

.billing-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background-color: #f3f4f6;
}

.billing-seg {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 22px;
  border: 0;
  border-radius: 999px;
  background-color: transparent;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  color: #6b7280;
  cursor: pointer;
  transition: background-color 0.22s ease, color 0.22s ease;
}

.billing-seg:hover:not(.is-active) {
  color: var(--opt-ink);
}

.billing-seg.is-active {
  background-color: var(--opt-green);
  color: var(--opt-white);
}

.billing-seg:focus-visible {
  outline: 2px solid var(--opt-green);
  outline-offset: 2px;
}

.billing-save {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.85;
}

.pricing__fallback {
  display: flex;
  justify-content: center;
  margin: 0;
}

@media (prefers-reduced-motion: reduce) {
  .billing-seg {
    transition: none;
  }
}

/* Tablet and phone: same cards, set to the width they get.
   - 64px between the heading and the plans is a desktop value: 40px here, 32px on phones.
   - Two columns hold three plans (672-995px), which used to leave the third plan alone in the
     left half of a second row. An odd last plan now spans both columns and lays itself out
     sideways (price and button on the left, the feature list on the right), so the grid is
     full and the card stays readable. It applies to "an odd last card", not to the Agency
     plan by name, because the plans come from the LeadXForms admin and can change in number. */
@media (max-width: 995.98px) {
  .pricing__wrap {
    gap: 40px;
  }
}

@media (min-width: 672px) and (max-width: 995.98px) {
  .pricing-plan:last-child:nth-child(odd):not(:only-child) {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto auto 1fr;
    align-items: start;
    gap: 28px 40px;
  }

  .pricing-plan:last-child:nth-child(odd):not(:only-child) .pricing-plan__features {
    grid-column: 2;
    grid-row: 1 / span 3;
  }

  .pricing-plan:last-child:nth-child(odd):not(:only-child) .pricing-plan__top,
  .pricing-plan:last-child:nth-child(odd):not(:only-child) .pricing-plan__cta {
    grid-column: 1;
  }
}

/* One column: the two-line minimum that lines the descriptions up across three columns only
   leaves a blank line under a short one here. */
@media (max-width: 671.98px) {
  .pricing-plan__desc {
    min-height: 0;
  }
}

/* Phones. The title drops to 30px (it is a 70-character sentence: four lines at 320px
   otherwise) and is balanced; the plan cards lose 8px of padding each side and tighten their
   inner gaps, so a plan is about 80px shorter without any line wrapping differently; the
   price row (A$ 49 A$59 / year) is left as it is, it already fits 230px. The billing toggle,
   when both monthly and yearly plans exist, shares the width in two equal halves instead of
   overflowing at 320px. */
@media (max-width: 575.98px) {
  .pricing__wrap {
    gap: 32px;
  }

  .pricing__title {
    font-size: 30px;
    /* text-wrap: balance; */
  }

  .pricing__body {
    gap: 24px;
  }

  .pricing__billing-grid {
    gap: 20px;
  }

  .pricing__plans {
    gap: 20px;
  }

  .pricing-plan {
    gap: 24px;
    padding: 24px 22px 22px;
  }

  .pricing-plan--popular {
    padding-top: 34px;
  }

  .pricing-plan__name {
    font-size: 21px;
  }

  .pricing-plan__features {
    gap: 16px;
  }

  .pricing-plan__count {
    padding-bottom: 14px;
  }

  .pricing-plan__list {
    gap: 12px;
  }

  .pricing-plan__item {
    font-size: 14.5px;
  }

  .pricing__note {
    font-size: 13px;
  }

  .billing-toggle {
    display: flex;
    width: 100%;
  }

  .billing-seg {
    flex: 1;
    justify-content: center;
    gap: 6px;
    padding: 10px 8px;
    font-size: 14px;
  }
}

@media (max-width: 379.98px) {
  .pricing-plan {
    padding: 22px 18px 20px;
  }

  .pricing-plan--popular {
    padding-top: 32px;
  }
}

/* One or two plans (the plans come from the LeadXForms admin, so the number varies; plans-render.php
   adds pricing__plans--n1 / --n2 below three): the cards keep their normal width and sit in the
   middle of the row, instead of in the left column(s) of a three-column grid with the rest of the
   row empty. A single plan is also never turned into the sideways card of an odd last plan (the
   :not(:only-child) on that rule above). */
@media (min-width: 672px) {
  .pricing__plans--n1 {
    grid-template-columns: minmax(0, 360px);
    justify-content: center;
  }
}

@media (min-width: 996px) {
  .pricing__plans--n2 {
    grid-template-columns: repeat(2, minmax(0, 360px));
    justify-content: center;
  }
}

/* The lines of a plan card that come from the LeadXForms pricing page (plans-render.php prints them from
   the same arithmetic): the chips under the price, the billed total with its struck list amount and a
   tooltip with the breakdown, and in green what the offer saves. */
.pricing-plan__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pricing-plan__billed strong {
  font-weight: 700;
  color: var(--opt-ink);
}

.pricing-plan__billed-was {
  margin: 0 2px;
  color: #9ca3af;
}

.pricing-plan__billed--tip {
  position: relative;
  width: fit-content;
  max-width: 100%;
  cursor: help;
}

.pricing-plan__billed--tip:focus-visible {
  outline: 2px solid var(--opt-green);
  outline-offset: 3px;
  border-radius: 4px;
}

.pricing-plan__save {
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
  color: var(--opt-green);
}

.pricing-plan__save strong {
  font-weight: 700;
}

.pricing-plan__tip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 0;
  z-index: 5;
  display: none;
  flex-direction: column;
  gap: 6px;
  width: 270px;
  max-width: 80vw;
  padding: 12px 14px;
  border-radius: 10px;
  background-color: #101828;
  box-shadow: 0 16px 32px -12px rgba(16, 24, 40, 0.45);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
  color: #e5e7eb;
}

.pricing-plan__billed--tip:hover .pricing-plan__tip,
.pricing-plan__billed--tip:focus .pricing-plan__tip,
.pricing-plan__billed--tip:focus-within .pricing-plan__tip {
  display: flex;
}

.pricing-plan__tip strong {
  color: var(--opt-white);
}

.pricing-plan__tip-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.pricing-plan__tip-row.is-total {
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.pricing-plan__tip-note {
  color: #9ca3af;
}

/* Level buttons. Cards of one row no longer have the same amount above the button (a free plan has
   no chips and no billed lines, a plan without an offer has no savings line), so each card hands its
   three parts - top, button, features - to the rows of the grid (subgrid): the tallest "top" of the row
   sets the height of that row for every card, and the buttons and the feature lists start level, as
   they do on the LeadXForms pricing page. Without subgrid support the cards keep their own flow. */
@supports (grid-template-rows: subgrid) {
  .pricing-plan {
    display: grid;
    grid-row: span 3;
    grid-template-rows: subgrid;
    row-gap: 28px;
  }
}
