/* LMS Landing Funnel – giao diện landing "danh sách bài (trái) + video (phải)" */

:root {
	--bg: #FAF6F0;
	--surface: #ffffff;
	--ink: #1F2A24;
	--muted: #66756C;
	--line: #E9E3D9;
	--brand: #2E7D32;
	--brand-d: #1B5E20;
	--brand-l: #EAF3EC;
	--cta: #D84315;
	--cta-d: #BF360C;
	--cta-l: #FBE9E4;
	--top: 60px;
	--r: 16px;
	--shadow: 0 1px 2px rgba(31, 42, 36, .06), 0 10px 28px rgba(31, 42, 36, .08);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.mbl {
	margin: 0;
	font-family: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
	color: var(--ink);
	background: var(--bg);
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}
body.mbl.modal-open { overflow: hidden; }
.mbl button { font: inherit; cursor: pointer; }
.mbl [hidden] { display: none !important; }
.mbl img { max-width: 100%; }

/* ---------- Buttons ---------- */
.mbl-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	border: 0; border-radius: 999px; padding: 11px 20px;
	font-weight: 700; font-size: 15px; line-height: 1.15; text-decoration: none;
	transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
	-webkit-tap-highlight-color: transparent;
}
.mbl-btn--cta { background: var(--cta); color: #fff; box-shadow: 0 6px 16px rgba(214, 75, 47, .28); }
.mbl-btn--cta:hover { background: var(--cta-d); transform: translateY(-1px); box-shadow: 0 10px 22px rgba(214, 75, 47, .32); }
.mbl-btn--cta:active { transform: translateY(0); }
.mbl-btn--ghost { background: #fff; color: var(--brand); border: 1.5px solid #cfe0d5; padding: 9px 16px; font-size: 14px; }
.mbl-btn--ghost:hover { background: var(--brand-l); }
.mbl-btn--ghost[disabled] { opacity: .4; cursor: default; background: #fff; }
.mbl-btn--lg { padding: 16px 26px; font-size: 17px; }
.mbl-btn--block { width: 100%; }
.mbl-btn:focus-visible, .mbl-lesson:focus-visible, .mbl-link:focus-visible, .mbl-copy:focus-visible, .mbl-close:focus-visible, .mbl-play:focus-visible {
	outline: 3px solid rgba(47, 107, 79, .45); outline-offset: 2px;
}
.mbl-link { background: none; border: 0; padding: 8px 4px; color: var(--brand); font-weight: 600; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.mbl-link--center { display: block; margin: 8px auto 0; }

/* ---------- Header ---------- */
.mbl-top {
	position: sticky; top: 0; z-index: 60;
	display: flex; align-items: center; justify-content: space-between; gap: 12px;
	min-height: var(--top); padding: 8px 16px;
	background: rgba(255, 255, 255, .94); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
	border-bottom: 1px solid var(--line);
}
.mbl-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); min-width: 0; }
.mbl-brand img { border-radius: 10px; object-fit: contain; }
.mbl-brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.mbl-brand-text strong { font-size: 15px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mbl-brand-text small { font-size: 12px; color: var(--brand); font-weight: 600; }
.mbl-top-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.mbl-chip {
	display: none; padding: 8px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 600;
	color: var(--brand); background: var(--brand-l); text-decoration: none;
}
.mbl-chip:hover { background: #d7e8dd; }
.mbl-pill {
	display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px;
	background: var(--brand-l); color: var(--brand); font-weight: 700; font-size: 13px;
}
.mbl-top-cta { display: none; padding: 10px 16px; font-size: 14px; } /* mobile đã có thanh CTA cố định ở đáy */

.mbl-banner {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 12px;
	width: 100%; padding: 10px 16px; border: 0; background: #fff4d6; color: #6b4d00;
	font-size: 13.5px; text-align: center; border-bottom: 1px solid #f0dca0;
}
.mbl-banner span { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Layout: mobile (xếp dọc, video dính trên cùng) ---------- */
.mbl-app { display: grid; grid-template-columns: 1fr; }
.mbl-stage, .mbl-stage-inner { display: contents; }
.mbl-player-wrap { order: 1; position: sticky; top: var(--top); z-index: 40; background: #0f1613; }
.mbl-now { order: 2; padding: 16px 16px 4px; }
/* Mobile: khối chào bán (giá + nút mua) nằm TRÊN danh sách bài cho khách dễ thấy; học viên đã mở khóa thì khối này không được in ra. */
.mbl-offer { order: 3; margin: 16px; }
.mbl-list { order: 4; background: var(--surface); }
.mbl-foot { order: 5; padding: 8px 16px 24px; color: var(--muted); font-size: 12.5px; }
body.has-sticky { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }

/* ---------- Player ---------- */
.mbl-player { position: relative; aspect-ratio: 16 / 9; background: #0f1613; overflow: hidden; }
.mbl-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.mbl-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mbl-play {
	position: absolute; inset: 0; width: 100%; border: 0; padding: 0; color: #fff;
	display: grid; place-items: center;
	background: linear-gradient(180deg, rgba(0, 0, 0, .06), rgba(0, 0, 0, .38));
}
.mbl-play-btn {
	display: grid; place-items: center; width: 74px; height: 74px; border-radius: 50%;
	background: var(--cta); box-shadow: 0 10px 30px rgba(0, 0, 0, .35); padding-left: 4px;
	transition: transform .18s ease;
}
.mbl-play:hover .mbl-play-btn { transform: scale(1.07); }
.mbl-empty {
	position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
	color: #e9efe9; text-align: center; padding: 16px;
	background: radial-gradient(120% 120% at 20% 10%, #2d5b45 0%, #17261f 70%);
}
.mbl-empty strong { font-size: 17px; }
.mbl-empty span { font-size: 13.5px; opacity: .8; }
.mbl-end {
	position: absolute; inset: 0; z-index: 3; display: flex; align-items: center; justify-content: center; padding: 12px;
	background: rgba(15, 22, 19, .88); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.mbl-end-box { text-align: center; color: #fff; max-width: 420px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.mbl-end-title { margin: 0; font-size: 19px; font-weight: 800; }
.mbl-end-sub { margin: 0 0 8px; font-size: 14px; opacity: .85; }
.mbl-end .mbl-link { color: #cfe6d6; }

/* ---------- Tên bài + điều hướng ---------- */
.mbl-eyebrow { margin: 0 0 4px; font-size: 13px; font-weight: 700; color: var(--brand); letter-spacing: .02em; }
.mbl-now h1 { margin: 0 0 12px; font-size: 21px; line-height: 1.3; font-weight: 800; }
.mbl-nav { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Danh sách bài ---------- */
.mbl-list-head { padding: 18px 16px 10px; border-top: 8px solid var(--bg); }
.mbl-list-head h2 { margin: 0; font-size: 17px; font-weight: 800; }
.mbl-list-head p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.mbl-free-count { color: var(--brand); font-weight: 700; }
.mbl-lessons { list-style: none; margin: 0; padding: 4px 8px 12px; }
/* Tiêu đề phần (nhóm bài học) */
.mbl-section {
	margin: 14px 4px 4px; padding: 6px 8px 6px 10px;
	font-size: 12.5px; font-weight: 700; letter-spacing: .02em; line-height: 1.35;
	color: var(--brand-d); background: var(--brand-l); border-radius: 8px;
}
.mbl-lessons > .mbl-section:first-child { margin-top: 4px; }
.mbl-lesson {
	display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 12px;
	width: 100%; padding: 11px 10px; border: 0; border-radius: 12px; background: transparent;
	color: inherit; text-align: left; -webkit-tap-highlight-color: transparent;
	transition: background-color .12s ease;
}
.mbl-lesson:hover { background: #f5f1ea; }
.mbl-lesson .n {
	display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
	background: var(--brand-l); color: var(--brand); font-weight: 800; font-size: 13px;
}
.mbl-lesson .body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mbl-lesson .t {
	font-weight: 600; font-size: 14.5px; line-height: 1.35;
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mbl-lesson .m { font-size: 12px; color: var(--muted); }
.mbl-lesson .st { display: flex; align-items: center; color: var(--muted); }
.mbl-lesson .ic-open { color: var(--brand); display: flex; }
.badge-free {
	font-size: 11px; font-weight: 800; letter-spacing: .02em; color: var(--brand); background: #fff;
	border: 1px solid #b6d4c1; border-radius: 999px; padding: 3px 9px; white-space: nowrap;
}
.mbl-lesson.is-locked .n { background: #efebe4; color: #8b918a; }
.mbl-lesson.is-locked .t { color: #7b857e; font-weight: 500; }
.mbl-lesson.is-locked .ico-lock { color: #a2a9a3; }
.mbl-lesson.is-current { background: var(--brand-l); box-shadow: inset 3px 0 0 var(--brand); }
.mbl-lesson.is-current .n { background: var(--brand); color: #fff; }
.mbl-lesson.is-current .t { color: var(--brand-d); font-weight: 700; }

/* ---------- Thẻ chào bán ---------- */
.mbl-offer {
	display: grid; gap: 20px; padding: 22px 18px;
	background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow);
	position: relative; overflow: hidden;
}
.mbl-offer::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: linear-gradient(180deg, var(--brand), #6fae8a); }
.mbl-offer-kicker { margin: 0 0 4px; font-size: 12.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--brand); }
.mbl-offer h2 { margin: 0 0 14px; font-size: 20px; line-height: 1.3; font-weight: 800; }
.mbl-benefits { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.mbl-benefits li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; font-size: 14.5px; align-items: start; }
.mbl-benefits .ico { color: var(--brand); background: var(--brand-l); border-radius: 50%; padding: 4px; width: 22px; height: 22px; }
.mbl-offer-buy { display: flex; flex-direction: column; gap: 12px; }
.mbl-price { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.mbl-price-num { font-size: 34px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); }
.mbl-price-note { font-size: 13.5px; color: var(--muted); }
.mbl-offer-fine { margin: 0; font-size: 12.5px; color: var(--muted); }
.mbl-offer .mbl-btn--lg { width: 100%; }

/* ---------- Thanh CTA dính đáy (mobile) ---------- */
.mbl-sticky {
	position: fixed; left: 0; right: 0; bottom: 0; z-index: 55;
	display: flex; align-items: center; justify-content: space-between; gap: 12px;
	padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
	background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -8px 24px rgba(31, 42, 36, .1);
}
.mbl-sticky-price { display: flex; flex-direction: column; line-height: 1.15; }
.mbl-sticky-price strong { font-size: 19px; font-weight: 800; }
.mbl-sticky-price small { font-size: 12px; color: var(--muted); }
.mbl-sticky .mbl-btn { padding: 13px 22px; font-size: 15.5px; }

/* ---------- Popup ---------- */
.mbl-modal {
	position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center;
	padding: 16px; background: rgba(18, 30, 24, .58); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
	overscroll-behavior: contain;
}
.mbl-modal.is-open { display: flex; }
.mbl-card {
	position: relative; width: 100%; max-width: 440px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px);
	overflow-y: auto; padding: 28px 24px 22px; background: #fff; border-radius: 24px;
	box-shadow: 0 30px 80px rgba(0, 0, 0, .35); animation: mbl-pop .22s ease-out; outline: none;
}
.mbl-card h2 { margin: 0 0 12px; font-size: 22px; line-height: 1.25; font-weight: 800; padding-right: 28px; }
.mbl-close {
	position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border: 0; border-radius: 50%;
	background: #f2eee7; color: #55625a; font-size: 24px; line-height: 1; display: grid; place-items: center; padding: 0 0 3px;
}
.mbl-close:hover { background: #e8e2d8; }
.mbl-ctx { margin: 0 0 6px; font-size: 13px; font-weight: 700; color: var(--cta); }
.mbl-ctx:empty { display: none; }
.mbl-sum {
	display: flex; align-items: center; justify-content: space-between; gap: 12px;
	padding: 11px 14px; margin-bottom: 16px; border-radius: 12px; background: var(--brand-l);
	font-size: 13.5px; color: var(--brand-d);
}
.mbl-sum strong { font-size: 17px; white-space: nowrap; }
.mbl-field { margin-bottom: 14px; }
.mbl-field label { display: block; margin-bottom: 5px; font-size: 13.5px; font-weight: 700; }
.mbl-field input {
	width: 100%; height: 52px; padding: 0 14px; border: 1.5px solid #d9d2c6; border-radius: 12px;
	font: inherit; font-size: 16px; /* 16px: tránh iOS tự zoom */ color: var(--ink); background: #fff;
	transition: border-color .15s ease, box-shadow .15s ease;
}
.mbl-field input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(47, 107, 79, .15); }
.mbl-field.has-error input { border-color: #c0392b; }
.mbl-err { display: block; min-height: 0; margin: 4px 0 0; font-size: 12.5px; color: #c0392b; }
.mbl-err:empty { display: none; }
.mbl-err--form { margin: 0 0 10px; text-align: center; font-size: 13.5px; }
.mbl-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.mbl-secure { margin: 12px 0 0; text-align: center; font-size: 12.5px; color: var(--muted); }

.mbl-btn .spin { display: none; width: 18px; height: 18px; border: 3px solid rgba(255, 255, 255, .45); border-top-color: #fff; border-radius: 50%; animation: mbl-spin .7s linear infinite; }
.mbl-btn.is-loading { pointer-events: none; opacity: .85; }
.mbl-btn.is-loading .spin { display: inline-block; }

.mbl-ok-kicker { margin: 0 0 4px; font-size: 13px; font-weight: 800; color: var(--brand); }
.mbl-note { margin: 0 0 14px; font-size: 14px; color: #44514a; }
.mbl-note:empty { display: none; }
.mbl-qr { display: flex; justify-content: center; margin-bottom: 12px; }
.mbl-qr img { width: 200px; height: 200px; border: 1px solid var(--line); border-radius: 14px; background: #fff; padding: 6px; }
.mbl-bank { margin: 0 0 10px; padding: 4px 14px; border: 1px solid var(--line); border-radius: 14px; background: #fcfaf6; }
.mbl-bank > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px dashed #e4ddd0; }
.mbl-bank > div:last-child { border-bottom: 0; }
.mbl-bank dt { font-size: 12.5px; color: var(--muted); flex-shrink: 0; }
.mbl-bank dd { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 600; text-align: right; word-break: break-all; }
.mbl-memo dd strong { color: var(--cta); font-size: 16px; }
.mbl-copy { border: 0; border-radius: 8px; padding: 5px 10px; background: var(--brand-l); color: var(--brand); font-size: 12px; font-weight: 700; flex-shrink: 0; }
.mbl-copy.is-copied { background: var(--brand); color: #fff; }
.mbl-hint { margin: 0 0 16px; font-size: 12.5px; color: var(--muted); text-align: center; }
.mbl-done-ic { display: grid; place-items: center; width: 56px; height: 56px; margin: 4px 0 14px; border-radius: 50%; background: var(--brand-l); color: var(--brand); }
.mbl-done-ic .ico { width: 30px; height: 30px; }

@keyframes mbl-pop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes mbl-slide { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes mbl-spin { to { transform: rotate(360deg); } }

@media (max-width: 560px) {
	.mbl-modal { align-items: flex-end; padding: 0; }
	.mbl-card { max-width: none; border-radius: 24px 24px 0 0; max-height: 92vh; max-height: 92dvh; animation: mbl-slide .26s ease-out; padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
}

/* ---------- Tablet ---------- */
@media (min-width: 640px) {
	.mbl-top { padding: 8px 24px; }
	.mbl-chip { display: inline-flex; }
	.mbl-top-cta { display: inline-flex; }
	.mbl-now, .mbl-list-head { padding-left: 24px; padding-right: 24px; }
	.mbl-lessons { padding: 4px 16px 12px; }
	.mbl-offer { margin: 20px 24px; padding: 26px 26px 26px 30px; }
	.mbl-foot { padding: 8px 24px 28px; }
}

/* ---------- Desktop: TRÁI = danh sách bài, PHẢI = video ---------- */
@media (min-width: 1024px) {
	body.mbl { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
	body.mbl.has-sticky { padding-bottom: 0; }
	.mbl-top { position: static; flex-shrink: 0; padding: 8px 28px; }
	.mbl-banner { flex-shrink: 0; }
	.mbl-sticky { display: none; }

	.mbl-app { flex: 1; min-height: 0; grid-template-columns: minmax(340px, 400px) minmax(0, 1fr); }
	.mbl-list { order: 0; overflow-y: auto; border-right: 1px solid var(--line); overscroll-behavior: contain; }
	.mbl-list-head { position: sticky; top: 0; z-index: 2; background: var(--surface); border-top: 0; border-bottom: 1px solid var(--line); padding: 18px 20px 12px; }
	.mbl-lessons { padding: 8px 10px 24px; }

	.mbl-stage { display: block; order: 0; overflow-y: auto; padding: 24px 32px 40px; overscroll-behavior: contain; }
	.mbl-stage-inner { display: block; max-width: 940px; margin: 0 auto; }
	.mbl-player-wrap { position: static; background: none; }
	.mbl-player { border-radius: 18px; box-shadow: var(--shadow); }
	.mbl-now { padding: 18px 0 4px; }
	.mbl-now h1 { font-size: 26px; }
	.mbl-offer { margin: 24px 0 0; grid-template-columns: minmax(0, 1.25fr) minmax(250px, 1fr); gap: 32px; padding: 28px 32px 28px 36px; align-items: center; }
	.mbl-offer h2 { font-size: 22px; }
	.mbl-foot { padding: 28px 0 0; }
}

@media (min-width: 1280px) {
	.mbl-app { grid-template-columns: 420px minmax(0, 1fr); }
	.mbl-stage { padding: 28px 44px 48px; }
}

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


/* ---------- Đăng nhập (học viên đã mua) ---------- */
.mbl-top-login {
	background: none; border: 0; padding: 8px 6px; color: var(--brand-d); font-weight: 700; font-size: 14px; cursor: pointer;
	text-decoration: underline; text-underline-offset: 3px; white-space: nowrap;
}
.mbl-top-login:hover { color: var(--brand); }
.mbl-top-link { color: var(--muted); font-size: 13px; font-weight: 600; text-decoration: none; padding: 6px 4px; }
.mbl-top-link:hover { color: var(--ink); text-decoration: underline; }
.mbl-switch { margin: 12px 0 0; text-align: center; color: var(--muted); font-size: 14px; }
.mbl-switch .mbl-link { padding: 4px 2px; }
.mbl-pw { position: relative; }
.mbl-pw input { padding-right: 76px; }
.mbl-pw-toggle {
	position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: var(--brand-l); color: var(--brand-d);
	border: 0; border-radius: 8px; padding: 7px 12px; font-weight: 700; font-size: 13px; cursor: pointer;
}
.mbl-tip {
	display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; padding: 9px 16px;
	background: var(--brand-l); color: var(--brand-d); font-size: 14px; text-align: center;
}
.mbl-tip[hidden] { display: none; }
.mbl-tip a { color: var(--brand-d); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.mbl-tip button { background: none; border: 0; font-size: 20px; line-height: 1; color: var(--brand-d); cursor: pointer; padding: 0 4px; }
@media (max-width: 639px) {
	/* Điện thoại: giữ nút Đăng nhập trên đầu trang, ẩn chip Zalo/hotline cho đỡ chật (hotline vẫn có ở chân/email) */
	.mbl-top-actions .mbl-chip { display: none; }
}


/* QR: khung chờ có hiệu ứng, ảnh hiện dần khi tải xong */
.mbl-qr { position: relative; width: 200px; height: 200px; margin: 0 auto 12px; }
.mbl-qr::before {
	content: ""; position: absolute; inset: 0; border-radius: 14px; border: 1px solid var(--line);
	background: linear-gradient(100deg, #efeae0 30%, #f8f4ec 50%, #efeae0 70%); background-size: 200% 100%; animation: mblShimmer 1.2s linear infinite;
}
.mbl-qr img { position: relative; opacity: 0; transition: opacity .25s ease; }
.mbl-qr.is-ready img { opacity: 1; }
.mbl-qr.is-ready::before { display: none; }
@keyframes mblShimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .mbl-qr::before { animation: none; } }
