/* Toán Tiểu Học — site design system.
   Màu & cảm giác đồng bộ app iOS 1.0.1: nền trời→giấy, thương hiệu tím, nút chính cam,
   bo góc lớn, bóng mềm (clay nhẹ). Dùng chung cho landing + legal + support. */
:root {
  --brand: #6b5de0;
  --brand-dark: #5748c4;
  --brand-soft: #efecff;
  --accent: #ff8a3d;
  --accent-dark: #f2721d;
  --ink: #2b2b40;
  --ink-soft: #5b5b74;
  --muted: #8a8aa3;
  --sky: #eaf2ff;
  --paper: #fbfaff;
  --card: #ffffff;
  --line: #e7e6f3;
  --ok: #35c08a;
  --radius: 20px;
  --radius-sm: 14px;
  --shadow: 0 18px 40px -22px rgba(74, 60, 160, .45);
  --shadow-sm: 0 8px 20px -12px rgba(74, 60, 160, .4);
  --wrap: 1120px;
  --font: "Be Vietnam Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: hidden; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
  overflow-x: hidden;
}
h1, h2, h3 { line-height: 1.2; letter-spacing: -.02em; color: var(--ink); }
h1 { font-size: clamp(2rem, 5vw, 3.3rem); font-weight: 800; margin: 0 0 .5em; }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.3rem); font-weight: 800; margin: 0 0 .4em; }
h3 { font-size: 1.15rem; font-weight: 700; margin: 0 0 .3em; }
p { margin: 0 0 1em; color: var(--ink-soft); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 820px; }

/* ---- header / nav ---- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251, 250, 255, .82);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  height: 66px; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand img { width: 36px; height: 36px; border-radius: 10px; box-shadow: var(--shadow-sm); }
.brand span { font-size: 1.08rem; }
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a { color: var(--ink-soft); font-weight: 600; font-size: .95rem; }
.nav-links a:hover { color: var(--brand); text-decoration: none; }
.nav-toggle { display: none; background: none; border: 0; font-size: 1.6rem; color: var(--ink); cursor: pointer; }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 24px; border-radius: 999px; font-weight: 700; font-size: 1rem;
  border: 0; cursor: pointer; transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 10px 22px -10px var(--accent-dark); }
.btn-primary:hover { background: var(--accent-dark); color: #fff; }
.btn-ghost { background: var(--brand-soft); color: var(--brand-dark); }
.btn-ghost:hover { background: #e4e0ff; color: var(--brand-dark); }
.btn-lg { padding: 16px 30px; font-size: 1.05rem; }

/* store badges (disabled until there is a link) */
.stores { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.store-badge {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--ink); color: #fff; padding: 11px 20px; border-radius: 14px;
  font-weight: 600; min-width: 190px; box-shadow: var(--shadow-sm);
  transition: transform .12s ease;
}
.store-badge:hover { text-decoration: none; color: #fff; transform: translateY(-2px); }
.store-badge svg { width: 26px; height: 26px; flex: none; }
.store-badge small { display: block; font-size: .68rem; opacity: .8; font-weight: 500; }
.store-badge b { font-size: 1.02rem; }
.store-badge.soon { background: #d9d8ea; color: var(--ink-soft); cursor: default; box-shadow: none; }
.store-badge.soon:hover { transform: none; color: var(--ink-soft); }
.store-badge.soon .pill {
  margin-left: auto; font-size: .62rem; background: #fff; color: var(--brand);
  padding: 2px 8px; border-radius: 999px; font-weight: 700;
}

/* ---- hero ---- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(1200px 500px at 80% -10%, #dfeafe 0, rgba(223,234,254,0) 60%),
    linear-gradient(180deg, var(--sky), var(--paper) 72%);
  padding: 64px 0 40px;
}
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 40px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--line); color: var(--brand-dark);
  padding: 6px 14px; border-radius: 999px; font-weight: 700; font-size: .85rem;
  box-shadow: var(--shadow-sm); margin-bottom: 18px;
}
.hero p.lead { font-size: 1.15rem; max-width: 30em; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin: 26px 0 14px; }
.hero-note { color: var(--muted); font-size: .9rem; }
.hero-art { position: relative; display: flex; justify-content: center; }
.hero-phone {
  width: min(300px, 78%); border-radius: 38px; background: #fff; padding: 10px;
  box-shadow: var(--shadow); border: 1px solid var(--line); transform: rotate(-3deg);
}
.hero-phone img { border-radius: 30px; }
.hero-mascot {
  position: absolute; width: 150px; bottom: -14px; right: 2%;
  filter: drop-shadow(0 14px 20px rgba(74,60,160,.3)); animation: bob 4s ease-in-out infinite;
}
@keyframes bob { 0%,100% { transform: translateY(0);} 50% { transform: translateY(-12px);} }

/* ---- sections ---- */
section { padding: 70px 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 44px; }
.section-head p { font-size: 1.08rem; }
.kicker { color: var(--brand); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; font-size: .82rem; }

/* feature cards */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.feature {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 24px; box-shadow: var(--shadow-sm);
}
.feature .ic {
  width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center;
  background: var(--brand-soft); margin-bottom: 16px; font-size: 1.6rem;
}
.feature h3 { margin-bottom: .35em; }
.feature p { margin: 0; font-size: .97rem; }

/* alt band */
.band { background: linear-gradient(180deg, #fff, var(--sky)); }

/* showcase carousel */
.swiper { padding-bottom: 50px !important; }
.shot {
  border-radius: 30px; overflow: hidden; background: #fff; border: 1px solid var(--line);
  box-shadow: var(--shadow); max-width: 260px; margin: 0 auto;
}
.shot img { display: block; }
.shot .cap { padding: 12px 14px; font-weight: 600; font-size: .9rem; color: var(--ink-soft); text-align: center; }
.swiper-pagination-bullet-active { background: var(--brand) !important; }
.swiper-button-next, .swiper-button-prev { color: var(--brand) !important; }

/* safety band */
.safety { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.safety-item {
  display: flex; gap: 14px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 18px 20px; box-shadow: var(--shadow-sm);
}
.safety-item .check {
  flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--ok);
  color: #fff; display: grid; place-items: center; font-weight: 800;
}
.safety-item p { margin: 0; font-size: .96rem; }
.safety-item b { color: var(--ink); }

/* CTA band */
.cta {
  text-align: center;
  background: radial-gradient(900px 300px at 50% 0, #efeaff 0, rgba(239,234,255,0) 70%),
    linear-gradient(135deg, var(--brand), #8b7bff);
  color: #fff; border-radius: 28px; padding: 54px 24px; margin: 0 20px;
}
.cta h2 { color: #fff; }
.cta p { color: rgba(255,255,255,.9); }
.cta .btn-primary { background: #fff; color: var(--brand-dark); }
.cta .btn-primary:hover { background: #fff; }

/* FAQ */
.faq { max-width: 760px; margin: 0 auto; }
.faq details {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 4px 20px; margin-bottom: 12px; box-shadow: var(--shadow-sm);
}
.faq summary {
  cursor: pointer; font-weight: 700; padding: 16px 0; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--brand); font-size: 1.5rem; font-weight: 400; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0 0 16px; }

/* ---- footer ---- */
.site-footer { background: #15152b; color: #c9c9e0; padding: 46px 0 28px; margin-top: 60px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 30px; }
.site-footer .brand span { color: #fff; }
.site-footer h4 { color: #fff; font-size: .95rem; margin: 0 0 14px; }
.site-footer a { color: #c9c9e0; display: block; margin-bottom: 9px; font-size: .95rem; }
.site-footer a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid #2a2a45; margin-top: 30px; padding-top: 20px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  color: #8a8aad; font-size: .85rem;
}

/* ---- legal / doc pages ---- */
.doc { padding: 50px 0 10px; }
.doc .narrow { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 40px clamp(20px, 4vw, 52px); box-shadow: var(--shadow-sm); }
.doc h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); }
.doc .updated { color: var(--muted); font-size: .92rem; margin-bottom: 8px; }
.doc .toc {
  background: var(--brand-soft); border-radius: var(--radius-sm); padding: 18px 22px;
  margin: 24px 0 32px;
}
.doc .toc b { display: block; margin-bottom: 8px; color: var(--brand-dark); }
.doc .toc a { color: var(--ink-soft); display: inline-block; margin: 3px 16px 3px 0; font-weight: 600; font-size: .92rem; }
.doc h2 { font-size: 1.25rem; color: var(--brand-dark); margin-top: 36px; scroll-margin-top: 80px; }
.doc ul { padding-left: 22px; } .doc li { margin-bottom: 7px; color: var(--ink-soft); }
.doc .back { display: inline-block; margin-top: 28px; font-weight: 700; }

/* ---- reveal on scroll (AOS fallback handled by lib) ---- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto; }
}

/* ---- responsive ---- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero p.lead { margin-inline: auto; }
  .hero-cta, .stores { justify-content: center; }
  .hero-art { order: -1; margin-bottom: 10px; }
  .features { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  h1 { font-size: clamp(1.8rem, 8vw, 2.4rem); }
  h2 { font-size: clamp(1.4rem, 6vw, 2rem); }
  .nav-links {
    position: fixed; inset: 66px 0 auto 0; flex-direction: column; gap: 0;
    background: #fff; border-bottom: 1px solid var(--line); padding: 10px 20px;
    transform: translateY(-120%); transition: transform .25s ease; align-items: stretch;
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links a { padding: 13px 0; border-bottom: 1px solid var(--line); }
  .nav-toggle { display: block; }
  .features, .safety, .footer-grid { grid-template-columns: 1fr; }
  section { padding: 52px 0; }
  .hero { padding: 36px 0 30px; }
  .hero p.lead { font-size: 1.02rem; }
  .hero-phone { width: min(230px, 66%); }
  .hero-mascot { width: 92px; right: 6%; }
  .store-badge { min-width: 0; width: 100%; }
  .hero-cta.stores { flex-direction: column; }
  .feature .ic { margin-bottom: 10px; }
  .cta { padding: 40px 20px; margin: 0 12px; }
}


/* ---- legal: iOS / Android switch ---- */
.platform-switch {
  display: inline-flex; gap: 4px; padding: 4px; margin: 2px 0 14px;
  background: var(--brand-soft); border-radius: 999px;
}
.platform-switch a {
  padding: 7px 16px; border-radius: 999px; font-weight: 700; font-size: .88rem;
  color: var(--ink-soft);
}
.platform-switch a:hover { text-decoration: none; color: var(--brand-dark); }
.platform-switch a.on { background: #fff; color: var(--brand-dark); box-shadow: var(--shadow-sm); }

/* ---- /premium (web checkout) ---- */
.hidden { display: none !important; }
.premium-hero {
  background:
    radial-gradient(1100px 460px at 85% -10%, #dfeafe 0, rgba(223,234,254,0) 60%),
    linear-gradient(180deg, var(--sky), var(--paper) 75%);
  padding: 54px 0 50px;
}
.premium-grid { display: grid; grid-template-columns: 1fr minmax(0, 440px); gap: 44px; align-items: start; }
.premium-hero h1 { font-size: clamp(1.9rem, 4.4vw, 2.9rem); }
.premium-hero .lead { font-size: 1.1rem; max-width: 30em; }
.perks { list-style: none; padding: 0; margin: 20px 0 16px; display: grid; gap: 10px; }
.perks li { display: flex; gap: 10px; align-items: flex-start; color: var(--ink); font-weight: 600; }
.perks li::before {
  content: "✓"; flex: none; width: 24px; height: 24px; border-radius: 50%;
  background: var(--ok); color: #fff; display: grid; place-items: center; font-size: .8rem;
  font-weight: 800; margin-top: 1px;
}
.checkout { position: relative; }
.stepper { list-style: none; display: flex; gap: 8px; padding: 0; margin: 0 0 12px; }
.stepper li {
  flex: 1; display: flex; align-items: center; gap: 8px; font-size: .84rem; font-weight: 700;
  color: var(--muted); background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 12px 6px 6px;
}
.stepper li span {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-dark); font-size: .78rem; flex: none;
}
.stepper li.on { color: var(--brand-dark); border-color: var(--brand); }
.stepper li.on span { background: var(--brand); color: #fff; }
.stepper li.done span { background: var(--ok); color: #fff; }
.pcard {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
}
.pcard h3 { margin-bottom: 6px; }
.pcard .small, .small { font-size: .86rem; color: var(--muted); margin: 0 0 12px; }
.center { text-align: center; }
.code-input {
  width: 100%; padding: 13px 14px; border: 2px solid var(--line); border-radius: 12px;
  font: 700 1.1rem "SF Mono", Menlo, Consolas, monospace; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--ink); background: #fff;
}
.code-input:focus { outline: none; border-color: var(--brand); }
.ferr { color: #d14343; font-size: .88rem; min-height: 1.3em; margin: 6px 0; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.acct {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: var(--brand-soft); border-radius: 12px; padding: 10px 14px; font-size: .92rem;
}
.acct b { font-family: "SF Mono", Menlo, Consolas, monospace; letter-spacing: 1px; }
.linkbtn {
  background: none; border: 0; color: var(--brand); font: inherit; font-weight: 700;
  cursor: pointer; padding: 6px 0;
}
.pnote {
  background: #fff7ec; border: 1px solid #ffe2bd; color: #8a5a12; border-radius: 12px;
  padding: 10px 12px; font-size: .86rem; margin-top: 10px; line-height: 1.5;
}
.plan {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border: 2px solid var(--line); border-radius: 14px; padding: 13px 16px; margin-bottom: 10px;
  background: #fff; cursor: pointer; font: inherit; text-align: left; color: var(--ink);
  transition: border-color .12s, background .12s;
}
.plan:hover { border-color: #c9c2ff; }
.plan.on { border-color: var(--brand); background: #f6f4ff; }
.plan b { font-size: 1rem; }
.plan small { display: block; color: var(--muted); font-size: .8rem; }
.plan .price { color: var(--brand-dark); font-weight: 800; font-size: 1.1rem; white-space: nowrap; }
.plan .tag {
  margin-left: 8px; font-size: .68rem; font-weight: 800; color: var(--accent-dark);
  background: #fff0e4; padding: 2px 8px; border-radius: 999px; vertical-align: 2px;
}
.gift { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 12px; }
.gift summary { cursor: pointer; font-weight: 700; color: var(--ink-soft); font-size: .92rem; }
.gift form { margin-top: 10px; }
.qr { text-align: center; margin: 8px 0 12px; }
.qr img { width: 240px; max-width: 100%; border-radius: 14px; border: 1px solid var(--line); margin: 0 auto; }
.memo {
  background: #fff7ec; border: 1px solid #ffe2bd; border-radius: 12px; padding: 12px 14px;
  font-size: .9rem; margin: 10px 0;
}
.memo code {
  display: block; margin: 6px 0; background: #fff; padding: 6px 10px; border-radius: 8px;
  font-weight: 800; color: var(--accent-dark); font-size: 1.15rem; letter-spacing: 1px;
  text-align: center;
}
.memo .small { display: block; margin: 0; }
.rows { display: grid; grid-template-columns: auto 1fr; gap: 0; margin: 4px 0 12px; font-size: .92rem; }
.rows dt, .rows dd { padding: 8px 0; border-bottom: 1px dashed var(--line); margin: 0; }
.rows dt { color: var(--muted); }
.rows dd { text-align: right; font-weight: 700; word-break: break-all; }
.pstatus {
  display: flex; align-items: center; justify-content: center; gap: 10px; text-align: center;
  padding: 12px; border-radius: 12px; font-weight: 600; font-size: .92rem;
}
.pstatus.wait { background: #fff7ec; color: #8a5a12; }
.spinner {
  width: 16px; height: 16px; border-radius: 50%; border: 2px solid #f3c98c;
  border-top-color: var(--accent-dark); animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.done-ic {
  width: 64px; height: 64px; border-radius: 50%; margin: 4px auto 12px; display: grid;
  place-items: center; background: var(--ok); color: #fff; font-size: 2rem; font-weight: 800;
}
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.how-step {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow-sm);
}
.how-step .num {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: var(--brand); color: #fff; font-weight: 800; margin-bottom: 14px;
}
.how-step p { margin: 0; font-size: .96rem; }
@media (max-width: 900px) {
  .premium-grid { grid-template-columns: 1fr; gap: 28px; }
  .how { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .premium-hero { padding: 30px 0 36px; }
  .pcard { padding: 20px 16px; }
  .stepper li { font-size: .76rem; padding-right: 8px; }
}
