/* Lex Legis – banner e preferenze cookie */
:root {
	--ll-bg: #fff;
	--ll-text: #0e0e0e;
	--ll-accent: #0e0e0e;
	--ll-soft: #f4f1ec;
	--ll-trust: #2e8b57;
	--ll-font: "Nunito Sans", system-ui, sans-serif;
	--ll-heading: "Playfair Display", Georgia, serif;
	--ll-radius: 18px;
	--ll-shadow: 0 18px 50px rgba(14, 14, 14, .18), 0 2px 8px rgba(14, 14, 14, .08);
	--ll-float-bottom: 16px;
	--ll-float-left: 16px;
}
.lexlegis[hidden], .lexlegis [hidden], .ll-float[hidden] { display: none !important; }
.lexlegis, .lexlegis *, .ll-float { box-sizing: border-box; }
.lexlegis { font-family: var(--ll-font); color: var(--ll-text); line-height: 1.5; }

/* Banner */
.ll-banner {
	position: fixed; z-index: 2147483000; left: 24px; bottom: 24px;
	width: min(460px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto;
	background: var(--ll-bg); border-radius: var(--ll-radius); box-shadow: var(--ll-shadow);
	padding: 24px 24px 18px; border: 1px solid rgba(14, 14, 14, .06);
	animation: ll-in .35s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes ll-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ll-banner, .ll-modal-box, .ll-toast { animation: none !important; } }

.ll-head { display: flex; align-items: center; gap: 12px; margin: 0 32px 10px 0; }
.ll-badge {
	flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%;
	display: grid; place-items: center; background: var(--ll-soft); color: var(--ll-trust);
}
.ll-brand { margin: 0; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; opacity: .65; font-weight: 700; }
.lexlegis .ll-title { margin: 0; font-family: var(--ll-heading); font-size: 22px; line-height: 1.2; font-weight: 600; color: var(--ll-text); text-transform: none; letter-spacing: 0; }
.lexlegis .ll-text { margin: 0 0 12px; font-size: 14.5px; color: var(--ll-text); opacity: .86; }
.ll-trust { list-style: none; margin: 0 0 16px; padding: 12px 14px; background: var(--ll-soft); border-radius: 12px; display: grid; gap: 6px; }
.ll-trust li { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 13.5px; font-weight: 600; }
.ll-trust svg { color: var(--ll-trust); flex: 0 0 auto; }

/* Pulsanti: "Accetta" e "Rifiuta" hanno la stessa dimensione e lo stesso peso visivo. */
.ll-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ll-actions .ll-btn-ghost { grid-column: 1 / -1; order: 3; }
.lexlegis .ll-btn {
	appearance: none; cursor: pointer; font: inherit; font-weight: 800; font-size: 15px; line-height: 1.2;
	min-height: 46px; padding: 12px 16px; border-radius: 999px; border: 2px solid var(--ll-accent);
	transition: transform .12s ease, background-color .15s ease, color .15s ease; text-transform: none; letter-spacing: 0;
}
.lexlegis .ll-btn:active { transform: scale(.98); }
.lexlegis .ll-btn-solid { background: var(--ll-accent); color: var(--ll-bg); }
.lexlegis .ll-btn-outline { background: var(--ll-bg); color: var(--ll-accent); }
.lexlegis .ll-btn-outline:hover { background: var(--ll-soft); }
.lexlegis .ll-btn-ghost { background: transparent; color: var(--ll-accent); border-color: transparent; text-decoration: underline; text-underline-offset: 3px; min-height: 38px; padding: 6px; font-weight: 700; }
.lexlegis .ll-btn:focus-visible, .lexlegis .ll-close:focus-visible, .ll-float:focus-visible, .lexlegis a:focus-visible, .ll-switch input:focus-visible + span {
	outline: 3px solid var(--ll-trust); outline-offset: 2px;
}
.ll-links { margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; }
.lexlegis .ll-links a { color: var(--ll-text); opacity: .75; text-decoration: underline; text-underline-offset: 2px; }
.ll-consent-id { margin-left: auto; opacity: .5; font-size: 11px; }

.lexlegis .ll-close {
	position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border-radius: 50%;
	border: 0; background: transparent; color: var(--ll-text); cursor: pointer; display: grid; place-items: center; padding: 0; opacity: .7;
}
.lexlegis .ll-close:hover { opacity: 1; background: var(--ll-soft); }

/* Pannello preferenze */
.ll-modal { position: fixed; inset: 0; z-index: 2147483001; background: rgba(14, 14, 14, .45); display: grid; place-items: center; padding: 16px; }
.ll-modal-box {
	position: relative; width: min(620px, 100%); max-height: calc(100vh - 32px); overflow: auto;
	background: var(--ll-bg); border-radius: var(--ll-radius); box-shadow: var(--ll-shadow); padding: 28px 24px 20px;
	animation: ll-in .3s ease both;
}
.ll-modal-box .ll-title { margin-right: 36px; margin-bottom: 8px; }
.ll-cats { display: grid; gap: 10px; margin: 16px 0 18px; }
.ll-cat { border: 1px solid rgba(14, 14, 14, .1); border-radius: 14px; padding: 14px 16px; }
.ll-cat-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.ll-cat h3 { margin: 0; font-family: var(--ll-font); font-size: 16px; font-weight: 800; color: var(--ll-text); text-transform: none; letter-spacing: 0; }
.ll-cat p { margin: 6px 0 0; font-size: 13.5px; opacity: .8; }
.ll-cat details { margin-top: 8px; font-size: 13px; }
.ll-cat summary { cursor: pointer; font-weight: 700; opacity: .8; }
.ll-cat ul { margin: 6px 0 0; padding-left: 18px; }
.ll-cat li { margin: 4px 0; }
.ll-always { font-size: 12.5px; font-weight: 800; color: var(--ll-trust); white-space: nowrap; }

.ll-switch { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; flex: 0 0 auto; }
.ll-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ll-switch span { width: 50px; height: 28px; border-radius: 999px; background: #c9c4bc; position: relative; transition: background .15s; }
.ll-switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .15s; }
.ll-switch input:checked + span { background: var(--ll-trust); }
.ll-switch input:checked + span::after { transform: translateX(22px); }
.ll-switch small { font-size: 12px; font-weight: 700; min-width: 72px; text-align: right; }
.ll-actions-prefs { grid-template-columns: 1fr 1fr 1fr; }
.ll-actions-prefs .ll-btn-ghost { grid-column: auto; order: 0; border-color: var(--ll-accent); text-decoration: none; min-height: 46px; }

/* Messaggio di conferma */
.ll-toast {
	position: fixed; z-index: 2147483002; left: 50%; bottom: 24px; transform: translateX(-50%);
	background: var(--ll-accent); color: var(--ll-bg); border-radius: 999px; padding: 12px 20px;
	font-weight: 700; font-size: 14px; box-shadow: var(--ll-shadow); animation: ll-in .25s ease both; max-width: calc(100vw - 32px); text-align: center;
}

/* Pulsante per riaprire le preferenze */
.ll-float {
	position: fixed; z-index: 2147482000; left: var(--ll-float-left); bottom: var(--ll-float-bottom);
	width: 42px; height: 42px; border-radius: 50%; border: 0; cursor: pointer; padding: 0;
	display: grid; place-items: center; background: var(--ll-bg, #fff); color: var(--ll-trust, #2e8b57);
	box-shadow: 0 4px 16px rgba(14, 14, 14, .18); opacity: .9;
}
.ll-float:hover { opacity: 1; }

/* Link "gestisci preferenze" nelle pagine */
.ll-pref-button { appearance: none; cursor: pointer; font: inherit; font-weight: 800; padding: 10px 18px; border-radius: 999px; border: 2px solid currentColor; background: transparent; }

/* Documenti */
.lexlegis-doc table { width: 100%; border-collapse: collapse; margin: 12px 0 24px; font-size: 14px; }
.lexlegis-doc th, .lexlegis-doc td { border: 1px solid rgba(14, 14, 14, .12); padding: 8px 10px; text-align: left; vertical-align: top; }
.lexlegis-doc th { background: #f4f1ec; }
.lexlegis-doc .ll-summary { background: #f4f1ec; border-radius: 14px; padding: 16px 20px; margin: 0 0 24px; }
.lexlegis-doc .ll-meta { font-size: 13px; opacity: .7; }
@media (max-width: 700px) {
	.lexlegis-doc table, .lexlegis-doc thead, .lexlegis-doc tbody, .lexlegis-doc tr, .lexlegis-doc th, .lexlegis-doc td { display: block; }
	.lexlegis-doc thead { display: none; }
	.lexlegis-doc tr { border: 1px solid rgba(14, 14, 14, .12); border-radius: 10px; margin-bottom: 10px; padding: 6px 0; }
	.lexlegis-doc td { border: 0; padding: 4px 12px; }
	.lexlegis-doc td::before { content: attr(data-label) ": "; font-weight: 700; }
}

/* Modulo di recesso */
.ll-withdrawal { max-width: 640px; }
.ll-withdrawal, .ll-withdrawal * { box-sizing: border-box; }
.ll-withdrawal label { display: block; font-weight: 700; margin: 14px 0 4px; }
.ll-withdrawal input[type=text], .ll-withdrawal input[type=email], .ll-withdrawal input[type=date], .ll-withdrawal textarea { width: 100%; padding: 10px 12px; border: 1px solid #c9c4bc; border-radius: 10px; font: inherit; }
.ll-withdrawal .ll-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.ll-withdrawal .ll-btn-solid { margin-top: 18px; appearance: none; cursor: pointer; font: inherit; font-weight: 800; font-size: 16px; padding: 14px 22px; border-radius: 999px; border: 2px solid #0e0e0e; background: #0e0e0e; color: #fff; }
.ll-withdrawal .ll-btn-outline { margin-top: 18px; appearance: none; cursor: pointer; font: inherit; font-weight: 800; font-size: 16px; padding: 14px 22px; border-radius: 999px; border: 2px solid #0e0e0e; background: #fff; color: #0e0e0e; }
.ll-withdrawal .ll-review { background: #f4f1ec; border-radius: 14px; padding: 16px 20px; margin-top: 16px; }
.ll-withdrawal .ll-msg { margin-top: 16px; padding: 14px 18px; border-radius: 12px; font-weight: 700; }
.ll-withdrawal .ll-msg.ok { background: #e6f4ec; color: #1d5e3a; }
.ll-withdrawal .ll-msg.err { background: #fbeaea; color: #8a1f1f; }

@media (max-width: 600px) {
	.ll-banner { left: 8px; right: 8px; bottom: 8px; width: auto; padding: 20px 16px 14px; border-radius: 16px; }
	.lexlegis .ll-title { font-size: 20px; }
	.ll-trust { padding: 10px 12px; }
	.ll-actions-prefs { grid-template-columns: 1fr 1fr; }
	.ll-actions-prefs .ll-btn-ghost { grid-column: 1 / -1; order: 3; }
	.ll-modal { padding: 0; align-items: end; }
	.ll-modal-box { border-radius: 18px 18px 0 0; max-height: 92vh; padding: 24px 16px 16px; }
}

/* 1.0.2 – pulsante preferenze sempre in basso a sinistra, tondo e bianco
   (il sito ha regole globali "button { top: 0; width: 100% }" e sfondo trasparente del tema/kit) */
#lexlegis-float.ll-float {
	position: fixed !important; top: auto !important; right: auto !important;
	left: var(--ll-float-left, 16px) !important; bottom: var(--ll-float-bottom, 16px) !important;
	width: 42px !important; min-width: 0 !important; height: 42px !important; max-width: none !important;
	margin: 0 !important; padding: 0 !important; flex: none !important; transform: none !important;
	border: 1px solid rgba(14, 14, 14, .12) !important; border-radius: 50% !important;
	background: #fff !important; background-color: #fff !important; color: var(--ll-trust, #2e8b57) !important;
	box-shadow: 0 4px 16px rgba(14, 14, 14, .18) !important; opacity: 1 !important;
	display: grid !important; place-items: center; line-height: 1 !important;
}
#lexlegis-float.ll-float[hidden] { display: none !important; }
#lexlegis-float.ll-float svg { display: block; width: 22px; height: 22px; }

/* 1.0.3 – Sanitrit: su mobile il banner deve lasciare visibile la pagina (e il pulsante di chiamata). */
@media (max-width: 600px) {
	#lexlegis .ll-banner .ll-trust { display: none !important; }
	#lexlegis .ll-banner .ll-text { margin-bottom: 12px; }
}
