/* ==========================================================================
   ITEC Quiz  (page template: page-template/quiz.php)
   Same visual system as the student-enrollment form (purple top bar,
   orange headings / progress, grey pill fields). All colors are variables.
   ========================================================================== */

:root {
	--purple: #570DAD;
	--orange: #F05A24;
	--muted: #f2ded8;
	--white: #ffffff;
	--black: #000000;
	--quiz-grey: #EBEBEB;
	--quiz-progress-bg: #EA5B2840;
	--quiz-error: #d63638;
	--quiz-font: "Inter", sans-serif;
}

body.itec-quiz-page {
	margin: 0;
	background: var(--white);
	font-family: var(--quiz-font);
}

/* Layout ------------------------------------------------------------------ */
.itec-quiz {
	display: flex;
	flex-direction: column;
	width: 100%;
	min-height: 100vh;
	min-height: 100dvh;
	background: var(--white);
	position: relative;
}
.admin-bar .itec-quiz {
	min-height: calc(100vh - 32px);
	min-height: calc(100dvh - 32px);
}
@media (max-width: 782px) {
	.admin-bar .itec-quiz {
		min-height: calc(100vh - 46px);
		min-height: calc(100dvh - 46px);
	}
}

.itec-quiz .container {
	width: 100%;
	max-width: 1300px;
	margin: 0 auto;
	padding: 0 15px;
}
.itec-quiz .row {
	display: flex;
	flex-wrap: wrap;
	margin-left: -15px;
	margin-right: -15px;
}
.itec-quiz .row > * {
	padding-left: 15px;
	padding-right: 15px;
}

/* Top bar ------------------------------------------------------------------ */
.quiz-topbar {
	background: var(--purple);
	color: var(--white);
	padding: 23px 0;
}
.quiz-topbar .row {
	justify-content: space-between;
	align-items: center;
}
.quiz-brand {
	display: flex;
	align-items: center;
	width: auto;
}
.quiz-brand a img {
	display: block;
	max-width: 100%;
	height: auto;
	filter: brightness(0) invert(1);
}
.quiz-brand__text {
	color: var(--white);
	font-weight: 700;
	font-size: 22px;
}
.quiz-topbar .btn-wrp{
	display: inline-block;
	width: auto;
	flex-shrink: 0;
}
.quiz-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 24px;
    border: 1px solid var(--white);
    border-radius: 50px;
    font-size: 14px;
    font-weight: 700;
}
.quiz-pill span {
	font-weight: 400;
	padding: 0 1px;
}
.quiz-pill span:first-of-type {
	margin-left: 5px;
}

/* Content ------------------------------------------------------------------ */
.quiz-content {
	flex: 1;
	display: flex;
	align-items: center;
	padding: 40px 0;
}
.quiz-form {
	width: 100%;
}
.quiz-empty {
	text-align: center;
	color: var(--black);
	font-size: 18px;
	margin: 0;
}

.quiz-step[hidden] {
	display: none !important;
}
.quiz-step.is-active {
	display: block;
	animation: quiz-fade .25s ease;
}
@keyframes quiz-fade {
	from { opacity: 0; transform: translateY(6px); }
	to   { opacity: 1; transform: none; }
}

/* Title row: [prev]  question  [next] */
.quiz-step__head {
	display: grid;
	grid-template-columns: 46px 1fr 46px;
	align-items: center;
	gap: 24px;
}
.quiz-step__title {
	margin: 0;
	text-align: center;
	color: var(--orange);
	font-family: var(--quiz-font);
	font-weight: 700;
	font-size: 28px;
	line-height: 1.25;
	outline: none;
}

.quiz-nav {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--orange);
	border-radius: 50%;
	cursor: pointer;
	transition: transform .12s ease, opacity .15s ease;
}
.quiz-nav:active {
	transform: scale(.96);
}
.quiz-nav:focus-visible {
	outline: 2px solid var(--purple);
	outline-offset: 3px;
}
.quiz-nav .quiz-nav__icon {
	display: block;
	width: 33px;
	height: 33px;
	fill: currentColor;
}
.quiz-nav--next .quiz-nav__icon {
	transform: scaleX(-1);
}
/* Keeps the grid layout stable while hiding the button (back on step 1 / next until answered). */
.quiz-nav.is-hidden {
	visibility: hidden;
	pointer-events: none;
}

/* Options (pills) ------------------------------------------------------------ */
.quiz-options {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 14px 12px;
	max-width: 1030px;
	margin: 50px auto 0;
}
.quiz-option {
	position: relative;
	display: inline-block;
	margin: 0;
	cursor: pointer;
}
.quiz-option input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	margin: 0;
}
.quiz-option__text {
	display: inline-block;
	padding: 13px 32px;
	border-radius: 999px;
	background: #E9E9E9;
	color: var(--black);
	font-size: 16px;
	font-weight: 400;
	line-height: 1.3;
	text-align: center;
	transition: background-color .15s ease, color .15s ease;
}
.quiz-option:hover .quiz-option__text {
	background: var(--muted);
}
.quiz-option input:checked + .quiz-option__text {
	background: var(--orange);
	color: var(--white);
}
.quiz-option input:focus-visible + .quiz-option__text {
	outline: 2px solid var(--purple);
	outline-offset: 2px;
}

.quiz-error {
	min-height: 1.5em;
	margin: 22px 0 0;
	text-align: center;
	color: var(--quiz-error);
	font-size: 15px;
}
.quiz-form.is-submitting .quiz-step {
	opacity: .6;
	pointer-events: none;
}

/* Honeypot (off-screen, not display:none so bots still fill it) */
.quiz-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Bottom progress bar ---------------------------------------------------------- */
.quiz-progress {
	position: relative;
	height: 21px;
}
.quiz-progress__bg {
	position: absolute;
	inset: 0;
	overflow: hidden;
	background: var(--quiz-progress-bg);
}
.quiz-progress__fill {
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 0;
	background: var(--orange);
	border-top-right-radius: 50px;
	border-bottom-right-radius: 50px;
	transition: width .35s ease;
}
.quiz-progress__fill[style*="width: 100%"] {
	border-radius: 0;
}

/* Responsive ------------------------------------------------------------------- */
@media (max-width: 767px) {
	/* .quiz-topbar {
		padding: 16px 0;
	} */
	.quiz-step__head {
		grid-template-columns: 36px 1fr 36px;
		gap: 12px;
	}
	.quiz-step__title {
		font-size: 22px;
	}
	.quiz-options {
		margin-top: 28px;
		gap: 10px;
	}
	.quiz-option__text {
		padding: 11px 22px;
		font-size: 15px;
	}
	.quiz-progress {
		height: 22px;
	}
}
@media (max-width: 575px) {
	.quiz-brand a img {
		max-width: 100px;
	}
	.quiz-pill {
		padding: 5px 16px;
		font-size: 13px;
	}
	.quiz-option,
	.quiz-option__text {
		max-width: 100%;
	}
}
@media (prefers-reduced-motion: reduce) {
	.quiz-step.is-active,
	.quiz-progress__fill,
	.quiz-nav,
	.quiz-option__text {
		animation: none;
		transition: none;
	}
}

/* Resume notice (unfinished quiz restored from the browser) ---------------- */
.itec-quiz .quiz-resume {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 6px 14px;
	margin: 0 0 18px;
	padding: 10px 16px;
	border-radius: 30px;
	background: var(--muted);
	color: var(--black);
	font-size: 14px;
	text-align: center;
}
.itec-quiz .quiz-resume[hidden] {
	display: none;
}
.itec-quiz .quiz-resume__btn {
	background: none;
	border: 0;
	padding: 0;
	color: var(--purple);
	font: inherit;
	font-weight: 600;
	text-decoration: underline;
	cursor: pointer;
}
