/* Questionario di gradimento Baby Fertilità
   Tutte le regole partono da #bfq-app: così gli stili del tema (titoli, link,
   immagini, spaziature) non possono sovrascrivere quelli del modulo.
   Colori sovrascrivibili dal tema: #bfq-app { --bfq-accent: ...; } */

#bfq-app {
	--bfq-font: "Nunito", ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

	--bfq-teal: oklch(0.73 0.095 206);        /* turchese del logo */
	--bfq-teal-deep: oklch(0.47 0.08 214);    /* turchese leggibile su bianco */
	--bfq-teal-wash: oklch(0.965 0.018 206);
	--bfq-accent: oklch(0.57 0.22 2);         /* magenta del logo */
	--bfq-accent-press: oklch(0.5 0.2 2);
	--bfq-accent-ink: oklch(1 0 0);
	--bfq-ink: oklch(0.32 0.085 262);         /* blu del logotipo */
	--bfq-ink-soft: oklch(0.45 0.045 255);
	--bfq-line: oklch(0.87 0.018 230);
	--bfq-line-strong: oklch(0.72 0.03 235);
	--bfq-surface: oklch(1 0 0);
	--bfq-surface-2: oklch(0.975 0.006 225);
	--bfq-error: oklch(0.5 0.19 27);
	--bfq-error-wash: oklch(0.96 0.025 27);

	--bfq-radius: 14px;
	--bfq-radius-sm: 10px;
	--bfq-ease: cubic-bezier(0.22, 1, 0.36, 1);   /* ease-out-quint */
	--bfq-gutter: 20px;

	position: relative;
	display: flex;
	flex-direction: column;
	max-width: 640px;
	min-height: min(720px, 100svh);
	margin: 0 auto;
	overflow: clip;
	border-radius: 20px;
	background: var(--bfq-surface);
	box-shadow: 0 1px 2px oklch(0.32 0.085 262 / 0.06), 0 12px 40px -12px oklch(0.32 0.085 262 / 0.18);
	color: var(--bfq-ink);
	font-family: var(--bfq-font);
	font-size: 17px;
	line-height: 1.5;
	text-align: left;
	-webkit-font-smoothing: antialiased;
	-webkit-tap-highlight-color: transparent;
	container-type: inline-size;
	isolation: isolate;
}

#bfq-app *,
#bfq-app *::before,
#bfq-app *::after {
	box-sizing: border-box;
}

#bfq-app :where(h2, p, fieldset, legend, ul) {
	margin: 0;
	padding: 0;
	border: 0;
}

/* Neutralizza le impostazioni tipografiche ereditate dal tema */
#bfq-app :where(h2, p, ul, li, span, label, a, button, input, textarea) {
	letter-spacing: normal;
	word-spacing: normal;
	text-transform: none;
	text-shadow: none;
	font-style: normal;
}

/* WPBakery: le righe hanno margini negativi (-15px) che, con il template
   senza contenitore, fanno scorrere la pagina in orizzontale su mobile. */
.vc_row:has(#bfq-app) {
	margin-left: 0 !important;
	margin-right: 0 !important;
}

.vc_row:has(#bfq-app) .vc_column-inner {
	padding-left: 0 !important;
	padding-right: 0 !important;
}

/* Su mobile il modulo occupa tutta la larghezza, senza cornice */
@media (max-width: 600px) {
	#bfq-app {
		--bfq-gutter: 18px;
		border-radius: 0;
		box-shadow: none;
		min-height: 100svh;
	}
}

#bfq-app .bfq-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* ---------- Barra superiore ---------- */

#bfq-app .bfq-top {
	display: grid;
	grid-template-columns: 44px 1fr 44px;
	align-items: center;
	gap: 8px;
	padding: 24px calc(var(--bfq-gutter) - 8px) 0;
	background: var(--bfq-surface);
}

#bfq-app .bfq-logo {
	grid-column: 2;
	justify-self: center;
	display: block;
	width: auto;
	min-width: 0;
	max-width: 100%;
	height: 28px;
	max-height: none;
	margin: 0;
	object-fit: contain;
}

#bfq-app .bfq-back {
	grid-column: 1;
	grid-row: 1;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--bfq-ink);
	cursor: pointer;
	transition: background-color 0.18s ease, opacity 0.18s ease;
}

#bfq-app .bfq-back:hover {
	background: var(--bfq-surface-2);
}

#bfq-app .bfq-back[hidden] {
	display: grid;
	visibility: hidden;
	opacity: 0;
}

#bfq-app .bfq-back svg {
	width: 22px;
	height: 22px;
}

#bfq-app .bfq-count {
	grid-column: 3;
	grid-row: 1;
	justify-self: end;
	padding-right: 8px;
	color: var(--bfq-ink-soft);
	font-size: 14px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

#bfq-app .bfq-progress {
	grid-column: 1 / -1;
	display: flex;
	gap: 4px;
	margin: 8px 8px 0;
}

#bfq-app .bfq-progress span {
	flex: 1;
	height: 4px;
	border-radius: 2px;
	background: var(--bfq-line);
	overflow: hidden;
}

#bfq-app .bfq-progress span::after {
	content: "";
	display: block;
	height: 100%;
	background: var(--bfq-teal-deep);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 0.35s var(--bfq-ease);
}

#bfq-app .bfq-progress span.is-done::after {
	transform: scaleX(1);
}

#bfq-app .bfq-progress span.is-current::after {
	transform: scaleX(0.5);
	background: var(--bfq-teal);
}

#bfq-app[data-screen="intro"] .bfq-progress,
#bfq-app[data-screen="done"] .bfq-progress,
#bfq-app[data-screen="intro"] .bfq-count,
#bfq-app[data-screen="done"] .bfq-count {
	visibility: hidden;
}

/* ---------- Area degli step ---------- */

#bfq-app .bfq-stage {
	position: relative;
	display: flex;
	flex: 1;
	flex-direction: column;
}

#bfq-app .bfq-step {
	display: flex;
	flex: 1;
	flex-direction: column;
	padding: 36px var(--bfq-gutter) 0;
}

#bfq-app .bfq-step:focus {
	outline: none;
}

#bfq-app .bfq-step.is-entering {
	animation: bfq-in 0.28s var(--bfq-ease) both;
}

#bfq-app .bfq-step.is-entering.is-back {
	animation-name: bfq-in-back;
}

@keyframes bfq-in {
	from { opacity: 0; transform: translateX(28px); }
}

@keyframes bfq-in-back {
	from { opacity: 0; transform: translateX(-28px); }
}

#bfq-app .bfq-q {
	max-width: 30ch;
	margin-bottom: 6px;
	color: var(--bfq-ink);
	font-family: var(--bfq-font);
	font-size: 25px !important; /* il sito forza h2 { font-size … !important } */
	font-weight: 800;
	line-height: 1.22;
	letter-spacing: -0.01em;
	text-wrap: balance;
}

#bfq-app .bfq-q:focus {
	outline: none;
}

#bfq-app .bfq-hint {
	max-width: 60ch;
	color: var(--bfq-ink-soft);
	font-size: 15.5px;
	text-wrap: pretty;
}

#bfq-app .bfq-body {
	margin-top: 24px;
}

@container (min-width: 520px) {
	#bfq-app .bfq-step {
		padding-top: 48px;
		padding-inline: 44px;
	}

	#bfq-app .bfq-q {
		font-size: 28px !important;
	}
}

/* ---------- Opzioni ---------- */

#bfq-app .bfq-options {
	display: grid;
	gap: 10px;
}

#bfq-app .bfq-group {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
}

#bfq-app .bfq-group-label {
	grid-column: 1 / -1;
	margin: 0 0 -2px 2px;
	color: var(--bfq-ink-soft);
	font-size: 14px;
	font-weight: 700;
}

#bfq-app .bfq-group + .bfq-opt,
#bfq-app .bfq-group + .bfq-optwrap {
	margin-top: 6px;
}

#bfq-app .bfq-opt {
	position: relative;
	display: flex;
	align-items: center;
	gap: 14px;
	min-height: 58px;
	margin: 0;
	padding: 14px 16px;
	border: 1.5px solid var(--bfq-line);
	border-radius: var(--bfq-radius);
	background: var(--bfq-surface);
	color: var(--bfq-ink);
	font-size: 17px;
	font-weight: 600;
	line-height: 1.3;
	cursor: pointer;
	user-select: none;
	transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.12s ease;
}

#bfq-app .bfq-opt input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}

@media (hover: hover) {
	#bfq-app .bfq-opt:hover {
		border-color: var(--bfq-line-strong);
		background: var(--bfq-surface-2);
	}
}

#bfq-app .bfq-opt:active {
	transform: scale(0.985);
}

#bfq-app .bfq-opt:has(input:checked) {
	border-color: var(--bfq-teal-deep);
	background: var(--bfq-teal-wash);
}

#bfq-app .bfq-opt:has(input:focus-visible) {
	outline: 3px solid var(--bfq-teal);
	outline-offset: 2px;
}

/* Indicatore: cerchio (scelta singola) o quadrato (scelta multipla) */
#bfq-app .bfq-mark {
	position: relative;
	flex: none;
	display: grid;
	place-items: center;
	width: 24px;
	height: 24px;
	border: 2px solid var(--bfq-line-strong);
	border-radius: 50%;
	background: var(--bfq-surface);
	transition: border-color 0.18s ease, background-color 0.18s ease;
}

#bfq-app .bfq-opt--multi .bfq-mark {
	border-radius: 7px;
}

#bfq-app .bfq-mark svg {
	width: 14px;
	height: 14px;
	color: var(--bfq-surface);
	stroke-dasharray: 20;
	stroke-dashoffset: 20;
	transition: stroke-dashoffset 0.22s var(--bfq-ease) 0.04s;
}

#bfq-app .bfq-opt input:checked ~ .bfq-mark {
	border-color: var(--bfq-teal-deep);
	background: var(--bfq-teal-deep);
}

#bfq-app .bfq-opt input:checked ~ .bfq-mark svg {
	stroke-dashoffset: 0;
}

#bfq-app .bfq-opt-label {
	flex: 1;
}

/* Campo "Altro": si apre sotto l'opzione */
#bfq-app .bfq-other {
	display: grid;
	grid-template-rows: 0fr;
	transition: grid-template-rows 0.26s var(--bfq-ease);
}

#bfq-app .bfq-other > div {
	overflow: hidden;
	min-height: 0;
}

#bfq-app .bfq-other.is-open {
	grid-template-rows: 1fr;
}

#bfq-app .bfq-other .bfq-input {
	margin-top: 8px;
}

/* ---------- Campi di testo ---------- */

#bfq-app .bfq-field {
	display: grid;
	gap: 6px;
}

#bfq-app .bfq-field + .bfq-field {
	margin-top: 16px;
}

#bfq-app .bfq-label {
	color: var(--bfq-ink);
	font-size: 15px;
	font-weight: 700;
}

#bfq-app .bfq-input,
#bfq-app .bfq-textarea {
	display: block;
	width: 100%;
	margin: 0;
	padding: 14px 16px;
	border: 1.5px solid var(--bfq-line-strong);
	border-radius: var(--bfq-radius-sm);
	background: var(--bfq-surface);
	box-shadow: none;
	color: var(--bfq-ink);
	font-family: var(--bfq-font);
	font-size: 17px;   /* ≥16px: niente zoom automatico su iOS */
	font-weight: 500;
	line-height: 1.45;
	transition: border-color 0.18s ease, box-shadow 0.18s ease;
	appearance: none;
}

/* Spazio per la barra del pulsante, che resta fissa in basso */
#bfq-app .bfq-opt,
#bfq-app .bfq-input,
#bfq-app .bfq-textarea,
#bfq-app .bfq-consent {
	scroll-margin: 96px 0 120px;
}

#bfq-app .bfq-textarea {
	min-height: 168px;
	resize: vertical;
}

#bfq-app .bfq-input::placeholder,
#bfq-app .bfq-textarea::placeholder {
	color: var(--bfq-ink-soft);
	opacity: 1;
}

#bfq-app .bfq-input:focus,
#bfq-app .bfq-textarea:focus {
	border-color: var(--bfq-teal-deep);
	outline: none;
	box-shadow: 0 0 0 3px oklch(0.73 0.095 206 / 0.35);
}

#bfq-app .bfq-input[aria-invalid="true"] {
	border-color: var(--bfq-error);
}

#bfq-app .bfq-counter {
	justify-self: end;
	color: var(--bfq-ink-soft);
	font-size: 13px;
	font-variant-numeric: tabular-nums;
}

#bfq-app .bfq-consent {
	position: relative;
	display: flex;
	align-items: flex-start;
	gap: 12px;
	margin-top: 20px;
	color: var(--bfq-ink);
	font-size: 15.5px;
	line-height: 1.45;
	cursor: pointer;
}

#bfq-app .bfq-consent input {
	position: absolute;
	width: 24px;
	height: 24px;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}

#bfq-app .bfq-consent .bfq-mark {
	margin-top: -1px;
	border-radius: 7px;
}

#bfq-app .bfq-consent input:checked ~ .bfq-mark {
	border-color: var(--bfq-teal-deep);
	background: var(--bfq-teal-deep);
}

#bfq-app .bfq-consent input:checked ~ .bfq-mark svg {
	stroke-dashoffset: 0;
}

#bfq-app .bfq-consent input:focus-visible ~ .bfq-mark {
	outline: 3px solid var(--bfq-teal);
	outline-offset: 2px;
}

#bfq-app .bfq-consent a,
#bfq-app .bfq-privacy {
	color: var(--bfq-teal-deep);
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 3px;
}

#bfq-app .bfq-privacy {
	display: inline-block;
	margin: 10px 0 0 36px;
	font-size: 15px;
}

/* ---------- Messaggi ---------- */

#bfq-app .bfq-error {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 14px;
	padding: 10px 14px;
	border-radius: var(--bfq-radius-sm);
	background: var(--bfq-error-wash);
	color: var(--bfq-error);
	font-size: 15px;
	font-weight: 700;
}

#bfq-app .bfq-error[hidden] {
	display: none;
}

#bfq-app .bfq-error svg {
	flex: none;
	width: 18px;
	height: 18px;
}

/* ---------- Barra azioni ---------- */

#bfq-app .bfq-actions {
	position: sticky;
	bottom: 0;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 6px;
	margin-top: auto;
	padding: 20px 0 max(20px, env(safe-area-inset-bottom));
	background: linear-gradient(to bottom, oklch(1 0 0 / 0), var(--bfq-surface) 18px);
}

#bfq-app .bfq-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 56px;
	margin: 0;
	padding: 0 28px;
	border: 0;
	border-radius: 999px;
	background: var(--bfq-accent);
	box-shadow: none;
	color: var(--bfq-accent-ink);
	font-family: var(--bfq-font);
	font-size: 17px;
	font-weight: 800;
	letter-spacing: 0.01em;
	line-height: 1;
	text-transform: none;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.18s ease, transform 0.12s ease, opacity 0.18s ease;
}

#bfq-app .bfq-btn:hover {
	background: var(--bfq-accent-press);
	color: var(--bfq-accent-ink);
}

#bfq-app .bfq-btn:active {
	transform: scale(0.98);
}

#bfq-app .bfq-btn:focus-visible {
	outline: 3px solid var(--bfq-ink);
	outline-offset: 3px;
}

#bfq-app .bfq-btn[aria-disabled="true"] {
	background: var(--bfq-line);
	color: var(--bfq-ink-soft);
	cursor: not-allowed;
}

#bfq-app .bfq-btn[aria-busy="true"] {
	pointer-events: none;
	opacity: 0.85;
}

#bfq-app .bfq-btn svg {
	width: 20px;
	height: 20px;
	transition: transform 0.2s var(--bfq-ease);
}

#bfq-app .bfq-btn:hover svg {
	transform: translateX(3px);
}

#bfq-app .bfq-spinner {
	width: 18px;
	height: 18px;
	border: 2.5px solid oklch(1 0 0 / 0.4);
	border-top-color: oklch(1 0 0);
	border-radius: 50%;
	animation: bfq-spin 0.7s linear infinite;
}

@keyframes bfq-spin {
	to { transform: rotate(360deg); }
}

#bfq-app .bfq-link {
	align-self: center;
	min-height: 44px;
	margin: 0;
	padding: 0 16px;
	border: 0;
	background: transparent;
	box-shadow: none;
	color: var(--bfq-ink);
	font-family: var(--bfq-font);
	font-size: 16px;
	font-weight: 700;
	text-decoration: underline;
	text-decoration-color: var(--bfq-line-strong);
	text-underline-offset: 4px;
	cursor: pointer;
	transition: text-decoration-color 0.18s ease; /* sostituisce il "transition: all" del tema */
}

#bfq-app .bfq-link:hover {
	background: transparent;
	color: var(--bfq-ink);
	text-decoration-color: currentColor;
}

@container (min-width: 520px) {
	#bfq-app .bfq-actions {
		flex-direction: row-reverse;
		justify-content: flex-start;
		align-items: center;
		padding-bottom: 32px;
	}

	#bfq-app .bfq-btn {
		min-width: 200px;
	}
}

/* ---------- Intro e ringraziamento: superficie turchese ---------- */

#bfq-app .bfq-step--drench {
	position: relative;
	margin-top: 12px;
	padding-top: 40px;
	background: var(--bfq-teal);
	color: var(--bfq-ink);
}

#bfq-app .bfq-step--drench::before {
	/* curva morbida che richiama l'anello del logo */
	content: "";
	position: absolute;
	top: -1px;
	left: 0;
	right: 0;
	height: 28px;
	border-radius: 0 0 50% 50% / 0 0 100% 100%;
	background: var(--bfq-surface);
	pointer-events: none;
}

#bfq-app .bfq-step--drench .bfq-actions {
	background: linear-gradient(to bottom, oklch(0.73 0.095 206 / 0), var(--bfq-teal) 18px);
}

#bfq-app .bfq-title {
	max-width: 14ch;
	margin-top: 12px;
	color: var(--bfq-ink);
	font-family: var(--bfq-font);
	font-size: 40px !important; /* il sito forza h2 { font-size … !important } */
	font-weight: 900;
	line-height: 1.05;
	letter-spacing: -0.02em;
	text-wrap: balance;
}

#bfq-app .bfq-title:focus {
	outline: none;
}

#bfq-app .bfq-lead {
	max-width: 46ch;
	margin-top: 18px;
	color: var(--bfq-ink);
	font-size: 18px;
	font-weight: 600;
	line-height: 1.5;
	text-wrap: pretty;
}

#bfq-app .bfq-facts {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 24px;
	list-style: none;
}

#bfq-app .bfq-facts li {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 8px 14px 8px 12px;
	border-radius: 999px;
	background: oklch(1 0 0 / 0.55);
	color: var(--bfq-ink);
	font-size: 15px;
	font-weight: 700;
}

#bfq-app .bfq-facts svg {
	width: 18px;
	height: 18px;
	color: var(--bfq-teal-deep);
}

#bfq-app .bfq-step--drench .bfq-btn:focus-visible {
	outline-color: var(--bfq-ink);
}

@container (min-width: 520px) {
	#bfq-app .bfq-step--drench {
		padding-top: 64px;
	}

	#bfq-app .bfq-title {
		font-size: 52px !important;
	}

	#bfq-app .bfq-step--drench .bfq-actions {
		flex-direction: row;
	}
}

/* Schermata finale: contenuto raccolto al centro, senza il vuoto sotto */
#bfq-app .bfq-step--done {
	justify-content: center;
	padding-bottom: 48px;
}

#bfq-app .bfq-step--done .bfq-actions {
	position: static;
	margin-top: 28px;
	padding: 0;
	background: none;
}

#bfq-app .bfq-step--done .bfq-link {
	align-self: flex-start;
	padding: 0;
}

/* Segno di spunta animato nella schermata finale */
#bfq-app .bfq-done-mark {
	display: grid;
	place-items: center;
	width: 72px;
	height: 72px;
	border-radius: 50%;
	background: var(--bfq-surface);
	color: var(--bfq-accent);
}

#bfq-app .bfq-done-mark svg {
	width: 36px;
	height: 36px;
	stroke-dasharray: 30;
	stroke-dashoffset: 30;
	animation: bfq-draw 0.5s var(--bfq-ease) 0.2s forwards;
}

@keyframes bfq-draw {
	to { stroke-dashoffset: 0; }
}

/* Campo trappola anti-spam: fuori dallo schermo */
#bfq-app .bfq-hp {
	position: absolute !important;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* ---------- Movimento ridotto ---------- */

@media (prefers-reduced-motion: reduce) {
	#bfq-app .bfq-step.is-entering,
	#bfq-app .bfq-step.is-entering.is-back {
		animation: bfq-fade 0.15s linear both;
	}

	#bfq-app .bfq-done-mark svg {
		animation: none;
		stroke-dashoffset: 0;
	}

	#bfq-app .bfq-mark svg,
	#bfq-app .bfq-other,
	#bfq-app .bfq-progress span::after,
	#bfq-app .bfq-btn svg {
		transition: none;
	}

	#bfq-app .bfq-opt:active,
	#bfq-app .bfq-btn:active {
		transform: none;
	}
}

@keyframes bfq-fade {
	from { opacity: 0; }
}
