/**
 * Theme: Exam — inline answer review, bordered options, marks per question.
 */

/* Question layout */
.qm-theme--exam .qm-quiz__questions {
	list-style: none;
	padding: 0;
	margin: 0;
}

.qm-theme--exam .qm-question {
	margin-bottom: 2rem;
	padding: 0;
	border: none;
	box-shadow: none;
	background: transparent;
}

.qm-theme--exam .qm-question__prompt {
	font-weight: 700;
	font-size: 1rem;
	margin-bottom: .75rem;
	line-height: 1.5;
	color: #1a1a1a;
}

.qm-theme--exam .qm-question__number {
	color: #1a1a1a;
	margin-right: .4rem;
}

.qm-theme--exam .qm-question__marks {
	font-weight: 400;
	color: #555;
	font-size: .9rem;
}

/* Options list */
.qm-theme--exam .qm-question__options {
	list-style: none;
	padding: 0;
	margin: 0;
	display: grid;
	gap: .5rem;
}

.qm-theme--exam .qm-option {
	position: relative;
}

.qm-theme--exam .qm-option label {
	display: flex;
	align-items: center;
	gap: .75rem;
	padding: .75rem 1rem;
	border: 1px solid #e0e0e0;
	border-radius: 6px;
	background: #fff;
	cursor: pointer;
	transition: border-color .15s, background .15s, box-shadow .15s;
}

.qm-theme--exam .qm-option label:hover {
	border-color: #b0b0b0;
	box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

/* Custom radio: gray square */
.qm-theme--exam .qm-option input[type="radio"] {
	-webkit-appearance: none;
	appearance: none;
	width: 24px;
	height: 24px;
	min-width: 24px;
	border: 2px solid #d0d0d0;
	border-radius: 4px;
	background: #f5f5f5;
	cursor: pointer;
	position: relative;
	transition: all .15s;
}

.qm-theme--exam .qm-option input[type="radio"]:checked {
	background: #e8f4fd;
	border-color: #2271b1;
}

.qm-theme--exam .qm-option input[type="radio"]:checked::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 10px;
	height: 10px;
	background: #2271b1;
	border-radius: 2px;
}

.qm-theme--exam .qm-option__text {
	font-size: .95rem;
	color: #333;
}

/* === POST-SUBMIT STATES (applied via JS) === */

/* Correct answer highlight */
.qm-theme--exam .qm-option.is-correct label {
	border-color: #28a745;
	border-left: 4px solid #28a745;
	background: #f0faf3;
}

.qm-theme--exam .qm-option.is-correct input[type="radio"] {
	border-color: #28a745;
	background: #28a745;
}

.qm-theme--exam .qm-option.is-correct input[type="radio"]::after {
	content: '✓';
	width: auto;
	height: auto;
	background: none;
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	border-radius: 0;
}

/* Wrong selected answer */
.qm-theme--exam .qm-option.is-wrong label {
	border-color: #dc3545;
	border-left: 4px solid #dc3545;
	background: #fef5f5;
}

.qm-theme--exam .qm-option.is-wrong input[type="radio"] {
	border-color: #dc3545;
	background: #dc3545;
}

.qm-theme--exam .qm-option.is-wrong input[type="radio"]::after {
	content: '✗';
	width: auto;
	height: auto;
	background: none;
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	border-radius: 0;
}

/* Dim non-selected, non-correct options after submit */
.qm-theme--exam .qm-option.is-neutral label {
	opacity: .7;
	border-color: #e8e8e8;
}

/* Question-level marks after submit */
.qm-theme--exam .qm-question__marks-result {
	font-weight: 400;
	font-size: .9rem;
	color: #555;
	margin-left: .3rem;
}

/* Submit button */
.qm-theme--exam .qm-btn--submit {
	background: #2271b1;
	padding: .8rem 2rem;
	font-size: 1rem;
	border-radius: 6px;
}

.qm-theme--exam .qm-btn--submit:hover {
	background: #135e96;
}

/* After submit: disable all interactions */
.qm-theme--exam.qm-submitted .qm-option label {
	cursor: default;
	pointer-events: none;
}

.qm-theme--exam.qm-submitted .qm-option input[type="radio"] {
	cursor: default;
	pointer-events: none;
}

/* Score summary at top after submit */
.qm-theme--exam .qm-quiz__score-banner {
	background: #f8f9fa;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	padding: 1rem 1.5rem;
	margin-bottom: 1.5rem;
	font-size: 1rem;
}

.qm-theme--exam .qm-quiz__score-banner strong {
	color: #2271b1;
}
