/*
 * Panel de preferencias de cookies del backoffice y el login (_cookie_consent.html.twig + consent.js).
 * Mismo aspecto que el aviso de la web pública: tarjeta abajo a la izquierda, aceptar y rechazar con el mismo peso.
 */
.cookie-consent{
    --cc-ink: #0b1220; --cc-muted: #64748b; --cc-line: #e2e8f0; --cc-tint: #f1f7f5; --cc-bg: #fff;
    --cc-brand: #0f766e; --cc-brand-hover: #0d6961; --cc-focus: #14b8a6;
    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: var(--cc-bg); color: var(--cc-ink); font-size: 14px; 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 cubic-bezier(.3,0,1,1), transform 220ms cubic-bezier(.3,0,1,1);
}
[data-theme="dark"] .cookie-consent{
    --cc-ink: #e8eaf0; --cc-muted: #9aa3b5; --cc-line: #2c3140; --cc-tint: #1b2030; --cc-bg: #141824;
    --cc-brand: #20d98e; --cc-brand-hover: #38f2a8;
}
.cookie-consent[hidden]{ display: none; }
.cookie-consent.is-in{ opacity: 1; transform: none; transition: opacity 320ms cubic-bezier(.05,.7,.1,1), transform 320ms cubic-bezier(.05,.7,.1,1); }
.cookie-consent h2{ margin: 0 0 8px; font-size: 17px; font-weight: 750; letter-spacing: -.01em; color: var(--cc-ink); }
.cookie-consent p{ margin: 0; font-size: 14px; line-height: 1.55; color: var(--cc-muted); }
.cookie-consent p a{ color: var(--cc-brand); font-weight: 600; text-underline-offset: 2px; }

.cookie-consent__prefs{ display: grid; gap: 8px; margin: 0; }
.cookie-consent__prefs[hidden],
.cookie-consent__opt[hidden],
.cookie-consent__actions [hidden]{ display: none; }
.cookie-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(--cc-tint); cursor: pointer;
}
.cookie-consent__opt strong{ display: block; font-size: 14px; }
.cookie-consent__opt small{ display: block; margin-top: 2px; font-size: 12.5px; line-height: 1.45; color: var(--cc-muted); }
.cookie-consent__opt input{ position: absolute; opacity: 0; pointer-events: none; }
.cookie-consent__switch{ position: relative; flex: none; width: 40px; height: 24px; border-radius: 999px; background: #cbd5e1; transition: background-color 160ms ease; }
.cookie-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 cubic-bezier(.2,0,0,1);
}
.cookie-consent__opt input:checked + .cookie-consent__switch{ background: var(--cc-brand); }
.cookie-consent__opt input:checked + .cookie-consent__switch::after{ transform: translateX(16px); }
.cookie-consent__opt input:disabled + .cookie-consent__switch{ opacity: .55; }
.cookie-consent__opt:has(input:disabled){ cursor: default; }
.cookie-consent__opt input:focus-visible + .cookie-consent__switch{ outline: 3px solid var(--cc-focus); outline-offset: 2px; }

.cookie-consent__actions{ display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.cookie-consent__btn{
    display: inline-flex; align-items: center; justify-content: center;
    padding: 10px 16px; border: 0; border-radius: 999px; background: var(--cc-bg); color: var(--cc-ink);
    font: inherit; font-size: 14px; font-weight: 600; white-space: nowrap; cursor: pointer;
    box-shadow: inset 0 0 0 1.5px var(--cc-line); transition: box-shadow 160ms ease, background-color 160ms ease;
}
.cookie-consent__btn:hover{ box-shadow: inset 0 0 0 1.5px rgba(20,184,166,.45); }
.cookie-consent__btn:focus-visible{ outline: 3px solid var(--cc-focus); outline-offset: 2px; }
.cookie-consent__btn--primary{ background: var(--cc-brand); color: #fff; box-shadow: none; }
.cookie-consent__btn--primary:hover{ background: var(--cc-brand-hover); box-shadow: none; }
[data-theme="dark"] .cookie-consent__btn--primary{ color: #04120f; }
.cookie-consent__btn--link{ margin-right: auto; padding-inline: 4px; color: var(--cc-muted); box-shadow: none; text-decoration: underline; text-underline-offset: 3px; }
.cookie-consent__btn--link:hover{ color: var(--cc-ink); box-shadow: none; }

@media (max-width: 560px){
    .cookie-consent{ left: 16px; bottom: 16px; padding: 18px; }
    .cookie-consent__actions .cookie-consent__btn:not(.cookie-consent__btn--link){ flex: 1; }
}
@media (prefers-reduced-motion: reduce){
    .cookie-consent, .cookie-consent.is-in{ transition: none; }
}
