/**
 * Job Hunters — Questionari
 * Tutto è annidato sotto .jhq per non interferire con il tema.
 */

.jhq {
	--jhq-navy: #132352;
	--jhq-ink: #5b6b90;
	--jhq-line: #e4eaf4;
	--jhq-blue: #0f47db;
	--jhq-errore: #c62828;
	--jhq-a: #0f47db;
	--jhq-font: 'Alexandria', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	font-family: var(--jhq-font);
	color: var(--jhq-navy);
	width: 100%;
	-webkit-font-smoothing: antialiased;
}

.jhq *,
.jhq *::before,
.jhq *::after {
	box-sizing: border-box;
	font-family: var(--jhq-font);
}

.jhq-titolo {
	margin: 0 0 10px;
	font-size: 26px;
	line-height: 1.25;
	font-weight: 600;
	letter-spacing: -0.015em;
	color: var(--jhq-navy);
}

.jhq-intro {
	margin: 0 0 26px;
	font-size: 13.5px;
	font-weight: 300;
	line-height: 1.65;
	color: var(--jhq-ink);
	max-width: 70ch;
}

/* ------------------------------------------------------- SELETTORE */

.jhq-griglia {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
}

.jhq-selettore[data-colonne="1"] .jhq-griglia { grid-template-columns: 1fr; }
.jhq-selettore[data-colonne="3"] .jhq-griglia { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.jhq-selettore[data-colonne="4"] .jhq-griglia { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.jhq-card {
	position: relative;
	display: block;
	padding: 24px;
	background: #fff;
	border: 1px solid var(--jhq-line);
	border-radius: 14px;
	cursor: pointer;
	transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease, background .2s ease;
	animation: jhq-entra .45s ease both;
}

.jhq-card:nth-child(1) { animation-delay: .04s; }
.jhq-card:nth-child(2) { animation-delay: .10s; }
.jhq-card:nth-child(3) { animation-delay: .16s; }
.jhq-card:nth-child(4) { animation-delay: .22s; }

@keyframes jhq-entra {
	from { opacity: 0; transform: translateY(10px); }
	to { opacity: 1; transform: none; }
}

.jhq-card:hover {
	border-color: var(--jhq-a);
	box-shadow: 0 8px 20px rgba(19, 35, 82, .07);
	transform: translateY(-2px);
}

.jhq-card input[type="radio"] {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	margin: 0;
}

.jhq-icona {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	margin-bottom: 16px;
	border-radius: 12px;
	background: color-mix(in srgb, var(--jhq-a) 10%, #fff);
	color: var(--jhq-a);
	transition: background .2s ease, color .2s ease, transform .2s ease;
}

.jhq-icona svg { width: 24px; height: 24px; display: block; }
.jhq-card:hover .jhq-icona { transform: scale(1.04); }

.jhq-card-titolo {
	display: block;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.4;
	letter-spacing: -0.01em;
	margin-bottom: 8px;
}

.jhq-card-testo {
	display: block;
	font-size: 13.5px;
	font-weight: 300;
	line-height: 1.65;
	color: var(--jhq-ink);
}

.jhq-spunta {
	position: absolute;
	top: 18px;
	right: 18px;
	width: 22px;
	height: 22px;
	color: var(--jhq-a);
	opacity: 0;
	transform: scale(.6);
	transition: opacity .18s ease, transform .18s cubic-bezier(.34, 1.56, .64, 1);
}

.jhq-spunta svg { width: 100%; height: 100%; display: block; }

/* Lo stato selezionato è retto DUE volte: dalla classe applicata dal JS e
   da :has() puro CSS. Così la card si evidenzia al clic anche se il
   JavaScript non è ancora partito o viene bloccato da cache/CSP. */
.jhq-card.jhq-selezionata,
.jhq-card:has(input:checked) {
	background: color-mix(in srgb, var(--jhq-a) 8%, #fff);
	border-color: var(--jhq-a);
	box-shadow: 0 0 0 1px var(--jhq-a) inset;
}

.jhq-card.jhq-selezionata .jhq-icona,
.jhq-card:has(input:checked) .jhq-icona { background: var(--jhq-a); color: #fff; }

.jhq-card.jhq-selezionata .jhq-spunta,
.jhq-card:has(input:checked) .jhq-spunta { opacity: 1; transform: scale(1); }

.jhq-card:has(input:focus-visible) {
	border-color: var(--jhq-a);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--jhq-a) 32%, transparent);
}

/* --------------------------------------------------- AVANZAMENTO */

.jhq-avanzamento {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 18px;
}

.jhq-barra {
	width: 30px;
	height: 3px;
	border-radius: 2px;
	background: #dbe3f2;
	transition: background .25s ease;
}

.jhq-barra.attiva { background: var(--jhq-a); }

/* Nel modulo unico le barre sono generate dal JS dentro questo contenitore:
   senza display flex resterebbero inline e ignorerebbero width/height. */
.jhq-barre {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.jhq-ramo[hidden] { display: none; }

.jhq-avanzamento-testo {
	margin-left: 8px;
	font-size: 11.5px;
	font-weight: 500;
	letter-spacing: .09em;
	text-transform: uppercase;
	color: #8b99b8;
}

.jhq-step-titolo {
	margin: 0 0 18px;
	font-size: 17px;
	font-weight: 600;
	letter-spacing: -0.01em;
	color: var(--jhq-navy);
}

/* --------------------------------------------------------- CAMPI */

.jhq-campi {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 18px;
}

.jhq-campo.jhq-full { grid-column: 1 / -1; }

.jhq-etichetta {
	display: block;
	margin-bottom: 7px;
	font-size: 13.5px;
	font-weight: 500;
	color: var(--jhq-navy);
}

.jhq-obbligatorio { color: var(--jhq-a); margin-left: 2px; }

.jhq input[type="text"],
.jhq input[type="email"],
.jhq input[type="tel"],
.jhq textarea,
.jhq select {
	width: 100%;
	padding: 13px 15px;
	font-size: 14.5px;
	font-weight: 300;
	color: var(--jhq-navy);
	background: #fff;
	border: 1px solid var(--jhq-line);
	border-radius: 10px;
	transition: border-color .18s ease, box-shadow .18s ease;
	appearance: none;
	-webkit-appearance: none;
}

.jhq textarea { resize: vertical; min-height: 110px; line-height: 1.6; }

.jhq input:focus,
.jhq textarea:focus,
.jhq select:focus {
	outline: none;
	border-color: var(--jhq-a);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--jhq-a) 18%, transparent);
}

.jhq ::placeholder { color: #a6b1c9; font-weight: 300; }

.jhq-select { position: relative; }

.jhq-select select { padding-right: 42px; cursor: pointer; }

.jhq-chevron {
	position: absolute;
	right: 14px;
	top: 50%;
	transform: translateY(-50%);
	width: 18px;
	height: 18px;
	color: #8b99b8;
	pointer-events: none;
}

/* Consenso */

.jhq-consenso {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 16px 18px;
	background: #f6f8fc;
	border: 1px solid var(--jhq-line);
	border-radius: 12px;
	cursor: pointer;
}

.jhq-consenso input { position: absolute; opacity: 0; width: 1px; height: 1px; }

.jhq-consenso-box {
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	margin-top: 1px;
	border: 1.5px solid #c9d2e3;
	border-radius: 6px;
	background: #fff;
	position: relative;
	transition: background .16s ease, border-color .16s ease;
}

.jhq-consenso-box::after {
	content: "";
	position: absolute;
	left: 6px;
	top: 2px;
	width: 5px;
	height: 10px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg) scale(.5);
	opacity: 0;
	transition: opacity .16s ease, transform .16s ease;
}

.jhq-consenso input:checked + .jhq-consenso-box {
	background: var(--jhq-a);
	border-color: var(--jhq-a);
}

.jhq-consenso input:checked + .jhq-consenso-box::after { opacity: 1; transform: rotate(45deg) scale(1); }

.jhq-consenso input:focus-visible + .jhq-consenso-box {
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--jhq-a) 30%, transparent);
}

.jhq-consenso-testo { font-size: 12.5px; font-weight: 300; line-height: 1.6; color: var(--jhq-ink); }
.jhq-consenso-testo a { color: var(--jhq-a); }

/* Errori */

.jhq-messaggio-errore,
.jhq-errore,
.jhq-errore-globale {
	margin: 7px 0 0;
	font-size: 12.5px;
	font-weight: 500;
	color: var(--jhq-errore);
}

.jhq-errore-globale {
	padding: 12px 16px;
	margin-top: 20px;
	background: #fdeced;
	border-radius: 10px;
}

.jhq-ha-errore input,
.jhq-ha-errore select,
.jhq-ha-errore textarea,
.jhq-ha-errore .jhq-consenso {
	border-color: var(--jhq-errore);
}

/* Honeypot: fuori dal flusso, invisibile e non focalizzabile */
.jhq-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* --------------------------------------------------------- PIEDE */

.jhq-piede {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
	margin-top: 28px;
}

.jhq-bottone {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 15px 30px;
	font-size: 14.5px;
	font-weight: 600;
	letter-spacing: -0.005em;
	color: #fff;
	background: var(--jhq-a);
	border: 0;
	border-radius: 10px;
	cursor: pointer;
	box-shadow: 0 8px 18px color-mix(in srgb, var(--jhq-a) 24%, transparent);
	transition: filter .2s ease, box-shadow .2s ease, transform .15s ease;
}

.jhq-bottone:hover { filter: brightness(.92); }
.jhq-bottone:active { transform: translateY(1px); }

.jhq-bottone:focus-visible {
	outline: 3px solid color-mix(in srgb, var(--jhq-a) 35%, transparent);
	outline-offset: 3px;
}

.jhq-bottone[aria-busy="true"],
.jhq-bottone:disabled { opacity: .7; cursor: progress; }

.jhq-freccia, .jhq-freccia-sx { width: 17px; height: 17px; transition: transform .2s ease; }
.jhq-bottone:hover .jhq-freccia { transform: translateX(3px); }
.jhq-bottone:hover .jhq-freccia-sx { transform: translateX(-3px); }

.jhq-indietro {
	background: transparent;
	color: var(--jhq-ink);
	box-shadow: none;
	padding: 15px 18px;
}

.jhq-indietro:hover { color: var(--jhq-navy); filter: none; }

/* ------------------------------------------------------- SUCCESSO */

.jhq-successo,
.jhq-grazie {
	text-align: center;
	padding: 40px 24px;
	background: color-mix(in srgb, var(--jhq-a) 6%, #fff);
	border: 1px solid color-mix(in srgb, var(--jhq-a) 25%, #fff);
	border-radius: 16px;
}

.jhq-successo-icona {
	display: block;
	width: 46px;
	height: 46px;
	margin: 0 auto 16px;
	color: var(--jhq-a);
}

.jhq-successo-icona svg { width: 100%; height: 100%; }

.jhq-successo-testo {
	margin: 0;
	font-size: 15.5px;
	font-weight: 300;
	line-height: 1.65;
	color: var(--jhq-navy);
}

.jhq-avviso {
	padding: 14px 18px;
	background: #fff7e6;
	border: 1px solid #f0d9a8;
	border-radius: 10px;
	font-size: 14px;
}

/* -------------------------------------------------------- MOBILE */

@media (max-width: 880px) {
	.jhq-griglia,
	.jhq-selettore[data-colonne="3"] .jhq-griglia,
	.jhq-selettore[data-colonne="4"] .jhq-griglia {
		grid-template-columns: 1fr;
		gap: 12px;
	}

	.jhq-campi { grid-template-columns: 1fr; gap: 15px; }
	.jhq-titolo { font-size: 22px; }
	.jhq-card { padding: 20px; }
	.jhq-icona { width: 42px; height: 42px; margin-bottom: 13px; }
	.jhq-piede { gap: 10px; }
	.jhq-avanti { width: 100%; justify-content: center; }
	.jhq-indietro { width: 100%; justify-content: center; order: 2; }
}

@media (prefers-reduced-motion: reduce) {
	.jhq *,
	.jhq *::before,
	.jhq *::after {
		animation: none !important;
		transition: none !important;
	}
}
