/* ==========================================================================
   HM2 WhatsApp Lead — Modal de captação de leads
   Independente do recurso hm2_comp_whatsapp_cta.
   Ativo apenas quando .hm2-wa-lead-modal está presente na página.
   ========================================================================== */

/* Modal — oculto por padrão */
body:not(.path-admin) .hm2-wa-lead-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  pointer-events: none;
}

body:not(.path-admin) .hm2-wa-lead-modal.is-open {
  visibility: visible;
  pointer-events: auto;
}

/* Backdrop */
body:not(.path-admin) .hm2-wa-lead-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  opacity: 0;
  transition: opacity .2s ease;
}

body:not(.path-admin) .hm2-wa-lead-modal.is-open .hm2-wa-lead-modal__backdrop {
  opacity: 1;
}

/* Scroll lock */
body.hm2-wa-modal-open {
  overflow: hidden;
}

/* Caixa */
body:not(.path-admin) .hm2-wa-lead-modal__box {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: .75rem;
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, .25);
  width: min(92vw, 460px);
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem 1.75rem 1.75rem;
  outline: none;
  transform: translateY(12px);
  opacity: 0;
  transition: transform .22s ease, opacity .22s ease;
}

body:not(.path-admin) .hm2-wa-lead-modal.is-open .hm2-wa-lead-modal__box {
  transform: translateY(0);
  opacity: 1;
}

/* Botão fechar */
body:not(.path-admin) .hm2-wa-lead-modal__close {
  position: absolute;
  top: .75rem;
  right: .75rem;
  width: 2rem;
  height: 2rem;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  padding: 0;
  transition: background .15s;
}

body:not(.path-admin) .hm2-wa-lead-modal__close:hover,
body:not(.path-admin) .hm2-wa-lead-modal__close:focus-visible {
  background: rgba(0, 0, 0, .07);
  outline: 2px solid currentColor;
}

/* Cabeçalho */
body:not(.path-admin) .hm2-wa-lead-modal__header {
  margin-bottom: 1.25rem;
  padding-right: 1.5rem;
}

body:not(.path-admin) .hm2-wa-lead-modal__title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--hm2-color-primary, #333);
}

/* Corpo — reset webform */
body:not(.path-admin) .hm2-wa-lead-modal__body .webform-submission-form {
  margin: 0;
}

body:not(.path-admin) .hm2-wa-lead-modal__body .form-item {
  margin-bottom: .9rem;
}

body:not(.path-admin) .hm2-wa-lead-modal__body .form-item label {
  display: block;
  font-size: .88rem;
  font-weight: 500;
  margin-bottom: .3rem;
}

body:not(.path-admin) .hm2-wa-lead-modal__body .form-text,
body:not(.path-admin) .hm2-wa-lead-modal__body .form-tel,
body:not(.path-admin) .hm2-wa-lead-modal__body .form-email {
  width: 100%;
  padding: .5rem .75rem;
  border: 1px solid #ccc;
  border-radius: .4rem;
  font-size: .95rem;
  transition: border-color .15s;
}

body:not(.path-admin) .hm2-wa-lead-modal__body .form-text:focus,
body:not(.path-admin) .hm2-wa-lead-modal__body .form-tel:focus,
body:not(.path-admin) .hm2-wa-lead-modal__body .form-email:focus {
  border-color: var(--hm2-color-primary, #0d6efd);
  outline: none;
  box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb, 13, 110, 253), .15);
}

/* Botão submit */
body:not(.path-admin) .hm2-wa-lead-modal__body .webform-button--submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  width: 100%;
  padding: .7rem 1rem;
  margin-top: .5rem;
  background: var(--hm2-color-primary, #25d366);
  color: #fff;
  border: none;
  border-radius: .4rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: filter .15s;
}

body:not(.path-admin) .hm2-wa-lead-modal__body .webform-button--submit:hover {
  filter: brightness(.9);
}

/* Checkbox de consentimento */
body:not(.path-admin) .hm2-wa-lead-modal__body .form-type--checkbox {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  font-size: .82rem;
  color: #555;
}

body:not(.path-admin) .hm2-wa-lead-modal__body .form-type--checkbox input[type="checkbox"] {
  margin-top: .15rem;
  flex-shrink: 0;
}

body:not(.path-admin) .hm2-wa-lead-modal__body .form-type--checkbox label {
  font-weight: normal;
  font-size: .82rem;
  margin-bottom: 0;
}

/* Confirmação pós-submit */
body:not(.path-admin) .hm2-wa-lead-modal__body .webform-confirmation {
  text-align: center;
  padding: 1rem 0;
}
