/* Đổi file này thì đổi số ?v= ở các trang .html: Cloudflare và trình duyệt giữ file css 1 ngày. */
/* Phong cách: Clean SaaS, nền sáng, thẻ trắng viền mảnh, không gradient, không bóng nặng. */
:root {
  --bg: #f8fafc;
  --card: #ffffff;
  --line: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;

  --radius: 12px;          /* rounded-xl */
  --radius-sm: 8px;        /* rounded-lg */
  --shadow: 0 1px 2px 0 rgb(15 23 42 / 5%); /* shadow-sm */
  --gap: 16px;             /* gap-4 */
  --pad: 20px;             /* p-5 */

  /* Icon lucide dùng làm mask cho hộp lưu ý / kết quả. */
  --i-info: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4'/%3E%3Cpath d='M12 8h.01'/%3E%3C/svg%3E");
  --i-alert: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3'/%3E%3Cpath d='M12 9v4'/%3E%3Cpath d='M12 17h.01'/%3E%3C/svg%3E");
  --i-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='m9 12 2 2 4-4'/%3E%3C/svg%3E");
  --i-error: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 8v4'/%3E%3Cpath d='M12 16h.01'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

/* Ảnh không bao giờ rộng hơn khung: một ảnh tràn là điện thoại thu nhỏ cả trang. */
img { max-width: 100%; height: auto; }
code {
  overflow-wrap: anywhere;
  font-size: .875em;
  padding: 1px 6px;
  border-radius: 6px;
  background: #f1f5f9;
  border: 1px solid var(--line);
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

h1 { font-size: 24px; line-height: 1.3; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 8px; }
b, strong { font-weight: 600; }

/* Icon lucide: 20px, nét mảnh. */
svg.icon {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round;
}

.wrap { max-width: 720px; margin: 0 auto; padding: 24px 20px 48px; }

header.top { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
header.top img { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); }
header.top a { color: inherit; text-decoration: none; font-weight: 600; font-size: 18px; }

.hero { text-align: center; padding: 16px 0 8px; }
.hero img.logo { width: 96px; height: 96px; border-radius: 22px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.hero h1 { margin: 20px 0 6px; font-size: 30px; letter-spacing: -0.02em; }
.hero p.lead { margin: 0 auto; max-width: 30em; color: var(--muted); font-size: 18px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--pad);
  margin-top: var(--gap);
}
.card > :last-child { margin-bottom: 0; }
.card h2 {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 12px; font-size: 18px; line-height: 1.4; font-weight: 600;
}
.card h2 svg.icon { color: var(--accent); }
.card h3 { margin: 20px 0 8px; font-size: 16px; font-weight: 600; }
section.card { scroll-margin-top: 12px; }

.download { display: flex; gap: 24px; align-items: flex-start; justify-content: center; flex-wrap: wrap; text-align: center; }
.download .store { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.download .qr { width: 200px; height: 200px; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; background: #fff; }
.download .btn { min-width: 218px; }
.hint { color: var(--muted); font-size: 14px; margin: 0; }
.hint.center { text-align: center; margin-top: 16px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 11px 18px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  transition: background-color .15s, border-color .15s;
}
.btn:hover { background: var(--accent-hover); color: #fff; }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #b91c1c; }
.btn.ghost { background: var(--card); color: var(--text); border-color: var(--line); }
.btn.ghost:hover { background: #f1f5f9; color: var(--text); }
.btn[disabled] { opacity: .6; cursor: default; }

ul.features, ol.steps { margin: 0; }
ul.features { padding-left: 1.2em; }
ol.steps { padding-left: 1.3em; }
ul.features li, ol.steps li { margin: 6px 0; }
ul.features li::marker, ol.steps li::marker { color: var(--muted); }
ol.steps ul { padding-left: 1.2em; margin: 6px 0; }

.toc ol { columns: 2; column-gap: 28px; padding-left: 1.5em; margin: 0; }
.toc li { margin: 0 0 8px; break-inside: avoid; }
.toc li::marker { color: var(--muted); }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }
@media (max-width: 560px) { .toc ol { columns: 1; } }

/* Hộp lưu ý: nền nhạt, viền màu trạng thái, icon bên trái. */
.tip, .warn, .result {
  position: relative;
  padding: 12px 14px 12px 44px;
  border: 1px solid;
  border-radius: var(--radius-sm);
  font-size: 15px;
}
.tip::before, .warn::before, .result::before {
  content: "";
  position: absolute; left: 14px; top: 13px;
  width: 20px; height: 20px;
  background: currentColor;
  -webkit-mask: var(--i) center / contain no-repeat;
          mask: var(--i) center / contain no-repeat;
}
.tip { --i: var(--i-info); background: #eff6ff; border-color: #bfdbfe; }
.tip::before { background: var(--accent); }
.warn { --i: var(--i-alert); background: #fffbeb; border-color: #fde68a; }
.warn::before { background: var(--warning); }

.shot { margin: 20px auto 8px; max-width: 340px; }
.shot img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.shot figcaption { margin-top: 10px; font-size: 14px; color: var(--muted); }
.shot .legend { margin: 0; padding-left: 1.5em; }
.shot .legend li { margin: 3px 0; }
/* Cùng màu với số khoanh trên ảnh chụp. */
.shot .legend li::marker { color: #e53935; font-weight: 600; }

.faq { margin: 0; }
.faq dt { font-weight: 600; margin-top: 16px; }
.faq dt:first-child { margin-top: 0; }
.faq dd { margin: 4px 0 0; color: var(--text); }

/* Điện thoại: bớt lề để chữ và ảnh chiếm gần hết màn hình, nút bấm rộng hết hàng. */
@media (max-width: 560px) {
  .wrap { padding: 16px 16px 32px; }
  .card { padding: 16px; }
  .hero h1 { font-size: 26px; }
  .hero p.lead { font-size: 17px; }
  .download .store { width: 100%; }
  .download .btn { width: 100%; min-width: 0; }
  .btn.ghost { display: flex; width: 100%; }
  footer { margin-top: 16px; }
}

/* PC: trang hướng dẫn rộng hơn, ảnh nằm cạnh chữ thay vì nằm dưới. */
@media (min-width: 900px) {
  .wrap.wide { max-width: 1000px; }
  .wide .toc ol { columns: 3; }
  .has-shot {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    /* Hàng cuối co giãn nhận phần cao dư của ảnh, để các hàng chữ không bị giãn cách. */
    grid-template-rows: repeat(8, auto) 1fr;
    column-gap: 36px;
    align-items: start;
  }
  .has-shot > * { grid-column: 1; }
  .has-shot > .shot { grid-column: 2; grid-row: 1 / -1; margin: 0; max-width: none; }
}

.note { color: var(--muted); font-size: 14px; }
.badge {
  display: inline-block; font-size: 12px; font-weight: 500; line-height: 1.6;
  padding: 1px 8px; border-radius: 99px;
  background: #fffbeb; color: #b45309; border: 1px solid #fde68a;
}

.result { margin-top: 16px; }
.result.ok { --i: var(--i-check); background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }
.result.ok::before { background: var(--success); }
.result.err { --i: var(--i-error); background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.result.err::before { background: var(--danger); }

.hidden { display: none !important; }

footer { margin-top: 40px; text-align: center; color: var(--muted); font-size: 14px; }
footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--text); text-decoration: underline; }

/* ===== Trang chủ (body.home): dải xanh đầu trang theo màu app, nút cửa hàng, lưới tính năng, ảnh vuốt ngang ===== */
body.home { overflow-x: hidden; font-size: 17px; }
body.home .wrap { padding-bottom: 0; }

.hero-band {
  background: linear-gradient(160deg, #2563eb 0%, #1d4ed8 55%, #1e3a8a 100%);
  color: #fff;
  padding-top: env(safe-area-inset-top);
}
.hero-band .wrap { padding-top: 20px; padding-bottom: 36px; }
.hero-grid { display: grid; gap: 32px; align-items: center; }

.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 22px; }
.brand img { width: 52px; height: 52px; border-radius: 14px; box-shadow: 0 0 0 2px rgb(255 255 255 / 35%); }
.free-tag {
  font-size: 13px; font-weight: 800; letter-spacing: .02em; text-transform: uppercase;
  padding: 3px 12px; border-radius: 99px; background: #fbbf24; color: var(--text);
}

.hero-band h1 { margin: 28px 0 14px; font-size: 34px; line-height: 1.18; font-weight: 800; letter-spacing: -.02em; }
.hero-band h1 em { display: block; font-style: normal; color: #fbbf24; }
.hero-band .lead { margin: 0; font-size: 18px; line-height: 1.6; color: #fff; opacity: .92; max-width: 32em; }

.stores { display: flex; flex-direction: column; gap: 12px; margin-top: 28px; }
.store-btn {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 64px; padding: 10px 22px;
  border-radius: 16px; background: #000; color: #fff; text-decoration: none;
  border: 1px solid rgb(255 255 255 / 35%);
}
.store-btn:hover { color: #fff; background: #111827; }
.store-btn:focus-visible { outline: 3px solid #fbbf24; outline-offset: 2px; }
.store-btn svg { width: 30px; height: 30px; flex: none; }
.store-btn span { display: flex; flex-direction: column; font-size: 22px; font-weight: 700; line-height: 1.1; text-align: left; }
.store-btn small { font-size: 13px; font-weight: 500; opacity: .85; margin-bottom: 2px; }
.store-btn.light { border-color: #000; }

.free { margin: 18px 0 0; font-size: 16px; color: #fff; opacity: .9; text-align: center; }

.hero-shot { display: none; }

.section { padding-top: 40px; padding-bottom: 8px; }
.section-title { margin: 0 0 8px; font-size: 26px; line-height: 1.25; font-weight: 700; letter-spacing: -.01em; }
.section .hint { margin: 0; font-size: 16px; color: var(--muted); }

.feature-grid { display: grid; grid-template-columns: 1fr; margin-top: 8px; }
.feature {
  display: grid; grid-template-columns: 52px 1fr; column-gap: 16px;
  padding: 20px 0; border-bottom: 1px solid var(--line); align-content: start;
}
.feature:last-child { border-bottom: 0; }
.home .ico {
  display: grid; place-items: center; width: 52px; height: 52px; flex: none;
  border-radius: 14px; background: #dbeafe; color: var(--accent);
}
.feature .ico { grid-row: span 2; }
.home .ico svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.feature h3 { margin: 0 0 4px; font-size: 18px; line-height: 1.35; font-weight: 600; }
.feature p { margin: 0; font-size: 16px; line-height: 1.55; color: #334155; }

.shots-section { padding-top: 0; }
.shots-section .wrap { padding-top: 40px; }
.shots {
  display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 16px 20px 20px; scroll-padding: 0 20px;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.shots::-webkit-scrollbar { display: none; }
.shots img {
  flex: none; width: 82vw; max-width: 340px; border-radius: 20px; scroll-snap-align: center;
  box-shadow: 0 6px 20px rgb(15 23 42 / 15%); background: var(--line);
}
.shots:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }

.guide {
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 20px;
}
.guide > div { flex: 1 1 220px; }
.guide h2 { margin: 0 0 2px; font-size: 20px; font-weight: 600; }
.guide p { margin: 0; color: #334155; }
.guide .btn { flex: 1 1 100%; }

.cta { text-align: center; background: #eff6ff; border-radius: 24px; padding: 32px 20px; }
.cta img { border-radius: 18px; }
.cta h2 { margin: 14px 0 6px; font-size: 24px; line-height: 1.25; font-weight: 700; }
.cta p { margin: 0; font-size: 17px; color: #334155; }
.qr-row { display: none; }

body.home footer { margin-top: 8px; font-size: 15px; line-height: 2; padding-bottom: calc(32px + env(safe-area-inset-bottom)); }

@media (min-width: 600px) {
  .stores { flex-direction: row; flex-wrap: wrap; }
  .stores.center { justify-content: center; }
  .store-btn { min-width: 230px; }
  .free { text-align: left; }
  .feature-grid { grid-template-columns: 1fr 1fr; column-gap: 32px; }
  .feature:nth-last-child(2) { border-bottom: 0; }
  .guide .btn { flex: none; }
}

@media (min-width: 900px) {
  body.home .wrap { max-width: 1040px; }
  .hero-band .wrap { padding-top: 40px; padding-bottom: 0; }
  .hero-grid { grid-template-columns: 1.2fr 1fr; gap: 48px; align-items: end; }
  .hero-text { padding-bottom: 64px; }
  .hero-band h1 { font-size: 50px; }
  .hero-shot { display: flex; justify-content: center; }
  .hero-shot img { width: 340px; display: block; border-radius: 24px 24px 0 0; box-shadow: 0 -8px 40px rgb(0 0 0 / 25%); }
  .feature-grid { grid-template-columns: repeat(3, 1fr); }
  .feature:nth-last-child(3) { border-bottom: 0; }
  .shots { max-width: 1040px; margin: 0 auto; }
  .shots img { width: 280px; scroll-snap-align: start; }
  .shots img.mobile-only { display: none; }
  .qr-row { display: flex; justify-content: center; gap: 32px; margin-top: 24px; }
  .qr-row figure { margin: 0; }
  .qr-row img { width: 140px; height: 140px; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
  .qr-row figcaption { margin-top: 6px; font-size: 14px; color: var(--muted); }
}
