* {
	box-sizing: border-box;
}

body {
	display: grid;
	place-items: center;
	min-height: 100vh;
	margin: 0;
	padding: 1.5rem;
	background: #f4f4f6;
	font-family: system-ui, sans-serif;
	color: #1c1c22;
}

.quiz {
	width: min(32rem, 100%);
	padding: 2rem;
	border-radius: 1.5rem;
	background: #ffffff;
	box-shadow: 0 10px 30px -15px rgb(0 0 0 / 0.25);
}

.quiz-title {
	margin: 0;
	font-size: 1.5rem;
}

.progress {
	margin: 0.25rem 0 1.5rem;
	font-size: 0.875rem;
	color: #6b6b76;
}

.question {
	margin: 0;
	padding: 0;
	border: 0;
}

.question-text {
	margin-bottom: 1rem;
	padding: 0;
	font-size: 1.125rem;
	font-weight: 600;
	line-height: 1.4;
}

.options {
	display: grid;
	gap: 0.5rem;
}

/* The whole card is the label, so a click anywhere on it picks the answer. */
.option {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.875rem 1rem;
	border: 2px solid #e4e4e8;
	border-radius: 0.875rem;
	cursor: pointer;
}

.option:hover {
	border-color: #1c1c22;
}

.option:has(input:checked) {
	border-color: #1c1c22;
	background: #f4f4f6;
}

.option:has(input:focus-visible) {
	outline: 3px solid #2563eb;
	outline-offset: 2px;
}

.option input {
	accent-color: #1c1c22;
}

/* Colour alone isn't enough, so each marked option also says why in words. */
.option.is-correct {
	border-color: #15803d;
	background: #f0fdf4;
}

.option.is-correct::after {
	content: "Correct answer";
	margin-left: auto;
	font-size: 0.75rem;
	font-weight: 600;
	color: #15803d;
}

.option.is-wrong {
	border-color: #b91c1c;
	background: #fef2f2;
}

.option.is-wrong::after {
	content: "Your answer";
	margin-left: auto;
	font-size: 0.75rem;
	font-weight: 600;
	color: #b91c1c;
}

.feedback {
	min-height: 1.5rem;
	margin: 1rem 0;
	font-weight: 600;
}

.quiz-button {
	width: 100%;
	padding: 0.75rem;
	border: 0;
	border-radius: 999px;
	background: #1c1c22;
	font: inherit;
	font-weight: 600;
	color: #ffffff;
	cursor: pointer;
}

.quiz-button:hover {
	background: #3a3a44;
}

.quiz-button:focus-visible {
	outline: 3px solid #2563eb;
	outline-offset: 3px;
}

.results:focus {
	outline: none;
}

.results-title {
	margin: 1.5rem 0 0.25rem;
	font-size: 1rem;
	color: #6b6b76;
}

.results-score {
	margin: 0;
	font-size: 2.5rem;
	font-weight: 700;
}

.results-message {
	margin: 0.5rem 0 1.5rem;
	color: #4b4b55;
}
