/* ─────────────────────────────────────────
   ERIN Leads v1.1 – Frontend styles
   Modal aparece al entrar, overlay bloquea scroll
   ───────────────────────────────────────── */

/* Mantener el menu del tema (header/nav) con su propio stacking context
   mientras el modal esta abierto, para evitar que el position:fixed
   dinamico del tema (#site-header-wrap/.is-sticky) haga cosas raras
   mientras el scroll esta bloqueado. IMPORTANTE: el z-index debe quedar
   POR DEBAJO del overlay del gate (999999): si el menu queda por encima,
   tapa la cabecera del modal (titulo + boton de cerrar) y en pantallas
   donde el modal no cabe entero el usuario se queda sin forma de
   cerrarlo en movil. El menu se vera bajo el blur/oscurecido mientras
   el modal esta abierto, que es el comportamiento esperado de un modal. */
body.erin-gate-open #masthead,
body.erin-gate-open #site-header-wrap,
body.erin-gate-open #site-header {
    position: relative !important;
    z-index: 10 !important;
}

/* #site-header es transparente por diseño (deja ver el hero de fondo) y solo
   se vuelve blanco solido cuando el usuario hace scroll (clase del tema que
   nunca se dispara porque el gate bloquea el scroll). Se lo forzamos aqui. */
body.erin-gate-open #site-header {
    background-color: #ffffff !important;
}

/* Bloqueo de scroll en body cuando el overlay está activo */
html.erin-no-scroll,
body.erin-no-scroll {
    overflow: hidden !important;
    height: 100% !important;
    touch-action: none;
}

/* ── Overlay ─────────────────────────────────────────────────────────────── */
#erin-leads-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .72);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    /* Oculto por defecto, JS añade .erin-visible */
    opacity: 0;
    visibility: hidden;
    transition: opacity .28s ease, visibility .28s ease;
    /* Bloquear clics en el fondo */
    pointer-events: none;
}

#erin-leads-overlay.erin-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

/* ── Modal ───────────────────────────────────────────────────────────────── */
#erin-leads-modal {
    background: #fff;
    border-radius: 12px;
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .35);
    animation: erinSlideUp .32s ease;
}

@keyframes erinSlideUp {
    from { transform: translateY(32px) scale(.97); opacity: 0; }
    to   { transform: translateY(0)    scale(1);   opacity: 1; }
}

/* ── Header ──────────────────────────────────────────────────────────────── */
.erin-leads-modal-header {
    background: #c0000c;
    color: #fff;
    padding: 28px 32px 22px;
    text-align: center;
}

.erin-leads-modal-header h2 {
    margin: 0 0 6px;
    font-size: 20px;
    font-weight: 700;
    color: #fff !important;
    line-height: 1.25;
}

.erin-leads-modal-header p {
    margin: 0;
    font-size: 14px;
    opacity: .88;
    color: #fff !important;
}

/* ── Form ────────────────────────────────────────────────────────────────── */
#erin-leads-form {
    padding: 24px 32px 28px;
}

.erin-leads-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.erin-leads-field {
    display: flex;
    flex-direction: column;
    margin-bottom: 14px;
}

.erin-leads-field label {
    font-size: 11.5px;
    font-weight: 700;
    color: #555;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.erin-leads-field input {
    border: 1.5px solid #ddd;
    border-radius: 7px;
    padding: 10px 12px;
    font-size: 16px;
    color: #222;
    transition: border-color .18s, box-shadow .18s;
    outline: none;
    background: #fff;
}

.erin-leads-field input:focus {
    border-color: #c0000c;
    box-shadow: 0 0 0 3px rgba(192, 0, 12, .11);
}

.erin-leads-legal {
    font-size: 11.5px;
    color: #999;
    margin: 4px 0 18px;
    line-height: 1.55;
}

.erin-leads-legal a {
    color: #c0000c;
    text-decoration: underline;
}

/* ── Botón submit ────────────────────────────────────────────────────────── */
#erin-leads-submit {
    display: block;
    width: 100%;
    background: #c0000c;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 13px 20px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: .02em;
    transition: background .2s, transform .12s;
}

#erin-leads-submit:hover:not(:disabled) {
    background: #a0000a;
    transform: translateY(-1px);
}

#erin-leads-submit:disabled {
    opacity: .65;
    cursor: not-allowed;
}

/* ── Mensajes ────────────────────────────────────────────────────────────── */
#erin-leads-error {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 7px;
    font-size: 13px;
    line-height: 1.4;
}

#erin-leads-error.erin-error   { background:#fff0f0; color:#c0000c; border:1px solid #fcc; }
#erin-leads-error.erin-success { background:#f0fff5; color:#1a7a3c; border:1px solid #b2f0c8; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .erin-leads-row          { grid-template-columns: 1fr; gap: 0; }
    #erin-leads-form         { padding: 20px 18px 24px; }
    .erin-leads-modal-header { padding: 22px 18px 18px; }
}
