/* ==========================================================================
   Legaless — Lingue
   Selettore di lingua (header) e modulo di richiesta (pagine EN/ES).
   Tutto e' sotto .lgl-*: nessuna regola tocca selettori di Avada.
   Colori del brand: navy #072938, teal #02B1AE (gli stessi delle pagine
   servizio).
   ========================================================================== */

/* ── Il selettore ─────────────────────────────────────────────────────────
   Una pillola "vuota" che prende il colore dell'header (bianco sulla home,
   scuro sulle altre pagine: lo copia lingue.js dal link vicino). Aperta,
   diventa una tendina bianca con le bandiere.
   ────────────────────────────────────────────────────────────────────── */

/* Desktop: fuori dal flusso, subito a sinistra di "MENU". La lista del menu
   di Avada e' gia' position:relative, quindi fa da riferimento. */
.lgl-sw-voce {
	position: absolute !important;
	top: 50%;
	right: 100%;
	transform: translateY(-50%);
	display: flex;
	align-items: center;
	margin: 0 16px 0 0 !important;
	padding: 0 !important;
	list-style: none;
	background: none !important;
}

/* Il colore prima che lingue.js lo copi dal menu (LiteSpeed rimanda il JS
   alla prima interazione): quello del menu di Avada, se lo dichiara, e
   bianco sulla home, il cui header e' a testo bianco su fondo scuro. */
.lgl-sw { color: var(--awb-color, inherit); }
body.page-template-template-hero-new .lgl-sw { --lgl-colore: #ffffff; }

.lgl-sw {
	position: relative;
	display: inline-flex;
	align-items: center;
	font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	line-height: 1;
	z-index: 30;
}

.lgl-sw > .lgl-sw__btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 36px;
	padding: 0 11px 0 10px;
	border-radius: 999px;
	color: var(--lgl-colore, currentColor);
	border: 1px solid rgba(128, 128, 128, 0.35);
	border-color: color-mix(in srgb, currentColor 28%, transparent);
	background: rgba(128, 128, 128, 0.06);
	background: color-mix(in srgb, currentColor 7%, transparent);
	font-size: 12.5px;
	font-weight: 700;
	letter-spacing: 0.08em;
	cursor: pointer;
	user-select: none;
	-webkit-user-select: none;
	-webkit-tap-highlight-color: transparent;
	list-style: none;
	transition: background-color 0.18s ease, border-color 0.18s ease;
}

.lgl-sw > .lgl-sw__btn::-webkit-details-marker { display: none; }
.lgl-sw > .lgl-sw__btn::marker { content: ''; }

.lgl-sw > .lgl-sw__btn:hover,
.lgl-sw[open] > .lgl-sw__btn {
	background: rgba(128, 128, 128, 0.12);
	background: color-mix(in srgb, currentColor 13%, transparent);
	border-color: color-mix(in srgb, currentColor 45%, transparent);
}

.lgl-sw > .lgl-sw__btn:focus-visible {
	outline: 2px solid #02B1AE;
	outline-offset: 2px;
}

.lgl-sw__bandiera {
	display: block;
	flex: none;
	width: 20px;
	height: 14px;
	border-radius: 3px;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.14);
	overflow: hidden;
}

.lgl-sw__codice { display: inline-block; }

.lgl-sw__freccia {
	width: 12px;
	height: 12px;
	flex: none;
	transition: transform 0.2s ease;
}

.lgl-sw[open] .lgl-sw__freccia { transform: rotate(180deg); }

/* La tendina */
.lgl-sw__menu {
	position: absolute;
	top: calc(100% + 10px);
	right: 0;
	min-width: 196px;
	margin: 0 !important;
	padding: 6px !important;
	list-style: none !important;
	background: #ffffff;
	border: 1px solid #e2e8ea;
	border-radius: 14px;
	box-shadow: 0 18px 40px rgba(7, 41, 56, 0.18), 0 2px 6px rgba(7, 41, 56, 0.08);
	transform-origin: top right;
	animation: lgl-apri 0.16s ease-out;
}

.lgl-sw__menu li {
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
	border: 0 !important;
	background: none !important;
}

.lgl-sw__menu li::before { content: none !important; }

.lgl-sw__menu a {
	display: flex !important;
	align-items: center;
	gap: 12px;
	padding: 11px 12px !important;
	border-radius: 10px;
	color: #1c2b33 !important;
	-webkit-text-fill-color: #1c2b33 !important;
	font-size: 14px !important;
	font-weight: 500 !important;
	letter-spacing: normal !important;
	text-transform: none !important;
	line-height: 1.2 !important;
	text-decoration: none !important;
	white-space: nowrap;
	transition: background-color 0.15s ease;
}

.lgl-sw__menu a:hover,
.lgl-sw__menu a:focus-visible {
	background: #eef6f7;
	outline: none;
}

.lgl-sw__menu a[aria-current] {
	font-weight: 700 !important;
	color: #072938 !important;
	-webkit-text-fill-color: #072938 !important;
}

.lgl-sw__nome { flex: 1 1 auto; }

.lgl-sw__spunta {
	width: 16px;
	height: 16px;
	flex: none;
	color: #02B1AE;
}

@keyframes lgl-apri {
	from { opacity: 0; transform: translateY(-4px) scale(0.98); }
	to   { opacity: 1; transform: none; }
}

/* Mobile: accanto all'hamburger, compatto (bandiera + codice, niente freccia).
   Il contenitore dell'icona e' largo ~76 px e va a capo: si tiene su una riga
   solo quando contiene il selettore. Allineato a destra, il selettore cresce
   verso sinistra, nello spazio libero dopo il logo. */
.fusion-column-wrapper:has(> .lgl-sw--mobile) {
	flex-wrap: nowrap !important;
	align-items: center !important;
}

.lgl-sw--mobile {
	flex: none;
	margin-right: 12px;
	align-self: center;
}

.lgl-sw--mobile > .lgl-sw__btn {
	height: 32px;
	padding: 0 10px 0 8px;
	gap: 6px;
	font-size: 12px;
}

.lgl-sw--mobile .lgl-sw__freccia { display: none; }

.lgl-sw--mobile .lgl-sw__menu {
	min-width: 184px;
	top: calc(100% + 12px);
}

@media (prefers-reduced-motion: reduce) {
	.lgl-sw__menu { animation: none; }
	.lgl-sw__freccia { transition: none; }
}


/* ── Il modulo di richiesta (pagine EN/ES) ───────────────────────────────
   Vive dentro .lps-form, la stessa scheda bianca del form italiano.
   ────────────────────────────────────────────────────────────────────── */

.lgl-richiesta { scroll-margin-top: 80px; }

.lps .lgl-richiesta__intro {
	text-align: center;
	color: var(--lps-tenue, #5b6c76);
	max-width: 60ch;
	margin: -14px auto 26px;
}

.lgl-form { margin: 0; }

.lgl-form__griglia {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 18px 20px;
}

.lps .lgl-form .lgl-campo {
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 7px;
}

.lgl-form .lgl-campo--pieno { grid-column: 1 / -1; }

.lps .lgl-form label {
	font-size: 0.92rem;
	font-weight: 600;
	color: var(--lps-navy, #072938);
	line-height: 1.3;
	margin: 0;
}

.lgl-obbl { color: #02B1AE; }

.lps .lgl-form .lgl-facolt {
	font-weight: 400;
	color: var(--lps-tenue, #5b6c76);
}

.lps .lgl-form input[type="text"],
.lps .lgl-form input[type="email"],
.lps .lgl-form input[type="tel"],
.lps .lgl-form select,
.lps .lgl-form textarea {
	width: 100% !important;
	min-height: 50px;
	height: auto !important;
	margin: 0 !important;
	padding: 13px 15px !important;
	border: 1px solid #cfdadd !important;
	border-radius: 10px !important;
	background: #fbfdfd !important;
	color: #1c2b33 !important;
	font-family: inherit !important;
	font-size: 16px !important; /* 16px: sotto, iOS ingrandisce la pagina al tocco */
	line-height: 1.4 !important;
	box-shadow: none !important;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.lps .lgl-form textarea {
	min-height: 150px;
	resize: vertical;
}

.lps .lgl-form select {
	appearance: none;
	-webkit-appearance: none;
	padding-right: 42px !important;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%23072938' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
	background-repeat: no-repeat !important;
	background-position: right 15px center !important;
	background-size: 12px !important;
}

.lps .lgl-form input:focus,
.lps .lgl-form select:focus,
.lps .lgl-form textarea:focus {
	outline: none !important;
	border-color: #02B1AE !important;
	background-color: #ffffff !important;
	box-shadow: 0 0 0 4px rgba(2, 177, 174, 0.14) !important;
}

.lps .lgl-form ::placeholder { color: #93a3aa; opacity: 1; }

/* Consenso */
.lps .lgl-consenso { margin: 22px 0 0; }

.lps .lgl-consenso label {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	font-size: 0.88rem;
	font-weight: 400;
	color: var(--lps-tenue, #5b6c76);
	line-height: 1.55;
	cursor: pointer;
}

.lps .lgl-consenso input[type="checkbox"] {
	flex: none;
	width: 20px;
	height: 20px;
	margin: 1px 0 0 !important;
	accent-color: #02B1AE;
	cursor: pointer;
}

.lps .lgl-consenso a {
	color: var(--lps-navy-2, #005764);
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* Invio */
.lps .lgl-form__azioni {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 14px 20px;
	margin: 26px 0 0;
}

.lps .lgl-form .lgl-invia {
	border: 0;
	cursor: pointer;
	font-family: inherit;
}

.lps .lgl-form__nota {
	color: var(--lps-tenue, #5b6c76);
	font-size: 0.88rem;
}

/* Trappola per i robot: fuori schermo, non display:none (alcuni la saltano). */
.lgl-form__trappola {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Esito dell'invio */
.lgl-esito {
	border-radius: 12px;
	padding: 16px 18px;
	margin: 0 0 22px;
	font-size: 0.95rem;
	line-height: 1.55;
}

.lgl-esito p { margin: 0; }
.lgl-esito strong { display: block; margin-bottom: 4px; }

.lgl-esito--ok {
	background: #e8f8f7;
	border: 1px solid rgba(2, 177, 174, 0.45);
	color: #07423f;
}

.lgl-esito--errore {
	background: #fdf1f1;
	border: 1px solid rgba(179, 45, 46, 0.35);
	color: #7a1f20;
}

/* Il percorso italiano */
.lps .lgl-italiano {
	margin: 18px auto 0;
	max-width: 70ch;
	text-align: center;
	color: var(--lps-tenue, #5b6c76);
	font-size: 0.9rem;
}

.lps .lgl-italiano a {
	color: var(--lps-navy-2, #005764);
	font-weight: 700;
	text-decoration: none;
	white-space: nowrap;
}

.lps .lgl-italiano a:hover { text-decoration: underline; }

@media (max-width: 640px) {
	.lgl-form__griglia { grid-template-columns: 1fr; gap: 16px; }
	.lps .lgl-form__azioni { flex-direction: column; align-items: stretch; text-align: center; }
	.lps .lgl-form .lgl-invia { width: 100%; }
}
