/* FO4 — marketing quiz.
   Loaded only on page-quiz.php (see inc/enqueue.php).

   Without JS every step is visible and the form is one long sheet that
   submits in one go. `.is-stepped` is added by quiz.js once it runs,
   and only then does the one-question-at-a-time layout apply. */

.quiz {
	border: 1px solid var(--hairline-dark-strong);
	background: var(--cream-rise);
	padding: 0;
}

/* ---- Progress ---- */
.quiz-progress {
	display: flex;
	align-items: center;
	gap: 20px;
	padding: 20px 32px;
	border-bottom: 1px solid var(--hairline-dark);
}
.quiz-progress-track {
	position: relative;
	flex: 1;
	height: 4px;
	background: rgba(20, 20, 20, 0.10);
}
.quiz-progress-bar {
	position: absolute;
	inset: 0 auto 0 0;
	width: 10%;
	background: var(--gold-deep);
	transition: width 0.3s ease;
}
.quiz-counter {
	font-family: var(--mono);
	font-size: 11px;
	letter-spacing: 0.1em;
	color: var(--on-cream-mute);
	white-space: nowrap;
}
/* No JS: the bar would be meaningless, so hide it. */
.quiz:not(.is-stepped) .quiz-progress { display: none; }

/* ---- Steps ---- */
.quiz-step {
	padding: 44px 32px;
	border-bottom: 1px solid var(--hairline-dark);
}
.quiz.is-stepped .quiz-step {
	display: none;
	border-bottom: none;
}
.quiz.is-stepped .quiz-step.is-current { display: block; }

.quiz-q {
	font-family: var(--display);
	font-weight: 400;
	font-size: clamp(26px, 3vw, 40px);
	line-height: 1.06;
	letter-spacing: -0.005em;
	color: var(--on-cream);
	margin: 0 0 28px;
	max-width: 20em;
	text-wrap: balance;
}
.quiz-legend {
	font-family: var(--mono);
	font-size: 11px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--gold-deep);
	margin-bottom: 14px;
	display: block;
}

/* ---- Answers ---- */
.quiz-answers {
	display: grid;
	gap: 12px;
	max-width: 780px;
	border: none;
	margin: 0;
	padding: 0;
}
.quiz-answer {
	position: relative;
	display: flex;
	align-items: flex-start;
	gap: 16px;
	padding: 18px 22px;
	border: 1px solid var(--hairline-dark-strong);
	background: var(--cream);
	cursor: pointer;
	transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}
.quiz-answer:hover {
	border-color: var(--gold-deep);
	background: var(--cream-rise);
}
.quiz-answer input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	margin: 0;
}
.quiz-key {
	flex: none;
	width: 30px;
	height: 30px;
	display: grid;
	place-items: center;
	border: 1px solid var(--hairline-dark-strong);
	font-family: var(--mono);
	font-size: 12px;
	font-weight: 700;
	color: var(--on-cream-dim);
	transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}
.quiz-answer-text {
	font-family: var(--body);
	font-size: 16px;
	line-height: 1.45;
	color: var(--on-cream);
	padding-top: 4px;
}
/* `.is-picked` is set by quiz.js so the selected answer still reads as
   selected in browsers without :has(). Both selectors are listed
   separately: grouping them would make the whole rule invalid wherever
   :has() is unsupported. */
.quiz-answer.is-picked {
	border-color: var(--gold-deep);
	background: rgba(232, 164, 28, 0.10);
}
.quiz-answer:has(input:checked) {
	border-color: var(--gold-deep);
	background: rgba(232, 164, 28, 0.10);
}
.quiz-answer.is-picked .quiz-key {
	background: var(--gold-deep);
	border-color: var(--gold-deep);
	color: #161410;
}
.quiz-answer:has(input:checked) .quiz-key {
	background: var(--gold-deep);
	border-color: var(--gold-deep);
	color: #161410;
}
.quiz-answer:focus-within {
	outline: 2px solid var(--gold-deep);
	outline-offset: 2px;
}

/* Shake when someone tries to skip ahead. */
@keyframes fo4-quiz-nudge {
	0%, 100% { transform: translateX(0); }
	25% { transform: translateX(-5px); }
	75% { transform: translateX(5px); }
}
.quiz-step.is-nudged .quiz-answers { animation: fo4-quiz-nudge 0.3s ease 2; }

/* ---- Contact step ---- */
.quiz-fields {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 20px;
	max-width: 900px;
}
.quiz-field label {
	display: block;
	font-family: var(--mono);
	font-size: 11px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--on-cream-mute);
	margin-bottom: 8px;
}
.quiz-field input {
	width: 100%;
	padding: 15px 16px;
	border: 1px solid var(--hairline-dark-strong);
	background: var(--cream);
	font-family: var(--body);
	font-size: 16px;
	color: var(--on-cream);
}
.quiz-field input:focus {
	outline: 2px solid var(--gold-deep);
	outline-offset: 1px;
}

/* ---- Controls ---- */
.quiz-controls {
	display: flex;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
	padding: 24px 32px;
	border-top: 1px solid var(--hairline-dark);
	background: var(--cream);
}
.quiz-hint {
	margin-left: auto;
	font-family: var(--mono);
	font-size: 11px;
	letter-spacing: 0.08em;
	color: var(--on-cream-mute);
	text-transform: uppercase;
}
.quiz-back {
	background: none;
	border: 1px solid var(--hairline-dark-strong);
	padding: 12px 20px;
	font-family: var(--mono);
	font-size: 11px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--on-cream-dim);
	cursor: pointer;
}
.quiz-back:hover { border-color: var(--on-cream); color: var(--on-cream); }
/* The submit button is the only control that makes sense with no JS. */
.quiz:not(.is-stepped) .quiz-back,
.quiz:not(.is-stepped) [data-quiz-next],
.quiz:not(.is-stepped) .quiz-hint { display: none; }
/* Only the final step can submit. `is-last` comes from quiz.js. */
.quiz.is-stepped [data-quiz-submit] { display: none; }
.quiz.is-stepped.is-last [data-quiz-submit] { display: inline-flex; }
.quiz.is-stepped.is-last [data-quiz-next] { display: none; }

/* Screen-reader-only announcements. */
.quiz-live {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* ---- Sent ---- */
.quiz-sent {
	border: 1px solid var(--gold-deep);
	background: rgba(232, 164, 28, 0.08);
	padding: 44px 40px;
}
.quiz-sent h3 {
	font-family: var(--display);
	font-weight: 400;
	font-size: clamp(32px, 4vw, 56px);
	line-height: 1;
	margin: 0 0 14px;
	color: var(--on-cream);
}
.quiz-error {
	border: 1px solid var(--burgundy);
	background: rgba(122, 46, 60, 0.06);
	padding: 20px 24px;
	margin-bottom: 24px;
	font-family: var(--body);
	font-size: 15px;
	color: var(--on-cream);
}

@media (max-width: 900px) {
	.quiz-fields { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
	.quiz-step { padding: 32px 20px; }
	.quiz-progress, .quiz-controls { padding: 16px 20px; }
	.quiz-answer { padding: 15px 16px; gap: 12px; }
	.quiz-hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	.quiz-progress-bar,
	.quiz-answer { transition: none; }
	.quiz-step.is-nudged .quiz-answers { animation: none; }
}
