 :root {
	--bg-cream: #fdfbf7;
	--surface: #ffffff;
	--surface-soft: #f5f1e8;
	--border: #e6dfd3;
	--text-main: #26292c;
	--text-muted: #5f666d;
	--primary: #2d7a59;
	--primary-hover: #236146;
	--accent: #e07a2b;
	--monte-blue: #2563eb; /* Quy chuẩn phụ âm Montessori */
	--monte-red: #dc2626;  /* Quy chuẩn nguyên âm Montessori */
	--zalo-blue: #0068ff;
	--radius-lg: 18px;
	--radius-md: 12px;
	--shadow: 0 6px 24px rgba(38, 41, 44, 0.06);
}

* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

body {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	background-color: var(--bg-cream);
	color: var(--text-main);
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
}

.container {
	max-width: 960px;
	margin: 0 auto;
	padding: 0 16px;
}

.noscript-banner {
	background: #fee2e2;
	color: #991b1b;
	padding: 12px;
	text-align: center;
	font-weight: 600;
}

/* HEADER */
.site-header {
	background: var(--surface);
	border-bottom: 1px solid var(--border);
	position: sticky;
	top: 0;
	z-index: 20;
}

.header-inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding-top: 12px;
	padding-bottom: 12px;
}

.brand {
	display: flex;
	align-items: center;
	gap: 10px;
	text-decoration: none;
	color: inherit;
}

.brand-icon {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: #e8f5ee;
	color: var(--primary);
	display: grid;
	place-items: center;
	font-size: 20px;
}

.brand-title {
	font-weight: 800;
	font-size: 1.1rem;
	color: var(--primary);
}

.brand-sub {
	font-size: 0.8rem;
	color: var(--text-muted);
}

.main-nav {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

.nav-link {
	background: transparent;
	border: none;
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--text-main);
	padding: 7px 12px;
	border-radius: 99px;
	cursor: pointer;
	text-decoration: none;
	transition: background 0.15s;
}

.nav-link:hover {
	background: var(--surface-soft);
}

.nav-link.active {
	background: #e8f5ee;
	color: var(--primary);
}

.btn-zalo-sm {
	background: var(--zalo-blue);
	color: #fff;
	text-decoration: none;
	font-size: 0.85rem;
	font-weight: 700;
	padding: 8px 14px;
	border-radius: 99px;
}

/* NAVIGATION PILLS */
.nav-bar-wrapper {
	background: var(--surface-soft);
	border-bottom: 1px solid var(--border);
	padding: 14px 0;
}

.book-badge {
	font-size: 0.82rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: var(--accent);
	margin-bottom: 8px;
}

.pill-group {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.page-pills {
	margin-top: 8px;
}

.pill-btn {
	border: 1px solid var(--border);
	background: var(--surface);
	color: var(--text-main);
	padding: 7px 14px;
	border-radius: 99px;
	font-size: 0.88rem;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.15s;
}

.pill-btn:hover {
	border-color: var(--primary);
}

.pill-btn.active {
	background: var(--primary);
	border-color: var(--primary);
	color: #fff;
}

.pill-btn.locked::after {
	content: " 🔒";
	font-size: 0.78rem;
}

/* MAIN LESSON LAYOUT */
.main-content {
	padding-top: 20px;
	padding-bottom: 24px;
}

.lesson-grid {
	display: grid;
	grid-template-columns: 1.15fr 0.85fr;
	gap: 20px;
	align-items: start;
}

@media (max-width: 820px) {
	.lesson-grid {
		grid-template-columns: 1fr;
	}
}

.card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	padding: 20px;
	box-shadow: var(--shadow);
}

/* MONTESSORI WORKSHEET (PHIẾU THỰC HÀNH) */
.worksheet-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 12px;
	gap: 8px;
}

.worksheet-title {
	font-size: 1.15rem;
	font-weight: 800;
}

.sample-tag {
	background: #fef3c7;
	color: #92400e;
	font-size: 0.78rem;
	font-weight: 700;
	padding: 4px 10px;
	border-radius: 99px;
	white-space: nowrap;
}

.worksheet-paper {
	position: relative;
	background: #ffffff;
	border: 2px dashed #cbd5e1;
	border-radius: var(--radius-md);
	padding: 18px;
	min-height: 360px;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
}

.worksheet-top {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
}

.phonics-box {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	background: #eff6ff;
	border: 2px solid #bfdbfe;
	border-radius: 16px;
	padding: 10px 18px;
	cursor: pointer;
	user-select: none;
	transition: transform 0.15s;
}

.phonics-box:active {
	transform: scale(0.96);
}

.phonics-hint {
	font-size: 0.72rem;
	font-weight: 700;
	color: var(--monte-blue);
	margin-top: 4px;
}

.trace-path-active {
	stroke-dasharray: 140;
	stroke-dashoffset: 140;
	animation: traceDraw 1.2s ease forwards;
}

@keyframes traceDraw {
	to {
		stroke-dashoffset: 0;
	}
}

.worksheet-tip {
	font-size: 0.82rem;
	color: var(--text-muted);
	max-width: 210px;
	text-align: right;
}

.words-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px;
	margin: 18px 0;
}

.word-item {
	border: 1.5px solid #e2e8f0;
	border-radius: 14px;
	padding: 14px 10px;
	text-align: center;
	cursor: pointer;
	transition: border-color 0.15s, transform 0.15s;
	user-select: none;
}

.word-item:hover {
	border-color: var(--monte-blue);
	transform: translateY(-2px);
}

.word-label {
	font-size: 1.45rem;
	font-weight: 800;
	letter-spacing: 0.02em;
	margin-top: 8px;
}

.word-label .consonant {
	color: var(--monte-blue);
}

.word-label .vowel {
	color: var(--monte-red);
}

.word-sub {
	font-size: 0.8rem;
	color: var(--text-muted);
}

.worksheet-bottom {
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	border-top: 1px solid #f1f5f9;
	padding-top: 10px;
}

.paper-watermark {
	font-size: 0.75rem;
	color: #94a3b8;
}

.sticker-slot {
	width: 68px;
	height: 68px;
	border: 2px dashed #f59e0b;
	border-radius: 50%;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	font-size: 0.72rem;
	font-weight: 700;
	color: #d97706;
	cursor: pointer;
	background: #fffbeb;
	user-select: none;
	transition: transform 0.2s;
}

.sticker-slot.earned {
	border-style: solid;
	background: #fef3c7;
	transform: scale(1.06);
}

.sticker-star {
	font-size: 1.7rem;
	line-height: 1;
}

/* AUDIO PLAYER & BILINGUAL SCRIPT */
.player-card {
	background: #f0fdf4;
	border-color: #bbf7d0;
}

.player-file-tag {
	font-size: 0.76rem;
	font-family: monospace;
	color: #166534;
	background: #dcfce7;
	padding: 4px 8px;
	border-radius: 6px;
	display: inline-block;
	margin-bottom: 10px;
}

.player-controls {
	display: flex;
	align-items: center;
	gap: 10px;
}

.btn-play-main {
	background: var(--primary);
	color: #fff;
	border: none;
	border-radius: 99px;
	padding: 12px 20px;
	font-size: 0.98rem;
	font-weight: 700;
	cursor: pointer;
	white-space: nowrap;
	transition: background 0.15s;
}

.btn-play-main:hover {
	background: var(--primary-hover);
}

.btn-speed {
	background: #ffffff;
	border: 1.5px solid #86efac;
	color: #166534;
	font-weight: 700;
	font-size: 0.85rem;
	padding: 10px 12px;
	border-radius: 99px;
	cursor: pointer;
}

.progress-wrap {
	margin-top: 12px;
}

.progress-wrap input[type="range"] {
	width: 100%;
	accent-color: var(--primary);
	cursor: pointer;
}

.time-row {
	display: flex;
	justify-content: space-between;
	font-size: 0.78rem;
	color: #166534;
	margin-top: 2px;
}

.audio-status {
	margin-top: 10px;
	font-size: 0.82rem;
	color: #15803d;
}

.audio-status.warn {
	background: #fffbeb;
	border: 1px solid #fde68a;
	color: #92400e;
	padding: 8px 10px;
	border-radius: 8px;
}

.local-test-box {
	margin-top: 8px;
}

.btn-local-audio {
	display: inline-block;
	background: #ffffff;
	border: 1px dashed #d97706;
	color: #b45309;
	font-size: 0.8rem;
	font-weight: 600;
	padding: 6px 12px;
	border-radius: 8px;
	cursor: pointer;
}

/* SUBTITLE 3 BEATS */
.subtitles-box {
	margin-top: 16px;
}

.subtitles-title {
	font-size: 0.9rem;
	font-weight: 700;
	margin-bottom: 8px;
	color: var(--text-main);
}

.beat-item {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 10px;
	padding: 10px 12px;
	margin-bottom: 8px;
	cursor: pointer;
	transition: all 0.15s;
}

.beat-item:hover {
	border-color: var(--primary);
}

.beat-item.active {
	background: #ecfdf5;
	border-color: var(--primary);
	box-shadow: 0 2px 8px rgba(45, 122, 89, 0.12);
}

.beat-head {
	display: flex;
	justify-content: space-between;
	font-size: 0.75rem;
	font-weight: 700;
	color: var(--primary);
	margin-bottom: 4px;
}

.beat-text {
	font-size: 0.88rem;
	color: var(--text-main);
}

/* PARENT GUIDE & PREV/NEXT */
.guide-box {
	margin-top: 14px;
	background: var(--surface-soft);
	border-radius: 12px;
	padding: 12px 14px;
	font-size: 0.86rem;
}

.guide-box strong {
	color: var(--primary);
}

.page-stepper {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	margin-top: 18px;
}

.btn-step {
	flex: 1;
	background: var(--surface);
	border: 1px solid var(--border);
	padding: 11px 16px;
	border-radius: 12px;
	font-weight: 700;
	font-size: 0.9rem;
	cursor: pointer;
}

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

.btn-step.next {
	background: var(--primary);
	border-color: var(--primary);
	color: #fff;
}

/* LOCKED PAGE VIEW */
.locked-card {
	text-align: center;
	padding: 36px 20px;
	max-width: 620px;
	margin: 0 auto;
}

.locked-icon {
	font-size: 2.5rem;
	margin-bottom: 8px;
}

.locked-card h2 {
	font-size: 1.3rem;
	margin-bottom: 8px;
}

.locked-card p {
	color: var(--text-muted);
	margin-bottom: 18px;
}

.package-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	margin-bottom: 20px;
	text-align: left;
}

@media (max-width: 540px) {
	.package-grid {
		grid-template-columns: 1fr;
	}
}

.pkg-box {
	border: 1.5px solid var(--border);
	border-radius: 14px;
	padding: 14px;
	background: var(--bg-cream);
}

.pkg-price {
	font-size: 1.25rem;
	font-weight: 800;
	color: var(--primary);
}

/* CTA BANNER */
.cta-banner {
	background: linear-gradient(135deg, #2d7a59 0%, #1f5c42 100%);
	color: #fff;
	border-radius: var(--radius-lg);
	padding: 24px;
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: 18px;
}

.cta-tag {
	font-size: 0.85rem;
	opacity: 0.9;
	margin-bottom: 4px;
}

.cta-text h2 {
	font-size: 1.25rem;
	margin-bottom: 6px;
}

.cta-price {
	font-size: 0.95rem;
	background: rgba(255, 255, 255, 0.14);
	display: inline-block;
	padding: 4px 12px;
	border-radius: 99px;
}

.cta-actions {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.cta-ask {
	font-size: 0.85rem;
	opacity: 0.92;
}

.btn-zalo-lg {
	background: #ffffff;
	color: var(--zalo-blue);
	text-decoration: none;
	font-weight: 800;
	padding: 12px 20px;
	border-radius: 99px;
	text-align: center;
}

.btn-copy-phone {
	background: transparent;
	border: 1px solid rgba(255, 255, 255, 0.5);
	color: #fff;
	font-size: 0.82rem;
	padding: 7px 14px;
	border-radius: 99px;
	cursor: pointer;
}

/* FOOTER */
.site-footer {
	margin-top: 28px;
	border-top: 1px solid var(--border);
	padding: 18px 0 28px;
	font-size: 0.85rem;
	color: var(--text-muted);
}

.footer-inner {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 10px;
}

.site-footer a {
	color: var(--zalo-blue);
	font-weight: 700;
	text-decoration: none;
}

/* MODALS & TOAST */
.modal-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(15, 23, 42, 0.55);
	display: grid;
	place-items: center;
	padding: 16px;
	z-index: 50;
}

.modal-backdrop[hidden] {
	display: none;
}

.modal-card {
	background: var(--surface);
	border-radius: var(--radius-lg);
	max-width: 560px;
	width: 100%;
	max-height: 85vh;
	overflow-y: auto;
	padding: 20px;
}

.modal-wide {
	max-width: 720px;
}

.modal-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	border-bottom: 1px solid var(--border);
	padding-bottom: 10px;
	margin-bottom: 14px;
}

.modal-close {
	background: none;
	border: none;
	font-size: 1.6rem;
	cursor: pointer;
	line-height: 1;
}

.howto-list {
	padding-left: 18px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	font-size: 0.92rem;
}

.syllabus-group {
	margin-bottom: 16px;
}

.syllabus-group h4 {
	color: var(--primary);
	margin-bottom: 8px;
}

.syllabus-item {
	padding: 8px 10px;
	border-bottom: 1px solid #f1f5f9;
	font-size: 0.88rem;
}

.toast {
	position: fixed;
	bottom: 20px;
	left: 50%;
	transform: translateX(-50%) translateY(20px);
	background: #1e293b;
	color: #fff;
	padding: 10px 18px;
	border-radius: 99px;
	font-size: 0.86rem;
	opacity: 0;
	pointer-events: none;
	transition: all 0.25s;
	z-index: 60;
}

.toast.show {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}
