/**
 * Shared lead-form layout and CRM states.
 *
 * Control appearance is owned by form-primitives.css. This file only owns
 * lead-form composition, privacy/disclaimer layout and submission states.
 */

#contact-form > .block {
  display: none !important;
}

#contact-form,
#contact-form #crmWebToEntityForm {
  width: 100% !important;
}

#contact-form #crmWebToEntityForm {
  max-width: var(--jci-form-max-width) !important;
  margin: 0 auto !important;
}

form.lead-form.jci-form {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 12px 16px !important;
  width: 100% !important;
  max-width: var(--jci-form-max-width) !important;
  margin: 0 auto !important;
  text-align: left !important;
}

form.lead-form .lds-ripple,
form.lead-form > div[style*="left:-9999px"],
form.lead-form > div[style*="left: -9999px"],
form.lead-form .jci-global-form-honeypot {
  position: absolute !important;
  left: -9999px !important;
  top: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

form.lead-form > :where(
  input:not([type="hidden"]):not([type="checkbox"]):not([type="submit"]),
  select:not(.jci-form-hidden-field),
  textarea
) {
  grid-column: 1 / -1 !important;
}

form.lead-form > input[name="First Name"] {
  grid-column: 1 / 2 !important;
}

form.lead-form > input[name="Last Name"] {
  grid-column: 2 / 3 !important;
}

form.lead-form > textarea[name="Description"] {
  min-height: 122px !important;
}

form.lead-form > .jci-phone-input-group {
  display: grid !important;
  grid-template-columns: minmax(170px, 0.36fr) minmax(0, 1fr) !important;
  grid-column: 1 / -1 !important;
  gap: 10px !important;
  width: 100% !important;
  min-width: 0 !important;
}

form.lead-form .jci-phone-input-group__country,
form.lead-form .jci-phone-input-group__number {
  width: 100% !important;
  min-width: 0 !important;
}

form.lead-form > small,
form.lead-form > br,
form.lead-form .form-group,
form.lead-form .jci-global-form-disclaimer,
form.lead-form .jci-global-form-privacy,
form.lead-form .jci-global-form-status {
  grid-column: 1 / -1 !important;
}

form.lead-form > br {
  display: none;
}

form.lead-form > small,
form.lead-form .form-group,
form.lead-form .form-group small,
form.lead-form .form-group .fw200,
form.lead-form .jci-global-form-disclaimer,
form.lead-form .jci-global-form-privacy,
form.lead-form .jci-global-form-privacy-control,
form.lead-form .jci-global-form-privacy-copy {
  margin: 0 !important;
}

/* Shared legal-copy typography. reCAPTCHA keeps its own spacing but follows
 * exactly the same readable secondary-text contract as opt-out/privacy copy. */
form.lead-form > small,
form.lead-form .form-group,
form.lead-form .form-group small,
form.lead-form .form-group .fw200,
form.lead-form .jci-global-form-disclaimer,
form.lead-form .jci-global-form-privacy,
form.lead-form .jci-global-form-privacy-control,
form.lead-form .jci-global-form-privacy-copy,
form.lead-form .jci-global-form-recaptcha-notice {
  color: var(--jci-form-muted) !important;
  font-family: var(--jci-form-font) !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  line-height: 1.5 !important;
}

form.lead-form > small,
form.lead-form .jci-global-form-disclaimer {
  padding-top: 2px;
}

form.lead-form a {
  color: inherit !important;
  text-decoration: underline !important;
  text-decoration-thickness: 1px !important;
  text-underline-offset: 2px !important;
}

form.lead-form a:hover,
form.lead-form a:focus-visible {
  color: var(--jci-form-border-focus) !important;
}

form.lead-form .jci-global-form-privacy {
  display: grid !important;
  grid-template-columns: 20px minmax(0, 1fr) !important;
  column-gap: 9px !important;
  align-items: start !important;
}

form.lead-form .jci-global-form-privacy .jci-global-form-privacy-control {
  grid-column: 1;
}

form.lead-form .jci-global-form-privacy .jci-global-form-privacy-copy {
  grid-column: 2;
}

form.lead-form .jci-global-form-privacy-control,
form.lead-form .jci-global-form-privacy-copy,
form.lead-form .newCustomchkbox-md,
form.lead-form .displayPurpose {
  display: block !important;
  width: auto !important;
}

form.lead-form .newCustomchkbox-md {
  line-height: 1 !important;
}

form.lead-form input[type="checkbox"]#privacyTool {
  display: block !important;
  width: 18px !important;
  height: 18px !important;
  margin: 0 !important;
  vertical-align: top !important;
}

form.lead-form .chkbxIcon {
  display: none !important;
}

form.lead-form .jci-global-form-recaptcha-notice {
  grid-column: 1 / 2 !important;
}

form.lead-form button#formsubmit,
form.lead-form input#formsubmit[type="submit"] {
  grid-column: 2 / 3 !important;
  justify-self: end !important;
  align-self: start !important;
  min-width: 0 !important;
  margin-top: 4px !important;
}

form.lead-form .jci-global-form-status {
  width: 100%;
  margin: 8px 0 0 !important;
  padding: 10px 12px;
  border-radius: var(--jci-form-radius);
  background: #f6f8fb;
  color: var(--jci-form-muted);
}

form.lead-form .jci-global-form-status[role="alert"] {
  background: #fff4f2;
  color: #a40000;
}

form.lead-form [hidden],
form.lead-form .jci-form-hidden-field {
  display: none !important;
}

form.lead-form[aria-busy="true"] {
  cursor: progress;
}

form.lead-form[aria-busy="true"] :where(input, select, textarea, button) {
  cursor: progress;
}

@media (max-width: 720px) {
  form.lead-form.jci-form {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  form.lead-form > .jci-phone-input-group {
    grid-template-columns: minmax(138px, 0.42fr) minmax(0, 1fr) !important;
    gap: 8px !important;
  }

  form.lead-form > input[name="First Name"],
  form.lead-form > input[name="Last Name"],
  form.lead-form button#formsubmit,
  form.lead-form input#formsubmit[type="submit"] {
    grid-column: 1 / -1 !important;
  }

  form.lead-form .jci-global-form-privacy {
    grid-template-columns: 22px minmax(0, 1fr) !important;
    column-gap: 10px !important;
  }

  form.lead-form input[type="checkbox"]#privacyTool {
    width: 20px !important;
    height: 20px !important;
  }

  form.lead-form > small,
  form.lead-form .form-group,
  form.lead-form .form-group small,
  form.lead-form .form-group .fw200,
  form.lead-form .jci-global-form-disclaimer,
  form.lead-form .jci-global-form-privacy,
  form.lead-form .jci-global-form-privacy-control,
  form.lead-form .jci-global-form-privacy-copy,
  form.lead-form .jci-global-form-recaptcha-notice {
    font-size: 13px !important;
    line-height: 1.5 !important;
  }

  form.lead-form button#formsubmit,
  form.lead-form input#formsubmit[type="submit"] {
    width: 100% !important;
    min-height: 42px;
    padding: 9px 10px;
  }

  form.lead-form button#formsubmit {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) 28px;
    align-items: center;
    gap: 0;
  }

  form.lead-form button#formsubmit .jci-form-submit__icon {
    grid-column: 1;
    justify-self: start;
    max-height: 12px;
  }

  form.lead-form button#formsubmit .jci-form-submit__label {
    grid-column: 2;
    justify-self: center;
    text-align: center;
  }
}

/* reCAPTCHA remains active; the vendor badge is hidden only because the
 * required Google disclosure is rendered inside every protected form. */
.grecaptcha-badge {
  visibility: hidden !important;
}

.jci-global-form-recaptcha-notice {
  max-width: 68ch;
  margin: 8px 0 14px;
}

.jci-global-form-recaptcha-notice a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.jci-global-form-recaptcha-notice a:hover {
  color: var(--jci-form-text, #041c40);
}

