/* Botón flotante y panel del formulario */
.floating-lead__button {
    position: fixed; z-index: 45;
    right: max(1rem, env(safe-area-inset-right, 0px)); bottom: max(1rem, env(safe-area-inset-bottom, 0px));
    display: grid; place-items: center; width: 3.5rem; height: 3.5rem; padding: 0;
    color: var(--champagne); background: var(--forest-700);
    border: 1px solid var(--champagne); border-radius: 50%;
    box-shadow: var(--shadow); cursor: pointer;
    transition: background-color .2s, transform .2s var(--ease);
}
.floating-lead__button:hover { background: var(--forest-900); transform: translateY(-2px); }
.floating-lead__button .icon { width: 1.7rem; height: 1.7rem; }
.floating-lead__button[hidden], .floating-lead__panel[hidden] { display: none; }
.floating-lead__tooltip {
    position: absolute; right: calc(100% + .6rem); top: 50%; transform: translateY(-50%);
    padding: .4rem .7rem; font-size: .8rem; white-space: nowrap;
    color: var(--ivory); background: var(--forest-900); border-radius: var(--radius);
    opacity: 0; pointer-events: none; transition: opacity .2s;
}
.floating-lead__button:hover .floating-lead__tooltip, .floating-lead__button:focus-visible .floating-lead__tooltip { opacity: 1; }

.floating-lead__panel {
    position: fixed; z-index: 45;
    left: max(.75rem, env(safe-area-inset-left, 0px)); right: max(.75rem, env(safe-area-inset-right, 0px));
    bottom: max(.75rem, env(safe-area-inset-bottom, 0px));
    display: flex; flex-direction: column;
    max-height: calc(100vh - var(--header-h) - 1.5rem);
    max-height: calc(100dvh - var(--header-h) - 1.5rem);
    color: var(--text); background: var(--ivory);
    border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden;
}
.floating-lead__header {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
    padding: 1rem 1.25rem; color: var(--ivory); background: var(--forest-700);
    border-bottom: 1px solid var(--champagne);
}
.floating-lead__title { margin: 0; font-size: 1.45rem; color: var(--ivory); }
.floating-lead__title:focus { outline: none; }
.floating-lead__intro { margin: .25rem 0 0; font-size: .85rem; color: var(--champagne-200); }
.floating-lead__close {
    flex: none; width: 2.75rem; height: 2.75rem; margin: -.4rem -.6rem 0 0;
    font-size: 1.6rem; line-height: 1; color: var(--ivory); background: none; border: 0; cursor: pointer;
}
.floating-lead__close:hover { color: var(--champagne); }
.floating-lead__body { padding: 1.25rem; overflow-y: auto; overscroll-behavior: contain; }
.floating-lead__panel .form-grid { grid-template-columns: minmax(0, 1fr); }

/* El botón no debe cubrir la última línea del hero */
@media (max-width: 39.99em) {
    .hero__note { padding-right: 4.5rem; }
}
@media (min-width: 40em) {
    .floating-lead__panel { left: auto; right: max(1.25rem, env(safe-area-inset-right, 0px)); bottom: max(1.25rem, env(safe-area-inset-bottom, 0px)); width: 26rem; }
}
@media (prefers-reduced-motion: no-preference) {
    .floating-lead__panel { animation: floating-lead-in .25s var(--ease); }
    @keyframes floating-lead-in { from { opacity: 0; transform: translateY(12px); } }
}
