/* Hide body until brand.js rewrites placeholders */
html.brand-pending body {
  visibility: hidden;
}

/* Functional form-22 integration only — keeps existing site form look */

.leadform {
  position: relative;
  overflow: visible;
}

.leadform [data-form-fields] {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.leadform .form-group.field,
.leadform .form-group:has(> button),
.leadform .form-msg,
.leadform > [data-form-fields] > ul {
  width: 100%;
  margin-bottom: 0;
}

.leadform .field {
  margin-bottom: 0;
}

.leadform .field label {
  display: none;
}

.leadform .field .iti {
  width: 100%;
  display: block;
  position: relative;
}

.leadform .field .iti input.iti__tel-input,
.leadform .field .iti input[type="tel"] {
  width: 100%;
}

/* Padding / gap between name fields on desktop (side by side) */
@media (min-width: 768px) {
  .leadform .form-group.field:has(input[name="first_name"]),
  .leadform .form-group.field:has(input[name="last_name"]) {
    width: calc(50% - 7px);
    flex: 0 0 calc(50% - 7px);
  }
}

.leadform .field-error {
  display: block;
  color: #c8102e;
  font-weight: 600;
  font-size: 13px;
  margin: 6px 0 0;
  min-height: 0;
}

.leadform .field-error.hide {
  display: none !important;
}

.leadform .field.is-invalid input,
.leadform .field.is-invalid .iti__tel-input {
  border-color: #c8102e;
}

.leadform .honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

.leadform .form-preloader {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.55);
}

.leadform .form-preloader.hidden {
  display: none !important;
}

.leadform .form-preloader .spinner,
.leadform .form-preloader .dot-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(0, 0, 0, 0.15);
  border-top-color: #1a1a1a;
  border-radius: 50%;
  animation: lead-spin 0.8s linear infinite;
}

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

.leadform .form-msg {
  margin-top: 0;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}

.leadform .form-msg.hidden {
  display: none !important;
}

.leadform .form-msg.err {
  display: block;
  color: #c8102e;
  background: rgba(200, 16, 46, 0.12);
}

.leadform .form-msg.ok {
  display: block;
  color: #15803d;
  background: rgba(21, 128, 61, 0.12);
}

.hidden {
  display: none !important;
}

/* Allow dropdown to escape form card / page wrapper */
.home__form,
.form__bg,
.form-login,
.form-contact,
.leadform .field {
  overflow: visible !important;
}

/* Shared country-picker bits */
.iti__selected-flag,
.iti__selected-country {
  background: transparent !important;
}

.iti--separate-dial-code .iti__selected-dial-code,
.iti__selected-dial-code {
  color: #111 !important;
}

.iti__search-input {
  display: block;
  width: 100% !important;
  min-width: 0 !important;
  height: auto !important;
  min-height: 48px !important;
  max-height: none !important;
  box-sizing: border-box;
  margin: 0 !important;
  padding: 12px 14px !important;
  border: none !important;
  border-bottom: 1px solid #e4e7ec !important;
  border-radius: 0 !important;
  font-size: 15px !important;
  color: #1a1c23 !important;
  background: #fff !important;
  outline: none !important;
  /* Override site-wide `input { height: 100% }` that collapses the country list */
  flex: 0 0 auto !important;
  align-self: stretch !important;
}

.iti__search-input:focus {
  border-bottom-color: #2f6fed !important;
  box-shadow: inset 0 0 0 1px #2f6fed !important;
}

.iti__country {
  display: flex !important;
  align-items: center !important;
  gap: 8px;
  padding: 10px 14px !important;
  color: #1a1c23 !important;
  cursor: pointer;
}

.iti__country.iti__highlight,
.iti__country:hover {
  background: #f2f4f7 !important;
  color: #1a1c23 !important;
}

.iti__flag-box,
.iti__country-name {
  margin-right: 8px;
}

.iti__country-name {
  color: #1a1c23 !important;
  font-size: 14px;
}

.iti__dial-code {
  color: #667085 !important;
  font-size: 14px;
}

/* Mobile fullscreen popup — Search + full country list */
.iti--fullscreen-popup.iti--container {
  position: fixed !important;
  inset: 0 !important;
  z-index: 10060 !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 16px !important;
  box-sizing: border-box;
  background: rgba(16, 24, 40, 0.45) !important;
}

.iti--fullscreen-popup .iti__dropdown-content {
  display: flex !important;
  flex-direction: column !important;
  width: min(420px, 100%) !important;
  max-width: 100% !important;
  height: min(640px, calc(100vh - 32px)) !important;
  max-height: calc(100vh - 32px) !important;
  margin: 0 !important;
  border: none !important;
  border-radius: 12px !important;
  background: #fff !important;
  box-shadow: 0 16px 40px rgba(16, 24, 40, 0.28) !important;
  overflow: hidden !important;
}

.iti--fullscreen-popup .iti__search-input {
  flex: 0 0 auto !important;
  height: auto !important;
  min-height: 52px !important;
  max-height: 56px !important;
  padding: 14px 16px !important;
  font-size: 16px !important;
  border-radius: 8px 8px 0 0 !important;
}

.iti--fullscreen-popup .iti__country-list {
  flex: 1 1 auto !important;
  height: auto !important;
  max-height: none !important;
  min-height: 200px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  background: #fff !important;
  white-space: normal !important;
}

.iti--fullscreen-popup .iti__country {
  padding: 12px 16px !important;
}

/* Desktop inline dropdown only (do not affect fullscreen popup) */
@media (min-width: 768px) {
  .iti:not(.iti--fullscreen-popup) .iti__dropdown-content,
  .iti:not(.iti--fullscreen-popup) .iti__country-list,
  body > .iti--container:not(.iti--fullscreen-popup) .iti__dropdown-content,
  body > .iti--container:not(.iti--fullscreen-popup) .iti__country-list {
    background: #fff !important;
    color: #1a1c23 !important;
    border: 1px solid #d0d5dd !important;
    border-radius: 0 0 8px 8px !important;
    box-shadow: 0 10px 28px rgba(16, 24, 40, 0.14) !important;
    z-index: 10050 !important;
  }

  body > .iti--container:not(.iti--fullscreen-popup) {
    z-index: 10050 !important;
  }

  body > .iti--container:not(.iti--fullscreen-popup) .iti__dropdown-content,
  body > .iti--container:not(.iti--fullscreen-popup) .iti__country-list {
    width: 100%;
    max-width: min(420px, calc(100vw - 24px));
    min-width: 280px;
  }

  body > .iti--container:not(.iti--fullscreen-popup) .iti__country-list,
  .iti:not(.iti--fullscreen-popup) .iti__country-list {
    max-height: 260px;
    overflow-y: auto;
    margin: 0 !important;
    padding: 0 !important;
    white-space: nowrap;
  }
}
