/* ==========================================================================
   Consorzio Ingauno – Privacy & Consent – interfaccia (v2.0, "Centro documentazione")
   Stile Soft UI: superfici bianche, angoli morbidi (10–16 px), ombre leggere,
   Montserrat 400/600, petrolio #1A6C7A, blu notte #153243, navy #000F2B.
   "Rifiuta" e "Accetta tutto" hanno sempre lo stesso peso visivo.

   ISOLAMENTO DAL TEMA: Astra applica a tutti i <button> padding e colori propri.
   Tutta l'interfaccia vive in #ci-pc-root: il reset con selettore ID prevale sul tema.
   ========================================================================== */

#ci-pc-root,
.ci-pc-ph {
	--ci-teal: #1A6C7A;
	--ci-teal-d: #153243;
	--ci-navy: #000F2B;
	--ci-acc: #5E93A2;
	--ci-text: #3A3A3A;
	--ci-muted: #56626B;
	--ci-tint: #F3F9FB;
	--ci-tint2: #E6F1F3;
	--ci-line: #D4EAEA;
	--ci-line2: #BFD6DB;
	--ci-r: 10px;
	--ci-r-lg: 16px;
	--ci-shadow: 0 24px 60px -24px rgba(0, 15, 43, .45), 0 2px 6px rgba(0, 15, 43, .06);
	--ci-font: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

/* ---------- Reset ---------- */
#ci-pc-root, #ci-pc-root *, #ci-pc-root *::before, #ci-pc-root *::after { box-sizing: border-box; }
#ci-pc-root { font-family: var(--ci-font); font-size: 15px; line-height: 1.6; color: var(--ci-text); -webkit-font-smoothing: antialiased; }
#ci-pc-root p, #ci-pc-root label { margin: 0; padding: 0; font: inherit; color: inherit; letter-spacing: normal; text-transform: none; }
#ci-pc-root button { all: unset; box-sizing: border-box; cursor: pointer; font-family: var(--ci-font); -webkit-tap-highlight-color: transparent; }
#ci-pc-root button:focus-visible,
#ci-pc-root a:focus-visible,
#ci-pc-root input:focus-visible + .ci-pc-track { outline: 2px solid var(--ci-teal); outline-offset: 3px; }
#ci-pc-root .ci-pc-svg { display: block; width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#ci-pc-root .ci-pc-link { color: var(--ci-teal); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
#ci-pc-root .ci-pc-link:hover { color: var(--ci-teal-d); }

/* ---------- Elementi comuni ---------- */
#ci-pc-root .ci-pc-tile { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex: 0 0 auto; border-radius: 12px; background: var(--ci-tint2); color: var(--ci-teal); }
#ci-pc-root .ci-pc-tile .ci-pc-svg { width: 21px; height: 21px; }
#ci-pc-root .ci-pc-tile-sm { width: 36px; height: 36px; border-radius: 10px; }
#ci-pc-root .ci-pc-tile-sm .ci-pc-svg { width: 18px; height: 18px; }
#ci-pc-root .ci-pc-title { font-weight: 600; font-size: 15.5px; line-height: 1.35; color: var(--ci-navy); }
#ci-pc-root .ci-pc-sub { font-size: 12.5px; color: var(--ci-muted); margin-top: 1px; }
#ci-pc-root .ci-pc-text { font-size: 14px; line-height: 1.6; color: var(--ci-text); }
#ci-pc-root .ci-pc-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 13px; }
#ci-pc-root .ci-pc-dot { color: var(--ci-line2); }

/* Chiusura */
#ci-pc-root .ci-pc-x { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex: 0 0 auto; border-radius: 10px; color: var(--ci-muted); transition: background-color .15s, color .15s; }
#ci-pc-root .ci-pc-x:hover { background: var(--ci-tint2); color: var(--ci-navy); }
#ci-pc-root .ci-pc-x .ci-pc-svg { width: 20px; height: 20px; stroke-width: 2; }

/* Pulsanti */
#ci-pc-root .ci-pc-btn,
.ci-pc-ph.ci-pc-ph .ci-pc-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 44px; min-width: 120px; padding: 10px 20px;
	border: 1.5px solid var(--ci-teal); border-radius: var(--ci-r);
	font-family: var(--ci-font); font-size: 14px; font-weight: 600; line-height: 1.2;
	letter-spacing: 0; text-transform: none; text-align: center; white-space: nowrap;
	box-shadow: none; transition: background-color .18s, border-color .18s, color .18s, box-shadow .18s;
}
#ci-pc-root .ci-pc-btn-primary,
.ci-pc-ph.ci-pc-ph .ci-pc-btn-primary { background: var(--ci-teal); color: #fff; }
#ci-pc-root .ci-pc-btn-primary:hover,
.ci-pc-ph.ci-pc-ph .ci-pc-btn-primary:hover { background: var(--ci-teal-d); border-color: var(--ci-teal-d); color: #fff; box-shadow: 0 8px 18px -10px rgba(0, 15, 43, .6); }
#ci-pc-root .ci-pc-btn-ghost { background: #fff; color: var(--ci-teal); }
#ci-pc-root .ci-pc-btn-ghost:hover { background: var(--ci-tint2); }
#ci-pc-root .ci-pc-btn .ci-pc-svg { width: 17px; height: 17px; }

/* ==========================================================================
   Banner: pannello bianco sospeso in alto (o in basso)
   ========================================================================== */
#ci-pc-root .ci-pc-banner {
	position: fixed; z-index: 2147483000; left: 50%; transform: translateX(-50%);
	width: min(1160px, calc(100% - 32px));
	display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 16px 28px;
	padding: 18px 64px 18px 20px;
	background: #fff; color: var(--ci-text);
	border: 1px solid var(--ci-line2); border-radius: var(--ci-r-lg);
	box-shadow: var(--ci-shadow);
}
#ci-pc-root .ci-pc-banner--top { top: 16px; animation: ci-pc-down .3s cubic-bezier(.2, .8, .2, 1); }
#ci-pc-root .ci-pc-banner--bottom { bottom: 16px; animation: ci-pc-up .3s cubic-bezier(.2, .8, .2, 1); }
.admin-bar #ci-pc-root .ci-pc-banner--top { top: 48px; }
#ci-pc-root .ci-pc-banner > .ci-pc-x { position: absolute; top: 10px; right: 10px; }
#ci-pc-root .ci-pc-banner-main { display: flex; gap: 16px; align-items: flex-start; min-width: 0; }
#ci-pc-root .ci-pc-banner-body { display: grid; gap: 4px; min-width: 0; }
#ci-pc-root .ci-pc-banner .ci-pc-text { max-width: 78ch; font-size: 13.8px; }
#ci-pc-root .ci-pc-actions { display: flex; gap: 8px; align-items: center; flex-wrap: nowrap; }
#ci-pc-root .ci-pc-banner .ci-pc-btn-customize { border-color: transparent; background: transparent; min-width: 0; padding: 10px 14px; }
#ci-pc-root .ci-pc-banner .ci-pc-btn-customize:hover { background: var(--ci-tint2); }

@keyframes ci-pc-down { from { opacity: 0; transform: translate(-50%, -16px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes ci-pc-up { from { opacity: 0; transform: translate(-50%, 16px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes ci-pc-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ci-pc-pop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes ci-pc-sheet { from { transform: translateY(100%); } to { transform: none; } }

@media (max-width: 1024px) {
	#ci-pc-root .ci-pc-banner { grid-template-columns: 1fr; }
	#ci-pc-root .ci-pc-actions { justify-content: flex-end; }
}
@media (max-width: 782px) {
	.admin-bar #ci-pc-root .ci-pc-banner--top { top: 58px; }
}
@media (max-width: 640px) {
	#ci-pc-root .ci-pc-banner { width: calc(100% - 16px); padding: 14px 14px 14px; gap: 12px; max-height: calc(100vh - 16px); overflow-y: auto; border-radius: 14px; }
	#ci-pc-root .ci-pc-banner--top { top: 8px; }
	#ci-pc-root .ci-pc-banner--bottom { bottom: 8px; }
	#ci-pc-root .ci-pc-banner-main .ci-pc-tile { display: none; }
	#ci-pc-root .ci-pc-banner-body { padding-right: 36px; }
	#ci-pc-root .ci-pc-banner .ci-pc-text { font-size: 13.5px; line-height: 1.5; }
	#ci-pc-root .ci-pc-banner > .ci-pc-x { top: 6px; right: 6px; }
	#ci-pc-root .ci-pc-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
	#ci-pc-root .ci-pc-actions .ci-pc-btn { min-width: 0; width: 100%; padding: 10px; }
	#ci-pc-root .ci-pc-actions .ci-pc-btn-customize { grid-column: 1 / -1; order: 3; min-height: 40px; }
}

/* ==========================================================================
   Pannello preferenze: finestra bianca con angoli morbidi
   ========================================================================== */
html.ci-pc-lock, html.ci-pc-lock body { overflow: hidden !important; }

#ci-pc-root .ci-pc-overlay {
	position: fixed; inset: 0; z-index: 2147483001;
	display: flex; align-items: center; justify-content: center; padding: 24px;
	background: rgba(0, 15, 43, .55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
	animation: ci-pc-fade .16s ease-out;
}
#ci-pc-root .ci-pc-dialog {
	display: flex; flex-direction: column;
	width: 100%; max-width: 640px; max-height: calc(100vh - 48px);
	background: #fff; border-radius: 18px; overflow: hidden; box-shadow: var(--ci-shadow);
	animation: ci-pc-pop .22s cubic-bezier(.2, .8, .2, 1);
}
#ci-pc-root .ci-pc-dhead { display: flex; align-items: center; gap: 14px; padding: 18px 14px 16px 22px; border-bottom: 1px solid var(--ci-line); }
#ci-pc-root .ci-pc-dhead-text { flex: 1 1 auto; min-width: 0; }
#ci-pc-root .ci-pc-dhead .ci-pc-title { font-size: 17px; }

#ci-pc-root .ci-pc-dbody { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; padding: 18px 22px 6px; display: grid; gap: 14px; align-content: start; background: var(--ci-tint); }
#ci-pc-root .ci-pc-cats { display: grid; gap: 10px; }
#ci-pc-root .ci-pc-cat { padding: 14px 16px; background: #fff; border: 1px solid var(--ci-line); border-radius: 12px; transition: border-color .15s; }
#ci-pc-root .ci-pc-cat:hover { border-color: var(--ci-line2); }
#ci-pc-root .ci-pc-cat-head { display: flex; align-items: center; gap: 12px; }
#ci-pc-root .ci-pc-cat-title { flex: 1 1 auto; min-width: 0; font-weight: 600; font-size: 15px; line-height: 1.35; color: var(--ci-navy); cursor: pointer; }
#ci-pc-root .ci-pc-cat.is-locked .ci-pc-cat-title { cursor: default; }
#ci-pc-root .ci-pc-cat-desc { margin-top: 8px; padding-left: 48px; font-size: 13.8px; line-height: 1.6; color: var(--ci-text); }
#ci-pc-root .ci-pc-cat-prov { margin-top: 6px; padding-left: 48px; font-size: 12.8px; color: var(--ci-muted); }
#ci-pc-root .ci-pc-cat-prov span { font-weight: 600; color: var(--ci-navy); }

#ci-pc-root .ci-pc-always {
	display: inline-flex; align-items: center; gap: 5px; flex: 0 0 auto;
	padding: 5px 11px; border-radius: 999px; background: var(--ci-tint2); color: var(--ci-teal-d);
	font-size: 12px; font-weight: 600; white-space: nowrap;
}
#ci-pc-root .ci-pc-always .ci-pc-svg { width: 13px; height: 13px; stroke-width: 2.6; }

/* Interruttore: stato indicato da posizione, colore e spunta */
#ci-pc-root .ci-pc-switch { position: relative; display: inline-flex; flex: 0 0 auto; width: 52px; height: 30px; }
#ci-pc-root .ci-pc-switch input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; padding: 0; opacity: 0; cursor: pointer; -webkit-appearance: none; appearance: none; border: 0; background: none; box-shadow: none; }
#ci-pc-root .ci-pc-track { position: relative; display: block; width: 52px; height: 30px; border-radius: 999px; background: #C3CFD4; transition: background-color .2s; }
#ci-pc-root .ci-pc-thumb { position: absolute; top: 3px; left: 3px; display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: #fff; color: var(--ci-teal); box-shadow: 0 1px 3px rgba(0, 15, 43, .3); transition: transform .2s cubic-bezier(.2, .8, .2, 1); }
#ci-pc-root .ci-pc-thumb .ci-pc-svg { width: 13px; height: 13px; stroke-width: 3; opacity: 0; transition: opacity .15s; }
#ci-pc-root .ci-pc-switch input:hover + .ci-pc-track { background: #AEBEC5; }
#ci-pc-root .ci-pc-switch input:checked + .ci-pc-track { background: var(--ci-teal); }
#ci-pc-root .ci-pc-switch input:checked + .ci-pc-track .ci-pc-thumb { transform: translateX(22px); }
#ci-pc-root .ci-pc-switch input:checked + .ci-pc-track .ci-pc-thumb .ci-pc-svg { opacity: 1; }

#ci-pc-root .ci-pc-dmeta { display: grid; gap: 6px; padding: 2px 0 12px; }
#ci-pc-root .ci-pc-id { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; font-size: 12px; color: var(--ci-muted); }
#ci-pc-root .ci-pc-id code { font-family: ui-monospace, Consolas, monospace; font-size: 11.5px; background: #fff; border: 1px solid var(--ci-line); border-radius: 6px; color: var(--ci-teal-d); padding: 2px 6px; word-break: break-all; }

#ci-pc-root .ci-pc-dfoot { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; padding: 14px 22px 18px; border-top: 1px solid var(--ci-line); background: #fff; }
#ci-pc-root .ci-pc-dfoot .ci-pc-btn { min-width: 0; width: 100%; padding: 10px; }

@media (max-width: 640px) {
	#ci-pc-root .ci-pc-overlay { align-items: flex-end; padding: 0; }
	#ci-pc-root .ci-pc-dialog { max-width: none; max-height: 92vh; border-radius: 18px 18px 0 0; animation: ci-pc-sheet .26s cubic-bezier(.2, .8, .2, 1); }
	#ci-pc-root .ci-pc-dhead { padding: 14px 10px 12px 16px; }
	#ci-pc-root .ci-pc-dbody { padding: 14px 12px 4px; }
	#ci-pc-root .ci-pc-cat-desc, #ci-pc-root .ci-pc-cat-prov { padding-left: 0; }
	#ci-pc-root .ci-pc-dfoot { grid-template-columns: 1fr; gap: 8px; padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); }
	#ci-pc-root .ci-pc-o1 { order: 1; }
	#ci-pc-root .ci-pc-o2 { order: 2; }
	#ci-pc-root .ci-pc-o3 { order: 3; }
}

/* ==========================================================================
   Pulsante flottante "Preferenze cookie"
   ========================================================================== */
#ci-pc-root .ci-pc-float {
	position: fixed; left: 16px; bottom: 16px; z-index: 2147482999;
	display: flex; align-items: center; justify-content: center;
	width: 48px; height: 48px; border-radius: 14px;
	background: #fff; color: var(--ci-teal); border: 1px solid var(--ci-line2);
	box-shadow: 0 10px 24px -12px rgba(0, 15, 43, .45);
	transition: background-color .16s, color .16s, transform .16s;
}
#ci-pc-root .ci-pc-float:hover { background: var(--ci-teal); color: #fff; transform: translateY(-2px); }
#ci-pc-root .ci-pc-float .ci-pc-svg { width: 22px; height: 22px; }

/* ==========================================================================
   Chat: pulsante rotondo e richiesta di attivazione in una scheda
   ========================================================================== */
#ci-pc-root .ci-pc-chat { position: fixed; right: 16px; bottom: 16px; z-index: 2147482998; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
#ci-pc-root .ci-pc-chat-btn { display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 50%; background: var(--ci-teal); color: #fff; box-shadow: 0 12px 26px -12px rgba(0, 15, 43, .6); transition: background-color .16s, transform .16s; }
#ci-pc-root .ci-pc-chat-btn:hover { background: var(--ci-teal-d); transform: translateY(-2px); }
#ci-pc-root .ci-pc-chat-btn .ci-pc-svg { width: 26px; height: 26px; }
#ci-pc-root .ci-pc-chat-pop { width: min(360px, calc(100vw - 32px)); display: grid; gap: 12px; padding: 0 0 16px; background: #fff; border: 1px solid var(--ci-line2); border-radius: var(--ci-r-lg); box-shadow: var(--ci-shadow); overflow: hidden; animation: ci-pc-pop .2s cubic-bezier(.2, .8, .2, 1); }
#ci-pc-root .ci-pc-chat-pop[hidden] { display: none; }
#ci-pc-root .ci-pc-chat-head { display: flex; align-items: center; gap: 10px; padding: 12px 8px 12px 16px; border-bottom: 1px solid var(--ci-line); }
#ci-pc-root .ci-pc-chat-head .ci-pc-title { flex: 1 1 auto; font-size: 15px; }
#ci-pc-root .ci-pc-chat-head .ci-pc-x { width: 36px; height: 36px; }
#ci-pc-root .ci-pc-chat-pop > .ci-pc-text, #ci-pc-root .ci-pc-chat-pop > .ci-pc-chat-actions, #ci-pc-root .ci-pc-chat-pop > .ci-pc-links { margin: 0 16px; }
#ci-pc-root .ci-pc-chat-pop .ci-pc-text { font-size: 13.8px; }
#ci-pc-root .ci-pc-chat-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
#ci-pc-root .ci-pc-chat-actions .ci-pc-btn { min-width: 0; width: 100%; padding: 10px 8px; }

/* ==========================================================================
   Segnaposto contenuti bloccati (video, mappe)
   ========================================================================== */
.ci-pc-ph.ci-pc-ph {
	display: flex; align-items: center; justify-content: center;
	width: 100%; margin: 0; padding: 28px 20px;
	font-family: var(--ci-font); color: var(--ci-text); text-align: center; line-height: 1.6;
	background: radial-gradient(120% 90% at 0% 0%, rgba(26, 108, 122, .9), rgba(21, 50, 67, .96) 60%), var(--ci-teal-d);
	border: 0; border-radius: 16px; box-sizing: border-box;
}
.ci-pc-ph.ci-pc-ph * { box-sizing: border-box; }
.ci-pc-ph.ci-pc-ph .ci-pc-ph-inner { max-width: 470px; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 26px 24px; background: #fff; border-radius: 14px; box-shadow: 0 20px 40px -24px rgba(0, 15, 43, .6); }
.ci-pc-ph.ci-pc-ph .ci-pc-ph-icon { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 12px; background: var(--ci-tint2); color: var(--ci-teal); }
.ci-pc-ph.ci-pc-ph .ci-pc-svg { display: block; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ci-pc-ph.ci-pc-ph p { margin: 0; padding: 0; }
.ci-pc-ph.ci-pc-ph .ci-pc-ph-title { font-weight: 600; font-size: 16px; color: var(--ci-navy); }
.ci-pc-ph.ci-pc-ph .ci-pc-ph-text { font-size: 14px; color: var(--ci-text); }
.ci-pc-ph.ci-pc-ph .ci-pc-ph-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 18px; margin-top: 6px; }
.ci-pc-ph.ci-pc-ph button { all: unset; box-sizing: border-box; cursor: pointer; }
.ci-pc-ph.ci-pc-ph button:focus-visible, .ci-pc-ph.ci-pc-ph a:focus-visible { outline: 2px solid var(--ci-teal); outline-offset: 3px; }
.ci-pc-ph.ci-pc-ph .ci-pc-link { color: var(--ci-teal); text-decoration: underline; text-underline-offset: 3px; font-size: 13.5px; }

/* ---------- Accessibilità e stampa ---------- */
@media (prefers-reduced-motion: reduce) {
	#ci-pc-root *, #ci-pc-root *::before, #ci-pc-root *::after, .ci-pc-ph * { animation: none !important; transition: none !important; }
}
@media print { #ci-pc-root { display: none !important; } }
