:root {
    --ink: #0b1b33;
    --paper: #ffffff;
    --muted: #5b6678;
    --line: #e1e6ee;
    --soft: #f4f6fa;
    --accent: #2f6fed;
    --radius: 10px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

a { color: inherit; }

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

.site-header { border-bottom: 1px solid var(--line); background: var(--paper); }
.site-header .bar { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: inline-flex; align-items: center; text-decoration: none; }
.brand img { display: block; height: 30px; width: auto; }
.nav { display: flex; gap: 20px; }
.nav a { text-decoration: none; color: var(--muted); }
.nav a:hover { color: var(--ink); }

main { padding-top: 32px; padding-bottom: 56px; min-height: 60vh; }

h1 { font-size: 2rem; line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 12px; }
h2 { font-size: 1.35rem; margin: 40px 0 16px; }
h3 { margin: 0 0 6px; font-size: 1.05rem; }

.muted { color: var(--muted); }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 640px; }

.hero { padding: 40px 0 16px; }
.hero h1 { font-size: 2.5rem; max-width: 720px; }

.btn {
    display: inline-block;
    padding: 10px 20px;
    border: 1px solid var(--ink);
    border-radius: var(--radius);
    background: var(--ink);
    color: var(--paper);
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}
.btn:hover { background: var(--accent); border-color: var(--accent); }
.btn.disabled { background: var(--soft); color: var(--muted); border-color: var(--line); cursor: not-allowed; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }

.card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    background: var(--paper);
}
.card:hover { border-color: var(--ink); }
.card-thumb { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--soft); }
.card-thumb.placeholder { display: flex; align-items: center; justify-content: center; font-size: 3rem; font-weight: 800; color: var(--accent); }
.card-body { padding: 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-body p { margin: 0; font-size: 0.95rem; }
.price { font-weight: 700; margin-top: auto; padding-top: 8px; }
.price.big { font-size: 1.5rem; margin-right: 16px; }

.meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 0.85rem; }
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    font-size: 0.78rem;
    font-weight: 600;
    background: var(--soft);
}
.badge-public { border-color: #b7d9c3; background: #eef8f1; }
.badge-free { border-color: #d3d9e4; background: #f1f4f9; }
.badge-paid { border-color: #bdd0f8; background: #edf3fe; }

.filters { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 28px; }
.filters input, .filters select {
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font: inherit;
    background: var(--paper);
}
.filters input[type="search"] { flex: 1 1 220px; }

.course-head { padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.cta { display: flex; align-items: center; margin: 20px 0 24px; }
.prose { max-width: 720px; }

.section-block { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; }
.lessons { list-style: none; margin: 8px 0 0; padding: 0; }
.lessons li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.lessons li:first-child { border-top: 0; }

.pagination-wrap { margin-top: 28px; }
.pagination-wrap nav { display: flex; gap: 12px; }

.site-footer { border-top: 1px solid var(--line); padding: 24px 0; color: var(--muted); font-size: 0.85rem; }

@media (max-width: 600px) {
    h1, .hero h1 { font-size: 1.75rem; }
    .cta { flex-wrap: wrap; gap: 12px; }
}

/* ---- Tài khoản (Bản 2) ---- */
.nav { align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.nav-user { color: var(--ink); font-weight: 600; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inline-form { display: inline; margin: 0; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); cursor: pointer; text-decoration: underline; }
.link-btn:hover { color: var(--ink); }
.btn.btn-sm { padding: 6px 14px; font-size: 0.9rem; color: var(--paper); }
.btn.block { display: block; width: 100%; text-align: center; margin-top: 16px; }

.flash { border: 1px solid #b7d9c3; background: #eef8f1; border-radius: var(--radius); padding: 10px 14px; margin-bottom: 20px; }

.auth-card { max-width: 420px; margin: 8px auto 0; }
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; margin-bottom: 4px; font-size: 0.95rem; }
.field input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font: inherit;
    background: var(--paper);
    color: var(--ink);
}
.field input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.hint { margin: 4px 0 0; font-size: 0.85rem; color: var(--muted); }
.error { margin: 4px 0 0; font-size: 0.9rem; color: #b42318; }
.check { display: flex; gap: 8px; align-items: center; font-size: 0.9rem; color: var(--muted); }
.small { font-size: 0.9rem; }

@media (max-width: 600px) {
    .site-header .bar { height: auto; padding-top: 10px; padding-bottom: 10px; gap: 8px; flex-wrap: wrap; }
    .nav { gap: 14px; }
    .nav-user { display: none; }
}

/* ---- Trang chủ (Bản 3A) ---- */
:root { --bull: #17935f; --bear: #d3453f; }

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

.site-header { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, 0.94); backdrop-filter: blur(8px); }
.badge { color: var(--ink); }

.btn.btn-ghost { background: transparent; color: var(--ink); }
.btn.btn-ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn.btn-invert { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.btn.btn-invert:hover { background: var(--accent); color: var(--paper); border-color: var(--accent); }
.btn.btn-outline-invert { background: transparent; color: var(--paper); border-color: rgba(255, 255, 255, 0.5); }
.btn.btn-outline-invert:hover { background: rgba(255, 255, 255, 0.12); border-color: var(--paper); color: var(--paper); }

/* Phần đầu trang: tiêu đề bên trái, sổ lệnh minh họa bên phải */
.arena { display: grid; gap: 40px; padding: 16px 0 24px; align-items: center; }
.arena h1 { font-size: clamp(2.1rem, 5.2vw, 3.5rem); line-height: 1.08; letter-spacing: -0.035em; font-weight: 800; margin: 0 0 20px; max-width: 16ch; }
.arena .lead { margin: 0 0 28px; }
.arena-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.fine { margin: 16px 0 0; font-size: 0.85rem; color: var(--muted); }

.ladder { margin: 0; border: 1px solid var(--line); border-radius: 12px; padding: 16px 16px 12px; background: var(--paper); font-variant-numeric: tabular-nums; }
.ladder-head, .rung { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; column-gap: 12px; }
.ladder-head { margin-bottom: 8px; font-size: 0.82rem; font-weight: 700; }
.ladder-head .bull { color: var(--bull); }
.ladder-head .bear { color: var(--bear); text-align: right; }
.ladder-px { color: var(--muted); font-weight: 500; }
.rung { height: 30px; border-top: 1px solid var(--soft); padding: 0 6px; }
.rung.is-last { background: rgba(47, 111, 237, 0.1); border-radius: 6px; outline: 1px solid var(--accent); border-top-color: transparent; }
.rung-px { min-width: 84px; text-align: center; font: 0.85rem ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.rung.is-last .rung-px { font-weight: 800; }
.ladder .bar { display: block; height: 16px; }
.ladder .bar i { display: block; height: 100%; border-radius: 3px; }
.ladder .bar-bid i { background: var(--bull); transform-origin: right center; transform: scaleX(var(--bid)); }
.ladder .bar-ask i { background: var(--bear); transform-origin: left center; transform: scaleX(var(--ask)); }
.tug { display: flex; height: 8px; margin: 14px 0 10px; border-radius: 999px; overflow: hidden; }
.tug-bull { width: var(--share); background: var(--bull); }
.tug-bear { flex: 1; background: var(--bear); }
.ladder figcaption { font-size: 0.82rem; color: var(--muted); }

@keyframes surge-bid { from { transform: scaleX(calc(var(--bid) * 0.55)); } to { transform: scaleX(var(--bid)); } }
@keyframes surge-ask { from { transform: scaleX(calc(var(--ask) * 0.55)); } to { transform: scaleX(var(--ask)); } }
@media (prefers-reduced-motion: no-preference) {
    .ladder .bar-bid i { animation: surge-bid 3.6s ease-in-out infinite alternate; animation-delay: calc(var(--i) * -0.45s); }
    .ladder .bar-ask i { animation: surge-ask 3.6s ease-in-out infinite alternate-reverse; animation-delay: calc(var(--i) * -0.45s); }
}

/* Các khối nội dung */
.band { margin-top: 64px; padding-top: 56px; border-top: 1px solid var(--line); }
.band-title { font-size: clamp(1.6rem, 3.4vw, 2.2rem); line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 14px; }
.band-lead { max-width: 62ch; margin: 0 0 32px; color: var(--muted); font-size: 1.08rem; }

.versus { display: grid; gap: 16px; }
.versus .side { padding: 20px 22px; border-radius: 10px; }
.versus h3 { margin: 0 0 6px; font-size: 1.15rem; }
.versus p { margin: 0; color: var(--muted); }
.side-bull { border-left: 4px solid var(--bull); background: #f3faf6; }
.side-bear { border-left: 4px solid var(--bear); background: #fcf4f3; }

.topics { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 32px; margin: 36px 0 0; }
.topics > div { padding: 14px 0; border-top: 1px solid var(--line); }
.topics dt { font-weight: 700; }
.topics dd { margin: 2px 0 0; color: var(--muted); }

.levels { display: grid; gap: 20px; }
.level-panel { display: flex; flex-direction: column; padding: 28px; border: 1px solid var(--ink); border-radius: 12px; }
.level-panel h3 { margin: 0 0 6px; font-size: 1.5rem; letter-spacing: -0.01em; }
.level-for { margin: 0; color: var(--muted); }
.level-list { margin: 18px 0 22px; padding-left: 1.1em; }
.level-list li { margin-bottom: 6px; }
.level-courses { margin-top: auto; border-top: 1px solid var(--line); }
.level-empty { margin: 14px 0; color: var(--muted); }
.level-link { display: inline-block; margin-top: 16px; font-weight: 600; }
.level-panel.is-pro { background: var(--ink); color: var(--paper); }
.level-panel.is-pro .level-for, .level-panel.is-pro .level-empty { color: rgba(255, 255, 255, 0.72); }
.level-panel.is-pro .level-courses { border-top-color: rgba(255, 255, 255, 0.22); }

.course-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.course-row:hover .course-row-title { color: var(--accent); }
.course-row-title { font-weight: 600; }
.course-row-meta { display: flex; align-items: center; gap: 10px; flex-shrink: 0; font-size: 0.85rem; }
.course-row-price { font-weight: 700; }
.is-pro .course-row { border-bottom-color: rgba(255, 255, 255, 0.22); }

.whom { display: grid; gap: 28px; }
.whom h3 { margin: 0 0 8px; font-size: 1.25rem; }
.whom p { margin: 0; max-width: 56ch; }

.results { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.result { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.result img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--soft); }
.result-body { padding: 14px 16px 16px; }
.result-body h3 { margin: 8px 0 4px; }
.result-body p { margin: 0; font-size: 0.95rem; }
.result-body .result-date { margin-top: 8px; font-size: 0.85rem; color: var(--muted); }

.faq { max-width: 760px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { padding: 16px 0; font-weight: 600; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; font-weight: 400; font-size: 1.3rem; line-height: 1.2; }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { margin: 0 0 16px; color: var(--muted); max-width: 64ch; }

.cta-band { margin-top: 72px; padding: 48px 28px; background: var(--ink); color: var(--paper); border-radius: 14px; }
.cta-band h2 { margin: 0 0 8px; font-size: clamp(1.5rem, 3.2vw, 2rem); letter-spacing: -0.02em; }
.cta-band p { margin: 0 0 22px; color: rgba(255, 255, 255, 0.75); }

.site-footer { margin-top: 24px; padding: 40px 0 28px; }
.foot-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; }
.foot-note { max-width: 38ch; margin: 8px 0 0; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.foot-links a { text-decoration: none; }
.foot-links a:hover { color: var(--ink); text-decoration: underline; }
.risk { max-width: 80ch; margin: 28px 0 8px; }
.copy { margin: 0; }

@media (min-width: 800px) {
    .versus { grid-template-columns: 1fr 1fr; }
    .whom { grid-template-columns: 1fr 1fr; gap: 48px; }
}
@media (min-width: 900px) {
    .arena { grid-template-columns: 1.05fr 0.95fr; gap: 56px; padding-top: 32px; }
    .levels { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
    .band { margin-top: 48px; padding-top: 40px; }
    .level-panel { padding: 22px; }
    .cta-band { padding: 36px 22px; }
    .course-row { flex-direction: column; align-items: flex-start; gap: 6px; }
    .rung-px { min-width: 72px; font-size: 0.78rem; }
}

@media (max-width: 600px) {
    .nav-home { display: none; }
}

/* ---- Trang học (Bản 3B) ---- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.tick { display: inline-block; margin-right: 6px; color: var(--bull); font-weight: 700; }
.lesson-link { text-decoration: none; }
.lesson-link:hover { color: var(--accent); }
.notice { margin: 0 0 16px; padding: 10px 14px; border: 1px solid #bdd0f8; background: #edf3fe; border-radius: var(--radius); }

.learn { display: grid; gap: 32px; }
.learn-main { min-width: 0; }
.learn-main h1 { margin-bottom: 16px; }
.crumbs { margin: 0 0 6px; font-size: 0.9rem; color: var(--muted); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }

.video-frame { position: relative; aspect-ratio: 16 / 9; background: var(--ink); border-radius: var(--radius); overflow: hidden; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: rgba(255, 255, 255, 0.75); }

.lesson-notes { margin-top: 24px; }
.lesson-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.lesson-actions form { margin: 0; }
.lesson-nav { display: flex; gap: 10px; flex-wrap: wrap; }

.learn-side { min-width: 0; }
.learn-side h2 { margin: 0 0 8px; font-size: 1.1rem; }
.progress { height: 6px; margin: 6px 0 14px; background: var(--soft); border-radius: 999px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--accent); }
.side-section { margin-bottom: 14px; }
.side-section h3 { margin: 0 0 4px; font-size: 0.95rem; color: var(--muted); }
.side-lessons { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.side-lessons li { border-top: 1px solid var(--line); }
.side-lessons li:first-child { border-top: 0; }
.side-lessons a, .side-lessons .locked { display: block; padding: 10px 12px; font-size: 0.95rem; text-decoration: none; }
.side-lessons a:hover { background: var(--soft); }
.side-lessons .locked { color: var(--muted); }
.side-lessons .is-current { background: var(--soft); box-shadow: inset 3px 0 0 var(--accent); font-weight: 600; }

.my-courses { display: grid; gap: 16px; max-width: 760px; }
.my-course { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); }
.my-course h3 { margin: 6px 0 2px; }
.my-course h3 a { text-decoration: none; }
.my-course h3 a:hover { color: var(--accent); }
.my-course .progress { width: min(320px, 60vw); }
.my-course p { margin: 0; }

@media (min-width: 960px) {
    .learn { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
    .learn-side { position: sticky; top: 76px; }
}
@media (max-width: 600px) {
    .my-course { flex-direction: column; align-items: flex-start; }
}

/* ---- Bài kiểm tra (Bản 4) ---- */
.quiz { max-width: 760px; }
.q { margin: 0 0 20px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); }
.q legend { padding: 0 6px; font-weight: 600; max-width: 100%; }
.q-no { display: inline-block; margin-right: 8px; color: var(--accent); }
.opt { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-top: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; }
label.opt { justify-content: flex-start; }
label.opt:hover { border-color: var(--ink); }
label.opt input { margin-top: 5px; }
label.opt:has(input:checked) { border-color: var(--ink); background: var(--soft); }
div.opt { cursor: default; }
.opt.is-correct { border-color: var(--bull); background: #f3faf6; }
.opt.is-wrong { border-color: var(--bear); background: #fcf4f3; }
.opt-tag { flex-shrink: 0; font-size: 0.82rem; font-weight: 700; }
.opt.is-correct .opt-tag { color: var(--bull); }
.opt.is-wrong .opt-tag { color: var(--bear); }
.q-verdict { display: inline-block; margin-right: 8px; font-size: 0.85rem; font-weight: 700; }
.q-verdict.is-right { color: var(--bull); }
.q-verdict.is-wrong { color: var(--bear); }
.explain { margin: 12px 0 0; padding: 10px 12px; background: var(--soft); border-radius: var(--radius); font-size: 0.95rem; }
.result-score { display: flex; align-items: center; gap: 16px; margin: 0 0 24px; padding: 18px 20px; border: 1px solid var(--line); border-left-width: 4px; border-radius: var(--radius); }
.result-score strong { font-size: 2rem; line-height: 1; }
.result-score.is-pass { border-left-color: var(--bull); background: #f3faf6; }
.result-score.is-fail { border-left-color: var(--bear); background: #fcf4f3; }
.side-score { display: block; font-size: 0.8rem; font-weight: 600; color: var(--muted); }

/* Thanh toán / đơn hàng (Bản 5) */
.pay { max-width: 760px; }
.pay-grid { display: grid; grid-template-columns: 300px 1fr; gap: 24px; align-items: start; margin: 16px 0; }
.pay-qr { text-align: center; }
.pay-qr img { width: 100%; max-width: 280px; height: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.pay-info { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; }
.pay-info dt { color: var(--muted); }
.pay-info dd { margin: 0; overflow-wrap: anywhere; }
.pay-code { font-size: 1.25rem; letter-spacing: 0.04em; color: var(--accent); }
.orders { display: grid; gap: 12px; }
.order-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); }
.order-row p { margin: 4px 0 0; }
.order-side { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
@media (max-width: 640px) {
    .pay-grid { grid-template-columns: 1fr; }
    .order-row { flex-direction: column; align-items: flex-start; }
}
.pay-qr-box { width: 100%; max-width: 280px; margin: 0 auto 8px; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.pay-qr-box svg { display: block; width: 100%; height: auto; }

/* Trang pháp lý */
.legal { max-width: 760px; }
.legal h2 { font-size: 1.2rem; margin: 28px 0 8px; }
.legal p, .legal li { line-height: 1.7; }
.legal ul { padding-left: 22px; }


/* ---- Đợt 2: liên hệ, Zalo, review, kết quả ---- */
.field textarea, .field select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font: inherit;
    background: var(--paper);
    color: var(--ink);
}
.field textarea:focus, .field select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.contact { max-width: 640px; }
.contact-ways { list-style: none; padding: 0; margin: 0 0 24px; }
.contact-ways li { padding: 4px 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.zalo-fab {
    position: fixed; right: 18px; bottom: 18px; z-index: 50;
    padding: 12px 18px; border-radius: 999px;
    background: #0068ff; color: #fff; font-weight: 700; text-decoration: none;
    box-shadow: 0 6px 18px rgba(0, 40, 120, 0.3);
}
.zalo-fab:hover { background: #0050c8; color: #fff; }
.reviews { margin-top: 40px; }
.review { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; }
.review-head { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: baseline; }
.review .stars { color: #e6a100; letter-spacing: 2px; font-size: 1.05rem; }
.review p { margin: 8px 0 0; white-space: pre-line; }
.review-form-wrap { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 20px 0; background: var(--soft); }
.review-form-wrap h3 { margin-top: 0; }
.star-pick { display: flex; gap: 14px; flex-wrap: wrap; border: 0; padding: 0; margin: 0 0 14px; }
.star-pick legend { font-weight: 600; margin-bottom: 4px; padding: 0; }
.star-pick label { display: inline-flex; gap: 4px; align-items: center; cursor: pointer; }
.results-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
.results-filter a { padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--muted); font-size: 0.92rem; }
.results-filter a.is-active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.result a.result-img { display: block; }

/* ---- Tài liệu bài học ---- */
.attachments { margin-top: 24px; }
.attachments h2 { font-size: 1.1rem; margin: 0 0 8px; }
.attachments ul { list-style: none; padding: 0; margin: 0; border: 1px solid var(--line); border-radius: var(--radius); }
.attachments li { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--line); }
.attachments li:first-child { border-top: 0; }
.att-title { font-weight: 600; }
.att-actions { margin-left: auto; display: flex; gap: 14px; }

/* ---- Khung QR Zalo (máy tính) ---- */
.zalo-panel {
    position: fixed; right: 18px; bottom: 72px; z-index: 51; width: 240px;
    padding: 16px; text-align: center;
    background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: 0 10px 28px rgba(11, 27, 51, 0.22);
}
.zalo-panel[hidden] { display: none; }
.zalo-panel p { margin: 0 0 8px; }
.zalo-qr { width: 180px; height: 180px; margin: 0 auto 8px; }
.zalo-qr svg { width: 100%; height: 100%; display: block; }
.zalo-close { position: absolute; top: 4px; right: 8px; border: 0; background: none; font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--muted); }
.zalo-close:hover { color: var(--ink); }

/* ---- Review trong Khóa học của tôi ---- */
.my-course { flex-wrap: wrap; }

/* ---- Menu 3 gạch trên điện thoại ---- */
.nav-toggle { display: none; }
@media (max-width: 760px) {
    .site-header .bar { height: 60px; padding-top: 0; padding-bottom: 0; flex-wrap: nowrap; position: relative; }
    .js .nav-toggle {
        display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
        width: 44px; height: 44px; padding: 0 10px; margin-right: -10px;
        background: none; border: 0; cursor: pointer;
    }
    .nav-toggle span { display: block; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .2s, opacity .2s; }
    .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
    .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
    .js .nav {
        display: none; position: absolute; left: 0; right: 0; top: 100%;
        flex-direction: column; align-items: stretch; gap: 0; flex-wrap: nowrap;
        background: var(--paper); border-bottom: 1px solid var(--line); box-shadow: 0 8px 16px rgba(0, 0, 0, .08);
        padding: 6px 16px 12px;
    }
    .js .nav.is-open { display: flex; }
    .js .nav a, .js .nav .link-btn { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 1.05rem; text-align: left; }
    .js .nav .nav-home { display: block; }
    .js .nav .nav-user { display: block; max-width: none; padding: 12px 0 4px; }
    .js .nav .btn { margin-top: 10px; text-align: center; border-bottom: 0; }
    .js .nav .inline-form { display: block; }
    .js .nav .inline-form .link-btn { width: 100%; border-bottom: 0; }
}

/* ---- Đợt 5: slogan, nút Đăng nhập, mạng xã hội, 3 level ---- */
.slogan { margin: 0 0 14px; font-size: 0.95rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.foot-slogan { margin: 10px 0 0; font-weight: 700; color: var(--accent); }
.btn.btn-login { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.btn.btn-login:hover { background: #1f57c7; border-color: #1f57c7; }
.levels { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.social { display: flex; flex-wrap: wrap; gap: 12px; list-style: none; margin: 16px 0 0; padding: 0; }
.social a { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); transition: background .15s, color .15s, border-color .15s; }
.social a:hover { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.social-band .social { margin-top: 0; }
@media (max-width: 760px) {
    .js .nav .btn-login { margin-top: 10px; }
    .js .nav .btn-login + .btn { margin-top: 8px; }
}

/* Trang chủ: khóa học dạng thẻ (ảnh, tên, tag level, giá) */
.level-group + .level-group { margin-top: 48px; }
.level-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 8px 24px; margin-bottom: 18px; }
.level-head h3 { margin: 0 0 4px; font-size: 1.5rem; letter-spacing: -0.01em; }
.level-head .level-for { max-width: 62ch; }
.level-head .level-link { margin-top: 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.tile { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--paper); text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.tile:hover { border-color: var(--ink); box-shadow: 0 6px 18px rgba(11, 27, 51, 0.1); }
.tile-media { position: relative; }
.tile-media img, .tile-ph { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--soft); }
.tile-ph { display: flex; align-items: center; justify-content: center; font-size: 3rem; font-weight: 800; color: var(--accent); }
.tile-level { position: absolute; left: 10px; top: 10px; padding: 3px 11px; border-radius: 999px; font-size: 0.78rem; font-weight: 700; background: var(--paper); color: var(--ink); box-shadow: 0 1px 4px rgba(11, 27, 51, 0.2); }
.tile-level.lvl-action { background: var(--accent); color: #fff; }
.tile-level.lvl-master { background: var(--ink); color: #fff; }
.tile-body { display: flex; flex-direction: column; gap: 8px; flex: 1; padding: 14px 16px 16px; }
.tile-title { margin: 0; font-size: 1.05rem; line-height: 1.3; color: var(--ink); }
.tile:hover .tile-title { color: var(--accent); }
.tile-price { margin-top: auto; font-weight: 700; color: var(--ink); }
