/* Persistent "Preferenze cookie" trigger.
 *
 * The Garante requires that withdrawing consent be as easy as giving it, which
 * in practice means a link reachable from every page. Nebea's app shell has no
 * document footer — the shell fills the viewport and each page owns its own
 * scroll — so a footer <a> would sit below a full-height flex column where
 * nobody would ever find it. A small fixed pill in the bottom-left corner is
 * the only placement that is genuinely present on every template.
 *
 * z-index sits below the CMP modal (2147483647 in cookieconsent.css) and below
 * app modals/toasts, so it never covers an interaction.
 */
.consent-prefs-trigger {
    position: fixed;
    left: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    z-index: 900;

    padding: 5px 10px;
    border: 1px solid rgba(127, 127, 127, 0.28);
    border-radius: 999px;
    background: rgba(250, 247, 242, 0.82);
    color: #6B6156;

    font-family: inherit;
    font-size: 11px;
    line-height: 1.2;
    letter-spacing: 0.01em;
    white-space: nowrap;
    cursor: pointer;

    opacity: 0.55;
    backdrop-filter: blur(6px);
    transition: opacity 140ms ease, color 140ms ease, border-color 140ms ease;
}

.consent-prefs-trigger:hover,
.consent-prefs-trigger:focus-visible {
    opacity: 1;
    color: #15110D;
    border-color: rgba(127, 127, 127, 0.55);
}

.consent-prefs-trigger:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

[data-theme="dark"] .consent-prefs-trigger {
    background: rgba(28, 26, 24, 0.82);
    color: #A9A196;
}

[data-theme="dark"] .consent-prefs-trigger:hover,
[data-theme="dark"] .consent-prefs-trigger:focus-visible {
    color: #E8EAED;
}

/* Inside the authenticated app shell the bottom-left corner is the sidebar.
   Push the pill past it so it sits over the content column instead of on top
   of the dark sidebar. Bottom-right is already taken by the toast stack and
   bottom-centre by the connection banner, so left-of-content is the only free
   corner. */
body.with-shell .consent-prefs-trigger {
    left: calc(var(--app-sidebar-w, 0px) + 12px);
}

/* Clear the mobile bottom nav / bottom bar on small screens, matching the
   1024px breakpoint the app shell uses for its own chrome. The sidebar is a
   drawer below this width, so the offset above no longer applies. */
@media (max-width: 1024px) {
    .consent-prefs-trigger,
    body.with-shell .consent-prefs-trigger {
        left: 12px;
        bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    }
}

/* Printing a page should not carry a UI control onto the paper. */
@media print {
    .consent-prefs-trigger { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .consent-prefs-trigger { transition: none; }
}
