/* ============================================================
   FireTech – giao diện. Màu, khoảng cách, font đặt ở :root.
   ============================================================ */
:root {
  --ink: #0b1020;
  --ink-2: #2a3350;
  --muted: #5b6482;
  --line: #e6e9f2;
  --bg: #ffffff;
  --bg-soft: #f6f7fb;
  --ember: #ff5a1f;
  --ember-d: #d9440d;
  --amber: #ffb020;
  --teal: #0e9f77;
  --teal-bg: #e3f8ef;
  --violet: #6d4cff;
  --violet-bg: #efeaff;
  --ember-bg: #fff0e8;
  --focus: #6d4cff;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(11, 16, 32, .06), 0 12px 32px -12px rgba(11, 16, 32, .16);
  --shadow-lg: 0 2px 4px rgba(11, 16, 32, .06), 0 30px 70px -20px rgba(11, 16, 32, .28);

  --gutter: clamp(16px, 4vw, 32px);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --header-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg);
  line-height: 1.6; font-size: 16px; overflow-x: hidden; -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
h1, h2, h3 { line-height: 1.12; letter-spacing: -.03em; margin: 0; }
p { margin: 0 0 1em; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }

.container { width: 100%; max-width: 1160px; margin-inline: auto; padding-inline: var(--gutter); }
.container.narrow { max-width: 820px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.skip-link { position: absolute; left: 8px; top: -60px; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { top: 8px; }

/* ------------------------------------------------ Nút */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 650; font-size: 1rem; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: .9rem; }
.btn-ink { background: var(--ink); color: #fff; box-shadow: 0 8px 20px -8px rgba(11, 16, 32, .6); }
.btn-ink:hover { background: #1b2342; }
.btn-ember { background: var(--ember); color: #fff; box-shadow: 0 10px 24px -10px rgba(255, 90, 31, .8); }
.btn-ember:hover { background: var(--ember-d); }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: #c8cde0; background: var(--bg-soft); }
.btn-block { width: 100%; }
.link-btn { background: none; border: 0; padding: 4px 0; color: var(--violet); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ------------------------------------------------ Header */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: rgba(255, 255, 255, .86); backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-row { display: flex; align-items: center; justify-content: space-between; height: 100%; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; letter-spacing: -.03em; text-decoration: none; flex-shrink: 0; }
.brand-logo { display: block; height: 22px; width: auto; object-fit: contain; }
.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav a { text-decoration: none; padding: 8px 12px; border-radius: 999px; font-size: .94rem; font-weight: 550; color: var(--ink-2); }
.main-nav a:hover { background: var(--bg-soft); }
.main-nav a.active { background: var(--ink); color: #fff; }
.main-nav .nav-phone { display: inline-flex; gap: 6px; align-items: center; margin-left: 6px; font-weight: 700; color: var(--ember-d); }
.main-nav .nav-phone:hover { background: var(--ember-bg); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.menu-btn { display: none; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: #fff; cursor: pointer; padding: 0; position: relative; }
.menu-btn span { position: absolute; left: 12px; right: 12px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .2s, opacity .2s; }
.menu-btn span:nth-child(1) { top: 14px; } .menu-btn span:nth-child(2) { top: 21px; } .menu-btn span:nth-child(3) { top: 28px; }
.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 1060px) {
  .menu-btn { display: block; }
  .main-nav {
    position: absolute; left: 0; right: 0; top: var(--header-h); flex-direction: column; align-items: stretch; gap: 2px;
    padding: 12px var(--gutter) 20px; background: #fff; border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
    display: none; max-height: calc(100vh - var(--header-h)); overflow-y: auto;
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 14px 12px; border-radius: 12px; font-size: 1.05rem; }
  .main-nav .nav-phone { margin: 6px 0 0; justify-content: center; background: var(--ember-bg); }
}
@media (max-width: 400px) {
  .header-actions .btn-sm { padding: 0 12px; font-size: .82rem; }
  .brand span { font-size: 1.05rem; }
  .brand-logo { height: 15px; }
}

/* ------------------------------------------------ Hero */
.hero { position: relative; padding: clamp(40px, 7vw, 84px) 0 0; overflow: hidden; isolation: isolate; }
.hero-inner { text-align: center; position: relative; z-index: 1; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 20px; padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: .85rem; font-weight: 600; color: var(--ink-2); max-width: 100%; }
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ember); box-shadow: 0 0 0 4px rgba(255, 90, 31, .18); flex: none; }
.eyebrow-dark { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .16); color: #cfd5ea; }
.hero h1 { font-size: clamp(2.1rem, 7.4vw, 4.6rem); font-weight: 800; letter-spacing: -.045em; }
.grad { background: linear-gradient(95deg, var(--ember) 0%, #ff2f6d 45%, var(--violet) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { max-width: 660px; margin: 22px auto 28px; font-size: clamp(1rem, 2.2vw, 1.18rem); color: var(--muted); }
.cta-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.hero-glow {
  position: absolute; inset: auto 0 0 0; height: 70%; z-index: 0; pointer-events: none;
  background:
    radial-gradient(50% 62% at 50% 100%, rgba(109, 76, 255, .26), transparent 70%),
    radial-gradient(36% 48% at 14% 100%, rgba(255, 90, 31, .24), transparent 70%),
    radial-gradient(36% 48% at 88% 100%, rgba(255, 176, 32, .22), transparent 70%);
}
.hero-stage { position: relative; display: grid; grid-template-columns: 1fr minmax(0, 1.5fr) 1fr; align-items: end; gap: 16px; margin: clamp(36px, 6vw, 64px) auto 0; max-width: 1040px; }
.hero-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); text-align: left; }
.hero-card-main { padding: 12px; border-bottom-left-radius: 0; border-bottom-right-radius: 0; border-bottom: 0; }
.hero-main-bar { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.pill { font-size: .75rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.pill-cad { background: #0a1a2f; color: #7fd6ff; }
.pill-sim { background: var(--teal-bg); color: #0b7a5b; }
.hero-main-plan svg, .sim-layer svg { display: block; width: 100%; height: auto; }
.hero-main-plan { border-radius: 10px; overflow: hidden; background: #0a1a2f; }
.hero-card-side { padding: 16px; align-self: center; }
.hero-card-left { transform: translateY(18px); }
.hero-card-right { transform: translateY(-6px); }
.mini-k { font-size: .75rem; color: var(--muted); font-weight: 600; margin: 0 0 4px; }
.mini-v { font-size: 1.7rem; font-weight: 800; letter-spacing: -.04em; margin: 0; }
.mini-v.ok { color: var(--teal); }
.mini-n { font-size: .82rem; color: var(--muted); margin: 6px 0 0; }
@media (max-width: 860px) {
  .hero-stage { grid-template-columns: 1fr; }
  .hero-card-side { display: none; }
}

.chips-row { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; padding: 26px 0 8px; margin: 0; }
.chips-row li { padding: 8px 18px; border: 1px solid var(--line); border-radius: 999px; font-weight: 700; font-size: .92rem; color: var(--ink-2); background: #fff; }

/* ------------------------------------------------ Section */
.section { padding: clamp(56px, 9vw, 104px) 0; }
.section-soft { background: var(--bg-soft); }
.section-head { max-width: 720px; margin-bottom: clamp(28px, 5vw, 48px); }
.section-head.center { text-align: center; margin-inline: auto; }
.section-head h2 { font-size: clamp(1.7rem, 4.6vw, 3rem); font-weight: 800; letter-spacing: -.04em; }
.section-head p { margin: 16px 0 0; color: var(--muted); font-size: 1.05rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 900px) { .grid-3 { grid-template-columns: 1fr; } }

.check-card, .soft-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.check-card h3, .soft-card h3 { font-size: 1.35rem; margin-bottom: 14px; }
.ticks { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.ticks li { position: relative; padding-left: 28px; color: var(--ink-2); }
.ticks li::before { content: ""; position: absolute; left: 0; top: .28em; width: 18px; height: 18px; border-radius: 50%; background: var(--teal-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%230e9f77' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round' d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center/12px no-repeat; }
.soft-card p { color: var(--muted); }
.tag { display: inline-block; font-size: .78rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; margin-bottom: 14px; }
.tag-ember { background: var(--ember-bg); color: var(--ember-d); }
.tag-teal { background: var(--teal-bg); color: #0b7a5b; }
.tag-violet { background: var(--violet-bg); color: #4b30d4; }
.legal-note { margin: 26px 0 0; font-size: .85rem; color: var(--muted); text-align: center; }

/* reveal */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.in, .js.reduce .reveal { opacity: 1; transform: none; }
.js.reduce .reveal { transition: none; }

/* ------------------------------------------------ Filters / chips */
.filters, .lib-tools { display: flex; flex-wrap: wrap; gap: 14px 28px; justify-content: center; margin-bottom: 14px; }
.lib-tools { align-items: center; }
.filter-group { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.filter-label { font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.chip-set { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-weight: 600; font-size: .9rem; cursor: pointer; color: var(--ink-2); }
.chip:hover { border-color: #c4cadf; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.result-count { text-align: center; color: var(--muted); font-size: .9rem; margin: 6px 0 22px; min-height: 1.4em; }
.lib-status { display: flex; align-items: center; gap: 14px; width: 100%; justify-content: center; }
.lib-status .result-count { margin: 0; }

/* ------------------------------------------------ Đề tài */
.topic-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 1000px) { .topic-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .topic-grid { grid-template-columns: 1fr; } }
.topic { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; transition: box-shadow .2s, transform .2s; }
.topic:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.topic-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.badge { font-size: .74rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--bg-soft); color: var(--ink-2); }
.badge-pccc { background: var(--ember-bg); color: var(--ember-d); }
.badge-kt { background: var(--violet-bg); color: #4b30d4; }
.topic h3 { font-size: 1.12rem; letter-spacing: -.02em; line-height: 1.3; margin-bottom: 10px; }
.topic p { color: var(--muted); font-size: .95rem; }
.topic ul { margin: 0 0 14px; padding-left: 18px; color: var(--ink-2); font-size: .9rem; }
.topic .std { font-size: .82rem; color: var(--muted); margin-top: auto; padding-top: 4px; }
.topic-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

/* ------------------------------------------------ Trình mô phỏng */
.sim { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(280px, 1fr); gap: 24px; align-items: start; }
@media (max-width: 960px) { .sim { grid-template-columns: 1fr; } }
.sim-main, .sim-side { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); min-width: 0; }
.sim-toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; flex-wrap: wrap; }
.sim-time { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 200px; font-weight: 600; font-size: .9rem; }
.sim-time input { flex: 1; min-width: 0; accent-color: var(--ember); height: 28px; }
.sim-time output { min-width: 52px; text-align: right; font-family: var(--font-mono); font-weight: 700; }

.sim-stage { position: relative; aspect-ratio: 800 / 480; border-radius: 12px; overflow: hidden; background: #0a1a2f; user-select: none; -webkit-user-select: none; touch-action: pan-y; }
.sim-layer { position: absolute; inset: 0; }
.sim-top { clip-path: inset(0 0 0 var(--pos)); }
.sim-hit { z-index: 2; }
.sim-hit svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.hit-room { fill: transparent; stroke: transparent; stroke-width: 4; cursor: pointer; pointer-events: all; }
.hit-room:hover { fill: rgba(109, 76, 255, .12); }
.hit-room:focus-visible { outline: none; stroke: var(--focus); }
.hit-room.sel { stroke: var(--focus); fill: rgba(109, 76, 255, .14); }
.hit-badge { pointer-events: none; }
.sim-label { position: absolute; top: 10px; z-index: 3; font-size: .72rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; pointer-events: none; max-width: 46%; }
.sim-label-l { left: 10px; background: rgba(10, 26, 47, .86); color: #7fd6ff; border: 1px solid rgba(127, 214, 255, .4); }
.sim-label-r { right: 10px; background: rgba(255, 255, 255, .92); color: #0b7a5b; border: 1px solid var(--teal-bg); }
.sim-handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 44px; margin-left: -22px; z-index: 4; cursor: ew-resize; touch-action: none; display: flex; align-items: center; justify-content: center; }
.sim-handle-line { position: absolute; top: 0; bottom: 0; left: 50%; width: 3px; margin-left: -1.5px; background: #fff; box-shadow: 0 0 0 1px rgba(11, 16, 32, .35); }
.sim-handle-knob { position: relative; width: 40px; height: 40px; border-radius: 50%; background: #fff; color: var(--ink); display: grid; place-items: center; box-shadow: 0 4px 16px rgba(11, 16, 32, .45); }
.sim-handle:focus-visible { outline: none; }
.sim-handle:focus-visible .sim-handle-knob { outline: 3px solid var(--focus); outline-offset: 2px; }
.sim-handle.drag .sim-handle-knob { transform: scale(1.1); background: var(--ember); color: #fff; }

.sim-rooms { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.room-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px 0 6px; border-radius: 999px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: .85rem; font-weight: 600; }
.room-btn .n { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: #fff; font-size: .75rem; }
.room-btn[aria-pressed="true"] { border-color: var(--focus); background: var(--violet-bg); }

.sim-side { display: grid; gap: 14px; }
.sim-hud { margin: 0; font-family: var(--font-mono); font-size: .88rem; font-weight: 700; padding: 10px 12px; border-radius: 10px; background: var(--ink); color: #fff; overflow-wrap: anywhere; }
.sim-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.metric { background: var(--bg-soft); border-radius: 12px; padding: 10px; min-width: 0; }
.metric span { display: block; font-size: .72rem; color: var(--muted); font-weight: 700; }
.metric strong { font-size: 1.15rem; letter-spacing: -.03em; }
.metric.ok strong { color: var(--teal); }
.metric.bad strong { color: #d12d3a; }
.sim-layers { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px 12px; margin: 0; display: grid; gap: 8px; }
.sim-layers legend { font-size: .8rem; font-weight: 700; color: var(--muted); padding: 0 6px; }
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: .92rem; }
.switch input { width: 18px; height: 18px; accent-color: var(--ember); flex: none; }
.sim-info { background: var(--bg-soft); border-radius: 12px; padding: 14px; min-height: 124px; font-size: .92rem; }
.sim-info h3 { font-size: 1.05rem; margin-bottom: 8px; }
.sim-info dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; }
.sim-info dt { color: var(--muted); }
.sim-info dd { margin: 0; font-weight: 600; }
.sim-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ------------------------------------------------ Thư viện */
.search-box { position: relative; width: min(100%, 420px); }
.search-box svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-box input { width: 100%; min-height: 48px; border-radius: 999px; border: 1px solid var(--line); padding: 0 18px 0 42px; background: #fff; }
.lib-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
@media (max-width: 760px) { .lib-grid { grid-template-columns: 1fr; } }
.doc { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.doc-head { display: flex; gap: 12px; align-items: flex-start; }
.doc-ic { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: .95rem; }
.doc-ic.formula { background: var(--violet-bg); color: #4b30d4; }
.doc-ic.excel { background: var(--teal-bg); color: #0b7a5b; }
.doc-ic.article { background: var(--ember-bg); color: var(--ember-d); }
.doc h3 { font-size: 1.05rem; letter-spacing: -.02em; line-height: 1.3; }
.doc p { margin: 0; color: var(--muted); font-size: .93rem; }
.doc-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.doc-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.formula-box { font-family: var(--font-mono); background: var(--ink); color: #fff; border-radius: 12px; padding: 12px 14px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .92rem; margin: 0; }
.doc details { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.doc summary { cursor: pointer; font-weight: 700; font-size: .92rem; }
.calc { display: grid; gap: 10px; margin-top: 12px; }
.calc label { display: grid; gap: 4px; font-size: .85rem; font-weight: 600; }
.calc input, .calc select { min-height: 42px; border-radius: 10px; border: 1px solid var(--line); padding: 0 10px; background: #fff; width: 100%; min-width: 0; }
.calc-out { display: grid; gap: 6px; background: var(--teal-bg); border-radius: 12px; padding: 10px 12px; font-size: .92rem; }
.calc-out div { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.calc-out strong { overflow-wrap: anywhere; }
.calc-out .bad { color: #d12d3a; }
.calc-out .ok { color: #0b7a5b; }
.empty { text-align: center; color: var(--muted); padding: 32px 0; }

/* ------------------------------------------------ Nền tối */
.dark-band { position: relative; background: var(--ink); color: #fff; padding: clamp(56px, 9vw, 96px) 0; overflow: hidden; isolation: isolate; }
.dark-band::before { content: ""; position: absolute; inset: 0; z-index: -1; background:
  radial-gradient(40% 60% at 85% 0%, rgba(109, 76, 255, .35), transparent 70%),
  radial-gradient(40% 60% at 10% 100%, rgba(255, 90, 31, .28), transparent 70%),
  linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px) 0 0 / 44px 44px,
  linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px) 0 0 / 44px 44px; }
.dark-band h2 { font-size: clamp(1.8rem, 5vw, 3.2rem); font-weight: 800; letter-spacing: -.04em; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin: 40px 0 0; }
@media (max-width: 820px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { display: flex; flex-direction: column-reverse; justify-content: flex-end; border-top: 1px solid rgba(255, 255, 255, .2); padding-top: 18px; }
.stat dd { margin: 0; font-size: clamp(2.4rem, 7vw, 4rem); font-weight: 800; letter-spacing: -.05em; line-height: 1; background: linear-gradient(180deg, #fff, #9aa4cc); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat dt { margin-top: 8px; color: #b6bedb; font-weight: 600; }

/* ------------------------------------------------ Học phí */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 20px; align-items: stretch; }
.plans[data-count="2"] { max-width: 900px; margin-inline: auto; }
.plan { position: relative; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.plan.hot { border: 2px solid var(--ember); box-shadow: var(--shadow-lg); }
.plan-badge { position: absolute; top: -14px; left: 24px; background: var(--ember); color: #fff; font-size: .78rem; font-weight: 700; padding: 5px 12px; border-radius: 999px; }
.plan h3 { font-size: 1.4rem; }
.plan .tagline { color: var(--muted); margin: 6px 0 18px; font-size: .95rem; }
.price { font-size: clamp(2rem, 5vw, 2.6rem); font-weight: 800; letter-spacing: -.05em; line-height: 1.1; margin: 0; }
.price small { font-size: .95rem; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.plan .sched { margin: 10px 0 18px; color: var(--ink-2); font-weight: 600; font-size: .92rem; }
.plan .ticks { margin-bottom: 24px; font-size: .94rem; }
.plan .btn { margin-top: auto; }

/* ------------------------------------------------ Zalo */
.zalo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 20px; }
.zalo-grid[data-count="1"] { max-width: 520px; margin-inline: auto; }
.zalo-grid[data-count="2"] { max-width: 860px; margin-inline: auto; }
.zalo-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; display: flex; flex-direction: column; gap: 10px; }
.zalo-card .zi { width: 44px; height: 44px; border-radius: 12px; background: #0068ff; color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 1.2rem; }
.zalo-card h3 { font-size: 1.15rem; }
.zalo-card p { color: var(--muted); font-size: .94rem; margin: 0 0 8px; }
.zalo-card .btn { margin-top: auto; }

/* ------------------------------------------------ Đăng ký */
.reg { display: grid; grid-template-columns: 1fr minmax(0, 480px); gap: clamp(28px, 6vw, 72px); align-items: start; }
@media (max-width: 900px) { .reg { grid-template-columns: 1fr; } }
.reg-copy h2 { font-size: clamp(1.8rem, 5vw, 3rem); font-weight: 800; letter-spacing: -.04em; }
.reg-copy > p { margin: 16px 0 24px; color: var(--muted); font-size: 1.05rem; }
.reg-contact { display: grid; gap: 10px; }
.contact-line { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; text-decoration: none; background: #fff; min-width: 0; }
.contact-line:hover { border-color: #c4cadf; box-shadow: var(--shadow); }
.contact-line .ic { flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 800; }
.contact-line strong { display: block; font-size: 1.1rem; overflow-wrap: anywhere; }
.contact-line small { color: var(--muted); }
.reg-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-lg); min-width: 0; }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 650; font-size: .92rem; margin-bottom: 6px; }
.field input, .field select, .field textarea { width: 100%; min-height: 48px; border: 1px solid #cfd4e6; border-radius: 12px; padding: 10px 14px; background: #fff; }
.field textarea { resize: vertical; min-height: 88px; }
.field input[aria-invalid="true"] { border-color: #d12d3a; }
.err { color: #d12d3a; font-size: .85rem; margin: 6px 0 0; min-height: 0; }
.err:empty { display: none; }
.reg-done h3 { font-size: 1.4rem; margin-bottom: 10px; }
.reg-done textarea { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--bg-soft); resize: vertical; margin: 6px 0 14px; }
.reg-done-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }

/* ------------------------------------------------ FAQ */
.faq { display: grid; gap: 10px; }
.faq details { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 4px 20px; }
.faq summary { cursor: pointer; font-weight: 700; padding: 14px 0; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--ember); }
.faq details[open] summary::after { content: "–"; }
.faq p { color: var(--muted); margin: 0 0 16px; }

/* ------------------------------------------------ Footer */
.site-footer { background: var(--bg-soft); border-top: 1px solid var(--line); padding: 48px 0 24px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: 32px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }
.footer-grid a:not(.brand) { display: block; text-decoration: none; color: var(--ink-2); padding: 5px 0; overflow-wrap: anywhere; }
.footer-grid a:not(.brand):hover { color: var(--ember-d); }
.footer-h { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 10px; }
.footer-brand p { color: var(--muted); margin: 10px 0 0; max-width: 340px; }
.footer-brand p:empty { display: none; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; }
.footer-bottom p { margin: 0; }

/* ------------------------------------------------ Dialog, toast */
.article-dialog { width: min(720px, calc(100vw - 24px)); max-height: calc(100vh - 32px); border: 0; border-radius: var(--radius); padding: 24px clamp(18px, 4vw, 32px) 32px; box-shadow: var(--shadow-lg); overflow-y: auto; }
.article-dialog::backdrop { background: rgba(11, 16, 32, .55); }
.dialog-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.dialog-bar p { margin: 0; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 1rem; }
.article-dialog h3 { font-size: clamp(1.4rem, 4vw, 1.9rem); margin-bottom: 16px; }
.article-body p { color: var(--ink-2); font-size: 1.02rem; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 999px; font-weight: 600; font-size: .92rem; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 200; max-width: calc(100vw - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 560px) {
  .sim-time { flex: 1 1 100%; }
}
@media (max-width: 480px) {
  .plan-label { display: none; }
  .section-head h2 { font-size: 1.65rem; }
  .btn { min-height: 48px; padding: 0 18px; }
  .cta-row .btn { width: 100%; }
  .check-card, .soft-card, .plan, .zalo-card, .reg-card { padding: 20px; }
  .sim-main, .sim-side { padding: 12px; }
  .sim-metrics { grid-template-columns: repeat(3, 1fr); }
  .metric strong { font-size: 1rem; }
  .sim-label { font-size: .62rem; padding: 3px 7px; }
  .sim-actions .btn { flex: 1 1 auto; }
  .plan-badge { left: 16px; }
  .doc { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .001ms !important; animation-duration: .001ms !important; }
  .reveal { opacity: 1; transform: none; }
}
