/**
 * Stili del form contatti (Contact Form 7).
 * Il markup del modulo usa classi con prefisso .ala-form__*; gli stati di
 * risposta usano le classi generate da CF7 (.wpcf7-response-output, ecc.).
 * Caricato solo quando CF7 è attivo (vedi functions.php → alabus_assets).
 */

.ala-form {
	width: 100%;
	max-width: 720px;
	margin-inline: auto;
}

/* Righe a due colonne (Nome/Cognome, Email/Telefono). */
.ala-form__row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 24px;
}

/* CF7 avvolge i campi in <p>: azzeriamo i margini di default. */
.ala-form p {
	margin: 0 0 24px;
}

.ala-form__row .ala-form__field {
	margin-bottom: 24px;
}

/* Etichette. */
.ala-form label {
	display: block;
	font-family: var(--font-body, "Inter", sans-serif);
	font-weight: 600;
	font-size: 16px;
	line-height: 1.5;
	color: var(--color-base, #000);
}

/* Campi input / textarea. */
.ala-form input[type="text"],
.ala-form input[type="email"],
.ala-form input[type="tel"],
.ala-form textarea {
	width: 100%;
	margin-top: 8px;
	padding: 0 16px;
	height: 50px;
	border: 1px solid #d0d5dd;
	border-radius: 10px;
	background-color: #fff;
	font-family: var(--font-body, "Inter", sans-serif);
	font-size: 16px;
	line-height: 1.5;
	color: var(--color-base, #000);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ala-form textarea {
	height: auto;
	min-height: 150px;
	padding: 13px 16px;
	resize: vertical;
}

.ala-form ::placeholder {
	color: #98a2b3;
	opacity: 1;
}

.ala-form input:focus,
.ala-form textarea:focus {
	outline: none;
	border-color: var(--color-ala, #2e65a9);
	box-shadow: 0 0 0 3px rgba(46, 101, 169, 0.15);
}

/* Consenso privacy: checkbox + testo su una riga. */
.ala-form__consent .wpcf7-list-item {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	margin: 0;
}

.ala-form__consent .wpcf7-list-item label {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	font-weight: 400;
	cursor: pointer;
}

.ala-form__consent input[type="checkbox"] {
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	margin-top: 2px;
	accent-color: var(--color-ala, #2e65a9);
}

/* Pulsante invio: riusa l'aspetto del bottone arancione del tema. */
.ala-form__submit {
	text-align: right;
	margin-bottom: 0;
}

.ala-form .wpcf7-spinner {
	margin: 0 0 0 12px;
}

/* Errore inline sul singolo campo. */
.ala-form .wpcf7-not-valid {
	border-color: #d92d20;
}

.ala-form .wpcf7-not-valid-tip {
	display: block;
	margin-top: 6px;
	font-size: 14px;
	color: #d92d20;
}

/* ── Stati di risposta del modulo ────────────────────────────────────
   Mappa i 4 stati del mockup (Confirm / Alert / Notice / Error) sulle
   classi che CF7 assegna al <form> dopo l'invio. */
.wpcf7 form .wpcf7-response-output {
	position: relative;
	max-width: 720px;
	margin: 24px auto 0;
	padding: 12px 16px 12px 48px;
	border: 0;
	border-left: 4px solid currentColor;
	border-radius: 8px;
	font-size: 16px;
	line-height: 1.5;
}

/* Icona di stato: forma mascherata colorata con currentColor (= colore stato). */
.wpcf7 form .wpcf7-response-output::before {
	content: "";
	position: absolute;
	left: 16px;
	top: 14px;
	width: 20px;
	height: 20px;
	background-color: currentColor;
	-webkit-mask: center / contain no-repeat;
	mask: center / contain no-repeat;
}

/* Confirm — invio riuscito (cerchio con spunta). */
.wpcf7 form.sent .wpcf7-response-output {
	color: #027a48;
	background-color: rgba(0, 200, 54, 0.1);
}

.wpcf7 form.sent .wpcf7-response-output::before {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Ccircle%20cx='12'%20cy='12'%20r='9'/%3E%3Cpath%20d='M8%2012l3%203%205-6'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Ccircle%20cx='12'%20cy='12'%20r='9'/%3E%3Cpath%20d='M8%2012l3%203%205-6'/%3E%3C/svg%3E");
}

/* Alert / Notice — errori di validazione o consenso non spuntato
   (triangolo con punto esclamativo). */
.wpcf7 form.invalid .wpcf7-response-output,
.wpcf7 form.unaccepted .wpcf7-response-output,
.wpcf7 form.payment-required .wpcf7-response-output {
	color: #b54708;
	background-color: rgba(233, 76, 23, 0.1);
}

.wpcf7 form.invalid .wpcf7-response-output::before,
.wpcf7 form.unaccepted .wpcf7-response-output::before,
.wpcf7 form.payment-required .wpcf7-response-output::before {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M12%203%202%2020h20z'/%3E%3Cpath%20d='M12%209v4'/%3E%3Cpath%20d='M12%2017h.01'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M12%203%202%2020h20z'/%3E%3Cpath%20d='M12%209v4'/%3E%3Cpath%20d='M12%2017h.01'/%3E%3C/svg%3E");
}

/* Error — invio fallito / spam (cerchio con X). */
.wpcf7 form.failed .wpcf7-response-output,
.wpcf7 form.aborted .wpcf7-response-output,
.wpcf7 form.spam .wpcf7-response-output {
	color: #b42318;
	background-color: rgba(217, 45, 32, 0.1);
}

.wpcf7 form.failed .wpcf7-response-output::before,
.wpcf7 form.aborted .wpcf7-response-output::before,
.wpcf7 form.spam .wpcf7-response-output::before {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Ccircle%20cx='12'%20cy='12'%20r='9'/%3E%3Cpath%20d='M9%209l6%206'/%3E%3Cpath%20d='M15%209l-6%206'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Ccircle%20cx='12'%20cy='12'%20r='9'/%3E%3Cpath%20d='M9%209l6%206'/%3E%3Cpath%20d='M15%209l-6%206'/%3E%3C/svg%3E");
}

/* Mobile: colonne impilate, pulsante a piena larghezza. */
@media (max-width: 781px) {
	.ala-form__row {
		grid-template-columns: 1fr;
		gap: 0;
	}

	.ala-form__submit {
		text-align: stretch;
	}

	.ala-form__submit .ala-button {
		width: 100%;
	}
}
