/* ==========================================================================
   Recovery Pro: basi del design
   Token (colori, caratteri, spaziature), reset, tipografia, link, bottoni,
   campi dei moduli e superfici. Mobile-first: le regole di base sono per il
   telefono, le media query min-width aggiungono tablet e desktop.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Carattere: Archivo variabile (pesi 400–800, larghezza 100–125%).
   Un solo file per tutto il sito. Licenza SIL OFL 1.1 (assets/fonts/LICENZA.txt).
   -------------------------------------------------------------------------- */
@font-face {
	font-family: "Archivo";
	font-style: normal;
	font-weight: 400 800;
	font-stretch: 100% 125%;
	font-display: swap;
	src: url("../fonts/archivo-variabile-latin.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --------------------------------------------------------------------------
   Token
   -------------------------------------------------------------------------- */
:root {
	/* Colori del marchio */
	--blu: #184a8c;            /* principale: link, bottoni, titoli in evidenza */
	--blu-scuro: #133c72;      /* stato hover dei bottoni blu */
	--blu-notte: #0b1f3a;      /* superfici scure: hero, footer, fasce */
	--azzurro: #109fdb;        /* accento: solo su fondo scuro o per testi grandi */
	--azzurro-testo: #0a72a1;  /* azzurro leggibile per testo piccolo su bianco */
	--azzurro-chiaro: #4fc3f7; /* azzurro per testo piccolo su fondo notte */

	/* Neutri, leggermente tinti di blu */
	--inchiostro: #0f1c2e;     /* testo principale */
	--testo-2: #43536b;        /* testo secondario su chiaro */
	--testo-notte: #c9d6e8;    /* testo su fondo notte */
	--testo-notte-2: #a9bcd6;  /* testo secondario su fondo notte */
	--carta: #ffffff;
	--nebbia: #f2f6fb;         /* sezioni alternate */
	--linea: #d5dfeb;          /* bordi e separatori su chiaro */
	--linea-notte: rgb(255 255 255 / 0.14);

	/* Stati */
	--errore: #b42318;
	--errore-fondo: #fdecea;
	--successo: #1b7f4b;
	--successo-fondo: #e7f5ee;

	/* Caratteri */
	--font: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
	--largo: 100%;             /* larghezza dei titoli in maiuscolo (normale) */

	/* Scala tipografica fluida (360px → 1280px) */
	--t-piccolo: 0.875rem;
	--t-corpo: clamp(1.0625rem, 1.02rem + 0.18vw, 1.125rem);
	--t-grande: clamp(1.1875rem, 1.1rem + 0.4vw, 1.375rem);
	--t-h4: clamp(1.125rem, 1.07rem + 0.25vw, 1.25rem);
	--t-h3: clamp(1.3125rem, 1.2rem + 0.55vw, 1.625rem);
	--t-h2: clamp(1.75rem, 1.4rem + 1.6vw, 2.75rem);
	--t-h1: clamp(2.25rem, 1.5rem + 3.4vw, 4.25rem);
	--t-display: clamp(2rem, 1.15rem + 3.6vw, 4.375rem);

	/* Spaziature (base 4px) */
	--sp-1: 0.25rem;
	--sp-2: 0.5rem;
	--sp-3: 0.75rem;
	--sp-4: 1rem;
	--sp-5: 1.5rem;
	--sp-6: 2rem;
	--sp-7: 3rem;
	--sp-8: 4rem;
	--sp-9: 6rem;
	--sp-sezione: clamp(3.5rem, 2.25rem + 4vw, 5.5rem);
	--t-h2-sezione: clamp(1.75rem, 1.4rem + 1.2vw, 2.25rem); /* titolo di ogni sezione */
	--ombra-card: 0 2px 6px rgb(11 31 58 / 0.05), 0 16px 36px -14px rgb(11 31 58 / 0.2);

	/* Impaginazione */
	--larghezza: 75rem;        /* 1200px */
	--larghezza-testo: 42rem;  /* ~70 caratteri */
	--margine: clamp(1rem, 0.6rem + 2vw, 2.5rem);

	/* Forme */
	--r-s: 4px;
	--r-m: 8px;
	--r-l: 14px;
	--r-pillola: 999px;

	/* Ombre: sempre con scostamento e sfocatura */
	--ombra-1: 0 1px 2px rgb(11 31 58 / 0.06), 0 2px 6px -2px rgb(11 31 58 / 0.08);
	--ombra-2: 0 2px 4px rgb(11 31 58 / 0.05), 0 12px 28px -10px rgb(11 31 58 / 0.22);

	/* Movimento */
	--rapido: 160ms;
	--medio: 280ms;
	--uscita: cubic-bezier(0.16, 1, 0.3, 1);

	/* Altezza minima delle zone da toccare */
	--tocco: 3rem;
}

/* Per tornare al titolo largo: --largo: 112% da 40em in su. */

/* --------------------------------------------------------------------------
   Reset essenziale
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-behavior: smooth;
	scroll-padding-top: 6rem; /* le ancore non finiscono sotto la barra fissa */
}

body {
	margin: 0;
	min-height: 100dvh;
	background: var(--carta);
	color: var(--inchiostro);
	font-family: var(--font);
	font-size: var(--t-corpo);
	line-height: 1.6;
	font-optical-sizing: auto;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	-webkit-tap-highlight-color: transparent;
	overflow-x: clip;
}

img,
svg,
video,
picture {
	display: block;
	max-width: 100%;
	height: auto;
}

input,
button,
textarea,
select {
	font: inherit;
	color: inherit;
}

button {
	cursor: pointer;
}

:where(h1, h2, h3, h4, p, ul, ol, figure, blockquote, dl, dd) {
	margin: 0;
}

/* --------------------------------------------------------------------------
   Superfici del browser: anche queste parlano la lingua del marchio
   -------------------------------------------------------------------------- */
::selection {
	background: rgb(16 159 219 / 0.28);
	color: var(--inchiostro);
}

.superficie-notte ::selection {
	background: var(--azzurro);
	color: var(--blu-notte);
}

html {
	scrollbar-color: #9fb2cc var(--nebbia);
}

input,
textarea {
	caret-color: var(--blu);
}

:focus-visible {
	outline: 3px solid var(--azzurro);
	outline-offset: 3px;
	border-radius: var(--r-s);
}

/* --------------------------------------------------------------------------
   Tipografia
   -------------------------------------------------------------------------- */
h1,
h2,
h3,
h4 {
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: -0.015em;
	text-wrap: balance;
	color: var(--inchiostro);
}

h1 {
	font-size: var(--t-h1);
	line-height: 1.05;
	letter-spacing: -0.025em;
}

h2 {
	font-size: var(--t-h2);
	letter-spacing: -0.02em;
}

h3 {
	font-size: var(--t-h3);
}

h4 {
	font-size: var(--t-h4);
	line-height: 1.3;
}

p,
li {
	text-wrap: pretty;
}

/* Titolo in maiuscolo, largo: la voce del marchio negli hero */
.titolo-display {
	font-size: var(--t-display);
	font-weight: 650;
	font-stretch: var(--largo);
	line-height: 1.02;
	letter-spacing: -0.005em;
	text-transform: uppercase;
}

/* Seconda riga in azzurro (concept del dev) */
.titolo-display .accento {
	display: block;
	color: var(--azzurro);
}

.testo-grande {
	font-size: var(--t-grande);
	line-height: 1.55;
	color: var(--testo-2);
}

.testo-piccolo {
	font-size: var(--t-piccolo);
	line-height: 1.5;
}

.prosa {
	max-width: var(--larghezza-testo);
}

.prosa > * + * {
	margin-top: 1em;
}

.prosa > :is(h2, h3, h4) {
	margin-top: 1.8em;
}

.prosa > :is(h2, h3, h4) + * {
	margin-top: 0.6em;
}

.prosa :is(ul, ol) {
	padding-left: 1.25em;
}

.prosa li + li {
	margin-top: 0.4em;
}

strong,
b {
	font-weight: 650;
}

/* Numeri allineati per orari, telefoni, dati */
.cifre {
	font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   Link
   -------------------------------------------------------------------------- */
a {
	color: var(--blu);
	text-decoration-line: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
	text-decoration-color: rgb(24 74 140 / 0.4);
	transition: color var(--rapido) ease-out, text-decoration-color var(--rapido) ease-out;
}

a:hover {
	color: var(--blu-scuro);
	text-decoration-color: currentColor;
}

.superficie-notte a:not(.pulsante) {
	color: var(--azzurro-chiaro);
	text-decoration-color: rgb(79 195 247 / 0.45);
}

.superficie-notte a:not(.pulsante):hover {
	color: var(--carta);
	text-decoration-color: currentColor;
}

/* --------------------------------------------------------------------------
   Bottoni
   .pulsante                  base (da usare su <a> o <button>)
   .pulsante--primario        blu pieno, su fondo chiaro
   .pulsante--accento         azzurro pieno, su fondo scuro (l'azione principale negli hero)
   .pulsante--contorno        bordo, per l'azione secondaria
   .pulsante--grande          per la chiamata principale della pagina
   -------------------------------------------------------------------------- */
.pulsante {
	--p-fondo: var(--blu);
	--p-fondo-hover: var(--blu-scuro);
	--p-testo: var(--carta);
	--p-bordo: transparent;

	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.6em;
	min-height: var(--tocco);
	padding: 0.7em 1.5em;
	border: 1.5px solid var(--p-bordo);
	border-radius: var(--r-pillola);
	background: var(--p-fondo);
	color: var(--p-testo);
	font-size: 1rem;
	font-weight: 650;
	line-height: 1.2;
	letter-spacing: 0.005em;
	text-align: center;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	user-select: none;
	-webkit-user-select: none;
	touch-action: manipulation;
	transition:
		background-color var(--rapido) ease-out,
		border-color var(--rapido) ease-out,
		color var(--rapido) ease-out,
		box-shadow var(--rapido) ease-out,
		transform var(--rapido) ease-out;
}

.pulsante:hover {
	background: var(--p-fondo-hover);
	color: var(--p-testo);
}

.pulsante:active {
	transform: translateY(1px);
}

.pulsante svg {
	width: 1.2em;
	height: 1.2em;
	flex: none;
}

.pulsante--accento {
	--p-fondo: var(--azzurro);
	--p-fondo-hover: #35b4ea;
	--p-testo: var(--blu-notte);
}

.pulsante--contorno {
	--p-fondo: transparent;
	--p-fondo-hover: rgb(24 74 140 / 0.07);
	--p-testo: var(--blu);
	--p-bordo: currentColor;
}

.superficie-notte .pulsante--contorno {
	--p-testo: var(--carta);
	--p-fondo-hover: rgb(255 255 255 / 0.1);
	--p-bordo: rgb(255 255 255 / 0.55);
}

.pulsante--grande {
	min-height: 3.5rem;
	padding-inline: 1.9em;
	font-size: 1.0625rem;
}

.pulsante[disabled],
.pulsante[aria-disabled="true"] {
	opacity: 0.5;
	pointer-events: none;
}

/* Il bottone si allarga a tutta riga sui telefoni, quando serve */
.pulsante--pieno-mobile {
	width: 100%;
}

@media (min-width: 40em) {
	.pulsante--pieno-mobile {
		width: auto;
	}
}

/* Gruppo di bottoni: in colonna sul telefono, affiancati da tablet */
.gruppo-pulsanti {
	display: flex;
	flex-wrap: wrap;
	gap: var(--sp-3);
}

/* Freccia che avanza al passaggio del mouse */
.pulsante .freccia {
	transition: transform var(--medio) var(--uscita);
}

@media (hover: hover) {
	.pulsante:hover .freccia {
		transform: translateX(3px);
	}
}

/* --------------------------------------------------------------------------
   Campi dei moduli (Contact Form 7 compreso)
   Font almeno 16px: iOS non ingrandisce la pagina quando si tocca un campo.
   -------------------------------------------------------------------------- */
.campo {
	display: grid;
	gap: var(--sp-2);
}

.campo label,
.etichetta {
	font-size: 0.9375rem;
	font-weight: 600;
	color: var(--inchiostro);
}

.campo .facoltativo {
	font-weight: 400;
	color: var(--testo-2);
}

input:is([type="text"], [type="email"], [type="tel"], [type="url"], [type="number"], [type="search"]),
select,
textarea {
	width: 100%;
	min-height: var(--tocco);
	padding: 0.7em 0.9em;
	border: 1.5px solid var(--linea);
	border-radius: var(--r-m);
	background: var(--carta);
	color: var(--inchiostro);
	font-size: max(16px, 1rem);
	line-height: 1.4;
	transition: border-color var(--rapido) ease-out, box-shadow var(--rapido) ease-out;
}

textarea {
	min-height: 8.5rem;
	resize: vertical;
}

::placeholder {
	color: var(--testo-2);
	opacity: 1;
}

input:hover,
select:hover,
textarea:hover {
	border-color: #a9bcd6;
}

input:focus,
select:focus,
textarea:focus {
	outline: none;
	border-color: var(--blu);
	box-shadow: 0 0 0 4px rgb(24 74 140 / 0.14);
}

[aria-invalid="true"],
.wpcf7-not-valid {
	border-color: var(--errore) !important;
}

.messaggio-errore,
.wpcf7-not-valid-tip {
	display: block;
	margin-top: var(--sp-1);
	color: var(--errore);
	font-size: var(--t-piccolo);
	font-weight: 500;
}

input[type="checkbox"],
input[type="radio"] {
	width: 1.25rem;
	height: 1.25rem;
	accent-color: var(--blu);
	flex: none;
}

/* --------------------------------------------------------------------------
   Impaginazione
   -------------------------------------------------------------------------- */
.contenitore {
	width: 100%;
	max-width: calc(var(--larghezza) + 2 * var(--margine));
	margin-inline: auto;
	padding-inline: var(--margine);
}

.sezione {
	padding-block: var(--sp-sezione);
}

.sezione--nebbia {
	background: var(--nebbia);
}

/* Superficie scura del marchio (hero, fasce di contatto, footer) */
.superficie-notte {
	background: var(--blu-notte);
	color: var(--testo-notte);
}

.superficie-notte :is(h1, h2, h3, h4) {
	color: var(--carta);
}

/* Fascia diagonale del concept: banda blu traslucida che attraversa la superficie */
.fascia-diagonale {
	position: relative;
	isolation: isolate;
	overflow: hidden;
}

.fascia-diagonale::after {
	content: "";
	position: absolute;
	inset: -20% auto -20% 38%;
	width: 46%;
	background: linear-gradient(180deg, rgb(24 74 140 / 0.55), rgb(16 159 219 / 0.22));
	transform: skewX(-24deg);
	transform-origin: top;
	z-index: -1;
	pointer-events: none;
}

/* Testo solo per lettori di schermo */
.solo-lettori,
.screen-reader-text { /* classe di WordPress (paginazione, moduli) */
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Collegamento "Vai al contenuto" per chi naviga da tastiera */
.salta-al-contenuto {
	position: absolute;
	top: var(--sp-2);
	left: var(--sp-2);
	z-index: 1000;
	padding: var(--sp-3) var(--sp-4);
	background: var(--carta);
	color: var(--blu);
	font-weight: 650;
	transform: translateY(-200%);
}

.salta-al-contenuto:focus {
	transform: none;
}

/* Icone SVG del tema (sprite assets/img/icone.svg) */
.icona {
	width: 1.25em;
	height: 1.25em;
	flex: none;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.75;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* --------------------------------------------------------------------------
   Movimento ridotto: chi lo chiede non vede animazioni
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}

/* Pulsante WhatsApp: verde del servizio, riconoscibile a colpo d'occhio.
   #0F7A3F con testo bianco ha contrasto 5,4:1 (AA). */
.pulsante--whatsapp {
	--p-fondo: #0f7a3f;
	--p-fondo-hover: #0b6633;
	--p-testo: #ffffff;
	--p-bordo: transparent;
}
