:root {
  --color-primary: #ee4d2d;
  --color-primary-dark: #d0391b;
  --color-primary-soft: #fff1ec;
  --color-accent: #ffc53d;
  --color-text: #1f1a17;
  --color-muted: #5b524d;
  --color-bg: #ffffff;
  --color-bg-alt: #fff7f4;
  --color-border: #f3e2dc;
  --color-code-bg: #0f172a;
  --color-success: #15803d;
  --color-error: #b91c1c;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(60, 20, 10, 0.06), 0 4px 16px rgba(60, 20, 10, 0.07);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-primary: #ff6a45;
    --color-primary-dark: #ee4d2d;
    --color-primary-soft: #2a1611;
    --color-text: #f3ece9;
    --color-muted: #b8aca6;
    --color-bg: #140e0c;
    --color-bg-alt: #1d1512;
    --color-border: #33241f;
    --color-code-bg: #020617;
    --color-success: #4ade80;
    --color-error: #f87171;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--color-primary); }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 0.6em; }
h1 { font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }

.container { width: min(1140px, 100% - 32px); margin-inline: auto; }
.narrow { max-width: 760px; }
.center { text-align: center; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 16px; top: 16px; z-index: 100; background: var(--color-bg); padding: 8px 12px; }

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.6em 1.2em;
  border: 2px solid var(--color-primary);
  border-radius: 999px;
  background: var(--color-primary);
  color: #fff;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}
.btn:hover { background: var(--color-primary-dark); border-color: var(--color-primary-dark); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.6; cursor: wait; }
.btn-ghost { background: transparent; color: var(--color-primary); }
.btn-ghost:hover { background: var(--color-bg-alt); }
.btn-sm { padding: 0.35em 0.9em; font-size: 0.9rem; }
.btn-lg { padding: 0.8em 1.6em; font-size: 1.05rem; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--color-bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; color: var(--color-text); text-decoration: none; }
.site-nav { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; justify-content: flex-end; }
.site-nav a:not(.btn) { color: var(--color-muted); text-decoration: none; font-weight: 500; }
.site-nav a:not(.btn):hover, .site-nav a[aria-current='page'] { color: var(--color-primary); }

/* Hero */
.hero { padding: 72px 0 64px; background: radial-gradient(1200px 500px at 85% 0%, color-mix(in srgb, var(--color-primary) 18%, transparent), transparent 70%), linear-gradient(180deg, var(--color-bg-alt), var(--color-bg)); }
.hero-inner { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; }
.eyebrow { display: inline-block; margin: 0 0 12px; padding: 4px 12px; border-radius: 999px; background: color-mix(in srgb, var(--color-primary) 15%, transparent); color: var(--color-primary); font-weight: 600; font-size: 0.85rem; }
.hero-subtitle { font-size: 1.2rem; color: var(--color-muted); margin: 0 0 28px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* Sections */
.section { padding: 72px 0; }
.section-alt { background: var(--color-bg-alt); }
.section-title { text-align: center; margin-bottom: 40px; }
.grid { display: grid; gap: 24px; }
.features { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.posts { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.steps { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); list-style: none; padding: 0; margin: 0; counter-reset: step; }
.steps li { counter-increment: step; }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 12px; border-radius: 50%; background: var(--color-primary); color: #fff; font-weight: 700; }
.card { background: var(--color-bg); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.card p { margin: 0; color: var(--color-muted); }
.feature-icon { font-size: 2rem; margin-bottom: 8px; }
.faq { border-bottom: 1px solid var(--color-border); padding: 16px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { color: var(--color-muted); margin: 8px 0 0; }

/* Lead form */
.lead { background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark)); color: #fff; }
.lead-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.lead-subtitle { font-size: 1.1rem; opacity: 0.9; }
.lead-form { background: var(--color-bg); color: var(--color-text); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); display: grid; gap: 14px; }
.lead-form label { display: grid; gap: 4px; font-weight: 600; font-size: 0.95rem; }
.lead-form input { font: inherit; font-weight: 400; padding: 12px 14px; border: 1px solid var(--color-border); border-radius: 8px; background: var(--color-bg); color: var(--color-text); }
.lead-form input:focus { outline: 2px solid var(--color-primary); outline-offset: 1px; }
.lead-form input[aria-invalid='true'] { border-color: var(--color-error); }
.field-error { color: var(--color-error); font-weight: 400; min-height: 0; }
.form-status { margin: 0; font-weight: 600; }
.form-status.is-success { color: var(--color-success); }
.form-status.is-error { color: var(--color-error); }
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Blog */
.page-header { padding: 40px 0 16px; }
.breadcrumb { font-size: 0.9rem; color: var(--color-muted); margin-bottom: 12px; }
.breadcrumb a { color: var(--color-muted); }
.blog-layout { display: grid; grid-template-columns: 1fr 260px; gap: 48px; padding-bottom: 64px; }
.post-list { display: grid; gap: 20px; }
.post-card { border-bottom: 1px solid var(--color-border); padding-bottom: 20px; }
.posts .post-card { border: 1px solid var(--color-border); border-radius: var(--radius); padding: 24px; background: var(--color-bg); }
.post-card-image { display: block; width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; border-radius: 10px; margin-bottom: 14px; background: var(--color-bg-alt); }
.post-list .post-card-image { max-width: 360px; }
.post-card h3 { font-size: 1.3rem; margin-bottom: 4px; }
.post-card h3 a { color: var(--color-text); text-decoration: none; }
.post-card h3 a:hover { color: var(--color-primary); }
.post-card p { margin: 0 0 8px; color: var(--color-muted); }
.post-meta { color: var(--color-muted); font-size: 0.9rem; margin: 0 0 8px; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tag { font-size: 0.85rem; padding: 2px 10px; border-radius: 999px; background: var(--color-bg-alt); text-decoration: none; }
.tag.active { background: var(--color-primary); color: #fff; }
.sidebar { padding-top: 40px; }
.sidebar h2 { font-size: 1rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-muted); }
.tag-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pagination { display: flex; justify-content: space-between; align-items: center; margin-top: 32px; }

/* Post (bố cục như Docusaurus: nội dung + mục lục bên phải) */
.post-layout { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 48px; padding: 24px 0 64px; }
.post { min-width: 0; max-width: 760px; }
.post-header { padding: 16px 0 8px; }
.post-cover { border-radius: var(--radius); margin: 16px 0; }
.post-updated { color: var(--color-muted); font-size: 0.9rem; font-style: italic; }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 40px 0; }
.post-nav a { text-decoration: none; display: grid; gap: 4px; }
.post-nav small { color: var(--color-muted); }
.align-right { text-align: right; }
.post-cta { text-align: center; }
.post-cta p { margin-bottom: 16px; }
.toc { position: sticky; top: 88px; align-self: start; max-height: calc(100vh - 110px); overflow: auto; border-left: 1px solid var(--color-border); padding-left: 16px; font-size: 0.9rem; }
.toc-title { font-weight: 700; margin: 0 0 8px; }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 6px 0; }
.toc .toc-l3 { padding-left: 14px; }
.toc a { color: var(--color-muted); text-decoration: none; }
.toc a:hover, .toc a.active { color: var(--color-primary); }

.prose { font-size: 1.05rem; }
.prose h2 { margin-top: 2em; }
.prose h3 { margin-top: 1.6em; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose pre, .prose table { margin: 0 0 1.2em; }
.prose img { border-radius: 8px; }
.prose blockquote { border-left: 4px solid var(--color-primary); padding: 4px 16px; color: var(--color-muted); background: var(--color-bg-alt); border-radius: 0 8px 8px 0; }
.prose code { font-family: var(--font-mono); font-size: 0.9em; background: var(--color-bg-alt); padding: 0.15em 0.35em; border-radius: 4px; }
.prose pre { background: var(--color-code-bg); color: #e2e8f0; padding: 16px 20px; border-radius: 8px; overflow-x: auto; line-height: 1.5; }
.prose pre code { background: none; padding: 0; color: inherit; }
.prose table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--color-border); padding: 8px 12px; text-align: left; }
.prose th { background: var(--color-bg-alt); }
.heading-anchor { opacity: 0; margin-left: 8px; text-decoration: none; }
.prose h2:hover .heading-anchor, .prose h3:hover .heading-anchor, .prose h4:hover .heading-anchor { opacity: 0.6; }

/* highlight.js (theme tối gọn nhẹ) */
.hljs-comment, .hljs-quote { color: #94a3b8; font-style: italic; }
.hljs-keyword, .hljs-selector-tag, .hljs-built_in { color: #c084fc; }
.hljs-string, .hljs-attr, .hljs-template-tag { color: #86efac; }
.hljs-number, .hljs-literal { color: #fdba74; }
.hljs-title, .hljs-function .hljs-title, .hljs-section { color: #93c5fd; }
.hljs-variable, .hljs-params, .hljs-property { color: #f9a8d4; }
.hljs-meta, .hljs-type { color: #67e8f9; }

/* Footer */
.site-footer { border-top: 1px solid var(--color-border); padding: 40px 0; color: var(--color-muted); font-size: 0.95rem; }
.footer-inner { display: grid; grid-template-columns: 1fr auto; gap: 16px; }
.footer-inner p { margin: 4px 0 0; }
.footer-inner nav { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-inner nav a { color: var(--color-muted); }
.copyright { grid-column: 1 / -1; }

/* Nút "Tải ứng dụng" — điểm nhấn chính của trang */
.btn-download {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(135deg, #ff7337, #ee4d2d 55%, #d0391b);
  border-color: transparent;
  box-shadow: 0 6px 18px color-mix(in srgb, #ee4d2d 40%, transparent);
  white-space: nowrap;
}
.btn-download:hover { background: linear-gradient(135deg, #ff6a2b, #e0401f 55%, #b92f14); border-color: transparent; transform: translateY(-1px); box-shadow: 0 10px 24px color-mix(in srgb, #ee4d2d 50%, transparent); }
.btn-download .btn-icon { flex: none; }
.btn-xl { padding: 0.95em 2em; font-size: 1.2rem; }
.btn-xl .btn-icon { width: 24px; height: 24px; }
.btn-download.btn-xl, .btn-download.btn-lg { animation: pulse 2.4s ease-out infinite; }
.btn-download-light { background: #fff; color: #ee4d2d; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18); }
.btn-download-light:hover { background: #fff7f4; color: #d0391b; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, #ee4d2d 55%, transparent), 0 6px 18px color-mix(in srgb, #ee4d2d 40%, transparent); }
  70% { box-shadow: 0 0 0 16px transparent, 0 6px 18px color-mix(in srgb, #ee4d2d 40%, transparent); }
  100% { box-shadow: 0 0 0 0 transparent, 0 6px 18px color-mix(in srgb, #ee4d2d 40%, transparent); }
}
.btn-download-light.btn-xl { animation-name: pulse-light; }
@keyframes pulse-light {
  0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7); }
  70% { box-shadow: 0 0 0 18px rgba(255, 255, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}
@media (prefers-reduced-motion: reduce) { .btn-download { animation: none !important; } }
.section-cta { margin: 40px 0 0; }

.hero-highlights { list-style: none; padding: 0; margin: 24px 0 0; display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--color-muted); font-size: 0.95rem; }
.hero-highlights li::before { content: '✓'; color: var(--color-primary); font-weight: 700; margin-right: 6px; }

/* Ưu đãi */
.promos-section, .cta-band { background: linear-gradient(135deg, #ff7337, #ee4d2d 50%, #c8321a); color: #fff; }
.promos-section .section-title { color: #fff; }
.promos { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.promo { background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.28); border-radius: var(--radius); padding: 24px; backdrop-filter: blur(4px); }
.promo h3 { margin-bottom: 6px; }
.promo p { margin: 0; opacity: 0.92; }
.promo .promo-value { font-size: 2rem; font-weight: 800; color: var(--color-accent); opacity: 1; margin-bottom: 8px; letter-spacing: -0.01em; }
.cta-band p { font-size: 1.15rem; opacity: 0.92; margin: 0 0 28px; }

/* Footer bổ sung */
.footer-cta { margin-top: 16px !important; }
.disclaimer { grid-column: 1 / -1; font-size: 0.85rem; margin: 8px 0 0; }
.disclaimer a { color: var(--color-muted); }

/* Thanh tải ứng dụng cố định (điện thoại) */
.sticky-download { display: none; }

/* Responsive */
@media (max-width: 900px) {
  .hero-inner, .lead-inner, .blog-layout, .post-layout { grid-template-columns: 1fr; }
  .hero { padding-top: 48px; }
  .toc { display: none; }
  .sidebar { padding-top: 0; }
}
@media (max-width: 900px) {
  .sticky-download {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: var(--color-bg); border-top: 1px solid var(--color-border);
    box-shadow: 0 -6px 20px rgba(60, 20, 10, 0.12);
  }
  .sticky-download-text { display: grid; line-height: 1.3; min-width: 0; }
  .sticky-download-text strong { font-size: 0.95rem; }
  .sticky-download-text small { color: var(--color-muted); }
  body { padding-bottom: 76px; }
}
@media (max-width: 600px) {
  .site-nav { gap: 12px; font-size: 0.95rem; }
  .site-nav a[href='/#tinh-nang'], .site-nav a[href='/#uu-dai'], .site-nav a[href='/blog'], .site-nav a[href='/']:not(.brand) { display: none; }
  .hero-actions .btn { flex: 1 1 100%; text-align: center; }
  .btn-xl { font-size: 1.1rem; }
  .brand { white-space: nowrap; }
  .section { padding: 48px 0; }
  .footer-inner { grid-template-columns: 1fr; }
  .post-nav { grid-template-columns: 1fr; }
}
