/* SP Leads - popup "lascia il numero" prima di WhatsApp e delle chiamate (includes/contact-popup.php, assets/sp-contact.js).
   Solo px: il tema imposta html{font-size:10px}. Selettori con .spc davanti per non farsi sovrascrivere dal tema. */
.spc {
	--spc-ink: #23212f;
	--spc-muted: #6d6b80;
	--spc-line: #e6e4ee;
	--spc-soft: #f5f4f8;
	--spc-bg: #ffffff;
	--spc-orange: #f0691a;
	--spc-orange-d: #d9570c;
	--spc-orange-soft: #fff1e8;
	--spc-wa: #15803d;
	--spc-wa-d: #116a32;
	--spc-wa-ico: #1fae54;
	--spc-wa-soft: #e8f8ee;
	--spc-err: #d13a2f;
	--spc-font: 'Montserrat', 'Source Sans Pro', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
	position: fixed;
	top: 0; right: 0; bottom: 0; left: 0;
	z-index: 2147483000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px 16px;
	font-family: var(--spc-font);
	color: var(--spc-ink);
	text-align: left;
	-webkit-font-smoothing: antialiased;
}
.spc[hidden] { display: none !important; }
.spc *, .spc *::before, .spc *::after { box-sizing: border-box; }
.spc[data-ch="whatsapp"] .spc-tel, .spc[data-ch="telefono"] .spc-wa { display: none !important; }
.spc [hidden] { display: none !important; }

.spc__backdrop {
	position: absolute;
	top: 0; right: 0; bottom: 0; left: 0;
	background: rgba(21, 20, 29, .62);
	-webkit-backdrop-filter: blur(3px);
	backdrop-filter: blur(3px);
	opacity: 0;
	transition: opacity .22s ease;
}
.spc__dialog {
	position: relative;
	width: 100%;
	max-width: 440px;
	max-height: calc(100vh - 48px);
	max-height: calc(100dvh - 48px);
	overflow: auto;
	overscroll-behavior: contain;
	background: var(--spc-bg);
	border-radius: 22px;
	padding: 28px 28px 22px;
	box-shadow: 0 30px 80px -30px rgba(21, 20, 29, .55), 0 10px 30px -18px rgba(21, 20, 29, .35);
	opacity: 0;
	transform: translateY(14px) scale(.98);
	transition: opacity .22s ease, transform .28s cubic-bezier(.16, 1, .3, 1);
	outline: none;
}
.spc.is-open .spc__backdrop { opacity: 1; }
.spc.is-open .spc__dialog { opacity: 1; transform: none; }

.spc .spc__close {
	position: absolute;
	top: 14px;
	right: 14px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--spc-soft);
	color: var(--spc-ink);
	box-shadow: none;
	cursor: pointer;
	transition: background .15s;
}
.spc .spc__close:hover { background: var(--spc-line); }

/* Intestazione */
.spc__head { display: flex; align-items: center; gap: 14px; margin: 0 40px 14px 0; }
.spc__ico { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 16px; }
.spc__ico--wa { background: var(--spc-wa-soft); color: var(--spc-wa-ico); }
.spc__ico--tel { background: var(--spc-orange-soft); color: var(--spc-orange); }
.spc__head-txt { min-width: 0; }
.spc .spc__eyebrow {
	margin: 0 0 4px;
	padding: 0;
	font-family: var(--spc-font);
	font-size: 11.5px;
	line-height: 1.35;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--spc-muted);
}
.spc .spc__title {
	margin: 0;
	padding: 0;
	font-family: var(--spc-font);
	font-size: 22px;
	line-height: 1.2;
	font-weight: 800;
	font-style: normal;
	letter-spacing: -.01em;
	text-transform: none;
	color: var(--spc-ink);
	text-wrap: balance;
}
.spc .spc__desc {
	margin: 0 0 18px;
	padding: 0;
	font-family: var(--spc-font);
	font-size: 14.5px;
	line-height: 1.55;
	font-weight: 400;
	color: var(--spc-muted);
}
.spc .spc__desc strong { font-weight: 700; color: var(--spc-ink); white-space: nowrap; }

/* Campi */
.spc__fields { display: grid; gap: 12px; }
.spc__field { display: grid; gap: 6px; }
.spc .spc__field label {
	display: block;
	margin: 0;
	padding: 0;
	font-family: var(--spc-font);
	font-size: 13px;
	line-height: 1.3;
	font-weight: 700;
	letter-spacing: 0;
	text-transform: none;
	color: var(--spc-ink);
}
.spc .spc__field input {
	display: block;
	width: 100%;
	height: 50px;
	min-height: 0;
	margin: 0;
	padding: 0 14px;
	border: 1.5px solid var(--spc-line);
	border-radius: 12px;
	background: #fff;
	color: var(--spc-ink);
	font-family: var(--spc-font);
	font-size: 16px;
	line-height: normal;
	font-weight: 500;
	letter-spacing: 0;
	box-shadow: none;
	outline: none;
	-webkit-appearance: none;
	appearance: none;
	transition: border-color .15s, box-shadow .15s;
}
.spc .spc__field input::placeholder { color: #a3a1b3; opacity: 1; }
.spc .spc__field input:focus { border-color: var(--spc-orange); box-shadow: 0 0 0 4px rgba(240, 105, 26, .16); }
.spc .spc__field input[aria-invalid="true"] { border-color: var(--spc-err); box-shadow: 0 0 0 4px rgba(209, 58, 47, .12); }
.spc .spc__hp { position: absolute !important; left: -9999px !important; top: auto; width: 1px; height: 1px; overflow: hidden; }

.spc .spc__check {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 2px 0 0;
	padding: 0;
	font-family: var(--spc-font);
	font-size: 12.5px;
	line-height: 1.5;
	font-weight: 500;
	text-transform: none;
	letter-spacing: 0;
	color: var(--spc-muted);
	cursor: pointer;
}
.spc .spc__check input {
	flex: none;
	width: 20px;
	height: 20px;
	margin: 1px 0 0;
	padding: 0;
	accent-color: var(--spc-orange);
	cursor: pointer;
}
.spc .spc__check input[aria-invalid="true"] { outline: 2px solid var(--spc-err); outline-offset: 2px; }
.spc .spc__check a { color: var(--spc-ink); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.spc .spc__err { margin: 0; padding: 0; font-size: 13px; line-height: 1.4; font-weight: 600; color: var(--spc-err); }
.spc .spc__err:empty { display: none; }

/* Pulsanti */
.spc__actions { display: grid; gap: 10px; margin-top: 18px; }
.spc .spc__btn {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	min-height: 54px;
	margin: 0;
	padding: 12px 18px;
	border: 1.5px solid transparent;
	border-radius: 14px;
	font-family: var(--spc-font);
	font-size: 16px;
	line-height: 1.2;
	font-weight: 700;
	letter-spacing: 0;
	text-transform: none;
	text-align: center;
	text-decoration: none;
	box-shadow: none;
	cursor: pointer;
	transition: background .15s, border-color .15s, color .15s, transform .1s;
}
.spc .spc__btn:active { transform: translateY(1px); }
.spc .spc__btn svg { flex: none; }
.spc .spc__btn--go, .spc .spc__btn--go:visited { background: var(--spc-wa); color: #fff; }
.spc .spc__btn--go:hover, .spc .spc__btn--go:focus { background: var(--spc-wa-d); color: #fff; text-decoration: none; }
.spc[data-ch="telefono"] .spc__btn--go, .spc[data-ch="telefono"] .spc__btn--go:visited { background: var(--spc-orange); }
.spc[data-ch="telefono"] .spc__btn--go:hover, .spc[data-ch="telefono"] .spc__btn--go:focus { background: var(--spc-orange-d); }
.spc .spc__btn--back { background: #fff; border-color: var(--spc-line); color: var(--spc-ink); }
.spc .spc__btn--back:hover { border-color: var(--spc-ink); background: #fff; color: var(--spc-ink); }
.spc .spc__btn[aria-disabled="true"], .spc .spc__btn.is-busy { opacity: .7; pointer-events: none; }

/* Da computer il telefono non chiama: per le chiamate il primo pulsante diventa "Richiamatemi voi". */
.spc.is-desk[data-ch="telefono"] [data-spc-step="form"] .spc__btn--back { order: -1; background: var(--spc-orange); border-color: transparent; color: #fff; }
.spc.is-desk[data-ch="telefono"] [data-spc-step="form"] .spc__btn--back:hover { background: var(--spc-orange-d); }
.spc.is-desk[data-ch="telefono"] [data-spc-step="form"] .spc__btn--go { background: #fff; border-color: var(--spc-line); color: var(--spc-ink); }
.spc.is-desk[data-ch="telefono"] [data-spc-step="form"] .spc__btn--go:hover { border-color: var(--spc-ink); background: #fff; }

.spc__spin { display: none; width: 18px; height: 18px; border: 2.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spc-spin .7s linear infinite; }
.spc .is-busy .spc__spin { display: inline-block; }
@keyframes spc-spin { to { transform: rotate(360deg); } }

.spc .spc__skip {
	justify-self: center;
	margin: 2px 0 0;
	padding: 6px 8px;
	border: 0;
	background: none;
	box-shadow: none;
	font-family: var(--spc-font);
	font-size: 13px;
	line-height: 1.3;
	font-weight: 600;
	text-transform: none;
	letter-spacing: 0;
	color: var(--spc-muted);
	text-decoration: underline;
	text-underline-offset: 2px;
	cursor: pointer;
}
.spc .spc__note {
	display: block;
	margin: 14px 0 0;
	padding: 0;
	font-family: var(--spc-font);
	font-size: 12px;
	line-height: 1.45;
	color: var(--spc-muted);
	text-align: center;
}
.spc .spc__note svg { display: inline-block; vertical-align: -2px; margin-right: 4px; }
.spc .spc__num, .spc [data-spc-num] { white-space: nowrap; }

.spc .spc__btn:focus-visible, .spc .spc__close:focus-visible, .spc .spc__skip:focus-visible, .spc .spc__check a:focus-visible {
	outline: 3px solid rgba(240, 105, 26, .55);
	outline-offset: 2px;
}

/* Conferma */
.spc .spc__step--done { text-align: center; padding-top: 6px; }
.spc__done-ico { display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%; background: var(--spc-wa-soft); color: var(--spc-wa-ico); }
.spc .spc__step--done .spc__title { margin-bottom: 8px; outline: none; }
.spc .spc__step--done .spc__actions { margin-top: 4px; }

/* Telefono: pannello che sale dal basso. */
@media (max-width: 600px) {
	.spc { align-items: flex-end; padding: 0; }
	.spc__dialog {
		max-width: none;
		max-height: calc(100vh - 16px);
		max-height: calc(100dvh - 16px);
		border-radius: 22px 22px 0 0;
		padding: 24px 18px calc(18px + env(safe-area-inset-bottom, 0px));
		transform: translateY(48px);
	}
	.spc .spc__title { font-size: 20px; }
	.spc__ico { width: 46px; height: 46px; border-radius: 14px; }
	.spc__head { margin-bottom: 12px; }
	.spc .spc__desc { font-size: 14px; margin-bottom: 16px; }
}
@media (prefers-reduced-motion: reduce) {
	.spc__backdrop, .spc__dialog { transition: none; }
	.spc__dialog { transform: none; }
}
html.spc-lock, html.spc-lock body { overflow: hidden !important; }
/* Col popup aperto si nasconde il pulsante delle preferenze cookie di iubenda (z-index massimo, gli starebbe sopra).
   :not(#spc-x) alza la specificita' sopra le regole !important di iubenda. */
html.spc-lock .iubenda-tp-btn:not(#spc-x) { visibility: hidden !important; pointer-events: none !important; }
