/*
 * Aviso y preferencias de cookies (templates/_consent.html.twig + public/js/consent.js).
 * Hoja autónoma: se usa en la web pública (landing, legales, soluciones), en las pantallas de acceso y en el panel.
 * Clases propias (c-btn…) para no chocar con Bootstrap; colores y curvas de la identidad de dmaPlaces.
 * Tarjeta abajo a la izquierda, sin bloquear la página. Aceptar y rechazar con el mismo peso visual.
 */
.consent {
    --c-ink: #0b1220;
    --c-ink-3: #64748b;
    --c-line: #e2e8f0;
    --c-tint: #f1f6fd;
    --c-brand: #0C66E4;
    --c-brand-2: #79B8FF;
    --c-ease: cubic-bezier(.2, 0, 0, 1);
    --c-ease-emph: cubic-bezier(.05, .7, .1, 1);
    --c-ease-in: cubic-bezier(.3, 0, 1, 1);

    position: fixed;
    z-index: 1090;
    left: 24px;
    bottom: 24px;
    width: min(440px, calc(100vw - 32px));
    display: grid;
    gap: 16px;
    padding: 22px;
    border-radius: 20px;
    background: #fff;
    color: var(--c-ink);
    font-size: 14px;
    line-height: 1.55;
    text-align: left;
    box-shadow: 0 2px 6px rgba(11, 18, 32, .08), 0 24px 60px rgba(11, 18, 32, .22);
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 220ms var(--c-ease-in), transform 220ms var(--c-ease-in);
}
.consent[hidden] { display: none; }
.consent.is-in { opacity: 1; transform: none; transition: opacity 320ms var(--c-ease-emph), transform 320ms var(--c-ease-emph); }
.consent h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; font: inherit; font-size: 17px; font-weight: 750; line-height: 1.12; letter-spacing: -.01em; color: var(--c-ink); text-transform: none; }
.consent h2 svg { width: 20px; height: 20px; flex: none; color: var(--c-brand); }
.consent p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--c-ink-3); }
.consent p a { color: var(--c-brand); font-weight: 600; text-underline-offset: 2px; }

.consent-prefs { display: grid; gap: 8px; margin: 0; }
.consent-prefs[hidden], .consent-opt[hidden], .consent-actions [hidden] { display: none; }
.consent-opt { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0; padding: 12px 14px; border-radius: 14px; background: var(--c-tint); cursor: pointer; font-weight: 400; }
.consent-opt strong { display: block; font-size: 14px; }
.consent-opt small { display: block; margin-top: 2px; font-size: 12.5px; line-height: 1.45; color: var(--c-ink-3); }
.consent-opt input { position: absolute; opacity: 0; pointer-events: none; }
.consent .switch { position: relative; flex: none; width: 40px; height: 24px; border-radius: 999px; background: #cbd5e1; transition: background-color 160ms var(--c-ease); }
.consent .switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(11, 18, 32, .25); transition: transform 320ms var(--c-ease); }
.consent-opt input:checked + .switch { background: var(--c-brand); }
.consent-opt input:checked + .switch::after { transform: translateX(16px); }
.consent-opt input:disabled + .switch { opacity: .55; }
.consent-opt:has(input:disabled) { cursor: default; }
.consent-opt input:focus-visible + .switch { outline: 3px solid var(--c-brand-2); outline-offset: 2px; }

/* Botones: hover <100ms, press <150ms, settle 240ms (como los de la landing) */
.consent-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.c-btn {
    --bg: #fff;
    --fg: var(--c-ink);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 16px;
    border: 0;
    border-radius: 999px;
    background: var(--bg);
    color: var(--fg);
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.55;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: inset 0 0 0 1.5px var(--c-line);
    transition: transform 240ms var(--c-ease), box-shadow 240ms var(--c-ease), background-color 90ms linear, color 90ms linear;
}
.c-btn:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1.5px rgba(38, 132, 255, .45); }
.c-btn:active { transform: translateY(0) scale(.97); transition-duration: 120ms; }
.c-btn:focus-visible { outline: 3px solid var(--c-brand-2); outline-offset: 3px; }
.c-btn--brand { --bg: var(--c-brand); --fg: #fff; box-shadow: 0 1px 0 rgba(255, 255, 255, .18) inset, 0 10px 24px -10px rgba(12, 102, 228, .7); }
.c-btn--brand:hover { --bg: #0b5ccd; box-shadow: 0 1px 0 rgba(255, 255, 255, .18) inset, 0 16px 30px -12px rgba(12, 102, 228, .75); }
.consent-actions [data-consent-toggle] { margin-right: auto; padding-inline: 4px; --fg: var(--c-ink-3); box-shadow: none; text-decoration: underline; text-underline-offset: 3px; }
.consent-actions [data-consent-toggle]:hover { transform: none; box-shadow: none; color: var(--c-ink); }

@media (max-width: 560px) {
    .consent { left: 16px; bottom: 16px; padding: 18px; }
    .consent-actions .c-btn:not([data-consent-toggle]) { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .consent, .consent *, .consent *::after { transition-duration: 1ms !important; }
}

/* «Configurar cookies» con aspecto de enlace (pies del acceso y del panel; cada pie le da su color) */
.consent-link { padding: 0; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; }
