:root {
  --blue: #0050a0; --blue-2: #0a66c2; --red: #e04020; --ink: #14202e; --muted: #5b6878; --line: #e3e8ef;
  --bg: #ffffff; --bg-2: #f5f7fa; --card: #ffffff; --ok: #1e8e4e; --warn: #b8572b; --code: #eef2f7;
  --radius: 12px; --shadow: 0 1px 2px rgba(16, 32, 56, .06), 0 6px 24px rgba(16, 32, 56, .06);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #e8eef6; --muted: #9fb0c4; --line: #26323f; --bg: #0f151c; --bg-2: #141c25; --card: #17212b; --code: #1d2935;
    --blue-2: #5aa2ff; --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  }
}
:root[data-theme="dark"] {
  --ink: #e8eef6; --muted: #9fb0c4; --line: #26323f; --bg: #0f151c; --bg-2: #141c25; --card: #17212b; --code: #1d2935;
  --blue-2: #5aa2ff; --shadow: 0 1px 2px rgba(0, 0, 0, .3);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); line-height: 1.6;
  font: 16px/1.6 "Be Vietnam Pro", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}
a { color: var(--blue-2); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* ---- đầu trang */
header.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
header.top .wrap { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; font-size: 17px; }
.brand:hover { text-decoration: none; }
.brand img { width: 40px; height: 40px; background: #fff; border-radius: 8px; padding: 2px; }
nav.main { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
nav.main a { color: var(--ink); padding: 8px 12px; border-radius: 8px; font-size: 15px; }
nav.main a:hover, nav.main a[aria-current="page"] { background: var(--bg-2); text-decoration: none; }
nav.main a.cta { background: var(--blue); color: #fff; }
nav.main a.cta:hover { background: var(--blue-2); }
@media (max-width: 720px) {
  header.top .wrap { height: auto; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
  nav.main { margin-left: 0; width: 100%; }
  nav.main a { padding: 6px 10px; font-size: 14px; }
}

/* ---- khối chính */
.hero { background: linear-gradient(135deg, #003b78 0%, var(--blue) 55%, #1569c7 100%); color: #fff; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -120px; top: -120px; width: 380px; height: 380px; border-radius: 50%;
  background: radial-gradient(circle, rgba(224, 64, 32, .55), rgba(224, 64, 32, 0) 70%); }
.hero .wrap { padding-top: 72px; padding-bottom: 72px; position: relative; z-index: 1; }
.hero h1 { font-size: clamp(30px, 5vw, 48px); line-height: 1.15; margin: 0 0 16px; letter-spacing: -.5px; max-width: 760px; }
.hero p.lead { font-size: clamp(17px, 2.2vw, 20px); opacity: .92; max-width: 680px; margin: 0 0 28px; }
.badge { display: inline-block; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .3); padding: 4px 12px; border-radius: 999px; font-size: 14px; margin-bottom: 18px; }
.btns { display: flex; gap: 12px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 10px; font-weight: 600; font-size: 16px; border: 1px solid transparent; cursor: pointer; font-family: inherit; }
.btn:hover { text-decoration: none; filter: brightness(1.06); }
.btn.primary { background: var(--red); color: #fff; }
.btn.light { background: #fff; color: var(--blue); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.blue { background: var(--blue); color: #fff; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

section { padding: 64px 0; }
section.alt { background: var(--bg-2); }
h2 { font-size: clamp(24px, 3.4vw, 32px); margin: 0 0 12px; letter-spacing: -.3px; }
h3 { font-size: 18px; margin: 0 0 6px; }
p.sub { color: var(--muted); margin: 0 0 32px; max-width: 720px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card p { margin: 0; color: var(--muted); font-size: 15px; }
.ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--blue) 12%, transparent); color: var(--blue-2); margin-bottom: 12px; }
.ico svg { width: 22px; height: 22px; }
.steps { counter-reset: s; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.steps .card { position: relative; padding-top: 44px; }
.steps .card::before { counter-increment: s; content: counter(s); position: absolute; top: 16px; left: 22px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--red); color: #fff; font-weight: 700; font-size: 14px; display: grid; place-items: center; }
.split { display: grid; gap: 32px; grid-template-columns: 1.1fr .9fr; align-items: start; }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; } }
ul.check { list-style: none; padding: 0; margin: 0; }
ul.check li { padding: 6px 0 6px 28px; position: relative; }
ul.check li::before { content: ""; position: absolute; left: 4px; top: 13px; width: 12px; height: 7px; border-left: 2px solid var(--ok); border-bottom: 2px solid var(--ok); transform: rotate(-45deg); }
table.spec { width: 100%; border-collapse: collapse; font-size: 15px; }
table.spec th, table.spec td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.spec th { color: var(--muted); font-weight: 600; width: 34%; }

/* ---- trang con */
.page-head { background: var(--bg-2); border-bottom: 1px solid var(--line); }
.page-head .wrap { padding-top: 40px; padding-bottom: 32px; }
.page-head h1 { margin: 0 0 8px; font-size: clamp(26px, 4vw, 36px); }
.page-head p { margin: 0; color: var(--muted); max-width: 760px; }
main.content { padding: 40px 0 64px; }
.dl { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.dl .card h3 { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.size { color: var(--muted); font-weight: 500; font-size: 14px; }
.hash { font-family: Consolas, "Cascadia Mono", monospace; font-size: 12.5px; background: var(--code); padding: 8px 10px; border-radius: 8px; word-break: break-all; margin: 12px 0; color: var(--ink); }
.note { border-left: 4px solid var(--blue); background: var(--bg-2); padding: 14px 16px; border-radius: 0 10px 10px 0; margin: 20px 0; color: var(--ink); }
.note.warn { border-color: var(--red); }
code, pre { font-family: Consolas, "Cascadia Mono", monospace; background: var(--code); border-radius: 6px; }
code { padding: 1px 6px; font-size: .92em; }
pre { padding: 12px 14px; overflow-x: auto; font-size: 13.5px; }

/* ---- biểu mẫu */
form.card { max-width: 720px; }
label { display: block; font-weight: 600; margin: 16px 0 6px; font-size: 15px; }
label .opt { font-weight: 400; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); font: inherit; font-size: 15px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--blue-2) 50%, transparent); border-color: var(--blue-2); }
textarea { min-height: 110px; resize: vertical; }
.help { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.consent { display: flex; gap: 10px; align-items: flex-start; margin-top: 20px; font-weight: 400; }
.consent input { margin-top: 5px; width: 18px; height: 18px; flex: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.msg { margin-top: 14px; font-size: 15px; }
.msg.err { color: var(--red); }
.status-pill { display: inline-block; padding: 4px 12px; border-radius: 999px; font-weight: 600; font-size: 14px; }
.st-cho-duyet { background: #fff4e5; color: #8a4b08; }
.st-da-cap { background: #e6f6ec; color: #17693a; }
.st-tu-choi { background: #fdecea; color: #a12a1b; }
textarea.key { font-family: Consolas, monospace; font-size: 13px; min-height: 120px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.linkbox { font-family: Consolas, monospace; font-size: 13.5px; background: var(--code); padding: 10px 12px; border-radius: 8px; word-break: break-all; }

/* ---- văn bản dài (điều kiện) */
article.prose { max-width: 780px; }
article.prose h2 { font-size: 22px; margin-top: 32px; }
article.prose li { margin: 6px 0; }

footer.bottom { border-top: 1px solid var(--line); background: var(--bg-2); color: var(--muted); font-size: 14px; }
footer.bottom .wrap { padding-top: 28px; padding-bottom: 28px; display: flex; gap: 24px; flex-wrap: wrap; justify-content: space-between; }
footer.bottom a { color: var(--muted); }
footer.bottom nav { display: flex; gap: 16px; flex-wrap: wrap; }
