/* ===========================================================================
   MiF quiz section (template-parts/programme/mif/quiz.php, 2026-11-17): live's
   five-question quiz as one card on the dark section, the heading and a list of
   the steps beside it. Fields, pills and the submit come from programme-forms.css's
   `.bib-form--on-dark`; this file adds the card, the step list, the questions
   (stacked answers, not pills: the answers are long), the step bar (phones) and
   Back / Next, and the done panel. MiF page only.
   ======================================================================== */

.mif-quiz__in {
	display: grid;
	gap: var(--space-10);
	align-items: start;
}

@media (min-width: 64em) {
	.mif-quiz__in {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
		gap: var(--space-16);
	}
}

@media (min-width: 64em) {
	.mif-quiz__head {
		position: sticky;
		top: var(--space-32);           /* clear of the header + sub-nav */
	}
}

.mif-quiz__head .bib-lead {
	margin-block-start: var(--space-4);
}

/* --- The step list (desktop; phones keep the bar inside the card) ------ */

.mif-quiz__steps {
	display: none;
	margin: var(--space-10) 0 0;
	padding: 0;
	list-style: none;
	border-inline-start: 1px solid var(--bib-line-dark);
}

@media (min-width: 64em) {
	.mif-quiz__steps {
		display: grid;
	}
}

.mif-quiz__step {
	position: relative;
	display: flex;
	gap: var(--space-4);
	align-items: baseline;
	padding: var(--space-3) 0 var(--space-3) var(--space-6);
	font-family: var(--font-display);
	font-size: var(--fs-editorial-sm);  /* 18 */
	line-height: 1.4;
	color: var(--bib-on-dark-3);
	transition: color var(--duration) var(--ease);
}

/* The current step: a crimson bar over the list's rule. */
.mif-quiz__step::before {
	content: '';
	position: absolute;
	inset-block: 0;
	inset-inline-start: -1px;
	width: 2px;
	background-color: transparent;
	transition: background-color var(--duration) var(--ease);
}

.mif-quiz__num {
	flex: none;
	font-family: var(--font-body);
	font-size: var(--fs-ui-xs);
	font-weight: var(--fw-medium);
	letter-spacing: 0.04em;
	font-variant-numeric: tabular-nums;
}

.mif-quiz__step.is-done {
	color: var(--bib-on-dark);
}

.mif-quiz__step.is-active {
	color: var(--color-white);
}

.mif-quiz__step.is-active::before {
	background-color: var(--color-crimson);
}

.mif-quiz__step.is-active .mif-quiz__num {
	color: var(--bib-magenta-on-dark);
}

.mif-quiz__card {
	padding: var(--space-8) var(--space-6);
	border: 1px solid var(--bib-line-dark);
	border-radius: var(--bib-r);
	background-color: color-mix(in srgb, var(--color-white) 5%, transparent);
}

@media (min-width: 48em) {
	.mif-quiz__card {
		padding: var(--space-10) var(--space-12);
	}
}

/* The steps take the card's full width (the on-dark form's two-column grid is for
   the contact fields, set on the last step below). */
.mif-quiz .frm-fluent-form > fieldset {
	display: block;
}

/* --- Step bar: the bar only. Fluent's line reads "Step 1 of 6 - Step 1" (its
   string is site-wide), so it is hidden; the bar shows the progress. -------- */

.mif-quiz .ff-step-header {
	margin-block-end: var(--space-8);
}

.mif-quiz .fluentform .ff-el-progress-status {
	display: none;
}

.mif-quiz .fluentform .ff-el-progress {
	height: 0.25rem;
	border-radius: var(--radius-full);
	background-color: var(--bib-line-dark);
}

.mif-quiz .fluentform .ff-el-progress-bar {
	background-color: var(--color-crimson);
}

.mif-quiz .fluentform .ff-el-progress-bar span {
	display: none;                      /* the percentage */
}

/* Desktop: the step list beside the card does the bar's job. */
@media (min-width: 64em) {
	.mif-quiz .ff-step-header {
		display: none;
	}
}

/* --- A question: Lora title, its text, answers stacked ------------------ */

.mif-quiz .ff-el-group.mif-quiz__q .ff-el-input--label label {
	font-family: var(--font-display);
	font-size: var(--fs-editorial-md);  /* 22 */
	font-weight: var(--fw-regular);
	line-height: 1.3;
	letter-spacing: 0;
	text-transform: none;
	color: var(--color-white);
}

.mif-quiz .mif-quiz__q .ff-el-help-message {
	margin-block: var(--space-2) var(--space-6);
	font-family: var(--font-display);
	font-size: var(--fs-editorial-sm);  /* 18 */
	font-style: normal;
	line-height: 1.6;
	color: var(--bib-on-dark);
}

.mif-quiz .mif-quiz__q .ff-el-input--content {
	display: grid;
	gap: var(--space-3);
}

.mif-quiz .mif-quiz__q .ff-el-form-check {
	margin: 0;
}

.mif-quiz .mif-quiz__q .ff-el-form-check-label {
	display: flex;
	width: 100%;
	height: auto;
	min-height: 3rem;
	padding: var(--space-3) var(--space-5);
	border-radius: var(--radius-field);
	font-size: var(--fs-ui);
	line-height: 1.4;
}

.mif-quiz .mif-quiz__q .ff-el-form-check-label:hover {
	border-color: var(--color-white);
}

.mif-quiz .mif-quiz__q .ff-el-form-check-label:has(.ff-el-form-check-radio:checked) {
	background-color: var(--color-white);
	border-color: var(--color-white);
	color: var(--color-navy);
}

/* White text in the fields, the country's "Select a country" included: Fluent's
   default skin (`.ff-default .ff-el-form-control`, grey) otherwise beats the
   on-dark rule, which has the same weight and loads earlier. */
.mif-quiz .fluentform .ff-el-form-control,
.mif-quiz .fluentform .ff-el-form-control::placeholder {
	color: var(--color-white);
	opacity: 1;                         /* the examples too (Domagoj, 2026-11-17) */
}

/* Live's line before the contact fields. */
.mif-quiz .mif-quiz__note p {
	margin: 0;
	font-family: var(--font-display);
	font-size: var(--fs-editorial-sm);
	line-height: 1.6;
	color: var(--bib-on-dark);
}

/* --- Back / Next (Fluent floats them; a flex row instead) ---------------- */

.mif-quiz .fluentform .step-nav {
	display: flex;
	gap: var(--space-3);
	margin-block-start: var(--space-8);
}

.mif-quiz .fluentform .step-nav .ff-btn {
	float: none !important;             /* beats Fluent's inline float */
	height: 3rem;
	padding-inline: var(--space-6);
	border: 1px solid var(--bib-on-dark-3);
	border-radius: var(--radius-full);
	background-color: transparent;
	color: var(--color-white);
	font-family: var(--font-body);
	font-size: var(--fs-ui);
	font-weight: var(--fw-medium);
	opacity: 1;
	transition: background-color var(--duration) var(--ease), border-color var(--duration) var(--ease), color var(--duration) var(--ease);
}

/* A question moves on as soon as it is answered (Fluent's auto slider), so its
   Next only shows once an answer is chosen, i.e. after coming Back to it. */
.mif-quiz .fluentform-step:has(.mif-quiz__q):not(:has(input:checked)) .ff-btn-next {
	visibility: hidden !important;      /* beats Fluent's inline visibility: visible */
}

.mif-quiz .fluentform .step-nav .ff-btn-next {
	margin-inline-start: auto;
	border-color: var(--color-crimson);
	background-color: var(--color-crimson);
}

.mif-quiz .fluentform .step-nav .ff-btn:hover {
	border-color: var(--color-white);
	background-color: var(--color-white);
	color: var(--color-navy);
}

/* The last step: the contact fields' grid, Back beside the submit. */
/* Fluent moves focus to the first block of each new step (for screen readers):
   no focus ring on that block, it is not a control. */
.mif-quiz .fluentform-step > .ff-el-group:focus {
	outline: 0;
}

/* `.active` + !important: Fluent shows the step with an inline display: block. */
.mif-quiz .fluentform .fluentform-step.active:last-child {
	display: grid !important;
	grid-template-columns: 1fr 1fr;
	gap: 1rem;
}

.mif-quiz .fluentform .fluentform-step:last-child > :not(.ff-el-group--half),
.mif-quiz .fluentform .fluentform-step:last-child > .ff-el-group--half:has(select) {
	grid-column: 1 / -1;                /* country: alone on its row (no nationality here) */
}

@media (max-width: 29.99em) {
	.mif-quiz .fluentform .fluentform-step.active:last-child {
		grid-template-columns: 1fr;
	}
}

/* --- Done panel ---------------------------------------------------------- */

.mif-quiz__ok {
	display: grid;
	place-items: center;
	width: 3.5rem;
	height: 3.5rem;
	border-radius: 50%;
	background-color: var(--color-crimson);
	color: var(--color-white);
}

.mif-quiz__done-title {
	margin-block-start: var(--space-6);
	font-family: var(--font-display);
	font-size: var(--fs-editorial-lg);  /* 24 */
	font-weight: var(--fw-regular);
	color: var(--color-white);
}

.mif-quiz .mif-quiz__done-title:focus,
.mif-quiz .mif-quiz__done-title:focus-visible {
	outline: 0;                         /* focused by the script for screen readers, not a control */
}

.mif-quiz__done-text {
	margin-block-start: var(--space-3);
	font-family: var(--font-display);
	font-size: var(--fs-editorial-sm);
	line-height: 1.6;
	color: var(--bib-on-dark);
}
