/* ============================================
   FORMULARIO DE COTIZACIÓN (modal + CTAs)
   Archivo propio a propósito: styles.css se sirve con cache de 30 días y
   el rediseño lo pisa a gusto. Usa los tokens de :root de styles.css.
   ============================================ */

/* ── Botones que abren el formulario ─────── */
.btn-cotizar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 24px;
  border: 1.5px solid #1C7BBE;
  background: var(--white, #fff);
  color: #1C7BBE;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.2px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.btn-cotizar:hover {
  background: #1C7BBE;
  color: var(--white, #fff);
  transform: translateY(-1px);
}

/* CTA dentro del estado vacío del chat */
.lead-cta {
  position: relative; /* por encima del video de fondo del chat (z-index 0) */
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
}
.lead-cta__hint {
  margin: 0;
  font-size: 13px;
  color: var(--gray-light, #888);
}
.lead-cta .btn-cotizar {
  background: linear-gradient(135deg, #1C7BBE 0%, #5BB4F0 100%);
  border-color: transparent;
  color: var(--white, #fff);
  box-shadow: 0 4px 12px rgba(28, 123, 190, 0.25);
}
.lead-cta .btn-cotizar:hover {
  filter: brightness(1.06);
}

/* ── Modal ───────────────────────────────── */
/* El atributo hidden tiene que ganarle a los display:flex de abajo */
.lead-modal [hidden] { display: none !important; }

.lead-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.lead-modal[hidden] { display: none; }

.lead-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 47, 68, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.lead-modal__card {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  background: var(--white, #fff);
  border-radius: var(--radius, 16px);
  box-shadow: var(--shadow-lg, 0 6px 24px rgba(0,0,0,0.11));
  padding: 28px 24px 22px;
  font-family: var(--font, 'Montserrat', sans-serif);
  color: var(--navy, #1a2f44);
  animation: lead-pop 0.25s ease;
}
@keyframes lead-pop {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .lead-modal__card { animation: none; }
}

.lead-modal__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--gray-light, #888);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}
.lead-modal__close:hover {
  background: var(--gray-bg, #f7f9fa);
  color: var(--navy, #1a2f44);
}

/* ── Textos ──────────────────────────────── */
.lead-form__eyebrow {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal, #4a8fb5);
}
.lead-form__title {
  margin: 0 0 6px;
  font-family: var(--font-display, 'DM Serif Display', serif);
  font-weight: 400;
  font-size: 28px;
  line-height: 1.15;
  color: var(--navy, #1a2f44);
}
.lead-form__subtitle {
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--gray-text, #444);
}

/* ── Campos ──────────────────────────────── */
.lead-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.lead-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy, #1a2f44);
}
.lead-field em {
  font-style: normal;
  font-weight: 400;
  color: var(--gray-light, #888);
}
.lead-field input {
  font: inherit;
  font-size: 16px; /* 16px evita el zoom automático de iOS */
  font-weight: 400;
  padding: 11px 13px;
  border: 1px solid var(--gray-border, #e4e8ea);
  border-radius: var(--radius-sm, 10px);
  background: var(--white, #fff);
  color: var(--navy, #1a2f44);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.lead-field input:focus {
  border-color: var(--teal, #4a8fb5);
  box-shadow: 0 0 0 3px rgba(74, 143, 181, 0.18);
}
.lead-field input[aria-invalid="true"] {
  border-color: var(--red-hang, #ef4444);
}

/* Honeypot: fuera de la vista, no display:none (algunos bots lo detectan) */
.lead-hp {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.lead-form__error {
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm, 10px);
  background: #fdecec;
  color: #b42318;
  font-size: 13px;
  line-height: 1.45;
}
.lead-form__error a {
  color: inherit;
  font-weight: 700;
}

.lead-form__submit {
  margin-top: 4px;
  border: 0;
  cursor: pointer;
  padding: 14px 20px;
  border-radius: 24px;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  color: var(--white, #fff);
  background: linear-gradient(135deg, #1C7BBE 0%, #5BB4F0 100%);
  box-shadow: 0 4px 12px rgba(28, 123, 190, 0.25);
  transition: transform 0.2s ease, filter 0.2s ease;
}
.lead-form__submit:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}
.lead-form__submit:disabled {
  opacity: 0.7;
  cursor: wait;
  transform: none;
}
.lead-form__submit--ghost {
  background: var(--gray-bg, #f7f9fa);
  color: var(--navy, #1a2f44);
  box-shadow: none;
}

.lead-form__note {
  margin: 2px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--gray-light, #888);
  text-align: center;
}

/* ── Éxito ───────────────────────────────── */
.lead-form__success {
  text-align: center;
  padding: 8px 0 4px;
}
.lead-form__check {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--teal-light, #eaf3f8);
  color: var(--teal, #4a8fb5);
  font-size: 28px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lead-form__success h3 {
  margin: 0 0 8px;
  font-family: var(--font-display, 'DM Serif Display', serif);
  font-weight: 400;
  font-size: 26px;
  color: var(--navy, #1a2f44);
}
.lead-form__success p {
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--gray-text, #444);
}

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

/* ── Mobile ──────────────────────────────── */
@media (max-width: 600px) {
  /* El header ya va justo con logo + tabs + Contactanos: el botón vive en el chat
     y en #cotizar (anuncios). */
  .header .btn-cotizar { display: none; }
  /* El estado vacío del chat mide justo para el logo + 4 chips y recorta lo que sobra
     (overflow hidden). Con el CTA abajo ya no entra en un iPhone SE: en mobile lo
     dejamos scrollear en vez de recortar. */
  .chat-empty {
    overflow-y: auto;
    justify-content: flex-start;
    padding: 24px 20px;
    gap: 24px;
  }
  .lead-cta { margin-top: 0; padding-bottom: 8px; }
  .lead-modal { padding: 10px; }
  .lead-modal__card { padding: 24px 18px 18px; }
  .lead-form__title { font-size: 24px; }
}
