/* Banner del consenso ai cookie di statistica (assets/js/consent.js, inc/consent.php). */

.lab-consent {
	position: fixed;
	left: 24px;
	bottom: 24px;
	z-index: 1000;
	box-sizing: border-box;
	width: 400px;
	max-width: calc(100vw - 32px);
	max-height: calc(100vh - 48px);
	overflow-y: auto;
	padding: 24px 24px 20px;
	border-radius: 8px;
	background: #000;
	box-shadow: 0 16px 40px rgba(0, 0, 0, .6);
	color: var(--lab-text, #d9d5d6);
	font-family: var(--lab-font-text, 'IBM Plex Sans', sans-serif);
	font-size: 14px;
	line-height: 1.55;
	opacity: 0;
	transform: translateY(12px);
	transition: opacity .3s ease, transform .3s ease;
}

.lab-consent[hidden] {
	display: none;
}

.lab-consent.is-open {
	opacity: 1;
	transform: none;
}

.lab-consent:focus {
	outline: none;
}

.lab-consent p {
	margin: 0;
}

.lab-consent .lab-consent__title {
	margin-bottom: 8px;
	padding-right: 28px;
	font-family: var(--lab-font-mono, 'Share Tech Mono', monospace);
	font-size: 18px;
	line-height: 1.2;
	color: var(--lab-green, #5ac134);
}

.lab-consent .lab-consent__link {
	color: var(--lab-text, #d9d5d6);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.lab-consent .lab-consent__link:hover,
.lab-consent .lab-consent__link:focus-visible {
	color: var(--lab-green, #5ac134);
}

/* X: chiude senza accettare. */
.lab-consent button.lab-consent__close {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	border-radius: 16px;
	background: transparent;
	color: var(--lab-muted, #9c9697);
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	transition: color .2s ease;
}

.lab-consent button.lab-consent__close:hover,
.lab-consent button.lab-consent__close:focus-visible {
	background: transparent;
	color: var(--lab-green, #5ac134);
}

.lab-consent__actions {
	display: flex;
	gap: 12px;
	margin-top: 18px;
}

/* Rifiuta e Accetta: identici per dimensione, bordo e colore. */
.lab-consent button.lab-consent__btn {
	flex: 1 1 0;
	box-sizing: border-box;
	min-height: 44px;
	padding: 10px 18px;
	border: 1px solid var(--lab-green, #5ac134);
	border-radius: 22px;
	background: transparent;
	color: var(--lab-green, #5ac134);
	font-family: var(--lab-font-text, 'IBM Plex Sans', sans-serif);
	font-size: 14px;
	font-weight: 500;
	letter-spacing: 0;
	text-transform: none;
	cursor: pointer;
	transition: background-color .2s ease, color .2s ease;
}

.lab-consent button.lab-consent__btn:hover,
.lab-consent button.lab-consent__btn:focus-visible {
	background: var(--lab-green, #5ac134);
	color: #171415;
}

.lab-consent button.lab-consent__btn:focus-visible,
.lab-consent button.lab-consent__custom:focus-visible,
.lab-consent button.lab-consent__close:focus-visible {
	outline: 2px solid var(--lab-green, #5ac134);
	outline-offset: 2px;
}

.lab-consent button.lab-consent__custom {
	display: block;
	margin: 14px 0 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--lab-muted, #9c9697);
	font-family: var(--lab-font-text, 'IBM Plex Sans', sans-serif);
	font-size: 13px;
	letter-spacing: 0;
	text-transform: none;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
	transition: color .2s ease;
}

.lab-consent button.lab-consent__custom:hover,
.lab-consent button.lab-consent__custom:focus-visible {
	background: transparent;
	color: var(--lab-green, #5ac134);
}

.lab-consent__panel {
	margin-top: 16px;
	padding-top: 16px;
	border-top: 1px solid var(--lab-border, #403a3b);
}

.lab-consent__panel[hidden] {
	display: none;
}

.lab-consent__row {
	position: relative;
	display: block;
	margin: 0 0 14px;
	padding-right: 60px;
	min-height: 28px;
}

.lab-consent__row-title {
	display: block;
	color: #fff;
	line-height: 1.5;
}

.lab-consent__row-desc {
	display: block;
	margin-top: 2px;
	font-size: 13px;
	line-height: 1.5;
	color: var(--lab-muted, #9c9697);
}

/* Interruttore delle statistiche (spento di default): la casella vera è nascosta e si vede la pillola. */
.lab-consent input.lab-consent__check {
	position: absolute;
	top: 0;
	right: 0;
	width: 44px;
	height: 26px;
	margin: 0;
	opacity: 0;
	cursor: pointer;
	z-index: 1;
}

.lab-consent .lab-consent__switch {
	position: absolute;
	top: 0;
	right: 0;
	width: 44px;
	height: 26px;
	box-sizing: border-box;
	border: 1px solid var(--lab-border, #403a3b);
	border-radius: 999px;
	background: #171415;
	pointer-events: none;
	transition: background-color .2s ease, border-color .2s ease;
}

.lab-consent .lab-consent__switch::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: var(--lab-muted, #9c9697);
	transition: transform .2s ease, background-color .2s ease;
}

.lab-consent input.lab-consent__check:checked + .lab-consent__switch {
	border-color: var(--lab-green, #5ac134);
	background: rgba(90, 193, 52, .18);
}

.lab-consent input.lab-consent__check:checked + .lab-consent__switch::after {
	background: var(--lab-green, #5ac134);
	transform: translateX(18px);
}

.lab-consent input.lab-consent__check:focus-visible + .lab-consent__switch {
	outline: 2px solid var(--lab-green, #5ac134);
	outline-offset: 2px;
}

.lab-consent__panel .lab-consent__btn {
	width: 100%;
	flex: none;
	margin-top: 4px;
}

@media (max-width: 767px) {
	.lab-consent {
		left: 12px;
		right: 12px;
		bottom: 12px;
		width: auto;
		max-width: none;
		padding: 20px 18px 16px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.lab-consent {
		transition: none;
		transform: none;
	}
}
