:root {
  --bfe-green: #58c69a;
  --bfe-green-dark: #006838;
  --bfe-ink: #171a18;
  --bfe-muted: #667069;
  --bfe-line: #dce6e0;
  --bfe-soft: #f3faf6;
  --bfe-danger: #b42318;
}

.bfe-interactive-form,
.bfe-interactive-form * {
  box-sizing: border-box !important;
}

.bfe-interactive-form {
  width: min(100%, 880px);
  margin: 2rem auto;
  padding: clamp(1.25rem, 3vw, 3rem);
  color: var(--bfe-ink);
  background: #fff;
  border: 1px solid var(--bfe-line);
  border-radius: 28px;
  box-shadow: 0 24px 70px rgba(21, 50, 35, 0.1);
  font-size: 16px;
  line-height: 1.55;
  scroll-margin-top: 120px;
}

.bfe-interactive-form .bfe-field > p,
.bfe-interactive-form .bfe-nav > p,
.bfe-interactive-form .bfe-product-selection > p,
.bfe-interactive-form .bfe-upload > p,
.bfe-interactive-form .bfe-note > p,
.bfe-interactive-form .bfe-step > p:has(> .bfe-step__eyebrow) {
  margin: 0;
}

.bfe-interactive-form .bfe-nav > p,
.bfe-interactive-form .bfe-product-selection > p,
.bfe-interactive-form .bfe-upload > p {
  display: contents;
}

.bfe-interactive-form .bfe-field > p > br,
.bfe-interactive-form .bfe-nav > p > br,
.bfe-interactive-form .bfe-product-selection > p > br,
.bfe-interactive-form .bfe-upload > p > br {
  display: none;
}

.bfe-progress {
  margin-bottom: clamp(2rem, 5vw, 3.75rem);
}

.bfe-progress__meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  margin-bottom: 0.65rem;
  color: var(--bfe-muted);
  font-size: 0.875rem;
  font-weight: 650;
  letter-spacing: 0.03em;
}

.bfe-progress__track {
  height: 8px;
  overflow: hidden;
  background: #edf1ee;
  border-radius: 999px;
}

.bfe-progress__bar {
  width: 20%;
  height: 100%;
  background: linear-gradient(90deg, var(--bfe-green-dark), var(--bfe-green));
  border-radius: inherit;
  transition: width 320ms ease;
}

.bfe-step[hidden],
.bfe-nav [hidden],
.bfe-submit-wrap[hidden],
.bfe-product-selection[hidden],
.bfe-confirmation[hidden] {
  display: none !important;
}

.bfe-step {
  animation: bfe-step-in 280ms ease both;
}

.bfe-step__eyebrow {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--bfe-green-dark);
  font-size: 0.82rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.bfe-step h2,
.bfe-confirmation h2 {
  margin: 0 0 0.65rem;
  color: var(--bfe-ink);
  font-size: clamp(1.7rem, 4vw, 2.65rem);
  font-weight: 650;
  line-height: 1.13;
  letter-spacing: -0.025em;
}

.bfe-step h2:focus,
.bfe-confirmation h2:focus {
  outline: none;
}

.bfe-step__intro {
  max-width: 680px;
  margin: 0 0 2rem;
  color: var(--bfe-muted);
  font-size: 1rem;
}

.bfe-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.bfe-grid > .bfe-field {
  min-width: 0;
  flex: 1 1 calc(50% - 0.625rem);
  margin-bottom: 0;
}

.bfe-field {
  position: relative;
  margin-bottom: 1.5rem;
}

.bfe-field--full {
  flex-basis: 100% !important;
}

.bfe-label,
.bfe-field > label {
  display: block;
  margin-bottom: 0.55rem;
  color: var(--bfe-ink);
  font-size: 0.96rem;
  font-weight: 650;
}

.bfe-required {
  color: var(--bfe-green-dark);
}

.bfe-optional {
  color: var(--bfe-muted);
  font-size: 0.85em;
  font-weight: 400;
}

.bfe-help {
  display: block;
  margin-top: 0.55rem;
  color: var(--bfe-muted);
  font-size: 0.875rem;
  line-height: 1.45;
}

.bfe-interactive-form input:not([type='radio']):not([type='checkbox']):not([type='submit']),
.bfe-interactive-form select,
.bfe-interactive-form textarea {
  width: 100% !important;
  height: 56px !important;
  min-height: 56px !important;
  margin: 0;
  padding: 0.85rem 1rem;
  color: var(--bfe-ink);
  background: #fff;
  border: 1.5px solid #bac9c0;
  border-radius: 12px;
  box-shadow: none;
  font: inherit;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.bfe-interactive-form textarea {
  height: auto !important;
  min-height: 150px;
  padding: 0.85rem 1rem !important;
  resize: vertical;
}

.bfe-interactive-form input:focus,
.bfe-interactive-form select:focus,
.bfe-interactive-form textarea:focus {
  border-color: var(--bfe-green-dark) !important;
  outline: none;
  box-shadow: 0 0 0 4px rgba(88, 198, 154, 0.2) !important;
}

.bfe-field.is-invalid input,
.bfe-field.is-invalid select,
.bfe-field.is-invalid textarea {
  border-color: var(--bfe-danger) !important;
}

.bfe-field__error,
.bfe-interactive-form .wpcf7-not-valid-tip {
  display: block;
  margin-top: 0.45rem;
  color: var(--bfe-danger);
  font-size: 0.875rem;
  font-weight: 600;
}

.bfe-size-options .wpcf7-form-control {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.bfe-size-options .wpcf7-list-item {
  min-width: 0;
  flex: 1 1 calc(50% - 0.375rem);
  margin: 0;
}

.bfe-size-options .wpcf7-list-item label {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 82px;
  align-items: center;
  padding: 1rem 1rem 1rem 3.2rem;
  cursor: pointer;
  background: #fff;
  border: 1.5px solid var(--bfe-line);
  border-radius: 14px;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.bfe-size-options .wpcf7-list-item label:hover {
  transform: translateY(-2px);
  border-color: var(--bfe-green);
  background: var(--bfe-soft);
}

.bfe-size-options input[type='radio'] {
  position: absolute;
  left: 1rem;
  width: 20px;
  height: 20px;
  accent-color: var(--bfe-green-dark);
}

.bfe-size-options label:has(input:checked) {
  color: var(--bfe-green-dark);
  background: var(--bfe-soft);
  border-color: var(--bfe-green-dark);
  box-shadow: inset 0 0 0 1px var(--bfe-green-dark);
}

.bfe-size-options .wpcf7-list-item-label {
  font-size: 0.96rem;
  font-weight: 650;
}

.bfe-product-picker.is-enhanced > .wpcf7-form-control-wrap {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.bfe-interactive-form .bfe-product-value {
  position: absolute !important;
  width: 1px !important;
  min-height: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  border: 0 !important;
  white-space: nowrap !important;
}

.bfe-product-search {
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: stretch;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.bfe-product-search__label {
  margin: 0 !important;
  font-size: 0.88rem !important;
  line-height: 1.4 !important;
}

.bfe-interactive-form .bfe-product-search__input {
  width: 100% !important;
  height: 56px !important;
  min-height: 56px !important;
  padding: 0 1rem !important;
  box-sizing: border-box !important;
}

.bfe-product-search__count {
  min-height: 1.25rem;
  margin: 0 !important;
  padding: 0 !important;
  color: var(--bfe-muted);
  font-size: 0.82rem;
  line-height: 1.4;
  white-space: nowrap;
}

.bfe-product-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  max-height: 460px;
  padding: 0.2rem 0.35rem 0.2rem 0.2rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: var(--bfe-green) #edf1ee;
}

.bfe-product-card {
  position: relative;
  display: flex;
  width: calc(50% - 0.35rem);
  min-width: 0;
  min-height: 104px;
  flex: 0 1 calc(50% - 0.35rem);
  flex-direction: row;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  color: var(--bfe-ink);
  background: #fff;
  border: 1.5px solid var(--bfe-line);
  border-radius: 16px;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.bfe-product-card:hover {
  transform: translateY(-2px);
  border-color: var(--bfe-green);
  box-shadow: 0 10px 24px rgba(21, 50, 35, 0.1);
}

.bfe-product-card:focus-visible {
  outline: 3px solid rgba(0, 104, 56, 0.25);
  outline-offset: 3px;
}

.bfe-product-card.is-selected {
  border-color: var(--bfe-green-dark);
  box-shadow: inset 0 0 0 1px var(--bfe-green-dark);
}

.bfe-product-card.is-selected::after {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  content: '\2713';
  color: #fff;
  background: var(--bfe-green-dark);
  border-radius: 50%;
  font-size: 0.82rem;
  font-weight: 800;
}

.bfe-product-card__image {
  width: 104px;
  flex: 0 0 104px;
  aspect-ratio: 1;
  object-fit: contain;
  background: var(--bfe-soft);
}

.bfe-product-card__copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.8rem 0.9rem;
}

.bfe-product-card__name {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.35;
}

.bfe-product-picker__loading,
.bfe-product-picker__empty,
.bfe-product-picker__error {
  padding: 1rem;
  color: var(--bfe-muted);
  background: var(--bfe-soft);
  border-radius: 12px;
}

.bfe-product-picker__retry {
  padding: 0;
  cursor: pointer;
  color: var(--bfe-green-dark);
  background: transparent;
  border: 0;
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
}

.bfe-product-picker__more {
  display: block;
  margin: 1rem auto 0;
}

/* "display: block" above would otherwise beat the hidden attribute, so the button stayed visible at the end of the list. */
.bfe-product-picker__more[hidden] {
  display: none;
}

.bfe-product-picker__more.is-busy {
  opacity: 0.7;
  cursor: progress;
}

/* Bottles added by "Show more" ease in, so it is clear which ones are new. */
.bfe-product-card.is-new {
  animation: bfe-card-in 0.35s ease both;
}

@keyframes bfe-card-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bfe-product-card.is-new {
    animation: none;
  }
}

.bfe-product-selection {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  background: var(--bfe-soft);
  border: 1.5px solid var(--bfe-green-dark);
  border-radius: 14px;
}

.bfe-product-selection__image {
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  object-fit: contain;
  background: #fff;
  border-radius: 10px;
}

.bfe-product-selection__name {
  min-width: 0;
  flex: 1 1 auto;
  font-weight: 700;
  line-height: 1.35;
}

.bfe-product-selection__change {
  min-width: 88px;
  min-height: 44px;
  flex: 0 0 auto;
  margin-left: auto;
  padding: 0.45rem 0.7rem;
  cursor: pointer;
  color: var(--bfe-green-dark);
  background: #fff;
  border: 1px solid var(--bfe-line);
  border-radius: 999px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
}

.bfe-product-picker.has-selection .bfe-product-browser {
  display: none;
}

.bfe-upload {
  position: relative;
  padding: 1.5rem;
  text-align: center;
  background: var(--bfe-soft);
  border: 1.5px dashed var(--bfe-green-dark);
  border-radius: 16px;
}

.bfe-upload input[type='file'] {
  height: auto !important;
  min-height: auto !important;
  padding: 0.6rem !important;
  background: transparent !important;
  border: 0 !important;
}

.bfe-upload__title {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 700;
}

.bfe-upload__status {
  display: block;
  color: var(--bfe-muted);
  font-size: 0.875rem;
}

.bfe-note {
  margin: 0.5rem 0 1.5rem;
  padding: 1rem 1.1rem;
  color: #264c38;
  background: var(--bfe-soft);
  border-left: 4px solid var(--bfe-green);
  border-radius: 0 10px 10px 0;
  font-size: 0.9rem;
}

.bfe-review {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}

.bfe-review__item {
  min-width: 0;
  flex: 1 1 calc(50% - 0.375rem);
  padding: 1rem;
  background: var(--bfe-soft);
  border-radius: 12px;
}

.bfe-review__label {
  display: block;
  margin-bottom: 0.2rem;
  color: var(--bfe-muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.bfe-review__value {
  overflow-wrap: anywhere;
  font-weight: 650;
}

.bfe-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--bfe-line);
}

.bfe-nav .bfe-back {
  min-width: 112px;
}

.bfe-nav .bfe-next {
  min-width: 148px;
  margin-left: auto;
}

.bfe-nav .bfe-submit-wrap input[type='submit'] {
  min-width: 190px;
}

.bfe-button,
.bfe-interactive-form input[type='submit'] {
  height: 52px !important;
  min-height: 52px !important;
  padding: 0 1.4rem !important;
  box-sizing: border-box !important;
  cursor: pointer;
  border: 1.5px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-size: 1rem;
  font-weight: 750;
  letter-spacing: 0.01em;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.bfe-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.bfe-button:hover,
.bfe-interactive-form input[type='submit']:hover {
  transform: translateY(-2px);
}

.bfe-button--primary,
.bfe-interactive-form input[type='submit'] {
  color: #fff;
  background: var(--bfe-green-dark);
  box-shadow: 0 8px 20px rgba(0, 104, 56, 0.2);
}

.bfe-button--secondary {
  color: var(--bfe-ink);
  background: #fff;
  border-color: var(--bfe-line);
}

.bfe-submit-wrap {
  margin-left: auto;
}

.bfe-interactive-form .wpcf7-spinner {
  vertical-align: middle;
}

.bfe-interactive-form .wpcf7-response-output {
  margin: 1.5rem 0 0 !important;
  padding: 0.85rem 1rem !important;
  border-width: 1px !important;
  border-radius: 10px;
}

.wpcf7.bfe-is-complete .wpcf7-response-output,
.wpcf7:has(.bfe-confirmation:not([hidden])) .wpcf7-response-output,
.bfe-interactive-form.is-complete .bfe-progress,
.bfe-interactive-form.is-complete .bfe-step,
.bfe-interactive-form.is-complete .bfe-nav,
.bfe-interactive-form.is-complete .bfe-submit-wrap,
.bfe-interactive-form.is-complete .wpcf7-submit,
.bfe-interactive-form.is-complete .wpcf7-spinner {
  display: none !important;
}

.bfe-interactive-form:has(.bfe-confirmation:not([hidden])) .bfe-progress,
.bfe-interactive-form:has(.bfe-confirmation:not([hidden])) .bfe-step,
.bfe-interactive-form:has(.bfe-confirmation:not([hidden])) .bfe-nav,
.bfe-interactive-form:has(.bfe-confirmation:not([hidden])) .bfe-submit-wrap,
.bfe-interactive-form:has(.bfe-confirmation:not([hidden])) .wpcf7-submit,
.bfe-interactive-form:has(.bfe-confirmation:not([hidden])) .wpcf7-spinner {
  display: none !important;
}

.bfe-interactive-form.is-complete {
  min-height: 0;
  padding-block: clamp(1.5rem, 4vw, 2.5rem);
}

.bfe-confirmation {
  max-width: 620px;
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 2rem) 1rem;
  text-align: center;
}

.bfe-confirmation__mark {
  display: grid;
  width: 70px;
  height: 70px;
  margin: 0 auto 1.5rem;
  place-items: center;
  color: transparent !important;
  background: var(--bfe-green-dark);
  border-radius: 50%;
  box-shadow: 0 10px 26px rgba(0, 104, 56, 0.2);
  font-size: 0 !important;
  line-height: 0 !important;
}

.bfe-confirmation__mark::before {
  width: 22px;
  height: 12px;
  content: '';
  border-bottom: 4px solid #fff;
  border-left: 4px solid #fff;
  transform: translateY(-2px) rotate(-45deg);
}

@keyframes bfe-step-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 680px) {
  .bfe-interactive-form {
    margin: 1rem auto;
    border-radius: 20px;
    scroll-margin-top: 88px;
  }

  .bfe-grid,
  .bfe-size-options .wpcf7-form-control,
  .bfe-product-options,
  .bfe-review {
    flex-direction: column;
    flex-wrap: nowrap;
  }

  .bfe-grid > .bfe-field,
  .bfe-size-options .wpcf7-list-item,
  .bfe-product-card,
  .bfe-review__item {
    width: 100%;
    max-width: 100%;
    flex-basis: auto;
  }

  .bfe-product-options {
    max-height: 520px;
  }

  .bfe-product-search__count {
    padding: 0;
  }

  .bfe-product-card {
    min-height: 88px;
  }

  .bfe-product-card__image {
    width: 88px;
    flex-basis: 88px;
  }

  .bfe-product-selection {
    flex-wrap: wrap;
  }

  .bfe-product-selection__image {
    width: 60px;
    height: 60px;
    flex-basis: 60px;
  }

  .bfe-product-selection__name {
    flex: 1 1 calc(100% - 76px);
  }

  .bfe-product-selection__change {
    width: 100%;
    margin-left: 0;
  }

  .bfe-nav {
    position: sticky;
    bottom: 0;
    z-index: 3;
    margin-inline: -0.5rem;
    padding: 1rem 0.5rem 0.25rem;
    background: rgba(255, 255, 255, 0.96);
  }
}

@media (prefers-reduced-motion: reduce) {
  .bfe-interactive-form *,
  .bfe-interactive-form *::before,
  .bfe-interactive-form *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
