/*
 * Aviso y preferencias de cookies (templates/landing/_consent.html.twig + public/js/consent.js).
 * Autónomo: lo cargan la web pública (landing.css) y las pantallas de acceso (login.css), así que no depende
 * de sus variables. Abajo a la izquierda, sin bloquear; misma curva y duraciones que la landing.
 */
.lp-consent {
    --c-ink: #16243F;
    --c-text: #334155;
    --c-muted: #64748b;
    --c-line: #e6e9f0;
    --c-tint: #f7f8fb;
    --c-gold-rgb: 22,125,141;
    --c-ease: cubic-bezier(0.2, 0, 0, 1);
    --c-enter: cubic-bezier(0.05, 0.7, 0.1, 1);
    --c-exit: cubic-bezier(0.3, 0, 1, 1);

    /* Por encima de la barra lateral del backoffice (1040) y su botón móvil (1080); por debajo de los modales (1100). */
    position: fixed; left: 24px; bottom: 24px; z-index: 1095; display: grid; gap: 16px;
    width: min(420px, calc(100vw - 32px)); padding: 22px; border-radius: 20px; background: #fff; color: var(--c-text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 16px; line-height: 1.6;
    text-align: left; box-shadow: 0 2px 6px rgba(22, 36, 63, .08), 0 24px 52px rgba(22, 36, 63, .18); border: 1px solid var(--c-line);
    opacity: 0; transform: translateY(16px);
    transition: opacity 160ms var(--c-exit), transform 160ms var(--c-exit);
}
.lp-consent[hidden] { display: none; }
.lp-consent.is-in { opacity: 1; transform: none; transition: opacity 320ms var(--c-enter), transform 320ms var(--c-enter); }
.lp-consent h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; color: var(--c-ink); font-size: 17px; font-weight: 720; line-height: 1.12; letter-spacing: -.02em; }
.lp-consent h2 i { color: #0E5965; }
.lp-consent p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--c-muted); }
.lp-consent p a { color: #0E5965; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.lp-consent-prefs { display: grid; gap: 8px; margin: 0; }
.lp-consent-prefs[hidden], .lp-consent-opt[hidden], .lp-consent-actions [hidden] { display: none; }
.lp-consent-opt { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px; border-radius: 14px; background: var(--c-tint); cursor: pointer; }
.lp-consent-opt strong { display: block; color: var(--c-ink); font-size: 14px; }
.lp-consent-opt small { display: block; margin-top: 2px; font-size: 12.5px; line-height: 1.45; color: var(--c-muted); }
.lp-consent-opt input { position: absolute; opacity: 0; pointer-events: none; }
.lp-switch { position: relative; flex: none; width: 40px; height: 24px; border-radius: 999px; background: #cbd5e1; transition: background-color 160ms var(--c-ease); }
.lp-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(22, 36, 63, .25); transition: transform 320ms var(--c-ease); }
.lp-consent-opt input:checked + .lp-switch { background: var(--c-ink); }
.lp-consent-opt input:checked + .lp-switch::after { transform: translateX(16px); }
.lp-consent-opt input:disabled + .lp-switch { opacity: .55; }
.lp-consent-opt:has(input:disabled) { cursor: default; }
.lp-consent-opt input:focus-visible + .lp-switch { outline: 3px solid rgba(var(--c-gold-rgb), .6); outline-offset: 2px; }

.lp-consent-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.lp-consent .lp-btn {
    display: inline-flex; align-items: center; justify-content: center; padding: 10px 16px; border: 0; border-radius: 12px;
    background: #fff; color: var(--c-ink); box-shadow: inset 0 0 0 1.5px var(--c-line);
    font: inherit; font-size: 14px; font-weight: 700; white-space: nowrap; cursor: pointer;
    transition: transform 160ms var(--c-ease), box-shadow 320ms var(--c-ease);
}
.lp-consent .lp-btn[hidden] { display: none; }
.lp-consent .lp-btn:hover { box-shadow: inset 0 0 0 1.5px rgba(var(--c-gold-rgb), .7); }
.lp-consent .lp-btn:active { transform: scale(.97); }
.lp-consent .lp-btn:focus-visible { outline: 3px solid rgba(var(--c-gold-rgb), .6); outline-offset: 2px; }
.lp-consent-actions [data-consent-toggle] { margin-right: auto; padding-left: 4px; padding-right: 4px; box-shadow: none; color: var(--c-muted); text-decoration: underline; text-underline-offset: 3px; }
.lp-consent-actions [data-consent-toggle]:hover { box-shadow: none; color: var(--c-ink); }

@media (max-width: 560px) {
    .lp-consent { left: 16px; bottom: 16px; padding: 18px; }
    .lp-consent-actions .lp-btn:not([data-consent-toggle]) { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .lp-consent, .lp-consent.is-in, .lp-switch, .lp-switch::after { transition: none; }
}
