/* go2fa — tokens from "Bộ thiết kế 4 website" (surface, ink, muted, line, accent-truth, risk-*, space-*, radius-*). */
:root {
  --surface: #FAF8F5; --raised: #FFFFFF; --ink: #1B1D21; --muted: #5B5F66; --line: #D9D5CE;
  --accent: #00805A; --on-accent: #FFFFFF;
  --low: #1F7A3E; --mid: #9A6200; --high: #B3261E;
  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 32px; --s5: 48px;
  --r-sm: 6px; --r-md: 10px; --r-lg: 16px;
  --font: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --surface: #16181C; --raised: #1F2228; --ink: #F2F0EC; --muted: #A7ABB3; --line: #3A3E46;
    --accent: #3DD29B; --on-accent: #16181C;
    --low: #58C47E; --mid: #E8B04A; --high: #F28B82;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 96px; }
body {
  margin: 0; background: var(--surface); color: var(--ink);
  font: 400 16px/26px var(--font);
}
a, button, input, select, label, summary { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
a { color: var(--accent); text-underline-offset: 3px; }
.wrap { max-width: 720px; margin: 0 auto; padding: 0 var(--s2); }
.skip { position: absolute; left: var(--s2); top: -64px; background: var(--raised); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-sm); padding: var(--s1) var(--s2); z-index: 10; }
.skip:focus { top: var(--s1); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
header.top { border-bottom: 1px solid var(--line); }
header.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: var(--s1); font-weight: 700; font-size: 20px; color: var(--ink); text-decoration: none; }
.brand svg { width: 28px; height: 28px; }
nav.top { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; font-size: 14px; line-height: 20px; }
nav.top a { color: var(--muted); text-decoration: none; padding: 12px 0; }
nav.top a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.linkbtn { font: inherit; font-size: 14px; background: none; border: 1px solid var(--line); border-radius: var(--r-sm); color: var(--ink); min-height: 36px; padding: 0 var(--s1); cursor: pointer; }
main { padding: var(--s4) 0 var(--s5); }
h1 { font-size: 30px; line-height: 36px; margin: 0 0 var(--s1); font-weight: 700; }
h2 { font-size: 22px; line-height: 28px; margin: var(--s4) 0 var(--s1); font-weight: 600; }
p { margin: 0 0 var(--s2); }
.lead { color: var(--muted); max-width: 60ch; }
.muted { color: var(--muted); }
.small { font-size: 14px; line-height: 20px; }

.card { background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s3); margin: var(--s3) 0 0; }
.card h2, .card h3 { margin: 0 0 var(--s1); font-size: 13px; line-height: 18px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
label.lbl { display: block; font-size: 13px; line-height: 18px; font-weight: 600; margin-bottom: 6px; }
input[type="text"], input[type="password"], input[type="search"], select {
  width: 100%; font: 400 16px/24px var(--mono); color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px; min-height: 48px;
}
select { font-family: var(--font); }
.note { font-size: 14px; line-height: 20px; color: var(--muted); margin: 6px 0 0; }
.err { display: none; margin: var(--s1) 0 0; padding: var(--s1) 12px; border: 1px solid var(--high); border-radius: var(--r-sm); color: var(--high); font-size: 14px; line-height: 20px; }
.err.on { display: block; }
.err::before { content: "Error · "; font-weight: 600; }
:lang(vi) .err::before { content: "Lỗi · "; }

.codes { display: none; margin-top: var(--s2); }
.codes.on { display: block; }
.big { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.digits { font: 700 40px/44px var(--mono); letter-spacing: .06em; font-variant-numeric: tabular-nums; }
.digits.mid { font-size: 26px; line-height: 32px; font-weight: 600; color: var(--muted); }
.lblrow { font-size: 13px; line-height: 18px; font-weight: 600; color: var(--muted); margin: var(--s2) 0 2px; }
.row { display: flex; align-items: center; gap: var(--s1); flex-wrap: wrap; }
.btn { font: 600 16px/24px var(--font); min-height: 44px; padding: 0 var(--s2); border-radius: var(--r-md); border: 1px solid var(--accent); background: var(--accent); color: var(--on-accent); cursor: pointer; }
.btn.alt { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.sm { min-height: 44px; font-size: 14px; }
@media (hover:hover) and (pointer:fine) {
  .btn:hover { filter: brightness(1.08); }
  .btn.alt:hover { border-color: var(--accent); }
  a:hover { text-decoration-thickness: 2px; }
  .old .ov:hover { filter: none; }
}
.timer { display: flex; align-items: center; gap: var(--s1); font-size: 14px; line-height: 20px; }
.ring { width: 36px; height: 36px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 4; }
.ring .bg { stroke: var(--line); }
.ring .fg { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .25s linear; }
.timer.low { color: var(--high); font-weight: 600; }
.timer.low .ring .fg { stroke: var(--high); }
.old { margin-top: var(--s2); display: none; }
.old.on { display: block; }
.old .ov { display: inline-block; margin: 0 var(--s1) var(--s1) 0; padding: 4px 10px; border: 1px dashed var(--line); border-radius: var(--r-sm); font: 400 18px/24px var(--mono); color: var(--muted); filter: blur(5px); user-select: none; }
.old .ov:hover, .old .ov:focus, .old .ov:active { filter: none; user-select: text; }
.old .why { display: block; font-size: 13px; line-height: 18px; color: var(--muted); margin-bottom: 6px; }
.masked .digits { letter-spacing: .2em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.status { font-size: 14px; line-height: 20px; margin: var(--s2) 0 0; padding: var(--s1) 12px; border: 1px solid var(--line); border-radius: var(--r-sm); }
.status.ok::before { content: "✓ "; color: var(--low); font-weight: 700; }
.status.warn { border-color: var(--mid); color: var(--mid); }
.status.warn::before { content: "! "; font-weight: 700; }
.status.bad { border-color: var(--high); color: var(--high); }
.status.bad::before { content: "!! "; font-weight: 700; }
.opts { display: grid; gap: 4px; margin-top: var(--s2); font-size: 14px; line-height: 20px; }
.opts label { display: flex; gap: var(--s1); align-items: flex-start; min-height: 32px; padding: 6px 0; }
.opts input { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--accent); }
.toolbar { display: flex; flex-wrap: wrap; gap: var(--s1); margin-top: var(--s3); }
.chip { display: none; margin-top: var(--s2); font-size: 14px; line-height: 20px; }
.chip.on { display: inline-block; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; color: var(--ink); text-decoration: none; }
.chip.on::before { content: "● "; color: var(--accent); }
.banner { display: none; position: fixed; left: var(--s2); right: var(--s2); bottom: var(--s2); max-width: 480px; margin: 0 auto; background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s2); gap: var(--s2); align-items: center; justify-content: space-between; z-index: 5; }
.banner.on { display: flex; }
.result { font-size: 14px; line-height: 20px; margin-top: var(--s1); min-height: 20px; }
.hint { font-size: 13px; line-height: 20px; color: var(--muted); margin-top: var(--s3); }
footer { border-top: 1px solid var(--line); padding: var(--s3) 0 var(--s5); font-size: 14px; line-height: 20px; color: var(--muted); }
footer .wrap > div { margin-bottom: var(--s1); }
footer a { padding: 8px 0; display: inline-block; }
ul.plain { padding-left: 20px; margin: 0 0 var(--s2); }
ul.plain li { margin-bottom: 6px; }
ol.steps { padding-left: 22px; }
ol.steps li { margin-bottom: 8px; }
code, kbd { font: 14px/20px var(--mono); background: var(--raised); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; }
pre.csp { font: 13px/20px var(--mono); background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-sm); padding: var(--s2); overflow-x: auto; white-space: pre-wrap; word-break: break-all; }
@media (max-width: 480px) { .digits { font-size: 34px; } h1 { font-size: 26px; line-height: 32px; } .card { padding: var(--s2); } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
.top8 { margin-top: 8px; }
