/* A-Level Biology Practice Generator - front-end styles */

.abpg-wrapper {
	box-sizing: border-box;
	max-width: 780px;
	margin: 1.5em 0;
	padding: 1.5em;
	background: #ffffff;
	border: 1px solid #e0e2e6;
	border-radius: 10px;
	box-shadow: 0 1px 3px rgba( 0, 0, 0, 0.06 );
	font-size: 15px;
	line-height: 1.5;
}

.abpg-wrapper *,
.abpg-wrapper *::before,
.abpg-wrapper *::after {
	box-sizing: border-box;
}

.abpg-title {
	margin: 0 0 1em;
	font-size: 1.3em;
}

.abpg-controls {
	display: flex;
	flex-wrap: wrap;
	gap: 1.25em;
	margin-bottom: 1.25em;
}

.abpg-field {
	display: flex;
	flex-direction: column;
	gap: 0.4em;
	border: none;
	padding: 0;
	margin: 0;
	min-width: 160px;
}

.abpg-topics-field {
	flex: 1 1 100%;
}

.abpg-label {
	font-weight: 600;
	font-size: 0.85em;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: #4a4f57;
}

.abpg-tier-select,
.abpg-count-input {
	padding: 0.5em 0.6em;
	border: 1px solid #ccced2;
	border-radius: 6px;
	font-size: 1em;
	background: #fff;
	max-width: 220px;
}

.abpg-topics-list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em 0.75em;
	margin-top: 0.25em;
}

.abpg-topic-option {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
	padding: 0.35em 0.7em;
	background: #f4f5f7;
	border: 1px solid #e0e2e6;
	border-radius: 999px;
	font-size: 0.9em;
	cursor: pointer;
	user-select: none;
}

.abpg-topic-option input {
	margin: 0;
}

.abpg-topics-actions {
	margin-top: 0.6em;
	display: flex;
	gap: 1em;
}

.abpg-link-btn {
	background: none;
	border: none;
	padding: 0;
	color: #2563eb;
	font-size: 0.85em;
	cursor: pointer;
	text-decoration: underline;
}

.abpg-link-btn:hover {
	color: #1d4ed8;
}

.abpg-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75em;
	margin-bottom: 1em;
}

.abpg-btn {
	padding: 0.65em 1.3em;
	border-radius: 6px;
	font-size: 0.95em;
	font-weight: 600;
	cursor: pointer;
	border: 1px solid transparent;
}

.abpg-btn-primary {
	background: #2563eb;
	color: #fff;
}

.abpg-btn-primary:hover {
	background: #1d4ed8;
}

.abpg-btn-primary:disabled {
	opacity: 0.6;
	cursor: default;
}

.abpg-btn-secondary {
	background: #fff;
	color: #2563eb;
	border-color: #2563eb;
}

.abpg-btn-secondary:hover {
	background: #eff4ff;
}

.abpg-status {
	min-height: 1.2em;
	color: #4a4f57;
	font-size: 0.9em;
	margin: 0 0 0.75em;
}

.abpg-results {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.9em;
}

.abpg-question-item {
	padding: 1em 1.1em;
	background: #fafbfc;
	border: 1px solid #ececef;
	border-radius: 8px;
	border-left: 4px solid #ececef;
	position: relative;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.abpg-question-item.abpg-item-correct {
	border-left-color: #22a35a;
	background: #f6fdf8;
}

.abpg-question-item.abpg-item-incorrect {
	border-left-color: #dc2626;
	background: #fef8f8;
}

.abpg-question-item.abpg-item-revealed {
	border-left-color: #9ca3af;
	background: #fafafa;
}

.abpg-check-btn {
	padding: 0.5em 1.1em;
	font-size: 0.9em;
}

.abpg-show-answer-link {
	display: inline-block;
	margin-top: 0.1em;
}

.abpg-feedback {
	margin-top: 0.75em;
	padding: 0.75em 0.9em;
	border-radius: 4px;
	border-left: 3px solid #9ca3af;
	background: #f4f5f7;
}

.abpg-feedback p {
	margin: 0 0 0.3em;
}

.abpg-feedback p:last-child {
	margin-bottom: 0;
}

.abpg-feedback-correct {
	background: #eefaf0;
	border-left-color: #22a35a;
}

.abpg-feedback-incorrect {
	background: #fdeeee;
	border-left-color: #dc2626;
}

.abpg-feedback-revealed {
	background: #f4f5f7;
	border-left-color: #9ca3af;
}

.abpg-feedback-neutral {
	background: #fff8e6;
	border-left-color: #d97706;
}

.abpg-feedback-verdict {
	font-weight: 700;
	font-size: 0.95em;
}

.abpg-feedback-correct .abpg-feedback-verdict {
	color: #15803d;
}

.abpg-feedback-incorrect .abpg-feedback-verdict {
	color: #b91c1c;
}

.abpg-working-line {
	color: #374151;
	font-size: 0.92em;
}

.abpg-try-again-link {
	margin-top: 0.4em;
}

.abpg-score-banner {
	margin-bottom: 1em;
	padding: 0.7em 1em;
	background: #eff4ff;
	border: 1px solid #c7d7fe;
	border-radius: 6px;
	font-weight: 600;
	color: #1d4ed8;
}

/* ---- v2: topic groups ---- */

.abpg-topics-list {
	display: flex;
	flex-direction: column;
	gap: 0.9em;
}

.abpg-topic-group-head {
	display: flex;
	align-items: baseline;
	gap: 0.75em;
	margin-bottom: 0.35em;
}

.abpg-topic-group-title {
	font-weight: 700;
	font-size: 0.9em;
	color: #1f2937;
}

.abpg-topic-group-items {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em 0.75em;
}

/* ---- v2: question card ---- */

.abpg-q-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5em 0.75em;
	margin-bottom: 0.55em;
}

.abpg-q-num {
	font-weight: 700;
	color: #111827;
}

.abpg-topic-tag {
	font-size: 0.72em;
	text-transform: uppercase;
	letter-spacing: 0.02em;
	color: #6b7280;
	background: #eef0f3;
	padding: 0.2em 0.55em;
	border-radius: 999px;
}

.abpg-q-marks {
	margin-left: auto;
	font-size: 0.85em;
	font-weight: 600;
	color: #4b5563;
}

.abpg-stem {
	margin: 0 0 0.6em;
}

.abpg-figure {
	margin: 0.4em 0 0.9em;
}

.abpg-diagram {
	display: block;
	max-width: 100%;
	height: auto;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 6px;
}

.abpg-figcaption {
	margin-top: 0.3em;
	font-size: 0.78em;
	font-style: italic;
	color: #6b7280;
}

.abpg-parts {
	display: flex;
	flex-direction: column;
	gap: 1em;
}

.abpg-part + .abpg-part {
	padding-top: 0.9em;
	border-top: 1px dashed #dfe2e7;
}

.abpg-part-head {
	display: flex;
	align-items: baseline;
	gap: 0.6em;
	margin-bottom: 0.5em;
}

.abpg-part-label {
	font-weight: 700;
	min-width: 1.6em;
}

.abpg-part-prompt {
	flex: 1 1 auto;
}

.abpg-part-marks {
	flex: 0 0 auto;
	font-size: 0.82em;
	font-weight: 600;
	color: #4b5563;
	white-space: nowrap;
}

.abpg-answer-row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6em;
	align-items: flex-start;
	margin-bottom: 0.4em;
}

.abpg-answer-stack {
	flex: 1 1 220px;
	min-width: 160px;
}

.abpg-answer-input {
	width: 100%;
	padding: 0.5em 0.7em;
	border: 1px solid #ccced2;
	border-radius: 6px;
	font-size: 0.95em;
}

.abpg-answer-input:disabled {
	background: #f3f4f6;
	color: #4b5563;
}

.abpg-symbols {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35em;
	margin-top: 0.4em;
}

.abpg-symbol-btn {
	min-width: 2.1em;
	padding: 0.2em 0.55em;
	font-size: 0.95em;
	line-height: 1.3;
	color: #1f2937;
	background: #f4f5f7;
	border: 1px solid #d5d8de;
	border-radius: 5px;
	cursor: pointer;
}

.abpg-symbol-btn:hover {
	background: #e8ecf5;
}

.abpg-choices {
	flex: 1 1 260px;
	display: flex;
	flex-direction: column;
	gap: 0.4em;
}

.abpg-choice {
	display: flex;
	align-items: flex-start;
	gap: 0.55em;
	padding: 0.45em 0.7em;
	background: #fff;
	border: 1px solid #d5d8de;
	border-radius: 6px;
	cursor: pointer;
}

.abpg-choice:hover {
	background: #f6f8fd;
}

.abpg-choice input {
	margin-top: 0.3em;
}

.abpg-note {
	color: #92400e;
	font-size: 0.92em;
}

.abpg-check-btn:focus-visible,
.abpg-answer-input:focus-visible,
.abpg-symbol-btn:focus-visible,
.abpg-link-btn:focus-visible {
	outline: 2px solid #2563eb;
	outline-offset: 2px;
}

@media ( max-width: 480px ) {
	.abpg-wrapper {
		padding: 1em;
	}

	.abpg-part-head {
		flex-wrap: wrap;
	}

	.abpg-part-marks {
		margin-left: auto;
	}

	.abpg-answer-row {
		flex-direction: column;
		align-items: stretch;
	}

	.abpg-q-marks {
		margin-left: 0;
	}
}
