:root {
  --primary: #2563eb;
  --primary-dark: #1e3a8a;
  --accent: #ffc107;
  --red: #c62828;
  --green: #16a34a;
  --bg: #f8fafc;
  --card: #fff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
}

* { box-sizing: border-box; }

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

a { color: var(--primary); }

.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: 44px; height: 44px; border-radius: 12px; }
header.top a { color: inherit; text-decoration: none; font-weight: 700; font-size: 20px; }

.hero { text-align: center; padding: 16px 0 8px; }
.hero img.logo { width: 112px; height: 112px; border-radius: 28px; box-shadow: 0 6px 24px rgb(37 99 235 / 25%); }
.hero h1 { margin: 20px 0 4px; font-size: 34px; color: var(--primary-dark); }
.hero p.lead { margin: 0 auto; max-width: 30em; color: var(--muted); font-size: 19px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  margin-top: 24px;
}
.card h2 { margin: 0 0 12px; font-size: 22px; color: var(--primary-dark); }

.download { display: flex; gap: 28px; 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: 12px; padding: 8px; background: #fff; }
.download .btn { min-width: 218px; }
.hint { color: var(--muted); font-size: 15px; margin: 0; }
.hint.center { text-align: center; margin-top: 16px; }

.btn {
  display: inline-block;
  border: 0;
  border-radius: 12px;
  padding: 14px 22px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  background: var(--primary);
  color: #fff;
}
.btn:hover { filter: brightness(1.08); }
.btn.danger { background: var(--red); }
.btn.ghost { background: transparent; color: var(--primary); border: 1px solid var(--line); }
.btn[disabled] { opacity: .6; cursor: default; }

ul.features { padding-left: 1.2em; margin: 0; }
ul.features li { margin: 6px 0; }

ol.steps { padding-left: 1.3em; margin: 0; }
ol.steps li { margin: 6px 0; }

.note { color: var(--muted); font-size: 15px; }
.badge { display: inline-block; font-size: 13px; padding: 2px 8px; border-radius: 99px; background: #fff3e0; color: #8a4b00; }

.result { margin-top: 16px; padding: 14px 16px; border-radius: 12px; }
.result.ok { background: #e8f5ec; color: var(--green); }
.result.err { background: #fdecec; color: var(--red); }

.hidden { display: none !important; }

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

/* ===== Trang chủ ===== */
body.home { overflow-x: hidden; font-size: 18px; line-height: 1.6; }
body.home img { max-width: 100%; height: auto; }

.hero-band {
  background: linear-gradient(170deg, #2563eb 0%, #1d4ed8 60%, #1e40af 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: 800; font-size: 22px; }
.brand img { width: 52px; height: 52px; border-radius: 14px; box-shadow: 0 0 0 2px rgb(255 255 255 / 30%); }

.hero-band h1 { margin: 28px 0 14px; font-size: 34px; line-height: 1.2; letter-spacing: -.01em; }
.hero-band .lead { margin: 0; font-size: 20px; line-height: 1.55; 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:focus-visible { outline: 3px solid var(--accent); 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: 17px; 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: 28px; line-height: 1.25; color: var(--text); }
.section .hint { margin: 0; font-size: 17px; color: #475569; }

.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; }
.feature .ico {
  grid-row: span 2;
  display: grid; place-items: center; width: 52px; height: 52px;
  border-radius: 14px; background: #dbeafe; color: var(--primary);
}
.feature .ico svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.feature h3 { margin: 0 0 4px; font-size: 20px; line-height: 1.3; color: var(--text); }
.feature p { margin: 0; font-size: 18px; line-height: 1.55; color: #334155; }

.shots-section { padding-top: 0; }
.shots-section .wrap { padding-top: 40px; padding-bottom: 0; }
.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: #e2e8f0;
}
.shots:focus-visible { outline: 3px solid var(--primary); outline-offset: -3px; }

.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: 26px; line-height: 1.25; }
.cta p { margin: 0; font-size: 18px; color: #334155; }

body.home footer { margin-top: 8px; font-size: 16px; 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; }
  .cta .stores + .free { text-align: center; }
  .feature-grid { grid-template-columns: 1fr 1fr; column-gap: 32px; }
  .feature:nth-last-child(2) { border-bottom: 0; }
}

@media (min-width: 900px) {
  .wrap { max-width: 1040px; }
  body:not(.home) .wrap { max-width: 720px; }
  .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: 48px; }
  .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; }
}
