/* ==========================================================================
   Légal Empresa — Registro para ver el resultado y descargar el PDF.
   Lo usan todas las calculadoras (js/components/shared/lead-gate.js).
   Mismo sistema visual del sitio: verde oscuro, verde lima, crema, Poppins.
   ========================================================================== */

.lead-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ── Bloqueo de resultados ───────────────────────────────────────────── */

.lead-locked {
    position: relative;
    min-height: var(--lead-min-height, 560px);
}

.lead-locked > :not(.lead-gate) {
    filter: blur(9px);
    opacity: 0.5;
    pointer-events: none;
    user-select: none;
}

.lead-gate {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px 12px;
}

.lead-gate[hidden] {
    display: none;
}

/* Tarjeta cerrada sin registrarse: el resultado sigue bloqueado y queda el
   botón para volver a abrirla. */
.lead-gate__reopen,
.lead-gate--dismissed .lead-gate__card {
    display: none;
}

.lead-gate--dismissed .lead-gate__reopen {
    display: block;
    position: sticky;
    top: 130px;
    padding: 13px 26px;
    border: none;
    border-radius: 999px;
    background-color: var(--verde-oscuro);
    color: var(--blanco);
    font-family: var(--font);
    font-size: 14px;
    font-weight: var(--peso-semibold);
    box-shadow: 0 12px 30px rgba(39, 51, 41, 0.25);
    cursor: pointer;
}

.lead-gate__reopen:hover {
    background-color: var(--verde-lima);
    color: var(--verde-oscuro);
}

.lead-gate__card {
    position: sticky;
    top: 110px;
    width: 100%;
    max-width: 440px;
    padding: 26px 22px;
    border-radius: 18px;
    background-color: var(--blanco);
    box-shadow: 0 20px 50px rgba(39, 51, 41, 0.22);
    border: 1px solid rgba(39, 51, 41, 0.08);
    font-family: var(--font);
}

.lead-gate__title {
    margin: 0 0 6px;
    padding-right: 36px; /* espacio para la × */
    font-size: 19px;
    font-weight: var(--peso-semibold);
    color: var(--verde-oscuro);
}

.lead-gate__text {
    margin: 0 0 16px;
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--gris-texto);
}

/* ── Formulario ──────────────────────────────────────────────────────── */

.lead-form {
    display: flex;
    flex-direction: column;
    gap: 13px;
}

.lead-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.lead-field label {
    font-size: 13px;
    font-weight: var(--peso-medium);
    color: var(--verde-oscuro);
}

.lead-field input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid rgba(39, 51, 41, 0.18);
    border-radius: 10px;
    background-color: var(--crema);
    color: var(--verde-oscuro);
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.lead-field input:focus {
    outline: none;
    border-color: var(--verde-lima);
    box-shadow: 0 0 0 3px rgba(132, 183, 46, 0.22);
}

/* Campo trampa anti-bots: fuera de pantalla, no display:none. */
.lead-hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.lead-consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 12px;
    line-height: 1.55;
    color: var(--gris-texto);
    cursor: pointer;
}

.lead-consent input {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    margin-top: 1px;
    accent-color: var(--verde-oscuro);
}

.lead-consent a {
    color: var(--verde-oscuro);
    text-decoration: underline;
}

.lead-error {
    padding: 11px 14px;
    border-radius: 10px;
    background-color: rgba(192, 57, 43, 0.1);
    color: #922b21;
    font-size: 13px;
    line-height: 1.5;
}

.lead-error[hidden] {
    display: none;
}

.lead-submit {
    width: 100%;
    padding: 15px 22px;
    border: none;
    border-radius: 12px;
    background-color: var(--verde-lima);
    color: var(--verde-oscuro);
    font-family: inherit;
    font-size: 15px;
    font-weight: var(--peso-semibold);
    cursor: pointer;
    transition: background-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.lead-submit:hover:not(:disabled) {
    background-color: var(--verde-oscuro);
    color: var(--blanco);
    transform: translateY(-2px);
}

.lead-submit:disabled {
    opacity: 0.7;
    cursor: wait;
}

.lead-field input:focus-visible,
.lead-submit:focus-visible,
.lead-consent input:focus-visible,
.lead-close:focus-visible,
.lead-gate__reopen:focus-visible {
    outline: 3px solid var(--verde-oscuro);
    outline-offset: 2px;
}

.lead-privacy {
    margin: 0;
    text-align: center;
    font-size: 11.5px;
    color: var(--gris-texto);
}

/* ── Modal (descargas que no están dentro de un resultado) ───────────── */

.lead-modal {
    width: min(92vw, 460px);
    padding: 0;
    border: none;
    border-radius: 18px;
    background: transparent;
    overflow: visible;
}

.lead-modal::backdrop {
    background-color: rgba(39, 51, 41, 0.6);
}

.lead-gate__card--modal {
    position: relative;
    top: 0;
    max-width: none;
    max-height: 90vh;
    overflow-y: auto;
}

/* Botón × de la tarjeta y del modal. */
.lead-close {
    position: absolute;
    top: 8px;
    right: 10px;
    z-index: 2;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: var(--crema);
    color: var(--verde-oscuro);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.lead-close:hover {
    background: var(--verde-oscuro);
    color: var(--blanco);
}

@media (prefers-reduced-motion: reduce) {
    .lead-submit,
    .lead-field input {
        transition: none;
    }
}
