/* PuzzleForge — sales.css
 * Shared stylesheet for FE / OTO / downsell / legal pages under deploy/sales/.
 * Design tokens: tím-xanh "brainy" palette, copied verbatim from src/css/app.css :root
 * (Global Constraints — giá trị đúng, không tự đổi). */
:root {
  --bg: #f5f3fc;
  --panel: #fff;
  --panel2: #f9f7ff;
  --line: #e5def7;
  --ink: #241d40;
  --mut: #7a7199;
  --mut2: #aaa2c6;
  --acc: #6d4df2;
  --acc2: #9078ff;
  --ok: #16a34a;
  --danger: #e5484d;
}

/* ---------- Reset / base ---------- */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

img, video { max-width: 100%; height: auto; display: block; }

a { color: var(--acc); }
a:hover { color: var(--acc2); }

/* ---------- Type scale ---------- */
h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.15;
  margin: 0 0 .6em;
  color: var(--ink);
}

h2 {
  font-size: clamp(1.5rem, 3.2vw, 2.1rem);
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 .5em;
  color: var(--ink);
}

h3 {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 .4em;
  color: var(--ink);
}

p, li {
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--ink);
}

.mut { color: var(--mut); }
.mut2 { color: var(--mut2); }

/* ---------- Layout ---------- */
.wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 20px;
}

section {
  padding: 56px 0;
}

section.tight { padding: 32px 0; }

section.panel {
  background: var(--panel);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

section.panel2 {
  background: var(--panel2);
}

.center { text-align: center; }

/* ---------- Dime-sale / dime-to-die-at top bar ---------- */
.dotd-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--ink);
  color: #fff;
  text-align: center;
  padding: 10px 16px;
  font-size: .95rem;
  font-weight: 600;
}

.dotd-bar strong { color: #ffd166; }

/* ---------- Countdown ---------- */
.countdown {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  margin: 14px 0;
  flex-wrap: wrap;
}

.countdown .unit {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  min-width: 64px;
  text-align: center;
}

.countdown .unit .n {
  display: block;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--acc);
  font-variant-numeric: tabular-nums;
}

.countdown .unit .label {
  display: block;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--mut);
}

/* Sticky countdown bar variant — pins a compact countdown under the DOTD bar
   or at the top of long-scroll pages. Opt-in via .countdown.sticky. */
.countdown.sticky {
  position: sticky;
  top: 0;
  z-index: 39;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
  width: 100%;
  margin: 0;
}

/* ---------- CTA button ---------- */
.cta-btn {
  display: inline-block;
  background: var(--acc);
  color: #fff;
  font-weight: 800;
  font-size: 1.15rem;
  padding: 16px 36px;
  border-radius: 12px;
  border: none;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(109, 77, 242, .35);
  transition: background .15s ease, transform .15s ease, box-shadow .15s ease;
}

.cta-btn:hover {
  background: var(--acc2);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(109, 77, 242, .42);
  color: #fff;
}

.cta-btn:active { transform: translateY(0); }

.cta-btn.block { display: block; width: 100%; }

.cta-sub {
  display: block;
  margin-top: 10px;
  font-size: .85rem;
  color: var(--mut);
}

/* ---------- Price block ---------- */
.price-strike {
  text-decoration: line-through;
  color: var(--mut2);
  font-size: 1.1rem;
  margin-right: 8px;
}

.price-now {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--acc);
}

.price-now sup { font-size: 1.1rem; top: -1em; }

/* ---------- Comparison table ---------- */
.cmp-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.cmp-table th, .cmp-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: .95rem;
}

.cmp-table th {
  background: var(--panel2);
  font-weight: 700;
  color: var(--ink);
}

.cmp-table tr:last-child td { border-bottom: none; }

.cmp-table td.yes { color: var(--ok); font-weight: 700; }
.cmp-table td.no { color: var(--danger); font-weight: 700; }

/* ---------- Feature grid ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.feature-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
}

.feature-card h3 { margin-bottom: .3em; }
.feature-card p { font-size: .95rem; color: var(--mut); margin: 0; }

/* ---------- FAQ ---------- */
.faq details {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 10px;
}

.faq summary {
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: "+";
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--acc);
  flex: none;
}

.faq details[open] summary::after { content: "\2212"; }

.faq details p {
  margin: 12px 0 0;
  color: var(--mut);
}

/* ---------- Bonus / value stack ---------- */
.stack-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}

.stack-item:last-child { border-bottom: none; }

.stack-item .val { font-weight: 700; color: var(--acc); white-space: nowrap; }

/* ---------- Guarantee badge ---------- */
.guarantee {
  display: flex;
  gap: 16px;
  align-items: center;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
}

.guarantee .badge {
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--ok);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.4rem;
}

/* ---------- Footer ---------- */
footer.site-footer {
  background: var(--ink);
  color: var(--mut2);
  padding: 32px 0;
  font-size: .85rem;
}

footer.site-footer a { color: #cfc6ff; }
footer.site-footer a:hover { color: #fff; }

footer.site-footer .legal-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

footer.site-footer .disclaimer {
  color: var(--mut2);
  line-height: 1.6;
}

/* ---------- Mobile sticky buy-bar ----------
   Fixed to the bottom of the viewport on small screens only; hidden ≥768px
   because desktop layouts already keep the primary CTA in view. */
.sticky-buybar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--panel);
  border-top: 1px solid var(--line);
  padding: 10px 14px;
  box-shadow: 0 -6px 18px rgba(36, 29, 64, .12);
}

.sticky-buybar .price {
  font-weight: 800;
  color: var(--acc);
  font-size: 1.1rem;
  white-space: nowrap;
}

.sticky-buybar .cta-btn {
  padding: 12px 22px;
  font-size: 1rem;
}

@media (min-width: 768px) {
  .sticky-buybar { display: none; }
}

/* Reserve space so the fixed bar never covers page content on mobile. */
body.has-sticky-buybar {
  padding-bottom: 76px;
}

@media (min-width: 768px) {
  body.has-sticky-buybar { padding-bottom: 0; }
}

/* ---------- Scroll-reveal ----------
   Elements with class .rv start slightly translated + transparent and
   transition to their resting state once IntersectionObserver flags them
   with .rv-in (see the inline script each page includes). Respects
   prefers-reduced-motion by skipping the animation entirely (handled both
   here via the media query and in JS, which adds .rv-in immediately). */
/* Hidden state is gated behind html.js (added by sales-reveal.js as its first statement):
   if the script fails to load or throws, no element is ever hidden — a broken reveal
   animation must degrade to a fully visible page, never a blank one. The hero block
   deliberately carries no .rv at all so above-the-fold content shows on first paint. */
.js .rv {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .3s ease, transform .3s ease;
}

.js .rv.rv-in {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .js .rv {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------- Utility ---------- */
.badge-pill {
  display: inline-block;
  background: var(--acc);
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 0;
}
