.hapo-seo-lead-form {
  --hapo-lead-green: #00b85c;
  --hapo-lead-yellow: #ffcf1a;
  position: relative;
  isolation: isolate;
  width: 100%;
  padding: 112px 32px;
  overflow: hidden;
  background: #08a85b url("../images/hapo-seo-lead-form-background.jpg") center / cover no-repeat;
  color: #fff;
  font-family: "Manrope", sans-serif;
}

.hapo-seo-lead-form__flow {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.hapo-seo-lead-form__flow svg {
  display: block;
  width: 100%;
  height: 100%;
}

.hapo-seo-lead-form__shape {
  opacity: .56;
  transform-box: fill-box;
  transform-origin: center;
  animation: hapo-lead-shape-drift 17s ease-in-out infinite alternate;
}

.hapo-seo-lead-form__shape--two { animation-duration: 21s; animation-delay: -8s; animation-direction: alternate-reverse; }
.hapo-seo-lead-form__shape--three { animation-duration: 19s; animation-delay: -5s; }
.hapo-seo-lead-form__shape--four { animation-duration: 23s; animation-delay: -12s; animation-direction: alternate-reverse; }

.hapo-seo-lead-form__shape path:first-child { opacity: .34; stroke-width: 1.5; }
.hapo-seo-lead-form__shape path:not(:first-child) {
  stroke-width: 2.5;
  stroke-dasharray: 150 850;
  animation: hapo-lead-shape-trace 13s linear infinite;
}
.hapo-seo-lead-form__shape path:nth-child(3) { animation-delay: -7s; animation-duration: 16s; }
.hapo-seo-lead-form__shape--two path:not(:first-child) { animation-duration: 17s; }
.hapo-seo-lead-form__shape--three path:not(:first-child) { animation-duration: 15s; }
.hapo-seo-lead-form__shape--four path:not(:first-child) { animation-duration: 19s; }

@keyframes hapo-lead-shape-drift {
  from { transform: translate3d(-12px, 8px, 0) rotate(-4deg) scale(.98); }
  to { transform: translate3d(20px, -17px, 0) rotate(5deg) scale(1.04); }
}

@keyframes hapo-lead-shape-trace {
  from { stroke-dashoffset: 1000; }
  to { stroke-dashoffset: 0; }
}

.hapo-seo-lead-form--width-full {
  position: relative;
  left: 50%;
  width: 100vw;
  margin-left: -50vw;
}

.hapo-seo-lead-form__inner {
  position: relative;
  z-index: 1;
  display: grid;
  max-width: 1376px;
  grid-template-columns: minmax(0, .9fr) minmax(520px, 616px);
  gap: clamp(48px, 7vw, 128px);
  align-items: center;
  margin: 0 auto;
}

.hapo-seo-lead-form__copy {
  max-width: 610px;
}

.hapo-seo-lead-form__eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 33px;
  margin: 0 0 22px;
  padding: 7px 18px;
  border-radius: 999px;
  background: var(--hapo-lead-yellow);
  color: #111;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
}

.hapo-seo-lead-form__title {
  max-width: 580px;
  margin: 0;
  color: #fff;
  font-size: clamp(34px, 3vw, 48px);
  font-weight: 800;
  letter-spacing: -1.44px;
  line-height: 1.22;
  text-transform: uppercase;
}

.hapo-seo-lead-form__description {
  max-width: 560px;
  margin: 26px 0 0;
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.55;
}

.hapo-seo-lead-form__card {
  padding: 32px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 42px rgb(0 50 24 / 16%);
  color: #181818;
}

.hapo-seo-lead-form .wpcf7 form,
.hapo-seo-lead-form .hapo-lead-form__fields {
  display: grid;
  gap: 16px;
  margin: 0;
}

.hapo-seo-lead-form .hapo-lead-form__row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

/* CF7 applies wpautop() to form templates. Keep its generated paragraphs from
 * changing the intentional two-column field rows defined in the CF7 form. */
.hapo-seo-lead-form .hapo-lead-form__fields > p,
.hapo-seo-lead-form .hapo-lead-form__row > p,
.hapo-seo-lead-form .wpcf7 fieldset > p {
  margin: 0;
}

.hapo-seo-lead-form .hapo-lead-form__row > p,
.hapo-seo-lead-form .hapo-lead-form__row + p {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.hapo-seo-lead-form .hapo-lead-form__row > p {
  grid-column: 1 / -1;
  min-width: 0;
}

.hapo-seo-lead-form .hapo-lead-form__row > p > label,
.hapo-seo-lead-form .hapo-lead-form__row + p > label {
  min-width: 0;
}

.hapo-seo-lead-form .hapo-lead-form__row br,
.hapo-seo-lead-form .hapo-lead-form__row + p > br {
  display: none;
}

.hapo-seo-lead-form .hapo-lead-form__fields > p:last-child {
  display: grid;
  gap: 16px;
}

.hapo-seo-lead-form .hapo-lead-form__fields > p:last-child > br {
  display: none;
}

.hapo-seo-lead-form .wpcf7 label {
  display: grid;
  gap: 8px;
  margin: 0;
  color: #171717;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.hapo-seo-lead-form .wpcf7-form-control-wrap {
  display: block;
}

.hapo-seo-lead-form .wpcf7 input:not([type="submit"]),
.hapo-seo-lead-form .wpcf7 textarea {
  width: 100%;
  margin: 0;
  border: 1px solid #e0e5e1;
  border-radius: 7px;
  background: #fff;
  box-shadow: none;
  color: #181818;
  font: inherit;
  font-size: 14px;
  line-height: 1.4;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.hapo-seo-lead-form .wpcf7 input:not([type="submit"]) {
  min-height: 44px;
  padding: 10px 12px;
}

.hapo-seo-lead-form .wpcf7 textarea {
  min-height: 72px;
  padding: 10px 12px;
  resize: vertical;
}

.hapo-seo-lead-form .wpcf7 input::placeholder,
.hapo-seo-lead-form .wpcf7 textarea::placeholder {
  color: #919791;
  opacity: 1;
}

.hapo-seo-lead-form .wpcf7 input:not([type="submit"]):focus,
.hapo-seo-lead-form .wpcf7 textarea:focus {
  border-color: var(--hapo-lead-green);
  box-shadow: 0 0 0 3px rgb(0 184 92 / 14%);
}

.hapo-seo-lead-form .wpcf7 fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.hapo-seo-lead-form .wpcf7 legend {
  margin: 0 0 10px;
  color: #171717;
  font-size: 14px;
  font-weight: 700;
}

.hapo-seo-lead-form .wpcf7 .wpcf7-list-item {
  display: inline-flex;
  margin: 0 13px 8px 0;
}

.hapo-seo-lead-form .wpcf7 .wpcf7-list-item label {
  display: flex;
  flex-flow: row nowrap;
  align-items: center;
  gap: 7px;
  color: #535953;
  font-size: 13px;
  font-weight: 600;
}

.hapo-seo-lead-form .wpcf7 input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 0;
  padding: 0;
  accent-color: var(--hapo-lead-green);
}

.hapo-seo-lead-form .wpcf7 input[type="submit"] {
  width: 100%;
  min-height: 50px;
  margin: 0;
  padding: 12px 24px;
  border: 0;
  border-radius: 999px;
  background: var(--hapo-lead-yellow);
  box-shadow: 0 8px 18px rgb(150 111 0 / 16%);
  color: #111;
  cursor: pointer;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.3;
  transition: background-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.hapo-seo-lead-form .wpcf7 input[type="submit"]:hover {
  background: #ffdc4d;
  box-shadow: 0 12px 22px rgb(150 111 0 / 24%);
  transform: translateY(-2px);
}

.hapo-seo-lead-form .wpcf7 input[type="submit"]:focus-visible {
  outline: 3px solid #161616;
  outline-offset: 3px;
}

.hapo-seo-lead-form .wpcf7 input[type="submit"]:active {
  box-shadow: 0 4px 10px rgb(150 111 0 / 20%);
  transform: translateY(0);
}

.hapo-seo-lead-form .wpcf7-not-valid-tip,
.hapo-seo-lead-form .wpcf7-response-output {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
}

.hapo-seo-lead-form__empty {
  margin: 0;
  padding: 16px;
  border: 1px dashed #a9b7ac;
  border-radius: 8px;
  color: #556158;
  font-size: 14px;
}

@media (max-width: 1024px) {
  .hapo-seo-lead-form__inner {
    grid-template-columns: minmax(0, 1fr) minmax(430px, .85fr);
    gap: 48px;
  }
}

@media (max-width: 767px) {
  .hapo-seo-lead-form {
    padding: 62px 16px;
    background-position: center;
  }

  .hapo-seo-lead-form__inner {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .hapo-seo-lead-form__copy {
    text-align: center;
  }

  .hapo-seo-lead-form__eyebrow {
    min-height: 27px;
    margin-bottom: 14px;
    padding: 5px 13px;
    font-size: 10px;
  }

  .hapo-seo-lead-form__title {
    max-width: 343px;
    margin: 0 auto;
    font-size: 20px;
    letter-spacing: -.2px;
    line-height: 1.3;
  }

  .hapo-seo-lead-form__description {
    margin: 14px auto 0;
    font-size: 13px;
    line-height: 1.5;
  }

  .hapo-seo-lead-form__card {
    padding: 20px 16px;
    border-radius: 12px;
  }

  .hapo-seo-lead-form .hapo-lead-form__row {
    grid-template-columns: 1fr;
  }

  .hapo-seo-lead-form .hapo-lead-form__row > p,
  .hapo-seo-lead-form .hapo-lead-form__row + p {
    grid-template-columns: 1fr;
  }

  .hapo-seo-lead-form .wpcf7,
  .hapo-seo-lead-form .hapo-lead-form__fields {
    gap: 14px;
  }

  .hapo-seo-lead-form .wpcf7 input:not([type="submit"]),
  .hapo-seo-lead-form .wpcf7 textarea {
    font-size: 16px;
  }

  .hapo-seo-lead-form .wpcf7 .wpcf7-list-item {
    display: flex;
    width: 100%;
    margin-right: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hapo-seo-lead-form__shape,
  .hapo-seo-lead-form__shape path:not(:first-child) {
    animation: none;
    transform: none;
  }

  .hapo-seo-lead-form__shape path:not(:first-child) {
    stroke-dasharray: none;
    opacity: .38;
  }

  .hapo-seo-lead-form .wpcf7 input:not([type="submit"]),
  .hapo-seo-lead-form .wpcf7 textarea,
  .hapo-seo-lead-form .wpcf7 input[type="submit"] {
    transition: none;
  }
}
