/* Khóa học của Khoa · một file CSS cho mọi trang. Màu đổi ở :root. */
:root {
  --ink: #14213D;
  --muted: #4A5568;
  --line: #DDE3EC;
  --bg: #FFFFFF;
  --alt: #F3F5F9;
  --accent: #2F5BEA;
  --accent-ink: #1E3FAF;
  --accent-soft: #E7EDFD;
  --accent-bg: #F7F9FF;
  --cta: #F2A541;
  --cta-ink: #8A5200;
  --cta-soft: #FFF1DA;
  --ok: #1F7A45;
  --no: #B4441C;
  --r: 14px;
  --r-sm: 10px;
  --wrap: 1120px;
  --font: "Be Vietnam Pro", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--font); }
img, video, iframe { max-width: 100%; display: block; }
a { color: var(--accent-ink); }
h1, h2, h3 { margin: 0; line-height: 1.2; text-wrap: balance; }
h1 { font-size: clamp(34px, 6vw, 56px); line-height: 1.1; font-weight: 800; max-width: 860px; }
h2 { font-size: clamp(26px, 4vw, 36px); font-weight: 800; }
h3 { font-size: 18px; font-weight: 700; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
section { padding: 80px 0; }
section.alt { background: var(--alt); }
.stack { display: flex; flex-direction: column; gap: 28px; }
.stack-sm { display: flex; flex-direction: column; gap: 12px; }
.center { text-align: center; align-items: center; }
.narrow { max-width: 820px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.mono { font-family: var(--mono); font-weight: 500; color: var(--accent); }
.eyebrow { font-family: var(--mono); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.lead { font-size: clamp(17px, 2.2vw, 20px); color: var(--muted); max-width: 760px; }
.sec-head { display: flex; flex-direction: column; gap: 10px; }
.sec-head .eyebrow { color: var(--accent); }
.sec-head .lead { font-size: 18px; }
mark.todo { background: #FFE58A; color: var(--ink); padding: 0 3px; border-radius: 4px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; z-index: 50; background: var(--bg); padding: 8px 12px; }

/* Nút */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 26px;
  border-radius: var(--r-sm); border: 2px solid transparent; font: 700 16px/1.2 var(--font); text-decoration: none; cursor: pointer;
  text-align: center; transition: transform .12s ease, background-color .12s ease; }
.btn:active { transform: translateY(1px); }
.btn-sm { min-height: 44px; padding: 0 18px; font-size: 15px; }
.btn-cta { background: var(--cta); color: var(--ink); font-weight: 800; }
.btn-cta:hover { background: #E8952A; }
.btn-ink { background: var(--ink); color: #FFF; }
.btn-ink:hover { background: #22325A; }
.btn-accent { background: var(--accent); color: #FFF; }
.btn-accent:hover { background: var(--accent-ink); }
.btn-line { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-line:hover { background: var(--ink); color: #FFF; }
.btn[disabled] { opacity: .6; cursor: progress; }
.ctas { display: flex; flex-wrap: wrap; gap: 12px; }
.center .ctas { justify-content: center; }
.link { font-weight: 600; color: var(--accent-ink); text-decoration: none; }
.link:hover { text-decoration: underline; }

/* Thanh trên */
.top { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.brand { font-weight: 800; font-size: 18px; color: var(--ink); text-decoration: none; }
.nav { display: flex; gap: 22px; margin-left: auto; font-size: 15px; }
.nav a { color: var(--ink); text-decoration: none; }
.nav a:hover { color: var(--accent-ink); }

/* Thẻ */
.card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); padding: 24px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.alt .card { border-color: transparent; }
.card-accent, .alt .card-accent { border: 2px solid var(--accent); }
.card-accent .eyebrow { color: var(--accent); }
.grid { display: grid; gap: 20px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.grid.tight { gap: 14px; }
.num { font-family: var(--mono); font-weight: 500; font-size: 20px; color: var(--accent); }
.chip { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); vertical-align: 2px; white-space: nowrap; }

/* Mở đầu */
.hero { padding: 72px 0 72px; }
.hero .stack { gap: 22px; }
.trust { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 14px; color: var(--muted); }
.trust li { display: inline-flex; align-items: center; gap: 6px; }
.trust svg { width: 16px; height: 16px; color: var(--ok); }
.ba { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 20px; margin-top: 12px; }
.alt .ba .card { border: 1px solid var(--line); }
.alt .ba .card-accent { border: 2px solid var(--accent); }

/* Học thử */
.trial { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.trial-video { display: flex; flex-direction: column; gap: 12px; }
.video { aspect-ratio: 16 / 9; border-radius: var(--r); overflow: hidden; background: var(--ink); color: #FFF; }
.video iframe, .video video { width: 100%; height: 100%; border: 0; }
.video.ph { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 16px; text-align: center; font-size: 15px; }
.video.ph svg { width: 64px; height: 64px; }
.cap { font-weight: 700; font-size: 17px; }
.lessons { display: flex; flex-direction: column; gap: 8px; }
.lesson { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: var(--r-sm); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 600; line-height: 1.4; }
.lesson:hover { border-color: var(--accent); }
.lesson svg { flex: 0 0 20px; width: 20px; height: 20px; color: var(--muted); }
.lesson span { display: flex; flex-direction: column; gap: 2px; }
.lesson small { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .02em; }
.lesson.open { background: var(--accent-soft); border-color: transparent; }
.lesson.open svg, .lesson.open small { color: var(--accent-ink); }

/* Form */
.form { display: flex; flex-direction: column; gap: 14px; position: relative; }
.form-accent { border: 2px solid var(--accent); border-radius: var(--r); padding: 24px; background: var(--accent-bg); }
.form-reg { border: 1px solid var(--line); border-radius: var(--r); padding: 24px; background: var(--bg); }
.form .row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.form .row .fld { flex: 1 1 280px; }
.fld { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; min-width: 0; }
.fld input, .fld select, .fld textarea { font: 400 16px/1.4 var(--font); color: var(--ink); background: #FFF; border: 1.5px solid #C5CEDB; border-radius: var(--r-sm); padding: 13px 14px; width: 100%; min-height: 52px; }
.fld textarea { resize: vertical; min-height: 96px; }
.fld input:focus, .fld select:focus, .fld textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47,91,234,.2); }
.fld input[aria-invalid="true"], .fld textarea[aria-invalid="true"] { border-color: var(--no); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-msg:empty { display: none; }
.form-msg { font-size: 14px; color: var(--no); }
.form-msg.warn { color: var(--cta-ink); }
.form-ok { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-sm); background: #E6F4EC; color: #14532D; font-weight: 600; }
.form-ok[hidden] { display: none; }
.form-ok svg { flex: 0 0 22px; width: 22px; height: 22px; color: var(--ok); margin-top: 1px; }
.form.sent > :not(.form-ok):not(.form-msg):not(h3) { display: none; }

/* Dải hoàn tiền */
.band { background: var(--ink); color: #FFF; padding: 48px 0; }
.band-in { display: flex; flex-wrap: wrap; gap: 20px 32px; align-items: center; justify-content: space-between; }
.band-in > div { flex: 1 1 480px; display: flex; flex-direction: column; gap: 8px; }
.band h2 { font-size: clamp(24px, 3.4vw, 30px); }
.band p { color: #D5DCEA; max-width: 680px; }

/* Đầu ra */
.card-out { flex-direction: row; gap: 14px; align-items: flex-start; }
.card-out svg { flex: 0 0 24px; width: 24px; height: 24px; color: var(--accent); margin-top: 2px; }

/* Máy chấm câu lệnh */
.grader { gap: 16px; }
.grader-out { display: flex; flex-direction: column; gap: 14px; border-top: 1px solid var(--line); padding-top: 16px; }
.grader-out[hidden] { display: none; }
.score { display: flex; align-items: baseline; gap: 10px; font-weight: 800; font-size: 22px; }
.score b { font-family: var(--mono); font-size: 32px; color: var(--accent); }
.crit { display: grid; gap: 8px; }
.crit li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; align-items: start; }
.crit svg { width: 20px; height: 20px; margin-top: 2px; }
.crit .y svg { color: var(--ok); }
.crit .n svg { color: var(--no); }
.crit strong { margin-right: 6px; }
.tpl { display: flex; flex-direction: column; gap: 8px; }
.tpl pre { margin: 0; white-space: pre-wrap; word-break: break-word; font: 500 14px/1.6 var(--mono); background: var(--alt); border-radius: var(--r-sm); padding: 14px 16px; }
.tpl .btn { align-self: flex-start; }

/* Giáo trình */
.chap h3 { display: flex; gap: 10px; align-items: baseline; }
.chap ul { display: flex; flex-direction: column; gap: 6px; color: var(--muted); }
.chap li { padding-left: 16px; position: relative; }
.chap li::before { content: ""; position: absolute; left: 0; top: .7em; width: 6px; height: 6px; border-radius: 50%; background: #B7C2D3; }

/* Người dạy */
.teacher { display: flex; flex-wrap: wrap; gap: 32px; align-items: center; }
.teacher > .stack-sm { flex: 1 1 420px; }
.photo { flex: 0 0 240px; width: 240px; height: 280px; border-radius: 16px; object-fit: cover; }
.photo.ph { background: var(--accent-soft); color: var(--accent-ink); display: flex; align-items: center; justify-content: center; font-weight: 600; }
.dots { display: flex; flex-direction: column; gap: 4px; }
.dots li { padding-left: 16px; position: relative; }
.dots li::before { content: ""; position: absolute; left: 0; top: .7em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* Danh sách nên / không */
.checks { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.checks li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; }
.checks svg { width: 20px; height: 20px; color: var(--ok); margin-top: 3px; }
.checks.neg svg { color: var(--no); }

/* Học phí */
.banner { background: var(--cta-soft); border: 1px solid #F4D39E; border-radius: var(--r-sm); padding: 14px 18px; font-weight: 600; }
.tier { gap: 10px; position: relative; }
.tier-hot, .alt .tier-hot { border: 2px solid var(--cta); }
.tier .btn { margin-top: auto; }
.tier .muted { flex: 1; }
.price { font-size: 30px; font-weight: 800; line-height: 1.1; }
.tier-hot .badge { position: absolute; top: -13px; left: 22px; }
.badge { align-self: flex-start; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; background: var(--cta); color: var(--ink); padding: 4px 10px; border-radius: 999px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 12px 24px; }
.steps li { display: flex; gap: 12px; align-items: flex-start; }
#dang-ky { scroll-margin-top: 90px; }
section[id] { scroll-margin-top: 60px; }

/* Học bổng */
.scholar { gap: 12px; padding: 28px; }
.reveal summary { list-style: none; align-self: flex-start; display: inline-flex; }
.reveal summary::-webkit-details-marker { display: none; }
.reveal[open] summary { display: none; }
.reveal .form { margin-top: 8px; }

/* Hỏi đáp */
.qas { display: flex; flex-direction: column; }
.qa { border-top: 1px solid var(--line); }
.qa:last-child { border-bottom: 1px solid var(--line); }
.qa summary { cursor: pointer; list-style: none; padding: 18px 40px 18px 0; font-weight: 700; position: relative; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: "+"; position: absolute; right: 4px; top: 14px; font: 500 24px/1 var(--mono); color: var(--accent); }
.qa[open] summary::after { content: "–"; }
.qa p { padding: 0 0 18px; color: var(--muted); max-width: 720px; }

/* Trang chủ */
.courses { grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }
.course { text-decoration: none; color: var(--ink); padding: 0; overflow: hidden; border: 1px solid var(--line); }
.course img { width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; }
.course-body { padding: 22px 24px 24px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.course:hover { border-color: var(--accent); }

/* Cuối trang */
.end-cta { gap: 18px; }
.foot { background: var(--ink); color: #C9D2E3; padding: 40px 0 48px; font-size: 14px; }
.foot-in { display: flex; flex-wrap: wrap; gap: 16px 40px; justify-content: space-between; align-items: flex-end; }
.foot-in > div { display: flex; flex-direction: column; gap: 6px; max-width: 640px; }
.foot .brand { color: #FFF; }
.foot-copy { color: #9AA6BD; }

/* Thanh đăng ký trên điện thoại */
.mbar { display: none; }
@media (max-width: 760px) {
  section { padding: 56px 0; }
  .wrap { padding: 0 16px; }
  .nav { display: none; }
  .hero { padding: 48px 0 56px; }
  .trial { grid-template-columns: 1fr; }
  .card, .form-accent, .form-reg { padding: 20px; }
  .photo { flex-basis: 100%; width: 100%; max-width: 320px; height: 300px; }
  .mbar { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.96); border-top: 1px solid var(--line);
    transform: translateY(110%); transition: transform .2s ease; }
  .mbar .btn { min-height: 46px; padding: 0 12px; }
  .mbar.show { transform: none; }
  body:has(.mbar) .foot { padding-bottom: 96px; }
  .form .row .btn { width: 100%; }
}

/* Trang học */
.top-tag { margin-right: auto; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); }
.learn { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 36px; align-items: start; padding-top: 32px; padding-bottom: 72px; }
.side { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow: auto; }
.side-box summary { list-style: none; font-weight: 800; font-size: 15px; padding: 4px 0 8px; cursor: default; }
.side-box summary::-webkit-details-marker { display: none; }
.side-ch { margin: 14px 0 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.side ol { display: flex; flex-direction: column; gap: 2px; }
.sl { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; align-items: start; padding: 8px 10px; border-radius: var(--r-sm); font-size: 14px; line-height: 1.4; color: var(--ink); text-decoration: none; }
a.sl:hover { background: var(--alt); }
.sl.on { background: var(--accent-soft); font-weight: 700; }
.sl.off { color: #8792A6; }
.sl.off svg { width: 16px; height: 16px; margin: 2px 0 0 4px; }
.sl small { display: block; font-size: 11px; color: #8792A6; }
.sl-n { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; font: 500 13px/1 var(--mono); background: var(--alt); color: var(--accent-ink); flex: 0 0 26px; }
.sl.on .sl-n { background: var(--accent); color: #FFF; }
.done .sl-n { background: var(--ok); color: #FFF; font-size: 0; }
.done .sl-n::before { content: "✓"; font-size: 14px; }
.learn-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.learn-main h1 { font-size: clamp(28px, 4.4vw, 40px); }
.learn-main h2 { font-size: 22px; }
.learn-body { display: flex; flex-direction: column; gap: 20px; }
.gated .learn-body, .gated .learn-cta { display: none; }
.kc-mo .gated .learn-body, .kc-mo .gated .learn-cta { display: flex; }
.kc-mo .gate { display: none; }
.gate h2 { display: flex; gap: 10px; align-items: center; }
.gate h2 svg { width: 22px; height: 22px; color: var(--accent); }
.gate .form { margin-top: 6px; }
.prose { display: flex; flex-direction: column; gap: 10px; }
.hint summary { cursor: pointer; font-weight: 700; color: var(--accent-ink); margin-top: 6px; }
.hint .prose { margin-top: 10px; padding: 14px 16px; border-radius: var(--r-sm); background: var(--alt); }
.quiz { gap: 14px; }
.q { border-top: 1px solid var(--line); padding-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.q-hoi { font-weight: 700; display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 8px; }
.q-opts { display: grid; gap: 8px; }
.opt { text-align: left; font: 500 15px/1.45 var(--font); color: var(--ink); background: #FFF; border: 1.5px solid #C5CEDB; border-radius: var(--r-sm); padding: 12px 14px; cursor: pointer; min-height: 48px; }
.opt:hover:not([disabled]) { border-color: var(--accent); }
.opt[disabled] { cursor: default; }
.opt.right { border-color: var(--ok); background: #E6F4EC; font-weight: 700; }
.opt.wrong { border-color: var(--no); background: #FCEBE4; }
.q-exp { padding: 12px 14px; border-radius: var(--r-sm); background: var(--alt); display: flex; flex-direction: column; gap: 6px; }
.q-exp[hidden] { display: none; }
.q-verdict { font-weight: 800; }
.q-verdict.y { color: var(--ok); }
.q-verdict.n { color: var(--no); }
.quiz-score { font-weight: 800; font-size: 18px; color: var(--accent-ink); }
.quiz-score[hidden] { display: none; }
.wait { background: var(--cta-soft); border-color: #F4D39E; }
.learn-nav { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.learn-cta { background: var(--alt); border-color: transparent; gap: 10px; }
.lcards { display: flex; flex-direction: column; gap: 10px; }
.lcard { flex-direction: row; gap: 14px; align-items: flex-start; text-decoration: none; color: var(--ink); padding: 18px 20px; }
.lcard:hover { border-color: var(--accent); }
.lcard .eyebrow { font-size: 11px; }
.lesson.unlocked svg { color: var(--accent); }
@media (max-width: 900px) {
  .learn { grid-template-columns: 1fr; gap: 20px; padding-top: 16px; }
  .side { position: static; max-height: none; border: 1px solid var(--line); border-radius: var(--r); padding: 8px 14px; }
  .side-box summary { cursor: pointer; padding: 8px 0; }
  .side-box summary::after { content: " ▾"; color: var(--accent); }
  .side-box[open] summary::after { content: " ▴"; }
}
