/* lead-form.css — Formulario de interesados Media Soft (kit reutilizable).
   Sin dependencias. Todo lo visual sale de variables --lead-*: el sitio las cambia en su propio CSS
   (por ejemplo :root{--lead-primario:#7a1fa2}) sin tocar este archivo. Por defecto, marca EF2. */
:root {
  --lead-primario: #0B5FD9;        /* azul EF2 */
  --lead-primario-oscuro: #06245A; /* navy EF2 */
  --lead-acento: #FFD21E;          /* amarillo EF2 */
  --lead-wa: #0F7A3E;              /* verde WhatsApp accesible: texto blanco 5,4:1 */
  --lead-wa-hover: #0C6633;
  --lead-fondo: #ffffff;
  --lead-fondo-2: #eef3fb;
  --lead-texto: #10213f;
  --lead-texto-2: #4a566b;
  --lead-borde: #c9d3e3;
  --lead-borde-campo: #7389aa;     /* borde de campos: 3,6:1 contra blanco */
  --lead-error: #c4141c;
  --lead-foco: #0B5FD9;
  --lead-radio: 24px;
  --lead-fuente: inherit;
}

/* ── Ventana ───────────────────────────────────────────────────────────────────────────────────── */
.lead-d {
  width: min(460px, calc(100% - 24px)); max-width: 460px; max-height: calc(100% - 24px);
  padding: 0; border: 0; border-radius: var(--lead-radio);
  background: var(--lead-fondo); color: var(--lead-texto);
  box-shadow: 0 30px 80px rgba(6, 36, 90, .45); overflow: auto;
  font-family: var(--lead-fuente);
}
.lead-d::backdrop { background: rgba(6, 36, 90, .55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.lead-d[open] { animation: lead-entra .22s ease-out; }
.lead-d:focus { outline: none; }
@keyframes lead-entra { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes lead-sube { from { transform: translateY(40px); } to { transform: none; } }
/* Celular: hoja inferior */
@media (max-width: 599px) {
  .lead-d { width: 100%; max-width: 100%; max-height: 92vh; max-height: 92svh; margin: auto 0 0; border-radius: var(--lead-radio) var(--lead-radio) 0 0; }
  .lead-d[open] { animation-name: lead-sube; }
}
@media (prefers-reduced-motion: reduce) { .lead-d[open] { animation: none; } }
html:has(dialog.lead-d[open]) { overflow: hidden; }

/* ── Formulario ────────────────────────────────────────────────────────────────────────────────── */
.lead-f, .lead-f * { box-sizing: border-box; }
.lead-f {
  position: relative; display: grid; gap: 12px; margin: 0;
  padding: 28px 22px calc(20px + env(safe-area-inset-bottom, 0px));
  font-family: var(--lead-fuente); font-size: 1rem; line-height: 1.35; color: var(--lead-texto); text-align: left;
}
.lead-f::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--lead-acento); }
.lead-f--inline {
  max-width: 520px; background: var(--lead-fondo); border: 1px solid var(--lead-borde); border-radius: var(--lead-radio);
  box-shadow: 0 10px 28px rgba(6, 36, 90, .10); overflow: hidden;
}
.lead-f--inline .lead-x { display: none; }

.lead-x {
  position: absolute; right: 10px; top: 14px; width: 44px; height: 44px; margin: 0; padding: 0;
  border: 0; border-radius: 50%; background: var(--lead-fondo-2); color: var(--lead-texto);
  font: inherit; font-size: 1.6rem; line-height: 1; cursor: pointer;
}
.lead-x:hover { background: var(--lead-borde); }
.lead-eti { display: inline-flex; align-items: center; gap: 6px; margin: 0; color: var(--lead-wa); font-weight: 700; font-size: .9rem; }
.lead-ico { width: 1.35em; height: 1.35em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lead-t { margin: 0; padding-right: 44px; color: var(--lead-primario-oscuro); font-size: clamp(1.5rem, 1.25rem + 1.2vw, 1.9rem); line-height: 1.15; font-weight: 800; }
.lead-sub { margin: -4px 0 4px; color: var(--lead-texto-2); }

/* Campos: 52 px de alto */
.lead-campo { display: grid; gap: 5px; margin: 0; }
.lead-campo-e { font-weight: 600; font-size: .95rem; }
.lead-campo-e em { font-style: normal; font-weight: 400; color: var(--lead-texto-2); }
.lead-campo input, .lead-campo textarea {
  display: block; width: 100%; margin: 0; font: inherit; font-size: max(16px, 1.05rem); color: var(--lead-texto);
  padding: 10px 14px; border: 1.5px solid var(--lead-borde-campo); border-radius: 14px; background: #fff;
  -webkit-appearance: none; appearance: none;
}
.lead-campo input { min-height: 52px; }
.lead-campo textarea { min-height: 88px; resize: vertical; line-height: 1.35; }
.lead-campo input:focus, .lead-campo textarea:focus { outline: none; border-color: var(--lead-foco); box-shadow: 0 0 0 4px rgba(11, 95, 217, .20); }
.lead-campo [aria-invalid="true"] { border-color: var(--lead-error); box-shadow: 0 0 0 4px rgba(196, 20, 28, .12); }
.lead-msg { color: var(--lead-error); font-weight: 600; font-size: .88rem; }
.lead-msg[hidden] { display: none; }

/* Chips redondos (Sí / No) */
.lead-chips { border: 0; margin: 2px 0 0; padding: 0; min-width: 0; }
.lead-chips legend { font-weight: 600; font-size: .95rem; padding: 0; margin-bottom: 8px; }
.lead-chips legend em { font-style: normal; font-weight: 400; color: var(--lead-texto-2); }
.lead-chips > div { display: flex; flex-wrap: wrap; gap: 8px; }
.lead-chip { position: relative; margin: 0; }
.lead-chip input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.lead-chip span {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 72px; padding: 0 20px;
  border: 1.5px solid var(--lead-borde-campo); border-radius: 99px; font-weight: 700; background: #fff; color: var(--lead-texto);
}
.lead-chip input:checked + span { background: var(--lead-primario); border-color: var(--lead-primario); color: #fff; }
.lead-chip input:focus-visible + span { outline: 3px solid var(--lead-foco); outline-offset: 2px; }
.lead-chips[aria-invalid="true"] .lead-chip span { border-color: var(--lead-error); }

/* Trampa antispam: fuera de pantalla, nunca visible */
.lead-trampa { position: absolute !important; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* Botón verde WhatsApp */
.lead-enviar {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 56px; margin: 4px 0 0; padding: 10px 22px;
  border: 2px solid transparent; border-radius: 14px; background: var(--lead-wa); color: #fff;
  font: inherit; font-size: 1.08rem; font-weight: 800; line-height: 1.2; text-align: center; cursor: pointer;
  box-shadow: 0 10px 24px -6px rgba(15, 122, 62, .55);
  transition: background-color .2s ease-out, transform .1s ease-out;
}
.lead-enviar:hover { background: var(--lead-wa-hover); }
.lead-enviar:active { transform: translateY(1px); }
.lead-enviar:focus-visible, .lead-x:focus-visible { outline: 3px solid var(--lead-foco); outline-offset: 2px; }
.lead-enviar:disabled { opacity: .75; cursor: progress; }
.lead-enviar .lead-ico { width: 1.5em; height: 1.5em; }

/* Comentario plegado y enlace directo a WhatsApp */
.lead-campo[hidden], .lead-mas[hidden] { display: none; }
.lead-mas { justify-self: start; padding: 2px 0; border: 0; background: none; color: var(--lead-primario); font: inherit; font-size: .92rem; font-weight: 600; cursor: pointer; }
.lead-mas:focus-visible { outline: 3px solid var(--lead-foco); outline-offset: 2px; }
.lead-directo { display: block; padding: 4px 0; text-align: center; font-weight: 700; color: var(--lead-wa); text-decoration: underline; }

/* Celulares bajos (360x640): que el botón de enviar se vea sin bajar */
@media (max-width: 599px) and (max-height: 720px) {
  .lead-f { gap: 8px; padding-top: 18px; }
  .lead-t { font-size: 1.35rem; }
  .lead-sub { display: none; }
  .lead-campo input { min-height: 46px; }
  .lead-chips legend { margin-bottom: 4px; }
}

.lead-pie { margin: 0; text-align: center; font-size: .88rem; color: var(--lead-texto-2); }
.lead-pie a { color: var(--lead-texto-2); text-decoration: underline; }
