/* Banner cookie e pannello preferenze - gestito da /js/cookie-consent.js */

#cc-root, #cc-root * { box-sizing: border-box; }
#cc-root [hidden] { display: none !important; }

/* le variabili sono su :root perche' i pulsanti .cc-btn sono usati anche fuori da #cc-root (pagine delle policy) */
:root {
	--cc-bg: #ffffff;
	--cc-fg: #222222;
	--cc-muted: #555555;
	--cc-brand: #4269aa;
	--cc-brand-dark: #2f4f8a;
	--cc-border: #d9dde3;
}

#cc-root {
	font-family: Roboto, Arial, Helvetica, sans-serif;
	font-size: 15px;
	line-height: 1.5;
	color: var(--cc-fg);
}

html.cc-lock { overflow: hidden; }

/* ---- banner ---- */
.cc-banner {
	position: fixed;
	left: 0; right: 0; bottom: 0;
	z-index: 99998;
	background: var(--cc-bg);
	border-top: 4px solid var(--cc-brand);
	box-shadow: 0 -4px 24px rgba(0,0,0,.25);
	animation: cc-fade .3s ease-out;
}
.cc-banner__inner {
	max-width: 1100px;
	margin: 0 auto;
	padding: 18px 20px;
	display: flex;
	gap: 24px;
	align-items: center;
}
.cc-banner__body { flex: 1 1 auto; min-width: 0; }
.cc-title { margin: 0 0 6px; font-size: 18px; line-height: 1.3; font-weight: 700; color: var(--cc-fg); }
.cc-text { margin: 0 0 8px; font-size: 14px; line-height: 1.5; color: var(--cc-muted); }
.cc-text--small { font-size: 13px; margin-bottom: 6px; }
.cc-link { color: var(--cc-brand); text-decoration: underline; }

.cc-actions { display: flex; flex: 0 0 auto; gap: 10px; }

/* Rifiuta e Accetta hanno identico aspetto e peso visivo (Linee guida Garante 10/06/2021) */
.cc-btn {
	appearance: none;
	cursor: pointer;
	min-height: 44px;
	padding: 10px 18px;
	border-radius: 4px;
	border: 2px solid var(--cc-brand);
	font: inherit;
	font-weight: 700;
	white-space: nowrap;
}
.cc-btn--solid { background: var(--cc-brand); color: #fff; }
.cc-btn--solid:hover { background: var(--cc-brand-dark); border-color: var(--cc-brand-dark); }
.cc-btn--outline { background: #fff; color: var(--cc-brand); }
.cc-btn--outline:hover { background: #eef2f9; }
.cc-btn:focus-visible, .cc-close:focus-visible, .cc-more:focus-visible,
.cc-switch input:focus-visible + .cc-switch__track, .cc-link:focus-visible {
	outline: 3px solid #f37f20;
	outline-offset: 2px;
}

/* ---- pannello preferenze ---- */
.cc-modal { position: fixed; inset: 0; z-index: 99999; display: flex; align-items: center; justify-content: center; padding: 16px; }
.cc-modal__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.6); }
.cc-modal__panel {
	position: relative;
	width: 100%; max-width: 640px; max-height: 100%;
	display: flex; flex-direction: column;
	background: var(--cc-bg);
	border-radius: 8px;
	box-shadow: 0 10px 40px rgba(0,0,0,.4);
	outline: none;
	animation: cc-fade .2s ease-out;
}
.cc-modal__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--cc-border); }
.cc-modal__head .cc-title { margin: 0; }
.cc-close { appearance: none; background: none; border: 0; cursor: pointer; font-size: 30px; line-height: 1; padding: 0 6px; color: var(--cc-muted); }
.cc-modal__body { padding: 16px 20px; overflow-y: auto; }
.cc-modal__foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--cc-border); }

.cc-cat { padding: 14px 0; border-top: 1px solid var(--cc-border); }
.cc-cat:first-of-type { border-top: 0; }
.cc-cat__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.cc-always { font-size: 13px; font-weight: 700; color: #1e7a3c; }
.cc-more { appearance: none; background: none; border: 0; padding: 0; cursor: pointer; font: inherit; font-size: 13px; color: var(--cc-brand); text-decoration: underline; }
.cc-list { margin: 10px 0 0; padding: 0; list-style: none; font-size: 13px; line-height: 1.45; color: var(--cc-muted); }
.cc-list li { padding: 8px 10px; margin-bottom: 6px; background: #f5f7fa; border-radius: 4px; }

/* interruttore */
.cc-switch { position: relative; display: inline-block; width: 48px; height: 26px; flex: 0 0 auto; }
.cc-switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.cc-switch__track { position: absolute; inset: 0; background: #9aa3af; border-radius: 26px; transition: background .2s; }
.cc-switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; background: #fff; border-radius: 50%; transition: transform .2s; }
.cc-switch input:checked + .cc-switch__track { background: var(--cc-brand); }
.cc-switch input:checked + .cc-switch__track::after { transform: translateX(22px); }

@keyframes cc-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .cc-banner, .cc-modal__panel { animation: none; } .cc-switch__track, .cc-switch__track::after { transition: none; } }

@media (max-width: 767px) {
	.cc-banner { max-height: 90vh; overflow-y: auto; }
	.cc-banner__inner { flex-direction: column; align-items: stretch; gap: 12px; padding: 14px 16px; }
	.cc-actions { flex-direction: column; }
	.cc-btn { width: 100%; }
	.cc-modal { padding: 0; align-items: flex-end; }
	.cc-modal__panel { max-width: none; max-height: 92vh; border-radius: 12px 12px 0 0; }
	.cc-modal__foot { flex-direction: column-reverse; }
}
