/* Consenso Semplice */
.csmp-root,
.csmp-reopen {
	--csmp-bg: #fff;
	--csmp-text: #1d2327;
	--csmp-primary: #1a4fd6;
	--csmp-primary-text: #fff;
	--csmp-link: var(--csmp-primary);
}

.csmp-root[hidden],
.csmp-reopen[hidden],
.csmp-view[hidden] {
	display: none !important;
}

.csmp-root {
	position: fixed;
	z-index: 999999;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 16px;
	pointer-events: none;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	font-size: 15px;
	line-height: 1.5;
	box-sizing: border-box;
}

.csmp-root *,
.csmp-root *::before,
.csmp-root *::after {
	box-sizing: border-box;
}

.csmp-box {
	position: relative;
	pointer-events: auto;
	max-width: 960px;
	max-height: calc(100vh - 32px);
	overflow-y: auto;
	margin: 0 auto;
	padding: 20px 24px;
	color: var(--csmp-text);
	background: var(--csmp-bg);
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 12px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.csmp-box:focus {
	outline: none;
}

.csmp-pos-bottom-left .csmp-box {
	max-width: 440px;
	margin: 0;
}

.csmp-pos-center {
	top: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}

.csmp-pos-center .csmp-box,
.csmp-box-prefs {
	max-width: 620px;
}

.csmp-title {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 32px 8px 0;
	padding: 0;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.3;
	color: inherit;
}

.csmp-icon {
	display: inline-flex;
	flex: none;
	font-size: 26px;
	color: var(--csmp-primary);
}

.csmp-icon svg,
.csmp-reopen-icon svg {
	display: block;
}

.csmp-logo {
	display: block;
	width: auto;
	max-width: 180px;
	height: auto;
	max-height: 44px;
	margin: 0 44px 12px 0;
	object-fit: contain;
}

.csmp-logo[hidden] {
	display: none;
}

/* Sfondo scurito: la pagina resta visibile ma la scelta viene prima. */
.csmp-root.csmp-overlay {
	top: 0;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	pointer-events: auto;
	background: rgba(0, 0, 0, 0.55);
}

.csmp-overlay .csmp-box {
	width: 100%;
	margin: 0;
}

.csmp-overlay.csmp-pos-bottom-left {
	justify-content: flex-start;
}

.csmp-overlay.csmp-pos-center {
	align-items: center;
}

.csmp-text {
	margin: 0 0 8px;
	color: inherit;
}

.csmp-policy {
	display: inline-block;
	margin-bottom: 4px;
	color: var(--csmp-link);
	text-decoration: underline;
}

.csmp-close {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 44px;
	height: 44px;
	padding: 0;
	font-size: 26px;
	line-height: 1;
	color: inherit;
	background: transparent;
	border: 0;
	border-radius: 8px;
	cursor: pointer;
}

.csmp-actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 8px;
	margin-top: 16px;
}

.csmp-btn {
	min-height: 44px;
	padding: 10px 18px;
	font: inherit;
	font-weight: 600;
	border: 2px solid var(--csmp-primary);
	border-radius: 8px;
	cursor: pointer;
}

/* «Accetta» e «Rifiuta» condividono questa classe: stesso peso visivo. */
.csmp-btn-primary {
	color: var(--csmp-primary-text);
	background: var(--csmp-primary);
}

.csmp-btn-secondary {
	color: var(--csmp-link);
	background: transparent;
}

.csmp-btn:hover {
	filter: brightness(0.92);
}

.csmp-btn:focus-visible,
.csmp-close:focus-visible,
.csmp-reopen:focus-visible,
.csmp-root a:focus-visible,
.csmp-root summary:focus-visible,
.csmp-root input:focus-visible {
	outline: 3px solid var(--csmp-primary);
	outline-offset: 2px;
}

.csmp-cat {
	padding: 12px 0;
	border-top: 1px solid rgba(128, 128, 128, 0.3);
}

.csmp-cat:first-child {
	border-top: 0;
}

.csmp-cat-head {
	display: flex;
	align-items: center;
	gap: 10px;
	font-weight: 700;
	cursor: pointer;
}

.csmp-cat-head input {
	width: 20px;
	height: 20px;
	margin: 0;
	accent-color: var(--csmp-primary);
}

.csmp-always {
	margin-left: auto;
	font-size: 13px;
	font-weight: 400;
	opacity: 0.75;
}

.csmp-cat-desc {
	margin: 4px 0 0 30px;
	font-size: 14px;
}

.csmp-services {
	margin: 6px 0 0 30px;
	font-size: 14px;
}

.csmp-services summary {
	cursor: pointer;
	color: var(--csmp-link);
}

.csmp-services ul {
	margin: 6px 0 0;
	padding: 0;
	list-style: none;
}

.csmp-services li {
	margin: 0 0 8px;
}

.csmp-meta {
	display: block;
	font-size: 13px;
	opacity: 0.85;
}

.csmp-root a.csmp-meta {
	color: var(--csmp-link);
	opacity: 1;
}

.csmp-reopen {
	position: fixed;
	z-index: 999998;
	left: 16px;
	bottom: 16px;
	width: 44px;
	height: 44px;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 26px;
	line-height: 1;
	color: var(--csmp-primary-text);
	background: var(--csmp-primary);
	border: 0;
	border-radius: 50%;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
	cursor: pointer;
}

.csmp-placeholder {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	min-height: 200px;
	padding: 24px;
	text-align: center;
	color: #1d2327;
	background: #f0f0f1;
	border: 1px dashed #8c8f94;
	border-radius: 8px;
}

.csmp-placeholder p {
	margin: 0;
}

.csmp-placeholder .csmp-btn {
	color: #fff;
	background: #1a4fd6;
	border-color: #1a4fd6;
}

.csmp-table {
	width: 100%;
	border-collapse: collapse;
}

.csmp-table th,
.csmp-table td {
	padding: 8px;
	text-align: left;
	vertical-align: top;
	border: 1px solid rgba(128, 128, 128, 0.4);
}

@media (max-width: 600px) {
	.csmp-root {
		padding: 8px;
	}

	.csmp-box {
		max-height: calc(100vh - 16px);
		padding: 16px;
	}

	.csmp-actions {
		flex-direction: column-reverse;
	}

	.csmp-btn {
		width: 100%;
	}
}
