/* AMC Quiz – frontend. Colours can be overridden in your theme via these variables. */
.amcq {
	--amcq-navy: #14305a;
	--amcq-navy-dark: #0c2143;
	--amcq-gold: #b8862b;
	--amcq-ink: #1d2433;
	--amcq-muted: #5b6475;
	--amcq-line: #d9dee7;
	--amcq-soft: #f2f5f9;
	--amcq-right: #1e7b4a;
	--amcq-wrong: #b3261e;
	--amcq-radius: 10px;

	box-sizing: border-box;
	max-width: 720px;
	margin: 2rem auto;
	padding: clamp(1.25rem, 4vw, 2.25rem);
	background: #fff;
	color: var(--amcq-ink);
	border: 1px solid var(--amcq-line);
	border-top: 4px solid var(--amcq-gold);
	border-radius: var(--amcq-radius);
	font-family: inherit;
	line-height: 1.55;
}

.amcq *,
.amcq *::before,
.amcq *::after {
	box-sizing: inherit;
}

.amcq [hidden] {
	display: none !important;
}

/* ---------- Start screen ---------- */
.amcq-title {
	margin: 0 0 0.5rem;
	color: var(--amcq-navy);
	font-size: clamp(1.5rem, 4vw, 2rem);
	line-height: 1.2;
}

.amcq-intro {
	color: var(--amcq-muted);
}

.amcq-intro p {
	margin: 0 0 0.75rem;
}

.amcq-meta {
	margin: 0 0 1.5rem;
	padding: 0.6rem 0.9rem;
	background: var(--amcq-soft);
	border-radius: 6px;
	color: var(--amcq-navy);
}

.amcq-field {
	margin-bottom: 1rem;
}

.amcq-field label {
	display: block;
	margin-bottom: 0.35rem;
	font-weight: 600;
}

.amcq-optional {
	font-weight: 400;
	color: var(--amcq-muted);
	font-size: 0.9em;
}

.amcq-field input,
.amcq-field select {
	display: block;
	width: 100%;
	min-height: 46px;
	padding: 0.6rem 0.8rem;
	border: 1px solid #b8c0cd;
	border-radius: 6px;
	background: #fff;
	color: var(--amcq-ink);
	font: inherit;
}

.amcq-field input:focus,
.amcq-field select:focus {
	outline: 3px solid rgba(184, 134, 43, 0.35);
	outline-offset: 1px;
	border-color: var(--amcq-navy);
}

.amcq-note {
	margin-top: 1rem;
	color: var(--amcq-muted);
}

.amcq-error {
	margin: 0 0 1rem;
	padding: 0.65rem 0.9rem;
	border-left: 4px solid var(--amcq-wrong);
	background: #fdf1f0;
	color: var(--amcq-wrong);
	border-radius: 4px;
}

/* ---------- Buttons ---------- */
.amcq-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 46px;
	padding: 0.65rem 1.5rem;
	border: 2px solid var(--amcq-navy);
	border-radius: 999px;
	font: inherit;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	text-decoration: none;
	transition: background-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.amcq-btn--primary {
	background: var(--amcq-navy);
	color: #fff;
}

.amcq-btn--primary:hover:not(:disabled) {
	background: var(--amcq-navy-dark);
	border-color: var(--amcq-navy-dark);
}

.amcq-btn--ghost {
	background: transparent;
	color: var(--amcq-navy);
}

.amcq-btn--ghost:hover:not(:disabled) {
	background: var(--amcq-soft);
}

.amcq-btn:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

.amcq-btn:focus-visible,
.amcq-option:has(.amcq-option__input:focus-visible) {
	outline: 3px solid var(--amcq-gold);
	outline-offset: 2px;
}

/* ---------- Question screen ---------- */
.amcq-progress {
	margin-bottom: 1.5rem;
}

.amcq-progress__label {
	margin: 0 0 0.4rem;
	color: var(--amcq-muted);
	font-size: 0.95rem;
	font-variant-numeric: tabular-nums;
}

.amcq-progress__track {
	height: 6px;
	background: var(--amcq-soft);
	border-radius: 999px;
	overflow: hidden;
}

.amcq-progress__bar {
	display: block;
	height: 100%;
	background: var(--amcq-gold);
	border-radius: inherit;
	transition: width 0.3s ease;
}

.amcq-question {
	margin: 0;
	padding: 0;
	border: 0;
	min-width: 0;
}

.amcq-question__text {
	display: block;
	width: 100%;
	margin: 0 0 1.25rem;
	padding: 0;
	color: var(--amcq-navy);
	font-size: clamp(1.15rem, 3vw, 1.4rem);
	font-weight: 700;
	line-height: 1.35;
}

.amcq-question__text:focus {
	outline: none;
}

.amcq-options {
	display: grid;
	gap: 0.65rem;
}

.amcq-option {
	position: relative;
	display: flex;
	align-items: center;
	gap: 0.85rem;
	min-height: 54px;
	padding: 0.7rem 1rem;
	border: 2px solid var(--amcq-line);
	border-radius: 8px;
	background: #fff;
	cursor: pointer;
	transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.amcq-option:hover {
	border-color: var(--amcq-navy);
}

.amcq-option__input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
}

.amcq-option__key {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	border-radius: 50%;
	background: var(--amcq-soft);
	color: var(--amcq-navy);
	font-weight: 700;
	font-size: 0.9rem;
}

.amcq-option__text {
	flex: 1 1 auto;
}

.amcq-option.is-selected {
	border-color: var(--amcq-navy);
	background: var(--amcq-navy);
	color: #fff;
}

.amcq-option.is-selected .amcq-option__key {
	background: var(--amcq-gold);
	color: #fff;
}

.amcq-nav {
	display: flex;
	justify-content: flex-end;
	gap: 0.75rem;
	margin-top: 1.5rem;
}

.amcq-nav .amcq-btn--ghost {
	margin-right: auto;
}

/* ---------- Result screen ---------- */
.amcq-screen--result {
	text-align: center;
}

.amcq-score {
	padding: 1.5rem 1rem 1rem;
}

.amcq-score__value {
	margin: 0;
	color: var(--amcq-navy);
	font-size: clamp(3.5rem, 14vw, 5.5rem);
	font-weight: 800;
	line-height: 1;
	font-variant-numeric: tabular-nums;
}

.amcq-score__max {
	margin: 0.35rem 0 0;
	color: var(--amcq-gold);
	font-weight: 700;
	font-size: 1.1rem;
}

.amcq-score__summary {
	margin: 0.5rem 0 0.25rem;
	font-size: 1.1rem;
	font-weight: 600;
}

.amcq-score__message {
	margin: 0 0 1.5rem;
	color: var(--amcq-muted);
}

.amcq-actions {
	margin-bottom: 1.75rem;
}

.amcq-review {
	text-align: left;
	border-top: 1px solid var(--amcq-line);
	padding-top: 1rem;
}

.amcq-review summary {
	cursor: pointer;
	color: var(--amcq-navy);
	font-weight: 700;
	padding: 0.4rem 0;
}

.amcq-review__list {
	margin: 1rem 0 0;
	padding-left: 1.4rem;
}

.amcq-review__item {
	margin-bottom: 1rem;
	padding: 0.75rem 0.9rem;
	border-left: 4px solid var(--amcq-line);
	background: var(--amcq-soft);
	border-radius: 4px;
}

.amcq-review__item.is-right {
	border-left-color: var(--amcq-right);
}

.amcq-review__item.is-wrong {
	border-left-color: var(--amcq-wrong);
}

.amcq-review__q {
	margin: 0 0 0.35rem;
	font-weight: 600;
}

.amcq-review__yours,
.amcq-review__correct {
	margin: 0;
}

.amcq-review__item.is-right .amcq-review__yours {
	color: var(--amcq-right);
}

.amcq-review__item.is-wrong .amcq-review__yours {
	color: var(--amcq-wrong);
}

.amcq-review__correct {
	color: var(--amcq-right);
}

.amcq-review__label {
	color: var(--amcq-muted);
	font-weight: 600;
}

@media (max-width: 480px) {
	.amcq {
		margin: 1rem 0;
		border-left: 0;
		border-right: 0;
		border-radius: 0;
	}

	.amcq-nav {
		flex-direction: column-reverse;
	}

	.amcq-nav .amcq-btn {
		width: 100%;
		margin: 0;
	}

	.amcq-form .amcq-btn--primary {
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.amcq * {
		transition: none !important;
	}
}
