:root {
  --ink: #10222b;
  --muted: #566872;
  --line: #cdd9dc;
  --bg: #edf2f2;
  --paper: #ffffff;
  --brand: #0a5c55;
  --brand-dark: #07423d;
  --tag: #ffd23f;
  --tag-edge: #c9a000;
  --red: #b3261e;
  --red-soft: #fbe3e1;
  --green: #1d7a4a;
  --font: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.5; color: var(--ink); background: var(--bg); }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid #f2a900; outline-offset: 2px; }
.boot { padding: 40px 16px; text-align: center; color: var(--muted); }

.wrap { max-width: 560px; margin: 0 auto; padding: 0 16px calc(32px + env(safe-area-inset-bottom)); }
.top { background: var(--brand); color: #fff; padding: calc(16px + env(safe-area-inset-top)) 0 0; }
.top .wrap { padding-bottom: 0; }
.shop { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; }
.shop img { height: 44px; width: auto; max-width: 120px; object-fit: contain; background: #fff; border-radius: 6px; padding: 3px; }
.shop strong { display: block; font-size: 1.1rem; line-height: 1.2; }
.shop span { font-size: .9rem; opacity: .85; }
.switch { display: flex; gap: 4px; }
.switch a { flex: 1; text-align: center; padding: 11px 8px; text-decoration: none; color: #d6ece9; border-radius: 10px 10px 0 0; font-weight: 600; }
.switch a[aria-current="page"] { background: var(--bg); color: var(--brand-dark); }

main { padding-top: 20px; }
h1 { font-size: 1.45rem; line-height: 1.25; margin-bottom: 6px; }
.lead { color: var(--muted); margin-bottom: 18px; }

.form { display: grid; gap: 14px; }
.field label { display: block; font-weight: 600; margin-bottom: 4px; }
.field .hint { color: var(--muted); font-size: .88rem; margin-top: 3px; }
.input { width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); font-size: 16px; }
textarea.input { min-height: 96px; resize: vertical; }
.input:focus { border-color: var(--brand); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 460px) { .row { grid-template-columns: 1fr; } }
.check { display: flex; gap: 10px; align-items: flex-start; }
.check input { width: 22px; height: 22px; margin-top: 2px; flex: none; }
.terms { color: var(--muted); font-size: .92rem; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 10px 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); cursor: pointer; text-decoration: none; font-weight: 600; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.small { min-height: 36px; padding: 4px 12px; font-size: .92rem; }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.error { background: var(--red-soft); color: var(--red); border-radius: 10px; padding: 10px 12px; font-weight: 600; }
.notice { background: #e4f2ef; color: var(--brand-dark); border-radius: 10px; padding: 10px 12px; }

/* Ô bẫy chống máy tự động: người thật không nhìn thấy và không điền */
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; margin-top: 8px; }
.thumb { position: relative; }
.thumb img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); display: block; }
.thumb button { position: absolute; top: 4px; right: 4px; }
.thumb .state { position: absolute; left: 4px; bottom: 4px; background: rgba(16,34,43,.78); color: #fff; font-size: .78rem; padding: 1px 7px; border-radius: 99px; }
.thumb .state.bad { background: var(--red); }

/* Thẻ mã tra cứu: giống thẻ tag treo vào máy ở cửa hàng sửa chữa */
.tag { position: relative; margin: 8px auto 20px; max-width: 360px; background: var(--tag); color: #231c00; border-radius: 6px 6px 18px 18px; padding: 44px 20px 22px; text-align: center; box-shadow: 0 1px 0 var(--tag-edge); }
.tag::before { content: ""; position: absolute; top: 14px; left: 50%; width: 18px; height: 18px; margin-left: -9px; border-radius: 50%; background: var(--bg); box-shadow: inset 0 1px 2px rgba(0,0,0,.35); }
.tag .lbl { font-size: .95rem; font-weight: 600; }
.tag .code { font-family: Consolas, "SFMono-Regular", ui-monospace, monospace; font-size: 2.2rem; font-weight: 700; letter-spacing: .08em; margin: 4px 0 10px; user-select: all; }
.tag .cut { border-top: 2px dashed rgba(35,28,0,.45); margin: 10px -4px 12px; }
.tag p { font-size: .92rem; }

.result { background: var(--paper); border-radius: 14px; padding: 18px; display: grid; gap: 14px; }
.result h2 { font-size: 1.2rem; }
.status { font-size: 1.1rem; font-weight: 700; color: var(--brand-dark); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.steps li { position: relative; padding: 0 0 14px 30px; color: var(--muted); }
.steps li:last-child { padding-bottom: 0; }
.steps li::before { content: ""; position: absolute; left: 0; top: 4px; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); background: var(--paper); }
.steps li::after { content: ""; position: absolute; left: 7px; top: 22px; bottom: -2px; width: 2px; background: var(--line); }
.steps li:last-child::after { display: none; }
.steps li.done { color: var(--ink); }
.steps li.done::before { background: var(--brand); border-color: var(--brand); }
.steps li.done::after { background: var(--brand); }
.steps li.now { font-weight: 700; color: var(--brand-dark); }
.steps li.now::before { background: var(--tag); border-color: var(--brand); box-shadow: 0 0 0 4px #ffd23f55; }
.kv { display: grid; gap: 2px; }
.kv .k { color: var(--muted); font-size: .9rem; }
.kv .v { font-weight: 600; }
.note { background: #fff8dd; border-left: 4px solid var(--tag-edge); padding: 10px 12px; border-radius: 6px; }

.foot { color: var(--muted); font-size: .92rem; margin-top: 28px; text-align: center; }
.foot a { color: var(--brand-dark); font-weight: 600; }
@media (prefers-reduced-motion: no-preference) { .btn { transition: background-color .15s; } }
.mt10 { margin-top: 10px; }
.mt40 { margin-top: 40px; }
