/* ============================================================
   Malatesta — Quiz "Scopri il tuo percorso"
   Scoped under .mq-app to avoid collisions with the theme.
   ============================================================ */

.malatesta-quiz-page {
	margin: 0;
	background: #f7f5f1;
}

.mq-app {
	--mq-deep: #07182d;
	--mq-primary: #153358;
	--mq-teal: #429599;
	--mq-teal-soft: #d9eef0;
	--mq-bone: #f7f5f1;
	--mq-ink: #0f1626;
	--mq-muted: #5b6675;
	--mq-white: #ffffff;
	--mq-line: rgba(15, 22, 38, 0.1);
	--mq-serif: "Cormorant Garamond", Georgia, serif;
	--mq-sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	--mq-ease: cubic-bezier(.22,.75,.2,1);
	--mq-radius: 22px;

	position: relative;
	min-height: 100svh;
	display: flex;
	flex-direction: column;
	font-family: var(--mq-sans);
	font-weight: 300;
	color: var(--mq-ink);
	background: transparent;
	overflow-x: hidden;
}

.mq-app *,
.mq-app *::before,
.mq-app *::after { box-sizing: border-box; }

.mq-app h1, .mq-app h2, .mq-app h3 {
	font-family: var(--mq-serif);
	font-weight: 400;
	line-height: 1.02;
	margin: 0;
}

.mq-app button { font: inherit; cursor: pointer; }

.mq-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); border: 0; }

/* ---------- Ambient ---------- */
.mq-ambient { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.mq-bg {
	position: absolute; inset: 0; z-index: 0;
	background-image: url('https://www.francescomalatesta.it/wp-content/uploads/2026/09/04-corpo.jpg');
	background-size: cover;
	background-position: 30% center;
	opacity: .42;
	filter: saturate(1.15);
}
.mq-ambient::before {
	content: ""; position: absolute; inset: 0; z-index: 1;
	background:
		radial-gradient(60% 50% at 15% 12%, rgba(66,149,153,.22), transparent 60%),
		radial-gradient(55% 45% at 85% 20%, rgba(21,51,88,.16), transparent 62%),
		radial-gradient(70% 60% at 60% 110%, rgba(66,149,153,.16), transparent 60%);
}
.mq-blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; will-change: transform; }
.mq-blob--1 { width: 420px; height: 420px; left: -120px; top: -80px; background: radial-gradient(circle at 30% 30%, #7fd4d8, transparent 70%); animation: mqFloat1 18s ease-in-out infinite; }
.mq-blob--2 { width: 380px; height: 380px; right: -120px; top: 30%; background: radial-gradient(circle at 60% 40%, #9fb8d6, transparent 70%); animation: mqFloat2 22s ease-in-out infinite; }
@keyframes mqFloat1 { 50% { transform: translate3d(40px, 30px, 0) scale(1.08); } }
@keyframes mqFloat2 { 50% { transform: translate3d(-40px, -20px, 0) scale(1.1); } }

/* ---------- Shell ---------- */
.mq-shell { width: min(100% - 32px, 940px); margin: 0 auto; padding: 22px 0 34px; flex: 1; display: flex; flex-direction: column; }

.mq-top { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.mq-brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; }
.mq-brand__name { font-family: var(--mq-serif); font-size: 23px; letter-spacing: -.02em; color: var(--mq-primary); }
.mq-brand__kicker { font-size: 8px; letter-spacing: .3em; text-transform: uppercase; color: var(--mq-muted); }
.mq-back { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--mq-muted); text-decoration: none; transition: color .2s ease; }
.mq-back:hover { color: var(--mq-primary); }

.mq-progress { display: flex; align-items: center; gap: 12px; justify-content: flex-end; margin-top: 8px; transition: opacity .3s ease; }
.mq-progress.is-hidden { opacity: 0; pointer-events: none; }
.mq-segs { display: flex; gap: 6px; }
.mq-seg { width: 26px; height: 4px; border-radius: 999px; background: rgba(15,22,38,.14); transition: background .35s var(--mq-ease), transform .35s var(--mq-ease); }
.mq-seg.is-done { background: var(--mq-teal); }
.mq-seg.is-current { background: var(--mq-primary); transform: scaleX(1.25); }
.mq-count { font-size: 11px; letter-spacing: .12em; color: var(--mq-muted); min-width: 42px; text-align: right; }

.mq-stage { flex: 1; display: flex; align-items: center; justify-content: center; padding: 32px 0; }

/* ---------- Screens ---------- */
.mq-screen { width: 100%; display: none; }
.mq-screen.is-active { display: block; animation: mqScreenIn .55s var(--mq-ease) both; }
@keyframes mqScreenIn { from { opacity: 0; transform: perspective(1000px) rotateX(7deg) translateY(22px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- Intro ---------- */
.mq-intro { text-align: center; max-width: 620px; margin: 0 auto; }
.mq-eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: 10px; letter-spacing: .28em; text-transform: uppercase; color: var(--mq-teal); margin: 0 0 22px; }
.mq-eyebrow::before { content: ""; width: 28px; height: 1px; background: currentColor; opacity: .6; }
.mq-intro h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); color: var(--mq-primary); }
.mq-intro h1 em { font-style: italic; color: var(--mq-teal); }
.mq-intro p { margin: 22px auto 0; max-width: 460px; color: var(--mq-muted); font-size: 1.05rem; line-height: 1.7; }

.mq-cta {
	display: inline-flex; align-items: center; gap: 14px; margin-top: 34px;
	padding: 0 26px; height: 56px; border: 0; border-radius: 999px;
	background: var(--mq-primary); color: #fff; text-transform: uppercase;
	letter-spacing: .16em; font-size: 11px; font-weight: 500;
	box-shadow: 0 18px 40px rgba(21,51,88,.28); text-decoration: none;
	translate: var(--tx, 0) var(--ty, 0);
	transition: translate .18s ease, transform .3s var(--mq-ease), background .3s ease, box-shadow .3s ease;
}
.mq-cta:hover { transform: translateY(-2px); background: var(--mq-teal); box-shadow: 0 22px 46px rgba(66,149,153,.34); }
.mq-cta svg { width: 16px; height: 16px; }
.mq-cta--ghost { background: transparent; color: var(--mq-primary); border: 1px solid rgba(21,51,88,.25); box-shadow: none; margin-top: 0; }
.mq-cta--ghost:hover { background: rgba(21,51,88,.06); box-shadow: none; }

.mq-intro__meta { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 10px 22px; justify-content: center; color: var(--mq-muted); font-size: 11px; }
.mq-intro__meta span { display: inline-flex; align-items: center; gap: 8px; }
.mq-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--mq-teal); }

/* ---------- Question card ---------- */
.mq-qcard {
	position: relative; background: rgba(255,255,255,.78); border: 1px solid var(--mq-line);
	border-radius: var(--mq-radius); padding: clamp(26px, 4vw, 46px);
	backdrop-filter: blur(14px); box-shadow: 0 30px 70px rgba(15,22,38,.1);
	transform: perspective(1300px) rotateX(calc(var(--my, 0) * -1.4deg)) rotateY(calc(var(--mx, 0) * 2deg));
	transition: transform .18s ease-out;
}
.mq-qcard::before {
	content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
	background: radial-gradient(440px circle at var(--sx, 50%) var(--sy, 50%), rgba(66,149,153,.12), transparent 62%);
	opacity: 0; transition: opacity .35s ease;
}
.mq-qcard:hover::before { opacity: 1; }
.mq-qcard.is-leaving { animation: mqCardOut .38s var(--mq-ease) both; }
@keyframes mqCardOut { 100% { opacity: 0; filter: blur(4px); transform: perspective(1300px) rotateX(-8deg) translate3d(0, -26px, 0) scale(.94); } }
.mq-qcard.is-entering { animation: mqCardIn .6s var(--mq-ease); }
@keyframes mqCardIn { 0% { opacity: 0; transform: perspective(1300px) rotateX(10deg) translate3d(0, 30px, 0) scale(.95); } 100% { opacity: 1; transform: perspective(1300px) rotateX(0deg) translate3d(0, 0, 0) scale(1); } }

.mq-step { font-size: 10px; letter-spacing: .26em; text-transform: uppercase; color: var(--mq-teal); margin: 0 0 14px; }
.mq-qcard h2 { font-size: clamp(1.9rem, 4vw, 3rem); color: var(--mq-primary); max-width: 20ch; }
.mq-sub { margin: 14px 0 0; color: var(--mq-muted); font-size: .98rem; }

.mq-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 30px; }
.mq-option {
	position: relative; text-align: left; background: var(--mq-white); border: 1px solid var(--mq-line);
	border-radius: 16px; padding: 20px; display: flex; align-items: flex-start; gap: 14px;
	transform-style: preserve-3d;
	transform: perspective(820px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--lift, 0px));
	transition: transform .22s ease-out, border-color .25s ease, box-shadow .25s ease, background .25s ease;
	will-change: transform;
}
.mq-option::after {
	content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
	background: radial-gradient(160px circle at var(--gx, 50%) var(--gy, 50%), rgba(255,255,255,.65), transparent 62%);
	opacity: 0; transition: opacity .28s ease;
}
.mq-option:hover { --lift: -4px; border-color: rgba(66,149,153,.6); box-shadow: 0 22px 46px rgba(15,22,38,.16); }
.mq-option:hover::after { opacity: .8; }
.mq-option:focus-visible { outline: 2px solid var(--mq-teal); outline-offset: 3px; }
.mq-option__icon { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--mq-teal-soft); color: var(--mq-primary); transition: background .25s ease, color .25s ease; transform: translateZ(30px); }
.mq-option__icon svg { width: 22px; height: 22px; }
.mq-option__label { display: block; font-weight: 500; font-size: 1.02rem; color: var(--mq-ink); }
.mq-option__hint { display: block; margin-top: 5px; color: var(--mq-muted); font-size: .82rem; line-height: 1.4; }
.mq-option.is-selected { border-color: var(--mq-teal); background: linear-gradient(180deg, #f2fbfb, #fff); box-shadow: 0 18px 40px rgba(66,149,153,.2); }
.mq-option.is-selected .mq-option__icon { background: var(--mq-teal); color: #fff; }
.mq-option__check { position: absolute; top: 14px; right: 14px; width: 22px; height: 22px; border-radius: 50%; background: var(--mq-teal); color: #fff; display: grid; place-items: center; opacity: 0; transform: scale(.5); transition: opacity .25s ease, transform .25s var(--mq-ease); }
.mq-option.is-selected .mq-option__check { opacity: 1; transform: scale(1); }
.mq-option__check svg { width: 12px; height: 12px; }

.mq-options .mq-option { animation: mqOptIn .55s var(--mq-ease) both; }
.mq-options .mq-option:nth-child(2) { animation-delay: .06s; }
.mq-options .mq-option:nth-child(3) { animation-delay: .12s; }
.mq-options .mq-option:nth-child(4) { animation-delay: .18s; }
@keyframes mqOptIn { from { opacity: 0; translate: 0 16px; scale: .96; } to { opacity: 1; translate: 0 0; scale: 1; } }

.mq-qfoot { display: flex; align-items: center; justify-content: space-between; margin-top: 26px; gap: 14px; }
.mq-backbtn { background: none; border: 0; color: var(--mq-muted); font-size: 12px; display: inline-flex; align-items: center; gap: 8px; padding: 8px 4px; transition: color .2s ease; }
.mq-backbtn:hover { color: var(--mq-primary); }
.mq-backbtn[hidden] { visibility: hidden; display: inline-flex; }
.mq-kbd { font-size: 10px; color: var(--mq-muted); letter-spacing: .08em; }
.mq-kbd b { font-weight: 600; color: var(--mq-primary); border: 1px solid var(--mq-line); border-radius: 6px; padding: 1px 6px; }

/* ---------- Result ---------- */
.mq-result { text-align: center; }
.mq-result__head {
	background: rgba(255,255,255,.6);
	border: 1px solid rgba(255,255,255,.55);
	border-radius: var(--mq-radius);
	padding: clamp(24px, 3.6vw, 40px) clamp(20px, 3vw, 34px) clamp(20px, 3vw, 30px);
	backdrop-filter: blur(18px);
	-webkit-backdrop-filter: blur(18px);
	box-shadow: 0 26px 60px rgba(15,22,38,.1);
}
.mq-badge { width: 78px; height: 78px; margin: 0 auto 18px; border-radius: 22px; display: grid; place-items: center; background: linear-gradient(145deg, var(--mq-teal), var(--mq-primary)); color: #fff; box-shadow: 0 20px 44px rgba(21,51,88,.3); transform: perspective(600px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); animation: mqBadgeFloat 5s ease-in-out infinite; }
@keyframes mqBadgeFloat { 50% { translate: 0 -8px; } }
.mq-badge svg { width: 36px; height: 36px; }
.mq-result .mq-eyebrow { display: block; margin: 0; }
.mq-result h2 { font-size: clamp(2.2rem, 5vw, 3.8rem); color: var(--mq-primary); margin-top: 12px; }
.mq-profile { margin: 18px auto 0; max-width: 540px; color: var(--mq-muted); font-size: 1.05rem; line-height: 1.7; }
.mq-traits { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 24px; }
.mq-trait { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; padding: 9px 14px; border-radius: 999px; background: rgba(66,149,153,.12); color: var(--mq-primary); border: 1px solid rgba(66,149,153,.28); }

.mq-lead {
	margin-top: 24px;
	text-align: left;
	background: rgba(255,255,255,.82);
	border: 1px solid var(--mq-line);
	border-radius: var(--mq-radius);
	padding: clamp(24px, 3.6vw, 40px);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
	box-shadow: 0 30px 70px rgba(15,22,38,.12);
}
.mq-lead .malatesta-form-shell { margin-top: 4px; }
.mq-lead__title { font-size: 1.9rem; color: var(--mq-primary); margin-top: 8px; }

/* ---------- Thanks ---------- */
.mq-thanks { text-align: center; max-width: 600px; margin: 0 auto; }
.mq-thanks__check { width: 104px; height: 104px; margin: 0 auto 26px; border-radius: 50%; display: grid; place-items: center; background: var(--mq-teal); color: #fff; box-shadow: 0 22px 50px rgba(66,149,153,.4); animation: mqPop .5s var(--mq-ease) both; }
.mq-thanks__check svg { width: 50px; height: 50px; }
@keyframes mqPop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.mq-thanks h2 { font-size: clamp(2.2rem, 5.5vw, 3.6rem); color: var(--mq-primary); }
.mq-thanks p { color: var(--mq-muted); margin: 16px auto 0; max-width: 460px; font-size: 1.05rem; line-height: 1.7; }

/* If the GF confirmation appears inside the lead card, hide the repeated heading. */
.mq-lead:has(.gform_confirmation_message) .mq-eyebrow,
.mq-lead:has(.gform_confirmation_message) .mq-lead__title,
.mq-lead:has(.gform_confirmation_message) .mq-sub,
.mq-lead:has(.malatesta-quiz-thanks) .mq-eyebrow,
.mq-lead:has(.malatesta-quiz-thanks) .mq-lead__title,
.mq-lead:has(.malatesta-quiz-thanks) .mq-sub { display: none; }
.mq-lead .gform_confirmation_message { text-align: center; color: var(--mq-primary); }
.malatesta-quiz-thanks { text-align: center; padding: 8px 0; }
.malatesta-quiz-thanks h3 { font-family: var(--mq-serif); font-weight: 400; font-size: clamp(1.9rem, 3.6vw, 2.8rem); color: var(--mq-primary); margin: 0 0 10px; }
.malatesta-quiz-thanks p { color: var(--mq-muted); margin: 0; font-size: 1.02rem; line-height: 1.7; }

.mq-foot { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 10px 22px; justify-content: center; font-size: 11px; letter-spacing: .04em; }
.mq-foot a { color: var(--mq-muted); text-decoration: none; }
.mq-foot a:hover { color: var(--mq-primary); }
.mq-note { margin-top: 22px; text-align: center; color: var(--mq-muted); font-size: 11px; line-height: 1.6; opacity: .85; }

/* Informative text (kept small and discreet) */
.mq-info { max-width: 760px; margin: 38px auto 0; text-align: center; }
.mq-info__title { font-family: var(--mq-sans); font-size: .95rem; font-weight: 600; letter-spacing: .01em; color: var(--mq-primary); margin: 0 0 10px; }
.mq-info__text { margin: 0 0 8px; color: var(--mq-muted); font-size: .78rem; line-height: 1.65; }

/* Back link on the result screen */
.mq-resultback { display: inline-flex; align-items: center; gap: 8px; margin-top: 24px; background: none; border: 0; color: var(--mq-muted); font-size: 12px; letter-spacing: .04em; transition: color .2s ease; }
.mq-resultback:hover { color: var(--mq-primary); }

.mq-confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 50; }

/* GF form inside the quiz keeps the theme's form shell styles; just tighten spacing. */
.mq-lead .gform_wrapper { margin: 0; }

@media (max-width: 640px) {
	.mq-options { grid-template-columns: 1fr; }
	.mq-brand__kicker { display: none; }
	.mq-count { display: none; }
	.mq-seg { width: 20px; }
}

@media (prefers-reduced-motion: reduce) {
	.mq-app *, .mq-app *::before, .mq-app *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
	.mq-blob { display: none; }
	.mq-qcard, .mq-option, .mq-badge { transform: none !important; }
	.mq-qcard::before, .mq-option::after { display: none; }
}
