/* Cookie consent banner and preferences modal (public sites). Layout follows Fortunato's; colours are Autrivo's. */
.cookie-consent-banner[hidden], .cookie-preferences-backdrop[hidden] { display: none !important; }

.cookie-consent-banner {
    position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 1080;
    display: flex; flex-direction: column; gap: .9rem;
    width: min(calc(100% - 2.5rem), 26rem); padding: 1.1rem 1.25rem;
    border: 1px solid var(--av-border); border-left: 4px solid var(--av-blue); border-radius: 12px;
    background: var(--av-surface); box-shadow: 0 20px 55px rgba(21, 28, 33, .18); color: var(--av-muted);
}
.cookie-consent-copy strong { display: block; color: var(--av-blue); font-size: 1.05rem; }
.cookie-consent-copy p { margin: .3rem 0 0; font-size: .86rem; line-height: 1.55; }
.cookie-consent-copy a { color: var(--av-blue); font-weight: 600; }
.cookie-consent-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.cookie-consent-actions .is-quiet { grid-column: 1 / -1; }

.cookie-consent-actions button, .cookie-preferences-actions button {
    min-height: 40px; padding: .55rem .9rem; border: 1px solid var(--av-blue); border-radius: 8px;
    background: var(--av-blue); color: #fff; font-size: .85rem; font-weight: 600;
}
.cookie-consent-actions button:hover, .cookie-preferences-actions button:hover { background: var(--av-blue-600); border-color: var(--av-blue-600); }
.cookie-consent-actions .is-secondary, .cookie-consent-actions .is-quiet { background: var(--av-surface); color: var(--bs-link-color, var(--av-blue)); }
.cookie-consent-actions .is-secondary:hover, .cookie-consent-actions .is-quiet:hover { background: var(--av-blue-50); color: var(--av-blue-600); }
.cookie-preferences-actions .is-secondary { border-color: var(--av-border); background: var(--av-bg); color: var(--av-text); }
.cookie-preferences-actions .is-secondary:hover { border-color: var(--av-border); background: var(--av-border-soft); color: var(--av-text); }
.cookie-consent-banner button:focus-visible, .cookie-preferences-dialog button:focus-visible, .cookie-preference-row input:focus-visible {
    outline: 3px solid rgba(40, 100, 122, .3); outline-offset: 2px;
}

.cookie-preferences-open { overflow: hidden; }
.cookie-preferences-backdrop {
    position: fixed; inset: 0; z-index: 1090; display: grid; place-items: center; padding: 1rem; overflow-y: auto;
    background: rgba(21, 28, 33, .6);
}
.cookie-preferences-dialog {
    width: min(100%, 36rem); max-height: calc(100dvh - 2rem); overflow: hidden auto;
    border-radius: 14px; background: var(--av-surface); box-shadow: 0 30px 80px rgba(21, 28, 33, .3); color: var(--av-muted);
}
.cookie-preferences-header {
    display: flex; align-items: center; gap: .6rem; padding: 1rem 1.25rem;
    background: linear-gradient(90deg, var(--av-blue-600), var(--av-blue)); color: #fff;
}
.cookie-preferences-header h2 { flex: 1; margin: 0; font-size: 1.05rem; font-weight: 600; color: #fff; }
.cookie-preferences-close {
    display: grid; width: 2rem; height: 2rem; padding: 0; place-items: center; border: 0; border-radius: 6px;
    background: transparent; color: rgba(255, 255, 255, .85); font-size: 1.4rem; line-height: 1;
}
.cookie-preferences-close:hover { background: rgba(255, 255, 255, .15); color: #fff; }
.cookie-preferences-body { padding: 1.25rem 1.25rem .25rem; }
.cookie-preferences-body > p { margin: 0; font-size: .9rem; line-height: 1.6; }
.cookie-preference-list { display: grid; margin: 1rem 0; }
.cookie-preference-row {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: .9rem 0;
    border-top: 1px solid var(--av-border-soft); cursor: pointer;
}
.cookie-preference-row.is-required { cursor: default; }
.cookie-preference-row span, .cookie-preference-row strong, .cookie-preference-row small { display: block; }
.cookie-preference-row strong { color: var(--av-text); font-size: .95rem; }
.cookie-preference-row small { margin-top: .2rem; color: var(--av-muted); font-size: .82rem; line-height: 1.45; }
.cookie-preference-row input { width: 1.15rem; height: 1.15rem; flex: 0 0 auto; margin-top: .2rem; accent-color: var(--av-blue); }
.cookie-preferences-actions {
    display: flex; justify-content: flex-end; gap: .5rem; padding: .9rem 1.25rem;
    border-top: 1px solid var(--av-border-soft); background: var(--av-bg);
}

.footer-link-button { padding: 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; }
.footer-link-button:hover { text-decoration: underline; }

@media (max-width: 460px) {
    .cookie-consent-banner { right: .65rem; bottom: .65rem; left: .65rem; width: auto; padding: 1rem; }
    .cookie-consent-actions, .cookie-preferences-actions { display: grid; grid-template-columns: 1fr; }
    .cookie-consent-actions .is-quiet { grid-column: auto; }
    .cookie-preferences-actions button { width: 100%; }
}
