/* Frontend quiz — theme-aware (light, dark, or any store color). */

.qa-timer-container,
.all-questions-answers {
	--wxg-qa-line: color-mix(in srgb, currentColor 16%, transparent);
	--wxg-qa-fill: color-mix(in srgb, currentColor 5%, transparent);
	--wxg-qa-fill-hover: color-mix(in srgb, currentColor 9%, transparent);
	--wxg-qa-ok: #16a34a;
	--wxg-qa-bad: #e11d48;
	--wxg-qa-sel: #2563eb;
	--wxg-qa-radius: 12px;
	--wxg-qa-radius-inner: 10px;
	color: inherit;
	box-sizing: border-box;
}

.qa-timer-container *,
.all-questions-answers * {
	box-sizing: border-box;
}

@supports not (background: color-mix(in srgb, red 10%, transparent)) {
	.qa-timer-container,
	.all-questions-answers {
		--wxg-qa-line: rgba(128, 128, 128, 0.38);
		--wxg-qa-fill: rgba(128, 128, 128, 0.08);
		--wxg-qa-fill-hover: rgba(128, 128, 128, 0.14);
	}
}

.qa-timer-container,
.all-questions-answers {
	width: 100%;
	max-width: 100%;
	margin: 1.25rem 0 0;
	padding: 1.15rem 1.2rem 1.25rem;
	background: var(--wxg-qa-fill);
	border: 1px solid var(--wxg-qa-line);
	border-radius: var(--wxg-qa-radius);
}

.qa-timer-container + .all-questions-answers {
	margin-top: 0;
	border-top: 0;
	border-top-left-radius: 0;
	border-top-right-radius: 0;
	padding-top: 0.35rem;
}

.qa-timer-container:has(+ .all-questions-answers) {
	margin-bottom: 0;
	border-bottom-left-radius: 0;
	border-bottom-right-radius: 0;
	padding-bottom: 0.85rem;
}

.wxg-qa-timer__caption {
	margin: 0 0 0.65rem;
	padding: 0;
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	opacity: 0.62;
}

.qa-countdown {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.wxg-qa-timer__seg,
.time-segment {
	flex: 1 1 4.5rem;
	min-width: 4.25rem;
	max-width: 7rem;
	padding: 0.65rem 0.5rem 0.55rem;
	text-align: center;
	background: var(--wxg-qa-fill);
	border: 1px solid var(--wxg-qa-line);
	border-radius: var(--wxg-qa-radius-inner);
}

.wxg-qa-timer__value,
.time-value {
	font-size: 1.35rem;
	font-weight: 650;
	letter-spacing: 0.04em;
	line-height: 1.15;
	font-variant-numeric: tabular-nums;
}

.wxg-qa-timer__label,
.time-label {
	margin-top: 0.2rem;
	font-size: 0.68rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	opacity: 0.58;
}

.wxg-qa__title {
	margin: 0 0 1rem;
	padding: 0;
	font-size: 1.05rem;
	font-weight: 650;
	letter-spacing: -0.02em;
	line-height: 1.35;
	color: inherit;
	background: none;
	border: 0;
}

.wxg-qa__item,
.question-answer-set {
	margin: 0 0 1.15rem;
	padding: 0 0 1.15rem;
	border-bottom: 1px solid var(--wxg-qa-line);
}

.wxg-qa__item:last-child,
.question-answer-set:last-child {
	margin-bottom: 0;
	padding-bottom: 0;
	border-bottom: 0;
}

.wxg-qa__question,
.all-questions-answers .question {
	display: flex;
	align-items: flex-start;
	gap: 0.7rem;
	margin: 0 0 0.75rem;
	padding: 0;
	font-size: 0.98rem;
	font-weight: 600;
	line-height: 1.4;
	text-align: left;
	color: inherit;
}

.wxg-qa__index {
	flex: 0 0 1.55rem;
	width: 1.55rem;
	height: 1.55rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-top: 0.05rem;
	border-radius: 999px;
	border: 1px solid var(--wxg-qa-line);
	background: var(--wxg-qa-fill);
	font-size: 0.72rem;
	font-weight: 700;
	line-height: 1;
	opacity: 0.85;
}

.wxg-qa__question-text {
	flex: 1 1 auto;
	min-width: 0;
}

.wxg-qa__list,
.mcq-answers ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.45rem;
}

.wxg-qa__choice,
.mcq-option {
	list-style: none;
	margin: 0;
	padding: 0;
	cursor: pointer;
}

.wxg-qa__choice-label {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	width: 100%;
	margin: 0;
	padding: 0.72rem 0.9rem;
	border: 1px solid var(--wxg-qa-line);
	border-radius: var(--wxg-qa-radius-inner);
	background: transparent;
	color: inherit;
	font-weight: 400;
	line-height: 1.4;
	text-align: left;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.wxg-qa__choice:hover .wxg-qa__choice-label,
.mcq-option:hover .wxg-qa__choice-label {
	background: var(--wxg-qa-fill-hover);
	border-color: color-mix(in srgb, currentColor 28%, transparent);
}

.wxg-qa__choice input[type="radio"],
.mcq-option input[type="radio"] {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.wxg-qa__choice-mark {
	flex: 0 0 1.05rem;
	width: 1.05rem;
	height: 1.05rem;
	border: 1.5px solid color-mix(in srgb, currentColor 40%, transparent);
	border-radius: 50%;
	position: relative;
	background: transparent;
}

.wxg-qa__choice-mark::after {
	content: '';
	position: absolute;
	inset: 3px;
	border-radius: 50%;
	background: currentColor;
	opacity: 0;
	transform: scale(0.6);
	transition: opacity 0.12s ease, transform 0.12s ease;
}

.wxg-qa__choice.selected .wxg-qa__choice-mark::after,
.mcq-option.selected .wxg-qa__choice-mark::after {
	opacity: 1;
	transform: scale(1);
}

.wxg-qa__choice-text {
	flex: 1 1 auto;
	min-width: 0;
}

.wxg-qa__choice:focus-within .wxg-qa__choice-label {
	border-color: color-mix(in srgb, currentColor 45%, transparent);
	box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 12%, transparent);
}

.wxg-qa__choice.selected .wxg-qa__choice-label,
.mcq-option.selected .wxg-qa__choice-label {
	background: var(--wxg-qa-fill-hover);
	border-color: color-mix(in srgb, currentColor 32%, transparent);
}

.wxg-qa__choice.is-correct .wxg-qa__choice-label,
.mcq-option.is-correct .wxg-qa__choice-label {
	border-color: var(--wxg-qa-ok);
	background: color-mix(in srgb, var(--wxg-qa-ok) 14%, transparent);
}

.wxg-qa__choice.is-incorrect .wxg-qa__choice-label,
.mcq-option.is-incorrect .wxg-qa__choice-label {
	border-color: var(--wxg-qa-bad);
	background: color-mix(in srgb, var(--wxg-qa-bad) 12%, transparent);
}

.wxg-qa__choice.is-correct .wxg-qa__choice-mark,
.mcq-option.is-correct .wxg-qa__choice-mark {
	border-color: var(--wxg-qa-ok);
}

.wxg-qa__choice.is-incorrect .wxg-qa__choice-mark,
.mcq-option.is-incorrect .wxg-qa__choice-mark {
	border-color: var(--wxg-qa-bad);
}

.wxg-qa__choice.is-answered .wxg-qa__choice-label,
.mcq-option.is-answered .wxg-qa__choice-label {
	border-color: var(--wxg-qa-sel);
	background: color-mix(in srgb, var(--wxg-qa-sel) 12%, transparent);
}

.wxg-qa__choice.is-answered .wxg-qa__choice-mark,
.mcq-option.is-answered .wxg-qa__choice-mark {
	border-color: var(--wxg-qa-sel);
}

.wxg-qa__field,
.free-text-answer {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
	margin: 0;
}

.wxg-qa__field-label,
.free-text-answer label {
	margin: 0;
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	opacity: 0.72;
}

.all-questions-answers .free-text-input,
form.cart .all-questions-answers .free-text-input {
	width: 100%;
	max-width: 100%;
	min-height: 2.75rem;
	margin: 0;
	padding: 0.7rem 0.9rem;
	font: inherit;
	font-size: 0.95rem;
	line-height: 1.4;
	color: inherit;
	background: transparent;
	border: 1px solid var(--wxg-qa-line);
	border-radius: var(--wxg-qa-radius-inner);
	box-shadow: none;
	appearance: none;
	-webkit-appearance: none;
}

.all-questions-answers .free-text-input::placeholder {
	color: inherit;
	opacity: 0.45;
}

.all-questions-answers .free-text-input:hover {
	border-color: color-mix(in srgb, currentColor 28%, transparent);
}

.all-questions-answers .free-text-input:focus {
	outline: none;
	border-color: color-mix(in srgb, currentColor 45%, transparent);
	box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 12%, transparent);
	background: var(--wxg-qa-fill);
}

.all-questions-answers .free-text-input.is-correct,
input.free-text-input.is-correct,
input.correct {
	border-color: var(--wxg-qa-ok) !important;
	background: color-mix(in srgb, var(--wxg-qa-ok) 12%, transparent) !important;
	box-shadow: none;
}

.all-questions-answers .free-text-input.is-incorrect,
input.free-text-input.is-incorrect,
input.incorrect {
	border-color: var(--wxg-qa-bad) !important;
	background: color-mix(in srgb, var(--wxg-qa-bad) 10%, transparent) !important;
	box-shadow: none;
}

.all-questions-answers .free-text-input.is-answered,
input.free-text-input.is-answered {
	border-color: var(--wxg-qa-sel) !important;
	background: color-mix(in srgb, var(--wxg-qa-sel) 10%, transparent) !important;
	box-shadow: none;
}

.correct-answer-display {
	margin: 0.15rem 0 0;
	padding: 0;
	font-size: 0.8rem;
	font-style: normal;
	font-weight: 500;
	line-height: 1.4;
	color: var(--wxg-qa-ok);
}

.wxg-qa__empty {
	margin: 0;
	opacity: 0.7;
	font-size: 0.9rem;
}

.qa-timer {
	font-weight: 700;
	display: inline-block;
	user-select: none;
}
