/* ============================================================
   BanQuyen.ai — frontend stylesheet
   Theme: indigo #6366f1 (distinct from TacPhamSo navy)
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --c-primary: #6366f1;
  --c-primary-dark: #4f46e5;
  --c-accent: #f59e0b;
  --c-text: #0f172a;
  --c-text-2: #475569;
  --c-text-muted: #6b7280;
  --c-bg: #ffffff;
  --c-bg-gray: #f8fafc;
  --c-border: #e5e7eb;
  --c-success: #16a34a;
  --c-error: #dc2626;
  --c-warn: #f59e0b;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 40px rgba(15,23,42,.12);
}

html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--c-text);
  background: var(--c-bg);
  padding-bottom: 0;
}
@media (max-width: 720px) { body { padding-bottom: calc(48px + env(safe-area-inset-bottom)); } }

a { color: var(--c-primary); text-decoration: none; transition: color .15s; }
a:hover { color: var(--c-primary-dark); }
img { max-width: 100%; height: auto; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--c-text-muted); }

/* ════════════════════════════════════════════════════════════
   TOPBAR
   ════════════════════════════════════════════════════════════ */
.m-toggle { position: absolute; left: -9999px; opacity: 0; pointer-events: none; }

.topbar {
  background: rgba(255, 255, 255, .92);
  border-bottom: 1px solid var(--c-border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
}
.topbar-inner { display: flex; align-items: center; gap: 8px; padding: 6px 12px; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--c-text); font-weight: 700; flex-shrink: 0; min-width: 0; }
.brand:hover { text-decoration: none; color: var(--c-text); }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--c-primary), var(--c-primary-dark));
  color: #fff; border-radius: 8px; font-weight: 800; font-size: 12px;
  letter-spacing: -0.5px;
  box-shadow: 0 2px 6px rgba(99, 102, 241, .35);
  flex-shrink: 0;
}
.brand-name { font-size: 16px; line-height: 1.2; letter-spacing: -0.2px; }
@media (max-width: 480px) { .brand-name { font-size: 15px; } }

.topnav { display: none; gap: 2px; margin-left: 20px; flex: 1; }
.topnav a { color: var(--c-text-2); font-size: 14px; font-weight: 500; padding: 8px 12px; border-radius: 7px; }
.topnav a:hover { background: #f1f5f9; color: var(--c-text); text-decoration: none; }
.topnav a.cur { background: rgba(99, 102, 241, .08); color: var(--c-primary); font-weight: 600; }
@media (min-width: 900px) { .topnav { display: flex; } }

.topbar-right { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-shrink: 0; }

/* Language switcher */
.lang-switch summary {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 9px;
  background: var(--c-bg-gray);
  border: 1px solid var(--c-border);
  border-radius: 6px; cursor: pointer;
  font-size: 12.5px; font-weight: 600; color: var(--c-text);
  list-style: none;
}
.lang-switch summary::-webkit-details-marker, .lang-switch summary::marker { display: none; }
.lang-menu {
  position: absolute; top: calc(100% + 4px); right: 0;
  background: #fff; border: 1px solid var(--c-border); border-radius: 8px;
  box-shadow: var(--shadow-lg); min-width: 160px; padding: 6px; z-index: 200;
}
.lang-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; font-size: 14px; color: var(--c-text); border-radius: 6px; }
.lang-item:hover { background: var(--c-bg-gray); text-decoration: none; }
.lang-item.cur { background: rgba(99, 102, 241, .08); color: var(--c-primary); font-weight: 600; }

.flag { display: inline-block; width: 22px; height: 16px; border-radius: 2px; vertical-align: middle; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
.flag-vi { background: #da251d; position: relative; }
.flag-vi::after { content: '★'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #ffff00; font-size: 11px; line-height: 1; }
.flag-en { background: #00247d; position: relative; overflow: hidden; }
.flag-en::before, .flag-en::after { content: ''; position: absolute; background: #fff; }
.flag-en::before { top: 50%; left: 0; right: 0; height: 4px; transform: translateY(-50%); }
.flag-en::after { top: 0; bottom: 0; left: 50%; width: 4px; transform: translateX(-50%); }

.cta-topbar { display: none; }
.cta-topbar { padding: 7px 14px; font-size: 13px; }
@media (min-width: 900px) { .cta-topbar { display: inline-flex; } }

/* Hamburger */
.hamburger {
  display: inline-flex; flex-direction: column; justify-content: center;
  gap: 4px; width: 32px; height: 32px;
  background: var(--c-bg-gray); border: 1px solid var(--c-border);
  border-radius: 7px; cursor: pointer; padding: 8px;
  position: relative; z-index: 110; flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.hamburger span { display: block; height: 2px; background: var(--c-text); border-radius: 1px; transition: all .3s; width: 100%; }
.m-toggle:checked ~ .topbar .hamburger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.m-toggle:checked ~ .topbar .hamburger span:nth-child(2) { opacity: 0; }
.m-toggle:checked ~ .topbar .hamburger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
@media (min-width: 900px) { .hamburger { display: none; } }

/* Drawer */
.mobile-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 86%; max-width: 340px; background: #fff;
  z-index: 105; transform: translateX(100%);
  transition: transform .35s cubic-bezier(.4, 0, .2, 1);
  box-shadow: -16px 0 40px rgba(15, 23, 42, .15);
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.m-toggle:checked ~ .mobile-drawer { transform: translateX(0); }

.drawer-head {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 60%, #312e81 130%);
  color: #fff; padding: 24px 22px 22px;
  position: relative; display: flex; align-items: center; gap: 12px;
}
.drawer-head .brand-mark {
  width: 44px; height: 44px;
  background: rgba(255, 255, 255, .15); font-size: 14px;
  box-shadow: none; border: 1px solid rgba(255, 255, 255, .1);
}
.drawer-head-text { flex: 1; min-width: 0; }
.drawer-head-title { font-weight: 700; font-size: 17px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-head-sub { font-size: 11.5px; color: rgba(255, 255, 255, .65); margin-top: 3px; line-height: 1.3; }

.drawer-close {
  position: absolute; top: 14px; right: 14px;
  width: 30px; height: 30px; background: rgba(255, 255, 255, .18);
  color: #fff; border-radius: 50%; font-size: 22px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; line-height: 1;
}

.drawer-section-title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px; color: #94a3b8; font-weight: 600; padding: 18px 22px 8px; }

.drawer-nav { display: flex; flex-direction: column; }
.drawer-nav a { display: flex; align-items: center; gap: 12px; padding: 11px 22px; color: var(--c-text); font-size: 15px; font-weight: 500; -webkit-tap-highlight-color: transparent; }
.drawer-nav a:hover { background: #f8fafc; text-decoration: none; }
.dnav-icon { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; background: rgba(99, 102, 241, .08); border-radius: 7px; font-size: 14px; flex-shrink: 0; }

.drawer-cta {
  margin: 16px 18px; padding: 18px 16px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  border-radius: 12px; color: #fff; text-align: center;
  box-shadow: 0 8px 24px rgba(99, 102, 241, .35);
}
.drawer-cta strong { display: block; font-size: 15px; margin-bottom: 5px; }
.drawer-cta small { display: block; font-size: 12px; opacity: 0.85; margin-bottom: 13px; }
.drawer-cta-btn { display: block; background: #fff; color: var(--c-primary); padding: 10px 14px; border-radius: 8px; font-weight: 700; font-size: 14px; }
.drawer-cta-btn:hover { background: #fff; color: var(--c-primary); }

.drawer-contact { display: flex; flex-direction: column; gap: 4px; padding: 0 18px; }
.drawer-contact a { display: flex; align-items: center; gap: 12px; padding: 10px 8px; color: var(--c-text); border-radius: 8px; }
.drawer-contact a:hover { background: #f8fafc; text-decoration: none; }
.drawer-contact a div { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.drawer-contact a strong { font-size: 14px; font-weight: 600; }
.drawer-contact a small { font-size: 11.5px; color: var(--c-text-muted); }

.drawer-foot { padding: 20px 22px 30px; margin-top: 14px; border-top: 1px solid #e2e8f0; text-align: center; font-size: 12px; color: var(--c-text-muted); }
.drawer-foot a { color: var(--c-accent); font-weight: 600; }

.menu-backdrop {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .45);
  opacity: 0; pointer-events: none; transition: opacity .3s;
  z-index: 104; cursor: pointer;
}
.m-toggle:checked ~ .menu-backdrop { opacity: 1; pointer-events: all; }

/* ════════════════════════════════════════════════════════════
   HERO + SEARCH BIG
   ════════════════════════════════════════════════════════════ */
.hero {
  padding: 50px 0 60px;
  background:
    radial-gradient(ellipse at top, rgba(99, 102, 241, .08) 0%, transparent 55%),
    linear-gradient(180deg, #f8fafc 0%, #fff 100%);
  text-align: center;
  position: relative;
}
@media (min-width: 720px) { .hero { padding: 70px 0 80px; } }

.hero-compact { padding: 28px 0 36px; }
@media (min-width: 720px) { .hero-compact { padding: 36px 0 40px; } }

.hero-badge {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 14px; background: rgba(99, 102, 241, .08);
  border: 1px solid rgba(99, 102, 241, .2);
  border-radius: 99px; font-size: 12.5px; color: var(--c-primary-dark); font-weight: 600;
  margin-bottom: 18px;
}
.hero-badge .dot { width: 6px; height: 6px; background: #16a34a; border-radius: 50%; animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1 } 50% { opacity: .4 } }

.hero-title { font-size: 32px; font-weight: 800; letter-spacing: -0.8px; line-height: 1.15; margin-bottom: 14px; }
.hero-title .grad { background: linear-gradient(135deg, #6366f1, #f59e0b); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero-title-sm { font-size: 26px; }
@media (min-width: 720px) {
  .hero-title { font-size: 52px; }
  .hero-title-sm { font-size: 36px; }
}

.hero-sub { font-size: 16px; color: var(--c-text-2); max-width: 620px; margin: 0 auto 26px; }
@media (min-width: 720px) { .hero-sub { font-size: 18px; } }

.hero-search {
  max-width: 720px; margin: 0 auto;
  background: #fff; padding: 14px; border-radius: 16px;
  box-shadow: 0 10px 40px rgba(99, 102, 241, .15), 0 0 0 1px rgba(99, 102, 241, .15);
  display: flex; flex-direction: column; gap: 10px;
}
.hero-search textarea {
  width: 100%; padding: 14px 16px;
  font-size: 16px; font-family: inherit;
  border: 1px solid var(--c-border); border-radius: 10px;
  resize: vertical; min-height: 80px;
  color: var(--c-text);
}
.hero-search textarea:focus { outline: 2px solid var(--c-primary); outline-offset: -1px; border-color: transparent; }
.hero-search button { width: 100%; }
@media (min-width: 720px) {
  .hero-search { flex-direction: row; align-items: flex-end; }
  .hero-search textarea { flex: 1; min-height: 60px; }
  .hero-search button { width: auto; min-width: 200px; height: 60px; }
}

.hero-suggestions {
  margin-top: 22px; display: flex; flex-wrap: wrap; gap: 8px;
  justify-content: center; align-items: center;
  font-size: 13px;
}
.hero-suggestions a {
  background: #fff; padding: 7px 13px;
  border: 1px solid var(--c-border); border-radius: 99px;
  color: var(--c-text-2); font-weight: 500;
}
.hero-suggestions a:hover { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }

/* ════════════════════════════════════════════════════════════
   SECTIONS
   ════════════════════════════════════════════════════════════ */
.section { padding: 50px 0; }
.section-alt { background: var(--c-bg-gray); }
.section-title { font-size: 26px; font-weight: 700; letter-spacing: -0.4px; text-align: center; margin-bottom: 10px; }
.section-sub { text-align: center; max-width: 580px; margin: 0 auto 30px; font-size: 15px; }
@media (min-width: 720px) { .section-title { font-size: 32px; } }

/* ════════════════════════════════════════════════════════════
   CATEGORIES
   ════════════════════════════════════════════════════════════ */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.cat-card {
  background: #fff; border: 1px solid var(--c-border);
  border-radius: var(--radius-lg); padding: 22px 20px;
  color: var(--c-text); transition: all .2s;
}
.cat-card:hover {
  text-decoration: none; color: var(--c-text);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md); border-color: var(--c-primary);
}
.cat-icon { font-size: 32px; display: block; margin-bottom: 10px; }
.cat-name { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.cat-desc { font-size: 13.5px; color: var(--c-text-muted); line-height: 1.5; }

.cat-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 26px; }
.cat-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 13px; background: #fff;
  border: 1px solid var(--c-border); border-radius: 99px;
  font-size: 13px; color: var(--c-text-2); font-weight: 500;
}
.cat-pill:hover { border-color: var(--c-primary); color: var(--c-primary); text-decoration: none; }
.cat-pill.cur { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }

/* ════════════════════════════════════════════════════════════
   SCENARIOS GRID + CARD
   ════════════════════════════════════════════════════════════ */
.scenarios-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 16px; }
.scenarios-grid-2 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

.scenario-card {
  background: #fff; border: 1px solid var(--c-border);
  border-radius: var(--radius-lg); padding: 20px;
  color: var(--c-text); display: flex; flex-direction: column;
  transition: all .2s;
}
.scenario-card:hover { color: var(--c-text); text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--c-primary); }
.sc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 10px; }
.sc-cat { font-size: 12px; color: var(--c-text-muted); font-weight: 500; }
.sc-title { font-size: 16px; font-weight: 700; line-height: 1.35; margin-bottom: 10px; }
.sc-excerpt { font-size: 13.5px; color: var(--c-text-2); line-height: 1.55; flex: 1; }
.sc-foot { display: flex; justify-content: space-between; margin-top: 14px; padding-top: 12px; border-top: 1px solid #f1f5f9; font-size: 12px; color: var(--c-text-muted); }
.sc-cta { color: var(--c-primary); font-weight: 600; }

/* Risk badges */
.risk-badge {
  display: inline-block; padding: 3px 10px;
  border-radius: 99px; font-size: 11.5px; font-weight: 600;
  letter-spacing: 0.2px; white-space: nowrap;
}
.risk-pill {
  display: inline-flex; align-items: center;
  padding: 6px 14px; border-radius: 99px;
  font-size: 14px; font-weight: 600;
  letter-spacing: 0.2px;
}
.risk-low { background: #dcfce7; color: #166534; }
.risk-medium { background: #fef3c7; color: #92400e; }
.risk-high { background: #fee2e2; color: #991b1b; }
.risk-depends { background: #e0e7ff; color: #3730a3; }

/* ════════════════════════════════════════════════════════════
   HOW IT WORKS
   ════════════════════════════════════════════════════════════ */
.how-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.how-step { text-align: center; padding: 24px 14px; }
.how-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--c-primary), var(--c-primary-dark));
  color: #fff; border-radius: 50%; font-weight: 700; font-size: 18px;
  margin-bottom: 14px;
  box-shadow: 0 4px 14px rgba(99, 102, 241, .35);
}
.how-step h3 { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.how-step p { font-size: 13.5px; color: var(--c-text-muted); line-height: 1.55; }

/* ════════════════════════════════════════════════════════════
   FAQ
   ════════════════════════════════════════════════════════════ */
.faq-item { background: #fff; border: 1px solid var(--c-border); border-radius: 10px; margin-bottom: 10px; padding: 0 18px; }
.faq-item summary { padding: 14px 0; font-weight: 600; font-size: 15px; cursor: pointer; list-style: none; position: relative; padding-right: 30px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; position: absolute; right: 0; top: 14px; font-size: 22px; color: var(--c-text-muted); line-height: 1; }
.faq-item[open] summary::after { content: '−'; }
.faq-item p { padding-bottom: 16px; font-size: 14px; color: var(--c-text-2); line-height: 1.65; }

/* ════════════════════════════════════════════════════════════
   ARTICLE (scenario detail)
   ════════════════════════════════════════════════════════════ */
.article { padding: 30px 0 50px; }
.breadcrumb { display: flex; gap: 8px; font-size: 13px; color: var(--c-text-muted); margin-bottom: 20px; flex-wrap: wrap; align-items: center; }
.breadcrumb a { color: var(--c-text-muted); }
.breadcrumb a:hover { color: var(--c-primary); }
.breadcrumb span { color: #cbd5e1; }

.article-head { margin-bottom: 30px; }
.article-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.cat-tag { font-size: 13px; color: var(--c-text-muted); }
.article-title { font-size: 28px; font-weight: 800; letter-spacing: -0.5px; line-height: 1.2; margin-bottom: 12px; }
@media (min-width: 720px) { .article-title { font-size: 36px; } }
.article-excerpt { font-size: 17px; color: var(--c-text-2); line-height: 1.5; }

.article-body { font-size: 16px; line-height: 1.75; color: var(--c-text); margin-bottom: 36px; }
.article-body h3 { font-size: 19px; font-weight: 700; margin: 26px 0 12px; }
.article-body p { margin-bottom: 14px; }
.article-body strong { font-weight: 700; color: var(--c-text); }
.article-body code { background: #f1f5f9; padding: 2px 6px; border-radius: 4px; font-size: 14px; font-family: Menlo, monospace; }

.article-section { margin-bottom: 30px; }
.article-section h2 { font-size: 21px; font-weight: 700; margin-bottom: 14px; letter-spacing: -0.2px; }

/* ════════════════════════════════════════════════════════════
   FACTORS / ACTIONS
   ════════════════════════════════════════════════════════════ */
.factor-list { display: grid; gap: 10px; }
.factor { padding: 14px 16px; border-radius: 10px; border-left: 4px solid; }
.factor strong { display: block; font-size: 14.5px; margin-bottom: 4px; }
.factor p { font-size: 13.5px; color: var(--c-text-2); margin: 0; line-height: 1.55; }
.factor-warning { background: #fef3c7; border-color: #f59e0b; }
.factor-warning strong { color: #92400e; }
.factor-info { background: #e0e7ff; border-color: #6366f1; }
.factor-info strong { color: #3730a3; }
.factor-positive { background: #dcfce7; border-color: #16a34a; }
.factor-positive strong { color: #166534; }

.action-list { display: grid; gap: 12px; }
.action-card {
  padding: 18px; background: #fff;
  border: 1px solid var(--c-border); border-radius: 12px;
}
.action-card strong { display: block; font-size: 15px; margin-bottom: 6px; }
.action-card p { font-size: 14px; color: var(--c-text-2); margin-bottom: 12px; line-height: 1.55; }

.legal-basis-box {
  padding: 16px 18px;
  background: #f8fafc; border-left: 4px solid var(--c-primary);
  border-radius: 8px;
}
.legal-basis-box p { font-size: 14px; line-height: 1.6; color: var(--c-text-2); }

.disclaimer { font-size: 12.5px; color: var(--c-text-muted); padding: 14px 16px; background: var(--c-bg-gray); border-radius: 8px; margin: 24px 0; font-style: italic; line-height: 1.55; }

/* AI Result Card */
.ai-result-card {
  background: #fff; border: 1px solid var(--c-border);
  border-radius: var(--radius-lg); padding: 24px;
  box-shadow: var(--shadow-sm); margin-bottom: 30px;
}
.ai-result-head { margin-bottom: 14px; }
.ai-summary { font-size: 16px; line-height: 1.65; margin-bottom: 20px; color: var(--c-text); padding: 14px 16px; background: #f8fafc; border-radius: 10px; }
.result-section-title { font-size: 17px; font-weight: 700; margin: 22px 0 12px; }
.result-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; font-size: 14px; flex-wrap: wrap; }

/* Final CTAs */
.final-ctas {
  display: grid; grid-template-columns: 1fr; gap: 12px;
  margin-top: 30px;
}
@media (min-width: 560px) { .final-ctas { grid-template-columns: 1fr 1fr; } }
.final-cta {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 22px 18px; background: #fff;
  border: 1px solid var(--c-border); border-radius: var(--radius-lg);
  color: var(--c-text); transition: all .2s;
}
.final-cta:hover { color: var(--c-text); text-decoration: none; border-color: var(--c-primary); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.fc-icon { font-size: 32px; margin-bottom: 10px; }
.final-cta strong { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.final-cta small { font-size: 12px; color: var(--c-text-muted); }

/* CTA banner */
.cta-banner-wrap { padding: 40px 0 60px; }
.cta-banner {
  background: linear-gradient(135deg, var(--c-primary), var(--c-primary-dark));
  color: #fff; border-radius: var(--radius-lg);
  padding: 36px 24px; text-align: center;
  box-shadow: 0 20px 60px rgba(99, 102, 241, .35);
}
.cta-banner h2 { font-size: 24px; margin-bottom: 8px; letter-spacing: -0.3px; }
.cta-banner p { font-size: 15px; opacity: 0.9; margin-bottom: 20px; }
.cta-banner .btn-primary { background: #fff; color: var(--c-primary); }
.cta-banner .btn-primary:hover { background: #fff; color: var(--c-primary-dark); }
@media (min-width: 720px) { .cta-banner { padding: 50px 30px; } .cta-banner h2 { font-size: 30px; } }

/* ════════════════════════════════════════════════════════════
   BUTTONS / FORMS
   ════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 11px 20px; border-radius: 9px;
  font-weight: 600; font-size: 14px; border: 1px solid transparent;
  cursor: pointer; text-decoration: none !important;
  transition: all .15s; white-space: nowrap; font-family: inherit;
}
.btn-primary {
  background: var(--c-primary); color: #fff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, .35);
}
.btn-primary:hover { background: var(--c-primary-dark); color: #fff; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(99, 102, 241, .45); }
.btn-ghost { background: #fff; color: var(--c-primary); border-color: var(--c-border); }
.btn-ghost:hover { background: var(--c-bg-gray); color: var(--c-primary); }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-lg { padding: 14px 26px; font-size: 16px; }
.btn-xl { padding: 16px 32px; font-size: 17px; font-weight: 700; }
.btn-block { display: flex; width: 100%; }

.alert { padding: 14px 18px; border-radius: 10px; margin: 0 0 18px; font-size: 14.5px; border: 1px solid transparent; }
.alert.ok { background: #dcfce7; color: #166534; border-color: #86efac; }
.alert.err { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.alert.info { background: #e0e7ff; color: #3730a3; border-color: #c7d2fe; }

.lead-form label { display: block; font-size: 13.5px; font-weight: 500; margin: 14px 0 5px; color: var(--c-text); }
.lead-form input, .lead-form textarea {
  width: 100%; padding: 11px 14px;
  border: 1px solid var(--c-border); border-radius: 9px;
  font-size: 15px; font-family: inherit; background: #fff;
}
.lead-form input:focus, .lead-form textarea:focus { outline: 2px solid var(--c-primary); outline-offset: -1px; border-color: transparent; }
.lead-form textarea { resize: vertical; min-height: 80px; }

.page-title { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 6px; }
@media (min-width: 720px) { .page-title { font-size: 32px; } }

/* ════════════════════════════════════════════════════════════
   BOTTOM-NAV (mobile)
   ════════════════════════════════════════════════════════════ */
.bottom-nav {
  display: flex; position: fixed; bottom: 0; left: 0; right: 0;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--c-border);
  z-index: 95; padding: 2px 0 calc(2px + env(safe-area-inset-bottom));
}
@media (min-width: 720px) { .bottom-nav { display: none; } }
.bn-item {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  gap: 1px; padding: 3px 2px;
  color: var(--c-text-muted); text-decoration: none;
  font-size: 9.5px; font-weight: 500;
  min-height: 44px; justify-content: center;
}
.bn-item:hover, .bn-item:active { color: var(--c-primary); text-decoration: none; }
.bn-item.cur { color: var(--c-primary); }
.bn-item svg { width: 19px; height: 19px; }
.bn-center { position: relative; }
.bn-center-bubble {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--c-primary), var(--c-primary-dark));
  color: #fff; border-radius: 50%; margin-top: -8px;
  box-shadow: 0 3px 10px rgba(99, 102, 241, .4);
}
.bn-center-bubble svg { width: 18px; height: 18px; }
.bn-center.cur .bn-center-bubble { background: linear-gradient(135deg, var(--c-accent), #d97706); }

/* ════════════════════════════════════════════════════════════
   FOOTER
   ════════════════════════════════════════════════════════════ */
.footer { background: var(--c-bg-gray); padding: 50px 0 30px; margin-top: 50px; border-top: 1px solid var(--c-border); }
.footer-inner { display: grid; grid-template-columns: 1fr; gap: 26px; }
@media (min-width: 640px) { .footer-inner { grid-template-columns: 1.5fr 1fr 1fr 1fr; } }
.footer-col strong { display: block; font-size: 14px; margin-bottom: 12px; font-weight: 700; }
.footer-col a { display: block; padding: 4px 0; color: var(--c-text-2); font-size: 13.5px; }
.footer-col a:hover { color: var(--c-primary); }
.footer-col-brand p { font-size: 13px; color: var(--c-text-muted); line-height: 1.5; }
.footer-bottom { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--c-border); text-align: center; font-size: 12.5px; color: var(--c-text-muted); }

/* ════════════════════════════════════════════════════════════
   AI LOADING ANIMATION (cho hoi-ai.php AJAX)
   ════════════════════════════════════════════════════════════ */
.ai-loading {
  text-align: center;
  padding: 50px 20px 60px;
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  margin: 12px 0 24px;
  box-shadow: var(--shadow-sm);
  animation: fade-in 0.3s ease-out;
}
@keyframes fade-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.ai-loading-spinner {
  display: inline-block;
  width: 54px; height: 54px;
  border: 4px solid #e0e7ff;
  border-top-color: var(--c-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 18px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.ai-loading-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--c-text);
  margin-bottom: 8px;
  letter-spacing: -0.2px;
}
.ai-loading-status {
  font-size: 14px;
  color: var(--c-text-muted);
  min-height: 22px;
  transition: opacity 0.3s;
  animation: status-fade 1.8s ease-in-out infinite;
}
@keyframes status-fade {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

.loading-dots { display: inline-block; margin-left: 2px; }
.loading-dots span {
  display: inline-block;
  animation: dot-bounce 1.4s infinite ease-in-out both;
  font-weight: 800;
}
.loading-dots span:nth-child(1) { animation-delay: 0s; }
.loading-dots span:nth-child(2) { animation-delay: 0.15s; }
.loading-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes dot-bounce {
  0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

/* Smooth fade-in cho result blocks */
#ask-result > * { animation: fade-in 0.4s ease-out; }

/* ════════════════════════════════════════════════════════════
   AI DEEP ANALYSIS CTA (Option B)
   ════════════════════════════════════════════════════════════ */
.ai-deep-cta {
  margin: 28px 0 12px;
  padding: 28px 22px;
  background: linear-gradient(135deg, #eef2ff 0%, #ffffff 70%);
  border: 1.5px solid #c7d2fe;
  border-radius: var(--radius-lg);
  text-align: center;
  box-shadow: 0 4px 12px rgba(67, 56, 202, 0.08);
}
.ai-deep-cta-icon {
  font-size: 40px;
  line-height: 1;
  margin-bottom: 10px;
}
.ai-deep-cta h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--c-text);
  margin: 0 0 8px;
  letter-spacing: -0.2px;
}
.ai-deep-cta p {
  color: var(--c-text-2);
  font-size: 14.5px;
  line-height: 1.55;
  margin: 0 auto 16px;
  max-width: 460px;
}
.ai-deep-cta .btn {
  margin-bottom: 10px;
  min-width: 220px;
}
.ai-deep-cta small {
  display: block;
  color: var(--c-text-muted);
  font-size: 12.5px;
}

/* ════════════════════════════════════════════════════════════
   SCENARIOS ACCORDION (collapse khi đã có AI result)
   ════════════════════════════════════════════════════════════ */
.scenarios-accordion {
  margin-top: 30px;
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.scenarios-accordion > summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
  color: var(--c-text);
  background: #fafbfc;
  transition: background 0.15s;
  user-select: none;
}
.scenarios-accordion > summary::-webkit-details-marker { display: none; }
.scenarios-accordion > summary::after {
  content: "▾";
  font-size: 14px;
  color: var(--c-text-muted);
  margin-left: auto;
  transition: transform 0.2s;
}
.scenarios-accordion[open] > summary::after { transform: rotate(180deg); }
.scenarios-accordion:hover > summary { background: #f3f4f6; }
.scenarios-accordion > summary .accordion-hint {
  font-size: 12.5px;
  font-weight: 400;
  margin-right: 10px;
}
.scenarios-accordion[open] > summary .accordion-hint { display: none; }
.scenarios-accordion > div { padding: 4px 16px 18px; }
