/**
 * Contact modal — international phone input (intl-tel-input) overrides.
 *
 * Makes the intl-tel-input widget fit the white, pill-shaped CF7 field used
 * in the contact modal (#modal02).
 */

#modal02 .iti {
  display: block;
  width: 100%;
}

/* Keep the white pill look — the input is wrapped by .iti now. */
#modal02 .iti > input[type="tel"] {
  width: 100% !important;
  height: 56px !important;
  border-radius: 100px;
}

/* Selected country / flag button rounded to match the left pill edge. */
#modal02 .iti__selected-country {
  border-radius: 100px 0 0 100px;
  padding-left: 18px;
}

#modal02 .iti__selected-country-primary {
  gap: 6px;
}

/* Dial code text matches the dark field text colour. */
#modal02 .iti__selected-dial-code {
  font-weight: 500;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: #18181a;
}

/* Dropdown panel. */
#modal02 .iti__dropdown-content {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(125, 135, 145, 0.18);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
}

#modal02 .iti__search-input {
  height: 44px;
  font-size: 15px;
}

/* Error state mirrors CF7's .wpcf7-not-valid styling. */
#modal02 .iti > input[type="tel"].wpcf7-not-valid {
  background: #ffdddd !important;
  border-color: #ff5454 !important;
  color: #ff5454 !important;
}

/* ============================================================
   Full field set (name · phone · email · service · consent)
   Mirrors the Permit consultation form, adapted to the white
   contact modal. Works with the CF7 template documented in
   inc/cf7-contact-form.md.
   ============================================================ */

/* Two-column grid: name | phone, email | service, then submit. */
#modal02 .wpcf7-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: start;
}

@media (min-width: 768px) {
  #modal02 .wpcf7-form {
    grid-template-columns: 1fr 1fr;
    gap: 12px 8px;
  }

  /* Email and submit span the full width. */
  #modal02 .modalForm__field--full {
    grid-column: 1 / -1;
  }
}

#modal02 .modalForm__field {
  position: relative;
  margin: 0;
}

/* Keep the intl-tel-input wrapper filling its grid cell. */
#modal02 .modalForm__field .iti {
  width: 100%;
}

/* ---- Service select ------------------------------------------------ */
#modal02 select.wpcf7-form-control {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 100%;
  height: 56px;
  background: #fff;
  border: 1px solid rgba(125, 135, 145, 0.1);
  border-radius: 100px;
  padding: 0 50px 0 27px;
  font-weight: 500;
  font-size: 18px;
  line-height: 20px;
  letter-spacing: -0.01em;
  color: #18181a;
  cursor: pointer;
  transition: 0.3s;
}

/* Grey out the placeholder option (empty value, via CF7 first_as_label). */
#modal02 select.wpcf7-form-control:invalid,
#modal02 select.wpcf7-form-control:has(option[value=""]:checked) {
  color: rgba(24, 24, 26, 0.48);
}

/* Custom chevron — native arrow is hidden by appearance:none above. */
#modal02 .modalForm__field--select::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 18px;
  width: 24px;
  height: 24px;
  transform: translateY(-50%);
  pointer-events: none;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' stroke='%2318181a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center / 12px 8px no-repeat;
}

#modal02 select.wpcf7-form-control.wpcf7-not-valid {
  background: #ffdddd !important;
  border-color: #ff5454 !important;
  color: #ff5454 !important;
}

/* ---- Consent checkbox (CF7 [acceptance]) --------------------------- */
#modal02 .modalForm__consent {
  grid-column: 1 / -1;
  margin: 0;
}

#modal02 .modalForm__consent .wpcf7-list-item {
  margin: 0;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

#modal02 .modalForm__consent .wpcf7-list-item-label {
  font-weight: 400;
  font-size: 14px;
  line-height: 1.43;
  letter-spacing: -0.01em;
  color: rgba(255, 255, 255, 0.65);
}

#modal02 .modalForm__consent input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin: 0;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  transition: 0.2s;
}

#modal02 .modalForm__consent input[type="checkbox"]:checked {
  background: #00c37b
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M20 6 9 17l-5-5' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center / 14px no-repeat;
  border-color: #00c37b;
}

#modal02 .modalForm__consent.wpcf7-not-valid input[type="checkbox"],
#modal02 .modalForm__consent .wpcf7-not-valid {
  border-color: #ff5454;
}
