:root {
	color-scheme: light dark;
	--bg: #f8faf6;
	--bg-card: #ffffff;
	--bg-subtle: #eff4ec;
	--fg: #19241b;
	--fg-muted: #536456;
	--border: #dce5d9;
	--border-focus: #2e6945;
	
	--primary: #25603a;
	--primary-hover: #1e4f30;
	--primary-light: #e8f3ec;
	--primary-text: #ffffff;
	
	--success: #1f7a45;
	--success-bg: #e6f7ec;
	--success-border: #a4e2ba;
	
	--wrong: #b8332a;
	--wrong-bg: #fbeeed;
	--wrong-border: #f2aba5;

	--radius-sm: 8px;
	--radius: 14px;
	--radius-lg: 20px;
	--space: 1.25rem;
	--font: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
	--font-display: "Outfit", var(--font);
	--shadow: 0 4px 20px -2px rgba(25, 36, 27, 0.05), 0 2px 6px -1px rgba(25, 36, 27, 0.03);
	--shadow-lg: 0 12px 32px -4px rgba(25, 36, 27, 0.08);
}

@media (prefers-color-scheme: dark) {
	:root {
		--bg: #0f1712;
		--bg-card: #152219;
		--bg-subtle: #1c2e22;
		--fg: #ecf3ed;
		--fg-muted: #95a898;
		--border: #263c2e;
		--border-focus: #52a874;
		
		--primary: #40955f;
		--primary-hover: #4eab6f;
		--primary-light: #183322;
		--primary-text: #ffffff;
		
		--success: #52ba7d;
		--success-bg: #12331f;
		--success-border: #245837;
		
		--wrong: #e06d65;
		--wrong-bg: #351a18;
		--wrong-border: #632a26;
		
		--shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.3);
		--shadow-lg: 0 12px 32px -4px rgba(0, 0, 0, 0.4);
	}
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	background-color: var(--bg);
	color: var(--fg);
	font-family: var(--font);
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

#root {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

.shell {
	max-width: 44rem;
	width: 100%;
	margin: 0 auto;
	padding: calc(var(--space) * 1.5) var(--space) calc(var(--space) * 3);
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}

/* Header */
.header-nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding-bottom: 1rem;
	border-bottom: 1px solid var(--border);
}

.brand {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	text-decoration: none;
	color: var(--fg);
	font-weight: 700;
	font-family: var(--font-display);
	font-size: 1.15rem;
	letter-spacing: -0.01em;
}

.brand-icon {
	width: 32px;
	height: 32px;
	background: var(--primary-light);
	color: var(--primary);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.1rem;
}

.tag-pill {
	font-size: 0.8rem;
	font-weight: 600;
	padding: 0.25rem 0.65rem;
	border-radius: 999px;
	background: var(--bg-subtle);
	color: var(--fg-muted);
	border: 1px solid var(--border);
}

/* Minimalist Card */
.card-main {
	background: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	padding: 2rem;
	box-shadow: var(--shadow);
	transition: all 0.2s ease;
}

@media (max-width: 480px) {
	.card-main {
		padding: 1.4rem;
	}
}

/* Typography */
h1, h2, h3 {
	font-family: var(--font-display);
	color: var(--fg);
	letter-spacing: -0.02em;
	line-height: 1.25;
	margin-top: 0;
}

h1 {
	font-size: clamp(1.8rem, 5vw, 2.3rem);
	margin-bottom: 0.5rem;
}

h2 {
	font-size: 1.4rem;
	margin-bottom: 0.75rem;
}

p {
	margin: 0 0 1rem;
	color: var(--fg);
}

.text-muted {
	color: var(--fg-muted);
}

.lede {
	font-size: 1.08rem;
	color: var(--fg-muted);
	line-height: 1.55;
	margin-bottom: 1.5rem;
}

/* Feature grid on Entrance */
.feature-list {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(12rem, 100%), 1fr));
	gap: 0.85rem;
	margin: 1.5rem 0 2rem;
}

.feature-item {
	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
	padding: 0.85rem 1rem;
	background: var(--bg-subtle);
	border-radius: var(--radius);
	border: 1px solid var(--border);
	font-size: 0.9rem;
}

.feature-icon {
	font-size: 1.2rem;
	flex-shrink: 0;
	line-height: 1;
}

/* Options / Buttons */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.8rem 1.4rem;
	border-radius: var(--radius);
	border: 1px solid transparent;
	font-family: var(--font);
	font-weight: 600;
	font-size: 0.95rem;
	cursor: pointer;
	text-decoration: none;
	transition: all 0.15s ease;
	user-select: none;
}

.btn-primary {
	background: var(--primary);
	color: var(--primary-text);
	box-shadow: 0 2px 8px rgba(37, 96, 58, 0.25);
}

.btn-primary:hover {
	background: var(--primary-hover);
	transform: translateY(-1px);
}

.btn-primary:active {
	transform: translateY(0);
}

.btn-outline {
	background: transparent;
	border-color: var(--border);
	color: var(--fg);
}

.btn-outline:hover {
	background: var(--bg-subtle);
	border-color: var(--border-focus);
}

.btn-block {
	width: 100%;
}

/* Selector Tabs */
.mode-picker {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.75rem;
	margin-bottom: 1.75rem;
}

.mode-card {
	padding: 1rem;
	border: 2px solid var(--border);
	background: var(--bg-card);
	border-radius: var(--radius);
	cursor: pointer;
	text-align: left;
	transition: all 0.15s ease;
}

.mode-card:hover {
	border-color: var(--border-focus);
}

.mode-card.active {
	border-color: var(--primary);
	background: var(--primary-light);
}

.mode-title {
	font-weight: 600;
	display: block;
	margin-bottom: 0.2rem;
	font-size: 0.95rem;
}

.mode-desc {
	font-size: 0.8rem;
	color: var(--fg-muted);
}

/* Progress bar */
.quiz-progress-bar {
	width: 100%;
	height: 6px;
	background: var(--bg-subtle);
	border-radius: 999px;
	overflow: hidden;
	margin-bottom: 1.25rem;
}

.quiz-progress-fill {
	height: 100%;
	background: var(--primary);
	border-radius: 999px;
	transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.question-meta {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 0.85rem;
	color: var(--fg-muted);
	font-weight: 500;
	margin-bottom: 0.75rem;
}

.question-text {
	font-size: clamp(1.15rem, 3.5vw, 1.35rem);
	font-weight: 600;
	margin-bottom: 1.5rem;
	line-height: 1.4;
}

/* Answers stack */
.answers-stack {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	margin-bottom: 1.5rem;
}

.answer-option {
	display: flex;
	align-items: center;
	gap: 1rem;
	padding: 1rem 1.15rem;
	border-radius: var(--radius);
	border: 1.5px solid var(--border);
	background: var(--bg-card);
	color: var(--fg);
	cursor: pointer;
	font-family: var(--font);
	font-size: 0.95rem;
	text-align: left;
	line-height: 1.4;
	transition: all 0.15s ease;
	width: 100%;
}

.answer-option:hover:not(:disabled) {
	border-color: var(--border-focus);
	background: var(--bg-subtle);
	transform: translateY(-1px);
}

.answer-key {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	border: 1px solid var(--border);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--fg-muted);
	flex-shrink: 0;
	background: var(--bg-subtle);
	transition: all 0.15s ease;
}

.answer-option.selected {
	border-color: var(--primary);
	background: var(--primary-light);
}

.answer-option.selected .answer-key {
	border-color: var(--primary);
	background: var(--primary);
	color: #fff;
}

.answer-option.correct {
	border-color: var(--success-border);
	background: var(--success-bg);
	color: var(--fg);
}

.answer-option.correct .answer-key {
	border-color: var(--success);
	background: var(--success);
	color: #ffffff;
}

.answer-option.incorrect {
	border-color: var(--wrong-border);
	background: var(--wrong-bg);
	color: var(--fg);
}

.answer-option.incorrect .answer-key {
	border-color: var(--wrong);
	background: var(--wrong);
	color: #ffffff;
}

/* Feedback box */
.feedback-box {
	padding: 1rem 1.25rem;
	border-radius: var(--radius);
	margin-bottom: 1.5rem;
	font-size: 0.92rem;
	line-height: 1.5;
	display: flex;
	gap: 0.75rem;
	align-items: flex-start;
	animation: fadeIn 0.25s ease-out;
}

.feedback-box.correct {
	background: var(--success-bg);
	border: 1px solid var(--success-border);
	color: var(--fg);
}

.feedback-box.incorrect {
	background: var(--wrong-bg);
	border: 1px solid var(--wrong-border);
	color: var(--fg);
}

.feedback-icon {
	font-size: 1.25rem;
	line-height: 1;
	margin-top: 0.1rem;
}

@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(4px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Score Screen */
.score-hero {
	text-align: center;
	padding: 1rem 0 1.5rem;
}

.score-badge-circle {
	width: 90px;
	height: 90px;
	border-radius: 50%;
	background: var(--primary-light);
	color: var(--primary);
	font-family: var(--font-display);
	font-size: 1.8rem;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto 1.25rem;
	border: 2px solid var(--border-focus);
}

.score-title {
	font-size: 1.6rem;
	margin-bottom: 0.4rem;
}

.score-subtitle {
	color: var(--fg-muted);
	font-size: 1rem;
	max-width: 28rem;
	margin: 0 auto 1.5rem;
}

/* Practical Takeaway Tips */
.tips-section {
	margin-top: 2rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--border);
}

.tips-title {
	font-size: 1.1rem;
	margin-bottom: 1rem;
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.tips-cards {
	display: grid;
	gap: 0.75rem;
}

.tip-card {
	display: flex;
	gap: 0.75rem;
	align-items: flex-start;
	background: var(--bg-subtle);
	padding: 0.9rem 1rem;
	border-radius: var(--radius-sm);
	font-size: 0.88rem;
}

.tip-num {
	width: 22px;
	height: 22px;
	background: var(--primary);
	color: #fff;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 0.75rem;
	font-weight: 700;
	flex-shrink: 0;
	margin-top: 0.15rem;
}

/* Question review list */
.review-list {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	margin: 1.5rem 0;
}

.review-item {
	padding: 0.85rem 1rem;
	border-radius: var(--radius-sm);
	border: 1px solid var(--border);
	font-size: 0.88rem;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 0.5rem;
}

.review-item.pass {
	border-left: 4px solid var(--success);
}

.review-item.fail {
	border-left: 4px solid var(--wrong);
}

/* Footer */
.footer {
	margin-top: auto;
	text-align: center;
	font-size: 0.82rem;
	color: var(--fg-muted);
	padding: 1.5rem 0;
}

:where(a, button, input, select, textarea):focus-visible {
	outline: 2px solid var(--primary);
	outline-offset: 2px;
}
