/*
 * Dragonfly Crowd "Which cover do I need?" quiz. Scoped to .dfc-quiz.
 * Same tokens as css/dfc-mega-menu.css.
 */

.dfc-quiz {
	--dfc-navy-900: #0C1427;
	--dfc-navy-700: #1A2B55;
	--dfc-teal-500: #4FC0A2;
	--dfc-teal-600: #3FA189;
	--dfc-teal-text: #26806A;
	--dfc-teal-050: #EEF8F5;
	--dfc-grey-050: #F7F8FA;
	--dfc-grey-100: #EFF1F4;
	--dfc-grey-200: #DFE3EA;
	--dfc-grey-600: #636B7B;
	--dfc-grey-800: #3D4557;
	--dfc-font: "Kumbh Sans", sans-serif;
	--dfc-t: 180ms cubic-bezier(.2, .6, .2, 1);
	max-width: 760px;
	margin: 0 0 3rem;
	font-family: var(--dfc-font);
	color: var(--dfc-grey-800);
}

.dfc-quiz *,
.dfc-quiz *::before,
.dfc-quiz *::after {
	box-sizing: border-box;
}

.dfc-quiz :where(p, ul, li, h2, h3) {
	margin: 0;
	padding: 0;
}

.dfc-quiz :where(ul) {
	list-style: none;
}

.dfc-quiz :where(a),
.dfc-quiz :where(a):hover {
	text-decoration: none;
}

.dfc-quiz :where(br) {
	display: none;
}

.dfc-quiz :focus-visible {
	outline: 2px solid var(--dfc-teal-500);
	outline-offset: 3px;
}

.dfc-quiz [tabindex="-1"]:focus {
	outline: none;
}

.dfc-quiz [hidden] {
	display: none !important;
}

.dfc-quiz__intro {
	margin-bottom: 1.5rem;
	font-size: 17px;
	line-height: 1.6;
	color: var(--dfc-grey-800);
}

.dfc-quiz__card {
	position: relative;
	overflow: hidden;
	background: #fff;
	border: 1px solid var(--dfc-grey-200);
	border-radius: 16px;
	box-shadow: 0 10px 30px rgba(12, 20, 39, .08);
}

.dfc-quiz__progress {
	height: 5px;
	background: var(--dfc-grey-100);
}

.dfc-quiz__bar {
	display: block;
	width: 6%;
	height: 100%;
	background: var(--dfc-teal-500);
	border-radius: 0 999px 999px 0;
	transition: width 300ms cubic-bezier(.2, .6, .2, 1);
}

.dfc-quiz__stage,
.dfc-quiz__contact,
.dfc-quiz__done {
	padding: 28px 32px 32px;
}

.dfc-quiz__contact {
	border-top: 1px solid var(--dfc-grey-200);
	background: var(--dfc-grey-050);
}

/* ---------- question ---------- */

.dfc-quiz__q,
.dfc-quiz__result {
	animation: dfc-quiz-in .24s cubic-bezier(.2, .6, .2, 1);
}

@keyframes dfc-quiz-in {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: none; }
}

.dfc-quiz__step {
	margin-bottom: 8px;
	font-weight: 700;
	font-size: 12px;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--dfc-teal-text);
}

.dfc-quiz__title {
	font-family: var(--dfc-font);
	font-weight: 700;
	font-size: 26px;
	line-height: 1.25;
	color: var(--dfc-navy-700);
	word-break: normal;
}

.dfc-quiz__title--sm {
	font-size: 21px;
}

.dfc-quiz__hint,
.dfc-quiz__lede {
	margin-top: 8px;
	font-size: 15.5px;
	line-height: 1.6;
	color: var(--dfc-grey-600);
}

.dfc-quiz__lede a,
.dfc-quiz__aside a {
	font-weight: 700;
	color: var(--dfc-navy-700);
}

.dfc-quiz__options {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-top: 22px;
}

.dfc-quiz__opt {
	appearance: none;
	position: relative;
	display: flex;
	align-items: center;
	gap: 14px;
	width: 100%;
	min-height: 56px;
	margin: 0;
	padding: 14px 18px;
	background: #fff;
	border: 1.5px solid var(--dfc-grey-200);
	border-radius: 12px;
	font-family: var(--dfc-font);
	text-align: left;
	color: var(--dfc-navy-700);
	cursor: pointer;
	transition: border-color var(--dfc-t), background-color var(--dfc-t), box-shadow var(--dfc-t);
}

.dfc-quiz__opt:hover {
	border-color: var(--dfc-teal-500);
	box-shadow: 0 4px 14px rgba(12, 20, 39, .07);
}

.dfc-quiz__opt[aria-pressed="true"],
.dfc-quiz__opt--check:has(.dfc-quiz__check:checked) {
	background: var(--dfc-teal-050);
	border-color: var(--dfc-teal-500);
}

.dfc-quiz__opt-txt {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 3px;
}

.dfc-quiz__opt-label {
	font-weight: 600;
	font-size: 16.5px;
	line-height: 1.35;
}

.dfc-quiz__opt-sub {
	font-size: 14px;
	line-height: 1.45;
	color: var(--dfc-grey-600);
}

/* ---------- icons ---------- */

.dfc-quiz__ic {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 44px;
	height: 44px;
	border-radius: 999px;
	background: var(--dfc-teal-050);
	color: var(--dfc-teal-text);
	transition: background-color var(--dfc-t), color var(--dfc-t);
}

.dfc-quiz .dfc-quiz__svg {
	display: block;
	max-width: none;
}

.dfc-quiz__opt:hover .dfc-quiz__ic {
	background: #DDF2EB;
}

.dfc-quiz__opt[aria-pressed="true"] .dfc-quiz__ic,
.dfc-quiz__check:checked ~ .dfc-quiz__ic {
	background: var(--dfc-teal-500);
	color: var(--dfc-navy-900);
}

/* "Who's the cover for?": three picture tiles on wider screens */
@media (min-width: 640px) {
	.dfc-quiz__options--tiles {
		display: grid;
		grid-template-columns: repeat(3, 1fr);
		gap: 12px;
	}

	.dfc-quiz__options--tiles .dfc-quiz__opt {
		flex-direction: column;
		align-items: flex-start;
		gap: 16px;
		padding: 22px 20px 24px;
	}

	.dfc-quiz__options--tiles .dfc-quiz__ic {
		width: 58px;
		height: 58px;
	}

	.dfc-quiz__options--tiles .dfc-quiz__opt-mark {
		position: absolute;
		top: 16px;
		right: 16px;
	}

	/* "Pick as many as you like": two columns */
	.dfc-quiz__options--grid {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 10px;
	}
}

.dfc-quiz__options--grid .dfc-quiz__opt {
	padding: 12px 14px;
}

.dfc-quiz__options--grid .dfc-quiz__opt-label {
	font-size: 15.5px;
}

.dfc-quiz__options--grid .dfc-quiz__ic {
	width: 40px;
	height: 40px;
}

/* round mark for single choice, square tick box for multi */
.dfc-quiz__opt-mark {
	position: relative;
	flex: 0 0 auto;
	width: 22px;
	height: 22px;
	border: 1.5px solid var(--dfc-grey-200);
	border-radius: 999px;
	background: #fff;
	transition: border-color var(--dfc-t), background-color var(--dfc-t);
}

.dfc-quiz__opt--check .dfc-quiz__opt-mark {
	border-radius: 6px;
}

.dfc-quiz__opt[aria-pressed="true"] .dfc-quiz__opt-mark,
.dfc-quiz__check:checked ~ .dfc-quiz__opt-mark {
	background: var(--dfc-teal-500);
	border-color: var(--dfc-teal-500);
}

.dfc-quiz__opt[aria-pressed="true"] .dfc-quiz__opt-mark::after,
.dfc-quiz__check:checked ~ .dfc-quiz__opt-mark::after {
	content: "";
	position: absolute;
	left: 7px;
	top: 3px;
	width: 5px;
	height: 10px;
	border: solid var(--dfc-navy-900);
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

/* the real checkbox stays focusable but invisible; its label is the card */
.dfc-quiz__check {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	margin: 0;
	pointer-events: none;
}

.dfc-quiz__opt--check:has(.dfc-quiz__check:focus-visible) {
	outline: 2px solid var(--dfc-teal-500);
	outline-offset: 3px;
}

/* ---------- navigation ---------- */

.dfc-quiz__nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-top: 24px;
}

.dfc-quiz__nav:empty {
	display: none;
}

.dfc-quiz__nav .dfc-quiz__btn {
	margin-left: auto;
}

.dfc-quiz__back {
	appearance: none;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 44px;
	margin: 0;
	padding: 0 4px 0 0;
	background: none;
	border: 0;
	font-family: var(--dfc-font);
	font-weight: 600;
	font-size: 15px;
	color: var(--dfc-grey-600);
	cursor: pointer;
}

.dfc-quiz__back:hover {
	color: var(--dfc-navy-700);
}

.dfc-quiz__btn,
.dfc-quiz .wpcf7-submit {
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	margin: 0;
	padding: 12px 28px;
	background: var(--dfc-teal-500);
	border: 0;
	border-radius: 999px;
	font-family: var(--dfc-font);
	font-weight: 700;
	font-size: 15.5px;
	line-height: 1.2;
	color: var(--dfc-navy-900);
	cursor: pointer;
	transition: background-color var(--dfc-t), opacity var(--dfc-t);
}

.dfc-quiz__btn:hover,
.dfc-quiz .wpcf7-submit:hover {
	background: var(--dfc-teal-600);
	color: var(--dfc-navy-900);
}

.dfc-quiz__btn:disabled {
	opacity: .45;
	cursor: not-allowed;
}

.dfc-quiz__link {
	appearance: none;
	margin: 0;
	padding: 0;
	background: none;
	border: 0;
	font-family: var(--dfc-font);
	font-weight: 700;
	font-size: inherit;
	color: var(--dfc-teal-text);
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

.dfc-quiz__link:hover {
	color: var(--dfc-navy-700);
}

/* ---------- result ---------- */

.dfc-quiz__topics {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-top: 22px;
}

.dfc-quiz__topic {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	padding: 16px 18px;
	border: 1px solid var(--dfc-grey-200);
	border-radius: 12px;
}

.dfc-quiz__topic-body {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding-top: 2px;
}

.dfc-quiz__topic .dfc-quiz__ic {
	width: 40px;
	height: 40px;
}

.dfc-quiz__topic-name {
	font-weight: 700;
	font-size: 16.5px;
	line-height: 1.3;
	color: var(--dfc-navy-700);
}

a.dfc-quiz__topic-name {
	text-decoration: underline;
	text-decoration-color: var(--dfc-grey-200);
	text-underline-offset: 4px;
}

a.dfc-quiz__topic-name:hover {
	color: var(--dfc-teal-text);
	text-decoration-color: currentColor;
}

.dfc-quiz__topic-desc {
	font-size: 14.5px;
	line-height: 1.5;
	color: var(--dfc-grey-600);
}

.dfc-quiz__note {
	margin-top: 18px;
	padding: 14px 16px;
	background: var(--dfc-grey-050);
	border-radius: 10px;
	font-size: 14px;
	line-height: 1.55;
	color: var(--dfc-grey-800);
}

.dfc-quiz__subtitle {
	margin-top: 22px;
	font-family: var(--dfc-font);
	font-weight: 700;
	font-size: 17px;
	line-height: 1.3;
	color: var(--dfc-navy-700);
}

.dfc-quiz__list {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 10px;
}

.dfc-quiz__list li {
	position: relative;
	padding-left: 20px;
	font-size: 15px;
	line-height: 1.5;
}

.dfc-quiz__list li::before {
	content: "";
	position: absolute;
	left: 2px;
	top: .6em;
	width: 7px;
	height: 7px;
	border-radius: 999px;
	background: var(--dfc-teal-500);
}

.dfc-quiz__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px 22px;
	margin-top: 24px;
}

.dfc-quiz__aside {
	margin-top: 18px;
	font-size: 15px;
	color: var(--dfc-grey-600);
}

/* ---------- Contact Form 7 inside the quiz ---------- */

.dfc-quiz .wpcf7 {
	margin-top: 18px;
}

.dfc-quiz .wpcf7 form > p:empty {
	display: none;
}

/* Contact Form 7 wraps template lines in <p>; let those wrappers drop out of the layout. */
.dfc-quiz-form__grid > p,
.dfc-quiz-form__submit > p {
	display: contents;
}

.dfc-quiz-form__grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px 16px;
}

.dfc-quiz-form__field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 0;
	font-weight: 600;
	font-size: 14.5px;
	color: var(--dfc-navy-700);
}

.dfc-quiz-form__field--wide {
	grid-column: 1 / -1;
}

.dfc-quiz .wpcf7-form-control-wrap {
	display: block;
}

.dfc-quiz .wpcf7 input[type="text"],
.dfc-quiz .wpcf7 input[type="email"],
.dfc-quiz .wpcf7 input[type="tel"],
.dfc-quiz .wpcf7 select {
	width: 100%;
	min-height: 48px;
	margin: 0;
	padding: 10px 14px;
	background: #fff;
	border: 1.5px solid var(--dfc-grey-200);
	border-radius: 10px;
	font-family: var(--dfc-font);
	font-weight: 400;
	font-size: 16px;
	color: var(--dfc-navy-900);
}

.dfc-quiz .wpcf7 input:focus,
.dfc-quiz .wpcf7 select:focus {
	border-color: var(--dfc-teal-500);
	outline: none;
	box-shadow: 0 0 0 3px rgba(79, 192, 162, .25);
}

.dfc-quiz .wpcf7-not-valid-tip {
	margin-top: 4px;
	font-weight: 400;
	font-size: 13.5px;
	color: #B42318;
}

.dfc-quiz-form__submit {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-top: 20px;
}

.dfc-quiz .wpcf7-spinner {
	margin: 0;
}

.dfc-quiz-form__small {
	margin-top: 14px;
	font-size: 13px;
	line-height: 1.5;
	color: var(--dfc-grey-600);
}

.dfc-quiz .wpcf7 form .wpcf7-response-output {
	margin: 16px 0 0;
	padding: 12px 14px;
	border-radius: 10px;
	font-size: 14.5px;
}

.dfc-quiz-form__hidden {
	display: none !important;
}

/* ---------- small screens ---------- */

@media (max-width: 767.98px) {
	.dfc-quiz__stage,
	.dfc-quiz__contact,
	.dfc-quiz__done {
		padding: 22px 18px 24px;
	}

	.dfc-quiz__title {
		font-size: 22px;
	}

	.dfc-quiz__opt {
		padding: 13px 14px;
	}

	.dfc-quiz-form__grid {
		grid-template-columns: 1fr;
	}

	.dfc-quiz-form__submit .wpcf7-submit {
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.dfc-quiz__q,
	.dfc-quiz__result {
		animation: none;
	}

	.dfc-quiz * {
		transition: none !important;
	}
}
