/* ================= Chat Auto — Landing site ================= */
:root {
  --bg: #fafcfe;
  --bg-alt: #eff6fb;
  --surface: #ffffff;
  --text: #22303a;
  --muted: #5f7585;
  --line: #e2edf4;
  --brand: #0a72ad;
  --brand-2: #0088cc;
  --grad: linear-gradient(135deg, #0a72ad 0%, #0088cc 100%);
  --shadow: 0 10px 30px rgba(11, 87, 130, .08);
  --shadow-sm: 0 4px 14px rgba(11, 87, 130, .06);
  --radius: 16px;
  --radius-sm: 10px;
  --maxw: 1140px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .4em; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.container.narrow { max-width: 780px; }

.grad-text {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  border: 0; border-radius: 999px; cursor: pointer;
  font-weight: 600; font-size: 15px; padding: 11px 22px;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease, opacity .12s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 6px 18px rgba(0, 136, 204, .24); }
.btn-primary:hover { box-shadow: 0 10px 24px rgba(0, 136, 204, .30); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--brand); border: 1.5px solid var(--brand); }
.btn-ghost:hover { background: rgba(10, 114, 173, .08); }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-sm { padding: 8px 16px; font-size: 14px; }
.btn-block { width: 100%; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
  transition: background-color .25s ease, box-shadow .25s ease;
}
/* Cuộn xuống thì thanh đầu trang gọn lại + nổi khối lên khỏi nội dung */
.site-header.scrolled { background: rgba(255, 255, 255, .94); box-shadow: 0 4px 20px rgba(11, 87, 130, .09); }
.header-inner { display: flex; align-items: center; gap: 18px; height: 64px; transition: height .25s ease; }
.site-header.scrolled .header-inner { height: 54px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; }
.brand-logo { width: 34px; height: 34px; border-radius: 9px; box-shadow: var(--shadow-sm); transition: transform .25s ease; }
.site-header.scrolled .brand-logo { transform: scale(.88); }
.brand-name { letter-spacing: -.02em; }
.brand-accent { color: var(--brand); }
.nav { display: flex; gap: 22px; margin-left: 10px; }
.nav a { color: var(--muted); font-weight: 500; font-size: 15px; transition: color .12s; }
.nav a:hover { color: var(--brand); }
.header-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }

.search-box { position: relative; display: flex; align-items: center; }
.search-box .search-ic { width: 18px; height: 18px; position: absolute; left: 11px; color: var(--muted); }
.search-box input {
  border: 1.5px solid var(--line); background: var(--surface);
  border-radius: 999px; padding: 8px 14px 8px 34px; font-size: 14px; width: 210px;
  outline: none; transition: border-color .12s, box-shadow .12s;
}
.search-box input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(10, 114, 173, .14); }

.nav-toggle { display: none; flex-direction: column; gap: 4px; background: none; border: 0; cursor: pointer; padding: 6px; }
.nav-toggle span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: .2s; }

/* ---------- Search results ---------- */
.search-results { padding: 18px 20px; }
.search-summary { color: var(--muted); font-weight: 600; margin: 8px 0 14px; }
.search-list { display: grid; gap: 10px; }
.search-hit {
  display: block; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 12px 16px; box-shadow: var(--shadow-sm);
}
.search-hit b { color: var(--brand); }
.search-hit .kind { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

/* ---------- Hero ---------- */
.hero { padding: 64px 0 40px; }
.hero-inner { display: grid; grid-template-columns: 1.15fr 1fr; gap: 48px; align-items: center; }
.pill {
  display: inline-block; background: rgba(10, 114, 173, .1); color: var(--brand);
  font-weight: 600; font-size: 13px; padding: 6px 14px; border-radius: 999px; margin-bottom: 18px;
}
.hero h1 { font-size: clamp(30px, 5vw, 50px); letter-spacing: -.02em; }
.lead { font-size: 18px; color: var(--muted); max-width: 40ch; }
.hero-cta { display: flex; gap: 12px; margin: 26px 0 22px; flex-wrap: wrap; }
.hero-badges { display: flex; gap: 10px; flex-wrap: wrap; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 14px; font-size: 13px; font-weight: 600; color: var(--muted); box-shadow: var(--shadow-sm);
}
.badge img { width: 16px; height: 16px; }

/* Hero visual chat card */
.hero-visual { display: flex; justify-content: center; }
.chat-card {
  width: 100%; max-width: 360px; background: var(--surface);
  border-radius: 22px; box-shadow: var(--shadow); border: 1px solid var(--line); overflow: hidden;
}
.chat-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.chat-head small { display: block; color: var(--brand); font-size: 12px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #d2dee6; }
.dot.online { background: #4cc38a; box-shadow: 0 0 0 3px rgba(76, 195, 138, .18); }
.bubbles { padding: 16px; display: flex; flex-direction: column; gap: 12px; background: var(--bg-alt); }
.bubble { max-width: 82%; padding: 10px 14px; border-radius: 16px; font-size: 14.5px; box-shadow: var(--shadow-sm); }
.bubble.in { background: #fff; border-bottom-left-radius: 4px; align-self: flex-start; }
.bubble.out { background: var(--grad); color: #fff; border-bottom-right-radius: 4px; align-self: flex-end; }
.auto-tag { display: block; margin-top: 6px; font-size: 11px; opacity: .9; font-weight: 600; }

/* ---------- Sections ---------- */
.section { padding: 68px 0; }
.section-alt { background: var(--bg-alt); }
.section-head { text-align: center; max-width: 620px; margin: 0 auto 42px; }
.eyebrow { color: var(--brand); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
.section-head h2 { font-size: clamp(24px, 3.4vw, 34px); margin-top: 8px; letter-spacing: -.02em; }
.section-head p { color: var(--muted); font-size: 17px; }
.note { text-align: center; color: var(--muted); margin-top: 26px; font-size: 14.5px; }

.grid { display: grid; gap: 20px; }
.features { grid-template-columns: repeat(3, 1fr); }
.platforms { grid-template-columns: repeat(2, 1fr); max-width: 760px; margin: 0 auto; }
.steps { grid-template-columns: repeat(4, 1fr); }
.pricing { grid-template-columns: repeat(5, 1fr); align-items: stretch; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 24px; box-shadow: var(--shadow-sm); transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card .ic { font-size: 30px; margin-bottom: 12px; }
.card h3 { font-size: 19px; }
.card p { color: var(--muted); margin: 0; font-size: 15px; }

/* ---------- Vì sao cần Chat Auto ---------- */
.pains { grid-template-columns: repeat(4, 1fr); }
.pain {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 22px; box-shadow: var(--shadow-sm);
  border-top: 3px solid #e3908c; transition: transform .15s ease, box-shadow .15s ease;
}
.pain:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.pain-ic { font-size: 28px; margin-bottom: 10px; }
.pain h3 { font-size: 17px; margin-bottom: .5em; }
.pain p { color: var(--muted); margin: 0; font-size: 14.5px; }

.compare {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 18px; align-items: center;
  margin-top: 34px;
}
.compare-col { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 24px; box-shadow: var(--shadow-sm); }
.compare-col h3 { font-size: 18px; margin-bottom: 16px; }
.compare-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 11px; }
.compare-col li { position: relative; padding-left: 27px; font-size: 15px; color: var(--muted); line-height: 1.5; }
.compare-col li::before { position: absolute; left: 0; top: 0; font-weight: 700; }

.compare-col.before { background: #fdf7f7; border-color: #f0dcdb; }
.compare-col.before li::before { content: '✕'; color: #b8514d; }

.compare-col.after { border-color: var(--brand); background: rgba(10, 114, 173, .05); }
.compare-col.after li::before { content: '✓'; color: #06669d; }

.compare-arrow { font-size: 26px; color: var(--brand); font-weight: 700; text-align: center; }

.vi-sao-cta { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 34px; }
.vi-sao-note { font-size: 13.5px; color: var(--muted); }

.platform { text-align: center; padding: 34px 26px; }
.platform-ic { width: 56px; height: 56px; margin: 0 auto 14px; }
.platform-ic.emoji { font-size: 48px; line-height: 56px; }

/* Steps */
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 22px; position: relative; box-shadow: var(--shadow-sm); }
.step-no {
  width: 40px; height: 40px; border-radius: 12px; background: var(--grad); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 18px; margin-bottom: 14px;
}
.step h3 { font-size: 18px; }
.step p { color: var(--muted); margin: 0; font-size: 15px; }

/* Pricing */
.billing-toggle { display: inline-flex; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px; margin: 0 auto 34px; }
.billing-toggle { display: flex; width: max-content; margin-left: auto; margin-right: auto; }
.bt { border: 0; background: transparent; padding: 9px 20px; border-radius: 999px; font-weight: 600; cursor: pointer; color: var(--muted); font-size: 14.5px; }
.bt.active { background: var(--grad); color: #fff; }
.bt .save { font-size: 11px; background: rgba(255, 255, 255, .25); padding: 1px 7px; border-radius: 999px; margin-left: 4px; }
.price { display: flex; flex-direction: column; text-align: center; padding: 28px 20px; position: relative; }
.price h3 { font-size: 18px; }
.price.featured { border-color: var(--brand); box-shadow: 0 12px 30px rgba(0, 136, 204, .20); transform: translateY(-4px); }
.ribbon { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--grad); color: #fff; font-size: 12px; font-weight: 700; padding: 4px 14px; border-radius: 999px; }
.amount { margin: 8px 0 16px; }
.amount .num { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.amount .per { color: var(--muted); font-size: 14px; }
.plan-feats { list-style: none; padding: 0; margin: 0 0 20px; text-align: left; display: grid; gap: 8px; flex: 1; }
.plan-feats li { position: relative; padding-left: 24px; color: var(--muted); font-size: 14.5px; }
.plan-feats li::before { content: "✓"; position: absolute; left: 0; color: var(--brand); font-weight: 800; }

/* ---------- Download + QR ---------- */
.download-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; max-width: 900px; margin: 0 auto; }
.dl-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; text-align: center; box-shadow: var(--shadow-sm); }
.dl-card h3 { font-size: 18px; margin-top: 14px; }
.dl-card p { color: var(--muted); font-size: 14px; margin: 0 0 16px; }
.qr { width: 168px; height: 168px; margin: 0 auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px; display: grid; place-items: center; }
.qr svg, .qr canvas, .qr img { width: 100%; height: 100%; }

/* ---------- Liên hệ (Zalo / Telegram) ---------- */
.contact-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; max-width: 620px; margin: 0 auto; }
.contact-grid .dl-card h3 { display: flex; align-items: center; justify-content: center; gap: 8px; }
.contact-grid .dl-card p { font-size: 15px; font-weight: 600; color: var(--text); }
.contact-ic { width: 22px; height: 22px; object-fit: contain; }
.contact-ic-tg { font-size: 19px; line-height: 1; }

.qr-placeholder { color: var(--muted); font-size: 13px; text-align: center; padding: 10px; }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 12px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 4px 20px; box-shadow: var(--shadow-sm); }
.faq summary { cursor: pointer; font-weight: 600; padding: 14px 0; list-style: none; position: relative; padding-right: 28px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: 12px; font-size: 22px; color: var(--brand); font-weight: 400; transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 0 16px; color: var(--muted); }

/* ---------- Footer ---------- */
.site-footer { background: #17212b; color: #d6e3ec; padding: 54px 0 24px; }
.footer-inner { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 30px; }
.site-footer .brand { color: #fff; }
.site-footer .brand-accent { color: #5fc9f2; }
.footer-brand p { color: #a3b6c4; font-size: 14.5px; max-width: 34ch; margin-top: 12px; }
.footer-col h4 { color: #fff; font-size: 15px; margin-bottom: 14px; }
.footer-col a { display: block; color: #bdd0dd; font-size: 14.5px; padding: 5px 0; transition: color .12s; }
.footer-col a:hover { color: #5fc9f2; }
.copyright { border-top: 1px solid rgba(255, 255, 255, .1); margin-top: 34px; padding-top: 20px; color: #94a9b8; font-size: 13.5px; text-align: center; }

/* ---------- Utilities ---------- */
.is-hidden { display: none !important; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .features { grid-template-columns: repeat(2, 1fr); }
  .pains { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .pricing { grid-template-columns: repeat(2, 1fr); }
  .price.featured { transform: none; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { order: -1; }
  .compare { grid-template-columns: 1fr; }
  .compare-arrow { transform: rotate(90deg); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .nav, .search-box { display: none; }
  .nav-toggle { display: flex; }
  /* top: 100% — bám theo đáy thanh đầu trang, không lệch khi thanh co lại lúc cuộn */
  .site-header.open .nav {
    display: flex; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column;
    background: var(--surface); border-bottom: 1px solid var(--line); padding: 12px 20px; gap: 4px;
  }
  .site-header.open .nav a { padding: 10px 0; }
  .site-header.open .search-box { display: flex; position: absolute; top: 100%; left: 0; right: 0; padding: 66px 20px 12px; background: transparent; }
  .site-header.open .search-box input { width: 100%; }
  .download-grid { grid-template-columns: 1fr; max-width: 340px; }
  .contact-grid { grid-template-columns: 1fr; max-width: 340px; }
}
@media (max-width: 560px) {
  .features, .pains, .steps, .pricing { grid-template-columns: 1fr; }
  .hero { padding: 40px 0 20px; }
  .section { padding: 48px 0; }
  .footer-inner { grid-template-columns: 1fr; }
}

/* ================= HIỆU ỨNG ĐỘNG =================
   Nguyên tắc: chỉ động `opacity`, `translate`, `scale` — các thuộc tính
   chạy trên card đồ hoạ, mượt cả trên điện thoại cấu hình thấp.
   Dùng `translate`/`scale` rời (không dùng `transform`) để không giẫm lên
   `transform` sẵn có của .card:hover và .price.featured.
   ================================================= */

/* ---------- Hiện dần khi cuộn tới ----------
   Lớp .reveal do JS gắn vào lúc chạy, và chỉ gắn cho phần còn nằm dưới
   màn hình. Nhờ vậy: tắt JS thì không có gì bị ẩn, và phần đang thấy
   ngay từ đầu không bị nháy. --rd là độ trễ so le, JS đặt theo thứ tự thẻ. */
.reveal { opacity: 0; translate: 0 22px; }
.reveal.is-visible {
  opacity: 1; translate: none;
  transition: opacity .5s ease var(--rd, 0ms), translate .55s cubic-bezier(.22, .61, .36, 1) var(--rd, 0ms);
}

/* ---------- Khung chat ở đầu trang tự diễn ---------- */
.bubbles { transition: opacity .4s ease; }
.bubbles.is-fading { opacity: 0; }

.bubbles .bubble { animation: .34s cubic-bezier(.22, .61, .36, 1) both; }
.bubbles .bubble.in { animation-name: bubbleInLeft; }
.bubbles .bubble.out { animation-name: bubbleInRight; }

@keyframes bubbleInLeft {
  from { opacity: 0; translate: -14px 6px; scale: .96; }
  to { opacity: 1; translate: none; scale: 1; }
}
@keyframes bubbleInRight {
  from { opacity: 0; translate: 14px 6px; scale: .96; }
  to { opacity: 1; translate: none; scale: 1; }
}

/* Nhãn "⚡ Tự động trả lời" hiện sau nội dung một nhịp */
.bubble.out .auto-tag { animation: tagIn .3s ease .32s both; }
@keyframes tagIn { from { opacity: 0; } to { opacity: .9; } }

/* Ba chấm "đang soạn tin" — bong bóng tạm trước mỗi câu trả lời tự động */
.bubble.typing { display: inline-flex; align-items: center; gap: 5px; padding: 15px 16px; }
.bubble.typing span {
  width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .9);
  animation: typingDot 1.1s ease-in-out infinite;
}
.bubble.typing span:nth-child(2) { animation-delay: .18s; }
.bubble.typing span:nth-child(3) { animation-delay: .36s; }
@keyframes typingDot {
  0%, 60%, 100% { opacity: .4; translate: 0 0; }
  30% { opacity: 1; translate: 0 -4px; }
}

/* Chấm "đang hoạt động" đập nhẹ như nhịp tim */
.dot.online { animation: pulseDot 2.4s ease-in-out infinite; }
@keyframes pulseDot {
  0%, 100% { box-shadow: 0 0 0 3px rgba(76, 195, 138, .18); }
  50% { box-shadow: 0 0 0 6px rgba(76, 195, 138, .05); }
}

/* ---------- Tôn trọng cài đặt "giảm chuyển động" của hệ điều hành ----------
   macOS: Trợ năng → Hiển thị → Giảm chuyển động.
   Người dễ chóng mặt / say chuyển động bật cái này; phải tắt sạch hiệu ứng. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1 !important; translate: none !important; }
}
