/**
 * Stile banner cookie PE. Volutamente neutro e minimale: si adatta a
 * qualsiasi brand di landing page di outreach senza bisogno di modifiche.
 */

.pe-gdpr-banner {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 999999;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 16px 24px;
	background: #1f2430;
	color: #f2f2f2;
	font-size: 14px;
	line-height: 1.5;
	box-shadow: 0 -2px 12px rgba( 0, 0, 0, 0.2 );
}

.pe-gdpr-banner[hidden] {
	display: none;
}

/**
 * Variante "al centro": stesso banner, ma come finestra centrata su sfondo
 * scurito invece di barra in basso. Usa lo stesso overlay dei dialog di
 * Privacy/Cookie Policy.
 */
.pe-gdpr-banner-center {
	position: fixed;
	inset: auto;
	top: 50%;
	left: 50%;
	right: auto;
	bottom: auto;
	transform: translate( -50%, -50% );
	z-index: 999998;
	width: min( 520px, 92vw );
	flex-direction: column;
	align-items: stretch;
	box-shadow: 0 10px 40px rgba( 0, 0, 0, 0.3 );
	border-radius: 10px;
}

.pe-gdpr-banner-center .pe-gdpr-banner-actions {
	justify-content: flex-end;
}

/* In colonna (stile centro) flex-basis è un'altezza, non una larghezza:
   senza questo reset il testo erediterebbe "flex: 1 1 480px" dalla variante
   footer e si allungherebbe fino a 480px+ di ALTEZZA, con un vuoto enorme
   sotto il testo prima dei pulsanti. */
.pe-gdpr-banner-center .pe-gdpr-banner-text {
	flex: none;
}

.pe-gdpr-banner-text {
	flex: 1 1 480px;
	margin: 0;
}

.pe-gdpr-banner-text p {
	margin: 0;
}

.pe-gdpr-banner-text a {
	color: #8fd3ff;
	text-decoration: underline;
}

.pe-gdpr-banner-actions {
	flex: 0 0 auto;
	display: flex;
	gap: 8px;
}

.pe-gdpr-btn {
	cursor: pointer;
	border: 1px solid transparent;
	border-radius: 4px;
	padding: 8px 18px;
	font-size: 14px;
	font-weight: 600;
}

.pe-gdpr-btn-primary {
	background: #2f80ed;
	color: #ffffff;
}

.pe-gdpr-btn-primary:hover {
	background: #2568c4;
}

/**
 * "Accetta" e "Rifiuta" hanno lo stesso peso visivo (stessa dimensione,
 * stesso stile "pieno", solo colore diverso): il Garante Privacy richiede
 * che rifiutare sia altrettanto facile/evidente quanto accettare, mai un
 * pulsante secondario/nascosto rispetto all'altro.
 */
.pe-gdpr-btn-reject {
	background: #4b5563;
	color: #ffffff;
}

.pe-gdpr-btn-reject:hover {
	background: #3f4653;
}

/* "Personalizza" resta volutamente più leggero: è un'opzione in più, non una
   delle due scelte principali accetta/rifiuta. */
.pe-gdpr-btn-tertiary {
	background: transparent;
	color: #cbd5e1;
	border-color: transparent;
	text-decoration: underline;
}

.pe-gdpr-btn-tertiary:hover {
	color: #ffffff;
}

.pe-gdpr-manage-btn {
	cursor: pointer;
	border: 1px solid #6b7280;
	border-radius: 4px;
	background: transparent;
	padding: 8px 16px;
	font-size: 14px;
}

.pe-gdpr-cookie-table {
	width: 100%;
	border-collapse: collapse;
	margin: 12px 0 24px;
}

.pe-gdpr-cookie-table th,
.pe-gdpr-cookie-table td {
	border: 1px solid #d0d0d0;
	padding: 8px 12px;
	text-align: left;
	vertical-align: top;
}

.pe-gdpr-cookie-table th {
	background: #f5f5f5;
}

@media ( max-width: 600px ) {
	.pe-gdpr-banner {
		flex-direction: column;
		align-items: stretch;
	}

	.pe-gdpr-banner-actions {
		justify-content: flex-end;
	}
}

/**
 * Overlay e finestre modali (Preferenze cookie, Privacy Policy, Cookie
 * Policy): contenuto scorrevole al posto di una navigazione a pagina intera.
 */

.pe-gdpr-overlay {
	position: fixed;
	inset: 0;
	z-index: 999997;
	background: rgba( 0, 0, 0, 0.5 );
}

.pe-gdpr-overlay[hidden] {
	display: none;
}

.pe-gdpr-modal {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate( -50%, -50% );
	z-index: 999998;
	width: min( 640px, 92vw );
	max-height: 80vh;
	background: #ffffff;
	color: #1f2430;
	border-radius: 10px;
	box-shadow: 0 10px 40px rgba( 0, 0, 0, 0.25 );
	display: flex;
	flex-direction: column;
}

.pe-gdpr-modal[hidden] {
	display: none;
}

.pe-gdpr-modal-content {
	padding: 32px;
	overflow-y: auto;
}

.pe-gdpr-modal-content h2:first-child {
	margin-top: 0;
}

.pe-gdpr-modal-close {
	position: absolute;
	top: 8px;
	right: 12px;
	background: none;
	border: none;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	color: #666;
	padding: 8px;
}

.pe-gdpr-modal-close:hover {
	color: #1f2430;
}

.pe-gdpr-category {
	border-top: 1px solid #eee;
	padding: 14px 0;
}

.pe-gdpr-category:first-of-type {
	border-top: none;
}

.pe-gdpr-category-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.pe-gdpr-category p {
	margin: 6px 0 0;
	font-size: 13px;
	color: #555;
}

.pe-gdpr-modal-actions {
	margin-top: 24px;
	text-align: right;
}

/* Toggle switch per le categorie di consenso */

.pe-gdpr-switch {
	position: relative;
	display: inline-block;
	width: 42px;
	height: 24px;
	flex: 0 0 auto;
}

.pe-gdpr-switch input {
	opacity: 0;
	width: 0;
	height: 0;
}

.pe-gdpr-slider {
	position: absolute;
	cursor: pointer;
	inset: 0;
	background-color: #ccc;
	border-radius: 24px;
	transition: background-color 0.15s;
}

.pe-gdpr-slider::before {
	position: absolute;
	content: '';
	height: 18px;
	width: 18px;
	left: 3px;
	bottom: 3px;
	background-color: #fff;
	border-radius: 50%;
	transition: transform 0.15s;
}

.pe-gdpr-switch input:checked + .pe-gdpr-slider {
	background-color: #2f80ed;
}

.pe-gdpr-switch input:checked + .pe-gdpr-slider::before {
	transform: translateX( 18px );
}

.pe-gdpr-switch-disabled .pe-gdpr-slider {
	cursor: not-allowed;
	opacity: 0.6;
}

/**
 * Riga di link sempre visibile in fondo ad ogni pagina (dopo il footer del
 * tema), indipendente dal banner iniziale.
 */

.pe-gdpr-persistent-footer {
	text-align: center;
	padding: 14px 16px;
	font-size: 12px;
	color: #777;
	border-top: 1px solid #eee;
}

.pe-gdpr-persistent-footer a {
	color: inherit;
	text-decoration: underline;
	margin: 0 4px;
}

.pe-gdpr-persistent-footer a:hover {
	color: #2f80ed;
}

.pe-gdpr-persistent-footer span {
	color: #bbb;
}

.pe-gdpr-manage-btn-link {
	border: none;
	background: none;
	padding: 0;
	margin: 0 4px;
	font-size: 12px;
	color: #777;
	text-decoration: underline;
	cursor: pointer;
}

.pe-gdpr-manage-btn-link:hover {
	color: #2f80ed;
}

/* Checkbox di consenso privacy da inserire nei moduli di contatto */

.pe-gdpr-consent-field {
	font-size: 13px;
	line-height: 1.5;
}

.pe-gdpr-consent-field label {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	cursor: pointer;
}

.pe-gdpr-consent-field input[type="checkbox"] {
	margin-top: 3px;
	flex: 0 0 auto;
}

.pe-gdpr-consent-field a {
	color: #2f80ed;
	text-decoration: underline;
}
