.contact {
  border-top: 1px solid #e6efe9;
  background: linear-gradient(180deg, #f4faf6, #ffffff);
}

.contact__wrap {
  max-width: 1152px;
  width: 100%;
  min-width: 0;
}

.contact__card {
  display: flex;
  flex-wrap: wrap;
  overflow: hidden;
  border: 1px solid #e6efe9;
  border-radius: 32px;
  background-color: var(--opt-white);
  box-shadow: 0 40px 90px -60px rgba(0, 60, 30, 0.45);
}

.contact__aside {
  position: relative;
  flex: 1 1 360px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  min-width: 0;
  padding: 44px 40px;
  background:
    radial-gradient(420px 300px at 100% 0%, rgba(255, 255, 255, 0.14), transparent 65%),
    var(--opt-green);
}

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

.contact__title {
  margin: 0;
  line-height: 1.1;
  color: var(--opt-white);
}

.contact__lead {
  margin: 0;
  font-size: 20px;
  line-height: 1.5;
  color: var(--opt-white);
  max-width: 400px;
}

.contact__points {
  display: grid;
  gap: 18px;
}

.contact-point {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.contact-point__icon {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background-color: rgba(255, 255, 255, 0.81);
}

.contact-point__icon svg {
  fill: none;
  stroke: var(--opt-green);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.contact-point__copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.contact-point__title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--opt-white);
}

.contact-point__text {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--opt-white);
}

.contact__panel {
  flex: 1.4 1 440px;
  min-width: 0;
  padding: 44px 40px;
}

.contact__form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.contact__fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.contact-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.contact-field--wide {
  grid-column: 1 / -1;
}

.contact-field__label {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.27;
  color: #3d4440;
}

.contact-field__star {
  color: #c2331f;
  font-weight: 600;
}

.contact-field__control {
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid #dce7e0;
  border-radius: 14px;
  background-color: #f8fbf9;
  font-family: inherit;
  font-size: 15px;
  color: var(--opt-ink);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

textarea.contact-field__control {
  resize: vertical;
}

.contact-field__control:focus-visible {
  border-color: var(--opt-green);
  background-color: var(--opt-white);
  box-shadow: 0 0 0 3px rgba(0, 135, 68, 0.15);
}

.contact-field--invalid .contact-field__control {
  border-color: #c2331f;
  background-color: #fff6f5;
}

.contact-field--invalid .contact-field__control:focus-visible {
  box-shadow: 0 0 0 3px rgba(194, 51, 31, 0.15);
}

.contact-field__error {
  min-height: 0;
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: #c2331f;
}

.contact-field__error:empty {
  display: none;
}

.contact__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.contact__status {
  margin: 0;
  font-size: 14px;
  color: #c2331f;
}

.contact__status:empty {
  display: none;
}

.contact__status--ok {
  color: #1f8a4c;
}

.contact__status--busy {
  color: #5f6b66;
}

.contact__actions .button:disabled {
  opacity: 0.6;
  cursor: progress;
  pointer-events: none;
}

.contact-field__foot {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.contact-field__count {
  flex: 0 0 auto;
  margin: 0 0 0 auto;
  font-size: 12.5px;
  line-height: 1.4;
  white-space: nowrap;
  color: #6b7280;
}

.contact-field__count--near {
  color: #b45309;
}

.contact__trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

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

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

/* Tablet and phone: same card (green panel, white form), set to the width it gets.
   - Below 880px the two halves stack. The 44px / 40px padding of both is a desktop value that on
     a 360px card left the fields 278px wide (208px at 320px): 36 / 32px up to 767px, and 28 / 24px
     on phones (20px below 380px), which gives the fields 310px at 390px and 242px at 320px.
   - Phones: card radius 32 -> 24px; title 30px balanced (it is the only heading on a green
     ground, three lines at 320px at 34px); lead 17px; the contact points and the form follow one
     smaller rhythm.
   - The fields are 16px on phones. iOS Safari zooms the whole page in on focusing any field
     below 16px, and the 15px fields did exactly that. */
@media (max-width: 767.98px) {

  .contact__aside,
  .contact__panel {
    padding: 36px 32px;
  }
}

@media (max-width: 575.98px) {
  .contact__card {
    border-radius: 24px;
  }

  .contact__aside {
    gap: 24px;
    padding: 28px 24px;
  }

  .contact__head {
    gap: 14px;
  }

  .contact__title {
    font-size: 30px;
    text-wrap: balance;
  }

  .contact__lead {
    font-size: 17px;
    line-height: 1.5;
  }

  .contact__points {
    gap: 16px;
  }

  .contact-point {
    gap: 12px;
  }

  .contact-point__icon {
    width: 36px;
    height: 36px;
    border-radius: 11px;
  }

  .contact-point__title {
    font-size: 15px;
  }

  .contact__panel {
    padding: 28px 24px;
  }

  .contact__form {
    gap: 18px;
  }

  .contact__fields {
    gap: 14px;
  }

  .contact-field__control {
    padding: 14px;
    font-size: 16px;
  }

  .contact__actions {
    gap: 12px;
  }
}

@media (max-width: 379.98px) {

  .contact__aside,
  .contact__panel {
    padding: 24px 20px;
  }
}

/* Tablet and phone: two cards instead of one card in two halves.
   Below 880px the halves are stacked, and a single card with a green block fused to the top of a
   white form read as one very tall slab (the green half alone is 410px on a phone). Here the
   card itself disappears (no border, background, shadow, clipping) and each half becomes a card
   of its own with its own radius and a 16px gap between them: the green card (title, lead,
   contact points) and the white form card (the white half gets the border and shadow the one
   card used to have). Nothing is moved or hidden, the order is the same as on desktop, and the
   paddings from the blocks above still apply to each card.
   From 640px the three contact points sit in three columns (icon above its text) so the green
   card is shorter on a tablet; below 640px they stay as rows. */
@media (max-width: 879.98px) {
  .contact__card {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 16px;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background-color: transparent;
    box-shadow: none;
  }

  .contact__aside,
  .contact__panel {
    flex: none;
    border-radius: 28px;
  }

  .contact__aside {
    box-shadow: 0 30px 60px -48px rgba(0, 80, 40, 0.55);
  }

  .contact__panel {
    border: 1px solid #e6efe9;
    background-color: var(--opt-white);
    box-shadow: 0 30px 60px -48px rgba(0, 60, 30, 0.45);
  }
}

@media (min-width: 640px) and (max-width: 879.98px) {
  .contact__points {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
  }

  .contact-point {
    flex-direction: column;
    gap: 12px;
  }
}

@media (max-width: 575.98px) {
  .contact__card {
    gap: 14px;
  }

  .contact__aside,
  .contact__panel {
    border-radius: 24px;
  }
}

/* The Submit button on tablet and phone: its desktop size (149px), centred under the last field.
   It is not stretched: a wide pill with one short word in it looks empty. The status line ("Please fix the highlighted fields.") is
   centred under the button instead of beside it. */
@media (max-width: 879.98px) {
  .contact__actions {
    justify-content: center;
    text-align: center;
  }

  .contact__status {
    width: 100%;
  }
}

/* Below 576px the shared button shrinks its label to 14px and its side padding to 12px (see
   site.css, the 575.98px block), which made this one 124px wide against 149px on desktop. The two
   variables are restated for this button only, so it keeps the desktop size on phones. */
@media (max-width: 575.98px) {
  .contact__actions {
    --fs-hf-btn: 18px;
    --hf-btn-pad-x: 24px;
  }
}

/* Tablet in portrait (576-879px): the form fields are 16px, as on phones. Below 16px, Safari on a
   touch screen zooms the whole page in when a field is focused, and the page then has to be
   pinched back out; the 15px desktop size was still in force on tablets, which only phones had
   been given a fix for. The visual change is 1px. The short texts under the three contact points
   sit in 166-240px columns, where "settings." was left alone on its last line; pretty keeps the
   last line to at least two words. */
@media (min-width: 576px) and (max-width: 879.98px) {
  .contact-field__control {
    font-size: 16px;
  }

  .contact-point__text {
    text-wrap: pretty;
  }
}

/* Tablet (640-879px): the green card is centred, like the headings of the other sections on
   tablet. The title and the lead sat at the left of a 738px card with 330px of empty green beside
   the lead, and the three contact points (icon above text) were left-aligned in their columns, so
   the card leaned to the left while the Submit button under it was centred. Now the title, the
   lead and each contact point (icon and text) are centred on their own column. The lead is
   balanced, which suits a centred paragraph ("…feel / free to reach out 24/7." instead of a last
   line of "out 24/7."). Not applied from 576px to 639px, where the points are still rows (icon
   beside the text) and read best left-aligned, or from 880px, where the green card is the left
   half of one card. Form labels and fields stay start-aligned, as forms do. */
@media (min-width: 640px) and (max-width: 879.98px) {
  .contact__head {
    align-items: center;
    text-align: center;
  }

  .contact__lead {
    text-wrap: balance;
  }

  .contact-point {
    align-items: center;
    text-align: center;
  }
}

/* Success toast, the same card LeadXForms shows after its contact form is sent: top right, white,
   green check, message, close button and a green bar that runs out as the toast leaves. The message
   is written into it by site.js (showToast); on screen it is role="status", so it is also announced. */
.contact-toast {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10000;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: 340px;
  max-width: calc(100vw - 32px);
  padding: 18px 16px 20px 18px;
  overflow: hidden;
  border-radius: 12px;
  background-color: #ffffff;
  box-shadow: 0 10px 30px rgba(20, 30, 25, 0.18);
  font-size: 17px;
  line-height: 1.4;
  color: #6b716d;
  animation: contact-toast-in 0.3s ease both;
}

.contact-toast[hidden] {
  display: none;
}

.contact-toast__icon {
  flex: none;
  width: 26px;
  height: 26px;
  margin-top: 2px;
  border-radius: 50%;
  background-color: #14c23a;
}

.contact-toast__icon svg {
  display: block;
  width: 26px;
  height: 26px;
  fill: none;
  stroke: #ffffff;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.contact-toast__text {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}

.contact-toast__close {
  flex: none;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  color: #aab0ac;
  cursor: pointer;
}

.contact-toast__close:hover {
  color: #5f6b66;
}

.contact-toast__bar {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 4px;
  background-color: #14c23a;
  transform-origin: left center;
  animation: contact-toast-bar 5s linear both;
}

@keyframes contact-toast-in {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes contact-toast-bar {
  from {
    transform: scaleX(1);
  }

  to {
    transform: scaleX(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .contact-toast {
    animation: none;
  }
}

/* Sending loader, the one LeadXForms shows while its contact form posts: the page dims, and a square
   card with a green spinner and "Please Wait..." sits in the middle. It covers the page, so nothing
   can be clicked or sent twice while the request runs. Shown and hidden by site.js (showLoader). */
.contact-loader {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.35);
}

.contact-loader[hidden] {
  display: none;
}

.contact-loader__box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 180px;
  height: 180px;
  background-color: #f2f2f2;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.contact-loader__spinner {
  width: 54px;
  height: 54px;
  border: 5px solid transparent;
  border-top-color: var(--opt-green);
  border-left-color: var(--opt-green);
  border-radius: 50%;
  animation: contact-loader-spin 0.9s linear infinite;
}

.contact-loader__text {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: #1b1b1b;
}

@keyframes contact-loader-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .contact-loader__spinner {
    animation-duration: 2.4s;
  }
}
