/* Modal de pre-contacto WhatsApp
 * Diseño basado en la referencia entregada por el cliente.
 */

.cnp-lead-modal-open {
  overflow: hidden;
}

.cnp-lead-modal[hidden] {
  display: none !important;
}

.cnp-lead-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  font-family: "Montserrat", Arial, sans-serif;
}

.cnp-lead-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 16, 16, 0.62);
  backdrop-filter: blur(1px);
}

.cnp-lead-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: #fff;
  border-radius: 34px;
  padding: 24px 28px 20px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  color: #202020;
}

.cnp-lead-modal__close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #666;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.cnp-lead-modal__close:hover,
.cnp-lead-modal__close:focus-visible {
  background: #f3f3f3;
  color: #222;
  outline: none;
}

.cnp-lead-modal__brand {
  display: flex;
  justify-content: center;
  margin: 2px 0 20px;
}

.cnp-lead-modal__logo {
  display: block;
  width: auto;
  max-width: 210px;
  max-height: 112px;
  object-fit: contain;
}

.cnp-lead-modal__form {
  display: grid;
  gap: 10px;
}

.cnp-lead-modal__field {
  position: relative;
}

.cnp-lead-modal__input-wrap {
  min-height: 50px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1.5px solid #ff4b23;
  border-radius: 9px;
  padding: 0 13px;
  background: #fff;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.cnp-lead-modal__input-wrap:focus-within {
  border-color: #ff3d12;
  box-shadow: 0 0 0 3px rgba(255, 75, 35, 0.12);
}

.cnp-lead-modal__input-wrap.is-invalid {
  border-color: #c92525;
  box-shadow: 0 0 0 3px rgba(201, 37, 37, 0.10);
}

.cnp-lead-modal__icon {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  color: #272727;
}

.cnp-lead-modal__icon svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cnp-lead-modal__input {
  width: 100%;
  min-width: 0;
  height: 46px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #282828;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
}

.cnp-lead-modal__input::placeholder {
  color: #3d3d3d;
  opacity: 1;
}

.cnp-lead-modal__error {
  min-height: 0;
  margin: 4px 4px 0;
  color: #bd1f1f;
  font-size: 11px;
  line-height: 1.35;
}

.cnp-lead-modal__field:not(.has-error) .cnp-lead-modal__error {
  display: none;
}

.cnp-lead-modal__marketing {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 1px 0 2px;
  padding: 0 1px;
  cursor: pointer;
  user-select: none;
  font-size: 11px;
  line-height: 1.4;
  font-style: italic;
  color: #242424;
}

.cnp-lead-modal__marketing input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.cnp-lead-modal__check {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border: 1.5px solid #ff4b23;
  border-radius: 3px;
  position: relative;
  background: #fff;
}

.cnp-lead-modal__marketing input:focus-visible + .cnp-lead-modal__check {
  box-shadow: 0 0 0 3px rgba(255, 75, 35, 0.15);
}

.cnp-lead-modal__marketing input:checked + .cnp-lead-modal__check::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 1px;
  width: 7px;
  height: 14px;
  border-right: 3px solid #282828;
  border-bottom: 3px solid #282828;
  transform: rotate(42deg);
}

.cnp-lead-modal__primary,
.cnp-lead-modal__secondary {
  width: 100%;
  border: 0;
  font-family: inherit;
  cursor: pointer;
}

.cnp-lead-modal__primary {
  min-height: 49px;
  border-radius: 24px;
  background: #20c866;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 18px;
  transition: transform .15s ease, filter .15s ease;
}

.cnp-lead-modal__primary:hover {
  filter: brightness(.96);
  transform: translateY(-1px);
}

.cnp-lead-modal__primary:active {
  transform: translateY(0);
}

.cnp-lead-modal__wa-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
}

.cnp-lead-modal__wa-icon svg {
  width: 100%;
  height: 100%;
  display: block;
  fill: currentColor;
}

.cnp-lead-modal__secondary {
  background: transparent;
  color: #4c4c4c;
  font-size: 11px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 3px 8px 1px;
}

.cnp-lead-modal__secondary:hover,
.cnp-lead-modal__secondary:focus-visible {
  color: #111;
  outline: none;
}

.cnp-lead-modal__note {
  margin: 6px auto 0;
  max-width: 310px;
  text-align: center;
  color: #353535;
  font-size: 9px;
  line-height: 1.35;
  font-style: italic;
}

@media (max-width: 520px) {
  .cnp-lead-modal {
    padding: 12px;
    align-items: center;
  }

  .cnp-lead-modal__dialog {
    width: min(100%, 390px);
    border-radius: 28px;
    padding: 22px 20px 18px;
  }

  .cnp-lead-modal__brand {
    margin-bottom: 17px;
  }

  .cnp-lead-modal__logo {
    max-width: 180px;
    max-height: 100px;
  }

  .cnp-lead-modal__input-wrap {
    min-height: 52px;
  }

  .cnp-lead-modal__input {
    font-size: 16px;
  }

  .cnp-lead-modal__marketing {
    font-size: 11px;
  }
}

@media (max-height: 650px) {
  .cnp-lead-modal {
    align-items: start;
    overflow-y: auto;
  }

  .cnp-lead-modal__dialog {
    margin: 8px 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cnp-lead-modal__input-wrap,
  .cnp-lead-modal__primary {
    transition: none;
  }
}


/* Estado de guardado del lead */
.cnp-lead-modal__status {
  display: none;
  margin: 0 2px 2px;
  padding: 9px 11px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
}

.cnp-lead-modal__status.is-error,
.cnp-lead-modal__status.is-success {
  display: block;
}

.cnp-lead-modal__status.is-error {
  background: #fff1f1;
  color: #a61b1b;
  border: 1px solid #ffd2d2;
}

.cnp-lead-modal__status.is-success {
  background: #eefbf3;
  color: #13723c;
  border: 1px solid #c9efd8;
}

.cnp-lead-modal__primary:disabled,
.cnp-lead-modal__secondary:disabled {
  cursor: wait;
  opacity: .72;
}

.cnp-lead-modal__primary.is-loading {
  transform: none;
  filter: none;
}
