/* Cookistica – stile banner, pannello e placeholder.
   Specificità alta + z-index elevato per convivere con Avada/Divi. */

/* Caratteri inclusi nel plugin: serviti dal sito stesso, nessuna chiamata a
   terzi prima del consenso. Si scaricano solo se il banner viene mostrato. */
@font-face { font-family: "Work Sans"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("fonts/worksans-latin.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500 600; font-display: swap; src: url("fonts/inter-latin.woff2") format("woff2"); }

#cs-root {
	--cs-primary: #00447f;
	--cs-bg: rgba(255, 255, 255, 0.76);
	--cs-text: #141617;
	--cs-muted: #434549;
	--cs-radius: 16px;
	--cs-brand-line: linear-gradient(90deg, #e99352 0%, #b3528d 55%, #6a519d 100%);
	--cs-font: "Work Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--cs-font-btn: "Inter", "Work Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	position: fixed;
	z-index: 2147483000;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 16px;
	pointer-events: none;
	font-family: var(--cs-font);
	font-size: 15px;
	line-height: 1.5;
}

#cs-root.cs-pos-bottom .cs-banner { margin: 0 auto; }
#cs-root.cs-pos-bottom-left .cs-banner { margin-right: auto; }
#cs-root.cs-pos-bottom-right .cs-banner { margin-left: auto; }

#cs-root .cs-banner {
	pointer-events: auto;
	max-width: 640px;
	/* Vetro: il sito resta intravisto sotto il banner, sfocato. In alto la
	   firma di Cookistica: la sfumatura del logo Euristica, sottile. */
	background: var(--cs-brand-line) top / 100% 3px no-repeat, var(--cs-bg);
	-webkit-backdrop-filter: blur(20px) saturate(160%);
	backdrop-filter: blur(20px) saturate(160%);
	border: 1px solid rgba(255, 255, 255, 0.72);
	color: var(--cs-text);
	border-radius: var(--cs-radius);
	box-shadow: 0 18px 48px -16px rgba(0, 34, 64, 0.24), 0 1px 3px rgba(0, 34, 64, 0.08);
	padding: 22px 24px;
	max-height: 85vh;
	overflow-y: auto;
	animation: cs-slide-up 0.35s ease;
}

/* Senza backdrop-filter il vetro sarebbe illeggibile sopra le foto: superficie piena. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
	#cs-root .cs-banner { background: var(--cs-brand-line) top / 100% 3px no-repeat, #ffffff; }
}
@media (prefers-reduced-motion: reduce) {
	#cs-root .cs-banner { animation: none; }
}

@keyframes cs-slide-up {
	from { transform: translateY(24px); opacity: 0; }
	to   { transform: translateY(0);    opacity: 1; }
}

#cs-root h3 {
	margin: 0 0 8px !important;
	padding: 0 !important;
	font-family: var(--cs-font) !important;
	font-size: 18px !important;
	font-weight: 600 !important;
	letter-spacing: -0.01em !important;
	line-height: 1.3 !important;
	color: var(--cs-text) !important;
}

/* Simbolo Euristica (lo stesso del fumetto del chatbot) accanto al titolo (decorativo: niente testo
   alternativo). Dalla 1.8.4 non sta più in alto a destra: quel posto
   spetta alla X di chiusura (LG Garante par. 7.1). */
#cs-root .cs-banner { position: relative; }
#cs-root .cs-banner h3 { padding-right: 44px !important; }
#cs-root .cs-banner h3::before {
	content: "";
	display: inline-block;
	width: 22px;
	height: 22px;
	margin-right: 10px;
	vertical-align: -4px;
	background: url("brand/simbolo-euristica.png") center / contain no-repeat;
}

/* X di chiusura: in alto a destra, area di tocco di 36px. */
#cs-root .cs-close {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--cs-text);
	cursor: pointer;
	transition: background 0.15s ease;
}
#cs-root .cs-close:hover {
	background: rgba(0, 68, 127, 0.10);
	background: color-mix(in srgb, var(--cs-primary, #00447f) 12%, transparent);
}
#cs-root .cs-close:focus-visible { outline: 2px solid var(--cs-primary, #00447f); outline-offset: 2px; }
#cs-root .cs-close svg { display: block; }

#cs-root .cs-body p {
	margin: 0 0 14px !important;
	font-family: var(--cs-font) !important;
	color: var(--cs-muted) !important;
	font-size: 14px !important;
}

#cs-root .cs-body p.cs-close-note {
	font-size: 13px !important;
	margin-top: -6px !important;
}

#cs-root .cs-body a {
	color: var(--cs-primary) !important;
	text-decoration: underline !important;
}

/* --- Pannello categorie ------------------------------------------------ */

#cs-root .cs-panel {
	border-top: 1px solid rgba(0, 34, 64, 0.10);
	margin-bottom: 14px;
	padding-top: 6px;
}

#cs-root .cs-cat { padding: 10px 0 4px; }

#cs-root .cs-cat-head {
	display: flex;
	align-items: center;
	gap: 10px;
}

#cs-root .cs-cat p {
	margin: 4px 0 0 54px !important;
	font-size: 13px !important;
	color: var(--cs-muted) !important;
}

/* Switch */
#cs-root .cs-switch {
	position: relative;
	display: inline-block;
	width: 44px;
	height: 24px;
	flex: 0 0 44px;
}
#cs-root .cs-switch input { opacity: 0; width: 0; height: 0; }
#cs-root .cs-slider {
	position: absolute;
	inset: 0;
	background: #c9d3df;
	border-radius: 24px;
	transition: 0.2s;
	cursor: pointer;
}
#cs-root .cs-slider::before {
	content: "";
	position: absolute;
	width: 18px;
	height: 18px;
	left: 3px;
	top: 3px;
	background: #fff;
	border-radius: 50%;
	transition: 0.2s;
}
#cs-root .cs-switch input:checked + .cs-slider { background: var(--cs-primary); }
#cs-root .cs-switch input:checked + .cs-slider::before { transform: translateX(20px); }
#cs-root .cs-switch input:disabled + .cs-slider { opacity: 0.55; cursor: not-allowed; }
/* L'input è invisibile: senza questo, da tastiera non si vede quale
   interruttore ha il focus. */
#cs-root .cs-switch input:focus-visible + .cs-slider { outline: 2px solid var(--cs-primary); outline-offset: 2px; }

/* --- Bottoni ------------------------------------------------------------ */

#cs-root .cs-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: flex-end;
}

/* Bottoni come su euristica.com: Inter 500, a pillola. Il fantasma prende una
   tinta del colore principale scelto nel pannello. */
.cs-btn {
	appearance: none;
	border: 0;
	border-radius: 999px;
	padding: 11px 22px;
	font-family: var(--cs-font-btn, "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif) !important;
	font-size: 14px;
	font-weight: 500;
	letter-spacing: 0.015em;
	cursor: pointer;
	transition: filter 0.15s ease, background 0.15s ease;
	line-height: 1.2;
}
.cs-btn:focus-visible { outline: 2px solid var(--cs-primary, #00447f); outline-offset: 2px; }
.cs-btn-primary {
	background: var(--cs-primary, #00447f);
	color: #fff;
}
.cs-btn-primary:hover { filter: brightness(1.18); }
.cs-btn-ghost {
	background: rgba(0, 68, 127, 0.08);
	background: color-mix(in srgb, var(--cs-primary, #00447f) 9%, transparent);
	color: #141617;
}
.cs-btn-ghost:hover {
	background: rgba(0, 68, 127, 0.14);
	background: color-mix(in srgb, var(--cs-primary, #00447f) 15%, transparent);
}

@media (max-width: 560px) {
	#cs-root .cs-actions { justify-content: stretch; }
	#cs-root .cs-actions .cs-btn { flex: 1 1 auto; }
}

/* --- Riga di credito ----------------------------------------------------- */

/* Sta dentro .cs-actions: il margine destro automatico spinge i pulsanti in
   fondo e tiene il credito a sinistra, senza occupare una riga in più. */
#cs-root .cs-actions .cs-credit {
	margin: 0 auto 0 0;
	align-self: center;
	text-align: left;
	font-size: 12px;
	line-height: 1.3;
	opacity: .7;
}

/* Schermi stretti: i pulsanti diventano a tutta larghezza, il credito passa
   su una riga propria sopra di loro invece di stringerli. */
@media (max-width: 560px) {
	#cs-root .cs-actions .cs-credit {
		flex: 1 0 100%;
		margin: 0 0 2px;
		text-align: center;
	}
}

/* --- Pulsante riapri preferenze ----------------------------------------- */

#cs-reopen {
	position: fixed;
	z-index: 2147482999;
	left: 16px;
	bottom: 16px;
	width: 46px;
	height: 46px;
	border-radius: 50%;
	border: 0;
	background: var(--cs-primary, #00447f);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 6px 18px -6px rgba(0, 34, 64, 0.45);
	transition: transform 0.15s ease;
}
#cs-reopen:hover { transform: scale(1.08); }
/* Simbolo Euristica usato come maschera (conta solo la trasparenza del PNG): prende il colore del testo
   del bottone (bianco sul colore principale), qualunque sia il file. */
#cs-reopen .cs-reopen-mark {
	width: 22px;
	height: 22px;
	background: currentColor;
	-webkit-mask: url("brand/simbolo-euristica.png") center / contain no-repeat;
	mask: url("brand/simbolo-euristica.png") center / contain no-repeat;
}

/* --- Placeholder embed bloccati ------------------------------------------ */

/* Wrapper di un singolo embed bloccato (iframe): lo creiamo noi o è il
   wrapper responsive del builder, quindi ritagliarlo è sicuro. */
.cs-placeholder-wrap { position: relative; overflow: hidden; }

/* Contenitore di uno slider il cui video di sfondo è bloccato. Qui serve
   SOLO un contesto di posizionamento per l'overlay: niente overflow:hidden,
   che su Revolution Slider ritaglierebbe i layer, e nessuna altra proprietà,
   perché il modulo è markup di terze parti che non dobbiamo alterare. */
.cs-placeholder-host { position: relative; }

/* --- Poster locale al posto del placeholder sfocato ----------------------- */
/* Usato quando lo slider espone un'immagine di anteprima ospitata sul sito:
   si vede il fotogramma del video, senza alcuna richiesta a YouTube. */

.cs-poster-ph {
	position: absolute;
	inset: 0;
	z-index: 9;
	overflow: hidden;
}

.cs-poster-img {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
}

/* Sfumatura solo nella fascia bassa: il soggetto dell'immagine resta libero
   e il testo sopra resta leggibile su qualunque fotogramma. */
.cs-poster-ph::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 58%;
	background: linear-gradient(to top, rgba(10, 14, 18, .78) 0%, rgba(10, 14, 18, .35) 45%, rgba(10, 14, 18, 0) 100%);
	pointer-events: none;
}

.cs-poster-bar {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 2;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 18px;
	padding: 24px 32px;
	color: #fff;
}

/* Scritta discreta: nessun pulsante, perché non c'è nulla da cliccare.
   Il video riparte al caricamento successivo, dopo l'accettazione. */
.cs-poster-note {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	background: rgba(16, 22, 28, .42);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	border: 1px solid rgba(255, 255, 255, .22);
	border-radius: 999px;
	padding: 10px 18px 10px 15px;
	font-size: 13.5px;
	font-weight: 500;
	line-height: 1.35;
	color: rgba(255, 255, 255, .96);
	text-shadow: 0 1px 6px rgba(0, 0, 0, .45);
}

.cs-poster-note svg {
	flex: 0 0 auto;
	opacity: .9;
}

@media (max-width: 782px) {
	.cs-poster-bar { padding: 16px 18px; }
	.cs-poster-note { font-size: 12.5px; padding: 9px 15px 9px 12px; }
}

.cs-placeholder {
	position: absolute;
	inset: 0;
	z-index: 10;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	border-radius: 6px;
	min-height: 180px;
	text-align: center;
	overflow: hidden;
}

/* Sfondo sfumato e SFOCATO che simula un fotogramma fuori fuoco: nessuna
   richiesta esterna (non carichiamo miniature da YouTube, sarebbero tracker).
   Più blobs di colore morbidi + blur pesante = effetto "immagine sfuocata". */
.cs-placeholder .cs-ph-blur {
	position: absolute;
	inset: -40px; /* deborda per non mostrare bordi chiari dopo il blur */
	background:
		radial-gradient(40% 55% at 22% 30%, rgba(120,150,190,0.95), transparent 60%),
		radial-gradient(45% 60% at 78% 25%, rgba(90,120,140,0.9), transparent 60%),
		radial-gradient(55% 65% at 65% 80%, rgba(70,95,120,0.95), transparent 62%),
		radial-gradient(50% 60% at 20% 85%, rgba(100,120,110,0.9), transparent 60%),
		linear-gradient(135deg, #3a4a5c, #26313d);
	filter: blur(28px) saturate(1.15);
	transform: scale(1.15);
}

/* Scrim scuro sopra il blur per garantire il contrasto del testo. */
.cs-placeholder::before {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(20, 26, 33, 0.55);
	z-index: 1;
}

.cs-placeholder .cs-ph-inner {
	position: relative;
	z-index: 2;
	max-width: 460px;
	padding: 22px 24px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
}

.cs-placeholder .cs-ph-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 58px;
	height: 58px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.18);
	backdrop-filter: blur(2px);
	color: #fff;
	box-shadow: 0 2px 14px rgba(0, 0, 0, 0.25);
}
.cs-placeholder.cs-ph-video .cs-ph-icon { padding-left: 4px; } /* centra il play */

.cs-placeholder .cs-ph-title {
	margin: 0 !important;
	font-size: 15px !important;
	font-weight: 600 !important;
	color: #fff !important;
	text-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
	line-height: 1.4 !important;
}

.cs-placeholder .cs-ph-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 12px;
	align-items: center;
	justify-content: center;
	margin-top: 2px;
}

.cs-placeholder .cs-ph-unlock {
	background: var(--cs-primary, #00447f);
	color: #fff;
	border: 0;
	border-radius: 10px;
	padding: 9px 18px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	transition: filter 0.15s ease;
}
.cs-placeholder .cs-ph-unlock:hover { filter: brightness(1.1); }

.cs-placeholder .cs-ph-all {
	appearance: none;
	background: transparent;
	border: 0;
	color: rgba(255, 255, 255, 0.85);
	font-size: 12px;
	text-decoration: underline;
	cursor: pointer;
	padding: 4px;
}
.cs-placeholder .cs-ph-all:hover { color: #fff; }

/* Su placeholder piccoli/stretti compatta il contenuto. */
@media (max-width: 400px) {
	.cs-placeholder .cs-ph-title { font-size: 13px !important; }
	.cs-placeholder .cs-ph-icon { width: 46px; height: 46px; }
}

/* Se il wrapper del builder collassa (iframe senza src), garantisci altezza
   e uno sfondo sfumato (non un bianco/nero piatto che sembra rotto). */
iframe.cs-blocked-iframe {
	min-height: 200px;
	background: linear-gradient(135deg, #3a4a5c, #26313d);
}

/* --- Avviso sui form Contact Form 7 con reCAPTCHA bloccato --------------- */

.cs-form-notice {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 16px;
	margin: 0 0 16px;
	padding: 12px 16px;
	background: #f4f6f8;
	border-left: 4px solid var(--cs-primary, #00447f);
	border-radius: 10px;
	font-size: 14px;
	line-height: 1.5;
	color: #1f2933;
}
.cs-form-notice p { margin: 0 !important; flex: 1 1 260px; }
.cs-form-notice.cs-form-notice-alert { border-left-color: #c0392b; background: #fdf1f0; }

/* --- Dichiarazione cookie ([cookistica_declaration]) ------------------ */

.cs-declaration { font-size: 15px; line-height: 1.6; }

.cs-declaration h3 {
	margin: 1.6em 0 0.4em;
	padding-bottom: 4px;
	border-bottom: 2px solid var(--cs-primary, #00447f);
}

.cs-declaration h4 { margin: 1.1em 0 0.35em; }

.cs-decl-table {
	width: 100%;
	border-collapse: collapse;
	margin: 0 0 10px;
	font-size: 14px;
}
.cs-decl-table th,
.cs-decl-table td {
	border: 1px solid #e0e5ea;
	padding: 8px 10px;
	text-align: left;
	vertical-align: top;
}
.cs-decl-table th { background: #f4f6f8; }
.cs-decl-table code { font-size: 13px; }

.cs-decl-state {
	background: #f4f6f8;
	border-radius: 10px;
	padding: 14px 18px;
	margin-bottom: 14px;
}
.cs-decl-state .cs-btn { margin-right: 8px; }

.cs-decl-meta { font-size: 13px; color: #5b6770; }
