/* Sổ Thuế landing — "Ink & Light" (decision #26), same tokens as the app
   (apps/mobile/tailwind.config.js is the source of truth for values). */
/* Self-hosted Inter, Vietnamese subset — the same @expo-google-fonts files
   the app bundles: no CDN dependency, identical rendering, instant repeats. */
@font-face {
  font-family: 'Inter';
  src: url('./assets/fonts/Inter_400Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('./assets/fonts/Inter_600SemiBold.ttf') format('truetype');
  font-weight: 500 600;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('./assets/fonts/Inter_800ExtraBold.ttf') format('truetype');
  font-weight: 700 800;
  font-display: swap;
}

:root {
  --bg: #fafaf8;
  --surface: #ffffff;
  --surface-2: #f3f2ef;
  --ink: #111110;
  --ink-soft: #55534e;
  --ink-faint: #6f6e68;
  --hairline: #ecebe8;
  --money: #00a876;
  --money-deep: #007a5e;
  --money-deeper: #00654a;
  --money-soft: #e3f6ef;
  --radius: 20px;
}

/* Dark twin — mirrors the app's first-class dark theme (docs/DESIGN.md: "Dark
   mode is a first-class twin, not an afterthought") so a dark-mode visitor no
   longer jumps from a bright cream landing to a near-black app. Values match
   apps/mobile/src/theme/colors.ts (darkColors). The one split worth naming:
   emerald that carries WHITE TEXT on a FILL (buttons, emerald bands) must stay
   deep (--money-fill), while emerald used AS TEXT on the near-black page must be
   bright (--money-deep) — a single emerald can't clear WCAG AA in both roles on
   #0c0c0b. Follows the app in giving elevation a neutral (not emerald) shadow in
   dark, so the phone doesn't neon-halo (design review #3 F4). */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0c0b;
    --surface: #161614;
    --surface-2: #1f1f1c;
    --ink: #f4f3f0;
    --ink-soft: #b0aea6;
    --ink-faint: #8f8d85;
    --hairline: #262623;
    --money: #00c08b;
    --money-deep: #00c891; /* emerald TEXT on the dark page — AA on #0c0c0b */
    --money-deeper: #33d6a6; /* brighter emerald text (blog callouts/strong) */
    --money-soft: #10281f;
    --money-fill: #008165; /* emerald FILL carrying white text — AA for #fff */
  }
  /* White-on-emerald fills use the deep fill token, not the bright text one. */
  .btn-primary,
  .section-dark,
  .section-cta { background: var(--money-fill); }
  .btn-primary { box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45); }
  .btn-primary:hover { background: #006e55; }
  /* A white button on an emerald band keeps deep-emerald text on its white face. */
  .btn-light { color: var(--money-fill); }
  /* Neutral elevation behind the phone — no emerald neon halo (app F4). */
  .phone-frame {
    box-shadow:
      0 1px 2px rgba(0, 0, 0, 0.5),
      0 24px 48px rgba(0, 0, 0, 0.5),
      0 60px 120px rgba(0, 0, 0, 0.45);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 720px; }

h1, h2, h3 { line-height: 1.15; margin: 0 0 16px; letter-spacing: -0.01em; }
h1 { font-size: clamp(34px, 6vw, 56px); font-weight: 800; letter-spacing: -0.025em; }
h1 .accent {
  background: linear-gradient(120deg, var(--money) 0%, var(--money-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
h2 { font-size: clamp(26px, 4vw, 38px); font-weight: 700; }
h3 { font-size: 19px; font-weight: 600; }
p { margin: 0 0 12px; }

/* in-app-webview install nudge (install-help-webview) — shown only inside
   Zalo/FB/etc. webviews where a PWA can't be installed. */
.iw-banner { background: var(--money-soft); border-bottom: 1px solid var(--hairline); }
.iw-inner { display: flex; align-items: center; gap: 16px; padding-top: 12px; padding-bottom: 12px; }
.iw-text { flex: 1; min-width: 0; }
.iw-text strong { display: block; font-size: 15px; font-weight: 700; color: var(--money-deeper); }
.iw-text p { margin: 3px 0 0; font-size: 13.5px; color: var(--ink-soft); line-height: 1.45; }
.iw-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
/* platform-specific rows — webview.js adds .iw-android or .iw-ios.
   Scoped under .iw-banner so the reset outranks .btn's own display rule. */
.iw-banner .iw-android-msg,
.iw-banner .iw-ios-msg,
.iw-banner .iw-android-btn { display: none; }
.iw-banner.iw-android .iw-android-msg { display: block; }
.iw-banner.iw-android .iw-android-btn { display: inline-block; }
.iw-banner.iw-ios .iw-ios-msg { display: block; }
.iw-dismiss {
  background: transparent; border: none; color: var(--ink-faint); font-size: 15px;
  cursor: pointer; padding: 8px 10px; border-radius: 8px; line-height: 1; font-family: inherit;
}
.iw-dismiss:hover { color: var(--ink); background: rgba(0, 0, 0, 0.05); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* A2HS install guide (install-a2hs-guide) — a bottom-anchored card shown only
   in a standalone browser where the PWA CAN install but the path isn't
   obvious. Distinct from .iw-banner (the in-app-webview case); the two are
   mutually exclusive and never co-occur. */
.a2hs-banner {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 40;
  margin: 0 auto; max-width: 460px;
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: 16px; box-shadow: 0 12px 34px rgba(17, 17, 16, 0.18);
  padding: 14px 16px;
  transform: translateY(140%); opacity: 0;
  transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.34s ease;
}
.a2hs-banner.a2hs-show { transform: none; opacity: 1; }
.a2hs-inner { display: flex; align-items: center; gap: 12px; padding-right: 20px; }
.a2hs-icon { flex-shrink: 0; border-radius: 10px; }
.a2hs-text { flex: 1; min-width: 0; }
.a2hs-text strong { display: block; font-size: 15px; font-weight: 700; color: var(--ink); }
.a2hs-text p { margin: 3px 0 0; font-size: 13px; color: var(--ink-soft); line-height: 1.45; }
/* platform-specific rows — install-a2hs.js adds .a2hs-android or .a2hs-ios.
   Scoped under .a2hs-banner so the reset outranks .btn's own display rule.
   The Android install button is a full-width row below the text (a clean
   install-card pattern); the ✕ sits in the top-right corner either way. */
.a2hs-banner .a2hs-android-msg,
.a2hs-banner .a2hs-ios-msg,
.a2hs-banner .a2hs-install { display: none; }
.a2hs-banner.a2hs-android .a2hs-android-msg { display: block; }
.a2hs-banner.a2hs-android .a2hs-install {
  display: block; width: 100%; margin-top: 12px; text-align: center;
  padding: 11px 18px; font-size: 15px; border-radius: 12px;
}
.a2hs-banner.a2hs-ios .a2hs-ios-msg { display: block; }
.a2hs-dismiss {
  position: absolute; top: 8px; right: 8px;
  background: transparent; border: none; color: var(--ink-faint); font-size: 15px;
  cursor: pointer; padding: 8px 10px; border-radius: 8px; line-height: 1; font-family: inherit;
}
.a2hs-dismiss:hover { color: var(--ink); background: rgba(0, 0, 0, 0.05); }
@media (prefers-reduced-motion: reduce) {
  .a2hs-banner { transition: opacity 0.2s ease; transform: none; }
}

@media (max-width: 560px) {
  .iw-inner { flex-wrap: wrap; }
  .iw-actions { width: 100%; justify-content: space-between; }
}

/* topbar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: var(--ink); text-decoration: none; }
.brand img { border-radius: 9px; }
.topnav { display: flex; align-items: center; gap: 12px; }
.topnav-link { color: var(--ink-soft); text-decoration: none; font-weight: 600; font-size: 15px; padding: 6px 4px; }
.topnav-link:hover { color: var(--money-deep); }
@media (max-width: 480px) { .topnav-link { display: none; } }

/* buttons */
.btn {
  display: inline-block; padding: 14px 26px; border-radius: 14px;
  font-weight: 600; font-size: 16px; text-decoration: none; border: none; cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.btn:active { transform: scale(0.98); }
.btn-sm { padding: 9px 18px; font-size: 14px; border-radius: 11px; }
.btn-primary { background: var(--money-deep); color: #fff; box-shadow: 0 6px 18px rgba(0, 122, 94, 0.25); }
.btn-primary:hover { background: var(--money-deeper); }
.btn-ghost { background: transparent; color: var(--money-deep); border: 1.5px solid var(--money-deep); }
.btn-ghost:hover { background: var(--money-soft); }
.btn-light { background: #fff; color: var(--money-deep); }
.lang-toggle {
  background: var(--surface); border: 1px solid var(--hairline); color: var(--ink-soft);
  font-weight: 700; font-size: 13px; padding: 8px 12px; border-radius: 10px; cursor: pointer;
  font-family: inherit;
}
.lang-toggle:hover { border-color: var(--money-deep); color: var(--money-deep); }

/* hero */
.hero { padding: 72px 0 40px; overflow: hidden; }
.hero-inner { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 48px; align-items: center; }
.eyebrow {
  display: inline-block; background: var(--money-soft); color: var(--money-deep);
  font-weight: 600; font-size: 13px; padding: 6px 14px; border-radius: 999px; margin-bottom: 20px;
}
.lede { font-size: 18px; color: var(--ink-soft); max-width: 54ch; }
.hero-ctas { display: flex; gap: 14px; margin: 26px 0 14px; flex-wrap: wrap; }
.hero-note { font-size: 13px; color: var(--ink-faint); }

.hero { position: relative; }
.hero::before {
  /* soft emerald aura behind the phone — depth without noise */
  content: '';
  position: absolute; right: -120px; top: -60px;
  width: 560px; height: 560px; border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 168, 118, 0.10) 0%, transparent 65%);
  pointer-events: none;
}
.hero-phone { display: flex; justify-content: center; position: relative; }
.phone-frame {
  width: min(300px, 78vw);
  border-radius: 44px; padding: 12px; background: linear-gradient(160deg, #2a2a26, #141412);
  box-shadow:
    0 1px 2px rgba(27, 27, 24, 0.3),
    0 24px 48px rgba(27, 27, 24, 0.22),
    0 60px 120px rgba(0, 122, 94, 0.18);
  transform: rotate(2.5deg);
}
.phone-frame img { width: 100%; display: block; border-radius: 33px; }

.float-chip {
  position: absolute; z-index: 2;
  background: var(--surface); border: 1px solid var(--hairline); border-radius: 16px;
  padding: 12px 18px; display: flex; flex-direction: column; line-height: 1.25;
  box-shadow: 0 1px 2px rgba(27, 27, 24, 0.06), 0 16px 40px rgba(27, 27, 24, 0.14);
  animation: float 7s ease-in-out infinite;
}
.float-chip strong { font-size: 19px; font-weight: 800; color: var(--money-deep); font-variant-numeric: tabular-nums; }
.float-chip span { font-size: 12px; color: var(--ink-soft); }
.chip-a { top: 8%; left: 2%; }
.chip-b { bottom: 12%; right: 0; animation-delay: -3.5s; }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-9px); }
}

/* sections */
.section { padding: 76px 0; }
.section-lede { color: var(--ink-soft); font-size: 17px; max-width: 62ch; }
.section-surface { background: var(--surface); border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); }
.section-dark { background: var(--money-deep); color: #fff; }
.section-dark h2 { color: #fff; }
.section-dark .section-lede { color: rgba(255, 255, 255, 0.82); }
.section-cta { background: var(--money-deep); color: #fff; padding: 64px 0; }
.section-cta h2 { color: #fff; }
.section-cta .section-lede { color: rgba(255, 255, 255, 0.9); margin: 0 auto 26px; }

/* stats */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 40px; }
.stat { background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.14); border-radius: var(--radius); padding: 26px; }
.stat-num {
  font-size: 36px; font-weight: 800; margin-bottom: 10px; font-variant-numeric: tabular-nums;
  background: linear-gradient(120deg, #ffffff 20%, #8fe6c9 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat p { color: rgba(255, 255, 255, 0.82); font-size: 14.5px; margin: 0; }

/* features */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 36px; }
.card {
  background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius);
  padding: 28px; transition: transform 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 1px 2px rgba(27, 27, 24, 0.04);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 1px 2px rgba(27, 27, 24, 0.05), 0 20px 44px rgba(27, 27, 24, 0.09);
}
.card-icon {
  width: 52px; height: 52px; border-radius: 16px; background: var(--money-soft);
  display: flex; align-items: center; justify-content: center; font-size: 24px; margin-bottom: 18px;
}
.card p { color: var(--ink-soft); font-size: 15px; margin: 0; }

/* rates table */
.table-wrap { overflow-x: auto; margin-top: 32px; border: 1px solid var(--hairline); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; background: var(--surface); font-size: 15px; min-width: 560px; }
th, td { text-align: left; padding: 16px 20px; border-bottom: 1px solid var(--hairline); }
th { font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-faint); font-weight: 600; }
tbody tr:last-child td { border-bottom: none; }
td:nth-child(n + 2), th:nth-child(n + 2) { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:hover { background: var(--money-soft); }

.fineprint { font-size: 13px; color: var(--ink-faint); margin-top: 18px; }

/* faq */
details { background: var(--surface); border: 1px solid var(--hairline); border-radius: 16px; padding: 18px 22px; margin-top: 14px; }
summary { font-weight: 600; cursor: pointer; font-size: 16px; }
details p { color: var(--ink-soft); margin: 12px 0 0; font-size: 15px; }

/* footer */
.footer { padding: 44px 0 28px; border-top: 1px solid var(--hairline); }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 18px; }
.footer p { color: var(--ink-soft); font-size: 14px; }
.footer-links { display: flex; align-items: center; gap: 18px; }
.footer-links a { color: var(--money-deep); text-decoration: none; font-weight: 600; font-size: 15px; }
.footer-links a:hover { text-decoration: underline; }

/* blog (landing/blog/) — reuses the "Ink & Light" tokens; no new language */
.blog-head { padding: 72px 0 8px; }
.blog-head .eyebrow { margin-bottom: 16px; }
.blog-head .lede { margin-top: 4px; }
.blog-list-section { padding-top: 40px; }

.post-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; }
.post-card {
  display: block; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius);
  padding: 28px; transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  box-shadow: 0 1px 2px rgba(27, 27, 24, 0.04);
}
.post-card:hover {
  transform: translateY(-4px); border-color: color-mix(in srgb, var(--money-deep) 30%, var(--hairline));
  box-shadow: 0 1px 2px rgba(27, 27, 24, 0.05), 0 20px 44px rgba(27, 27, 24, 0.09);
}
.post-card h2 { font-size: 24px; margin: 12px 0 8px; }
.post-card p { color: var(--ink-soft); font-size: 15.5px; margin: 0 0 14px; }

.post-meta { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--ink-faint); }
.post-tag {
  background: var(--money-soft); color: var(--money-deep);
  font-weight: 600; padding: 4px 12px; border-radius: 999px; font-size: 12.5px;
}
.post-meta time { font-variant-numeric: tabular-nums; }
.post-more { color: var(--money-deep); font-weight: 600; font-size: 15px; }

/* article (a single blog post) */
.article { padding: 48px 0 24px; }
.article-back {
  display: inline-block; color: var(--money-deep); text-decoration: none;
  font-weight: 600; font-size: 14px; margin-bottom: 24px;
}
.article-back:hover { text-decoration: underline; }
.article-head { border-bottom: 1px solid var(--hairline); padding-bottom: 28px; margin-bottom: 8px; }
.article-head h1 { font-size: clamp(28px, 4.6vw, 42px); margin: 16px 0 14px; }
.article-dek { font-size: 19px; color: var(--ink-soft); line-height: 1.5; margin: 0; }

.article-body { font-size: 17px; color: var(--ink); }
.article-body h2 { font-size: 23px; margin: 40px 0 12px; }
.article-body p { color: var(--ink-soft); margin: 0 0 16px; }
.article-body strong { color: var(--ink); font-weight: 600; }

.callout {
  background: var(--money-soft); border: 1px solid color-mix(in srgb, var(--money) 22%, var(--hairline));
  border-radius: var(--radius); padding: 26px; margin: 36px 0;
}
.callout strong { display: block; font-size: 18px; color: var(--money-deeper); margin-bottom: 8px; }
.callout p { color: var(--ink-soft); font-size: 15.5px; margin: 0 0 18px; }

.sources { margin: 36px 0 20px; }
.sources strong { display: block; font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-faint); margin-bottom: 10px; }
.sources ul { margin: 0; padding-left: 20px; }
.sources li { color: var(--ink-soft); font-size: 14px; margin-bottom: 6px; line-height: 1.5; }

@media (max-width: 860px) {
  .blog-head { padding: 40px 0 4px; }
  .article { padding: 28px 0 16px; }
  .post-card { padding: 22px; }
  .post-card h2 { font-size: 21px; }
}

/* scroll reveal */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .float-chip { animation: none; }
  html { scroll-behavior: auto; }
}

/* responsive */
@media (max-width: 860px) {
  .hero { padding: 40px 0 24px; }
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .stat-grid, .feature-grid { grid-template-columns: 1fr; }
  .section { padding: 56px 0; }
}
