/* Página de checkout. As cores principais vêm da personalização do produto (o app.js grava as variáveis
   --bg, --card, --primary, --ink, --cta, --timer e as --b-* dos order bumps); o tema (claro/escuro)
   define as cores de apoio (linhas, campos, textos secundários). */
:root {
  --bg: #faf7f2;
  --card: #ffffff;
  --ink: #14213d;
  --primary: #1d5fd8;
  --cta: #1f9d57;
  --timer: #e8603c;
  --b-card: #eaf0fb;
  --b-title: #14213d;
  --b-desc: #5b6475;
  --b-price: #1f9d57;
  --b-btn: #ffffff;
  --b-btn-on: #1f9d57;
  --b-btn-text: #14213d;
  --b-btn-text-on: #ffffff;
  --muted: #6b7280;
  --line: #e3e7ee;
  --field-bg: #ffffff;
  --field-line: #c7ced9;
  --placeholder: #a3abba;
  --soft: #f5f7fb;
  --danger: #c0392b;
  --danger-soft: #fdecea;
  --ok: #1f9d57;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 33, 61, .05), 0 6px 20px rgba(20, 33, 61, .06);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1020;
  --card: #151c2f;
  --ink: #e8ecf5;
  --primary: #5b8def;
  --cta: #22a861;
  --muted: #a3acc0;
  --line: #27324d;
  --field-bg: #0f1628;
  --field-line: #33415f;
  --placeholder: #6f7a93;
  --soft: #1b2440;
  --danger: #ff7b6e;
  --danger-soft: rgba(240, 82, 82, .15);
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.draft-banner {
  background: #14213d;
  color: #fff;
  text-align: center;
  padding: 9px 16px;
  font-size: 12.5px;
  line-height: 1.4;
}

/* ---------- topo ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--timer);
  color: #fff;
  text-align: center;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}
.topbar-dot { width: 6px; height: 6px; border-radius: 50%; background: #fff; flex: none; }
.topbar strong { font-size: 16px; font-variant-numeric: tabular-nums; letter-spacing: .02em; }

/* ---------- coluna central ---------- */
.wrap {
  max-width: 500px;
  margin: 0 auto;
  padding: 16px 16px 40px;
}

.logo { display: block; max-width: 180px; max-height: 64px; margin: 0 auto 14px; object-fit: contain; }

/* banners: um só, ou carrossel com rolagem por arraste e pontinhos */
.banners { margin-bottom: 14px; }
.banner-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  border-radius: var(--radius);
  scrollbar-width: none;
}
.banner-track::-webkit-scrollbar { display: none; }
.banner-track img { display: block; flex: 0 0 100%; width: 100%; height: auto; scroll-snap-align: start; }
.banner-dots { display: flex; justify-content: center; gap: 6px; margin-top: 8px; }
.banner-dots button { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 50%; background: var(--field-line); cursor: pointer; }
.banner-dots button[aria-selected="true"] { background: var(--primary); width: 18px; border-radius: 4px; }

/* vídeo de vendas */
.video-slot { margin-bottom: 14px; border-radius: var(--radius); overflow: hidden; background: #000; }
.video-slot .ratio { position: relative; padding-top: 56.25%; }
.video-slot iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-slot video { display: block; width: 100%; height: auto; }
#video-below-form { margin-top: 2px; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

/* ---------- resumo ---------- */
.summary-head {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--line);
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}
.summary-head[aria-expanded="false"] { border-bottom-color: transparent; }
.summary-head[aria-expanded="false"] .chevron { transform: rotate(180deg); }
.chevron { transition: transform .2s; flex: none; }
.summary-body { padding: 18px 20px 20px; }

.line-item { display: flex; gap: 14px; align-items: center; }
.line-item + .line-item { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.line-item img { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; flex: none; background: var(--soft); }
.line-item h3 { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.25; }
.line-price { margin-top: 3px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.line-price strong { color: var(--primary); font-size: 16px; font-weight: 800; }
.line-price small, .line-price s { color: var(--muted); font-size: 12px; }
.line-price .off { padding: 1px 6px; border-radius: 6px; background: var(--cta); color: #fff; font-size: 11px; font-weight: 800; }
.line-item.small img { width: 40px; height: 40px; }
.line-item.small h3 { font-size: 14px; }
.line-item.small .line-price strong { font-size: 14px; }

.summary-total {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  font-weight: 700;
}
.summary-total strong { color: var(--primary); font-size: 18px; }

/* ---------- formulário ---------- */
.checkout { padding: 26px 22px 22px; }

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 700;
}
.section-title svg { color: var(--primary); flex: none; }
form .section-title:not(:first-child) { margin-top: 26px; }

.field {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  border: 1.5px solid var(--field-line);
  border-radius: 10px;
  background: var(--field-bg);
  transition: border-color .15s, box-shadow .15s;
}
.field:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.field.invalid { border-color: var(--danger); }
.field-icon { position: absolute; left: 14px; color: var(--placeholder); pointer-events: none; }
.field input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 14px 14px 14px 42px;
  font: inherit;
  color: var(--ink);
  outline: none;
  font-size: 16px; /* 16px evita o zoom automático do iOS */
}
.field input::placeholder { color: var(--placeholder); }
.phone-prefix { position: absolute; left: 42px; color: var(--ink); font-size: 15px; }
#phone { padding-left: 80px; }

.email-hint {
  display: block;
  margin: -4px 0 12px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 13px;
  color: var(--primary);
  text-decoration: underline;
  cursor: pointer;
  text-align: left;
}

/* ---------- order bumps ---------- */
.bumps-title {
  margin: 26px 0 12px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
}
.bump {
  position: relative;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  margin-bottom: 12px;
  background: var(--b-card);
  border: 1.5px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.bump.on { border-color: var(--b-btn-on); box-shadow: 0 0 0 3px color-mix(in srgb, var(--b-btn-on) 18%, transparent); }
.bump input { position: absolute; opacity: 0; pointer-events: none; }
.bump:focus-within { outline: 2px solid var(--primary); outline-offset: 2px; }
.bump img { width: 56px; height: 56px; border-radius: 9px; object-fit: cover; flex: none; }
.bump-text { flex: 1; min-width: 0; }
.bump-text h4 { margin: 0 0 3px; font-size: 14px; font-weight: 700; line-height: 1.3; color: var(--b-title); }
.bump-text p { margin: 0 0 8px; font-size: 12.5px; color: var(--b-desc); }
.bump-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.bump-price { color: var(--b-price); font-weight: 800; font-size: 14px; }
.bump-price s { color: var(--b-desc); font-weight: 500; font-size: 12px; margin-right: 6px; opacity: .8; }
.bump-btn {
  padding: 7px 14px;
  border: 0;
  border-radius: 8px;
  background: var(--b-btn);
  color: var(--b-btn-text);
  box-shadow: 0 1px 3px rgba(20, 33, 61, .15);
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  pointer-events: none; /* o clique é do cartão inteiro */
}
.bump.on .bump-btn { background: var(--b-btn-on); color: var(--b-btn-text-on); }

/* layout horizontal: cartões lado a lado, rolando de lado no celular */
.bumps.horizontal { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 2px 8px; margin: 0 -2px; }
.bumps.horizontal .bump { flex: 0 0 min(260px, 82%); flex-direction: column; margin-bottom: 0; scroll-snap-align: start; }
.bumps.horizontal .bump img { width: 100%; height: 120px; }
.bumps.horizontal .bump-foot { margin-top: auto; }
.bumps.horizontal .bump-text { display: flex; flex-direction: column; width: 100%; }

/* ---------- pagamento ---------- */
.pay-methods { margin-bottom: 18px; }
.pay-pix {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 28px 13px 14px;
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  cursor: default;
}
.pay-pix-icon, .cta-icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .22);
  font-weight: 700;
  font-size: 13px;
}

.pix-info {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 16px;
  background: var(--soft);
}
.pix-info h3 { margin: 0 0 12px; font-size: 14px; font-weight: 700; }
.pix-info p { margin: 0 0 8px; font-size: 12.5px; color: var(--muted); }
.pix-info-total {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted);
}
.pix-info-total strong { color: var(--primary); font-size: 13px; margin-left: 4px; }

.cta {
  position: relative;
  overflow: hidden;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 0;
  border-radius: 8px;
  background: var(--cta);
  color: #fff;
  font: inherit;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: .03em;
  cursor: pointer;
  transition: filter .15s, transform .05s;
}
.cta:hover { filter: brightness(.93); }
.cta:active { transform: translateY(1px); }
.cta:focus-visible { outline: 3px solid color-mix(in srgb, var(--cta) 45%, transparent); outline-offset: 2px; }
.cta:disabled { opacity: .7; cursor: progress; }

/* animações do botão de compra (desligadas para quem pede menos movimento) */
.cta.anim-pulse { animation: pulse 1.8s ease-in-out infinite; }
.cta.anim-shake { animation: shake 3s ease-in-out infinite; }
.cta.anim-shine::after {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 40%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .45), transparent);
  animation: shine 2.6s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.035); } }
@keyframes shake { 0%, 80%, 100% { transform: translateX(0); } 84% { transform: translateX(-5px); } 88% { transform: translateX(5px); } 92% { transform: translateX(-3px); } 96% { transform: translateX(3px); } }
@keyframes shine { 0% { left: -60%; } 60%, 100% { left: 130%; } }

.secure {
  margin-top: 14px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
}
.secure svg { color: var(--ok); }

.form-error {
  margin: 0 0 14px;
  padding: 11px 14px;
  border-radius: 8px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13.5px;
  font-weight: 600;
}

/* ---------- tela do Pix / pago / expirado ---------- */
#pix-view, .center-view { text-align: center; }

.pix-title { margin: 0 0 6px; font-size: 19px; font-weight: 800; }
.pix-amount { margin: 0 0 16px; color: var(--muted); }
.pix-amount strong { color: var(--primary); font-size: 20px; }
.qr {
  display: block;
  margin: 0 auto 16px;
  width: 240px;
  max-width: 100%;
  height: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.pix-countdown { margin: 14px 0 18px; font-size: 13.5px; color: var(--muted); }
.pix-countdown strong { color: var(--ink); font-variant-numeric: tabular-nums; }

.steps {
  margin: 0 0 18px;
  padding: 14px 16px 14px 34px;
  text-align: left;
  border-radius: 10px;
  background: var(--soft);
  font-size: 13px;
  color: var(--muted);
}
.steps li + li { margin-top: 6px; }

.status {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-weight: 600;
  font-size: 14px;
}
.spinner {
  width: 16px;
  height: 16px;
  border: 2.5px solid var(--line);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.dev-pay {
  margin-top: 16px;
  padding: 9px 14px;
  border: 1.5px dashed #e8603c;
  border-radius: 8px;
  background: transparent;
  color: #e8603c;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.center-view { padding: 10px 0 6px; }
.center-view .cta { margin-top: 18px; }
.check {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ok);
  color: #fff;
}
.muted { color: var(--muted); margin: 6px 0 0; }
.small { font-size: 12.5px; }

/* ---------- upsell (depois do pagamento) ---------- */
.upsell {
  margin-top: 24px;
  padding: 20px 18px;
  border: 2px dashed var(--cta);
  border-radius: 14px;
  background: color-mix(in srgb, var(--cta) 8%, var(--card));
  text-align: center;
}
.upsell-tag { margin: 0 0 12px; font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--cta); }
.upsell-img { display: block; margin: 0 auto 10px; width: 72px; height: 72px; border-radius: 12px; object-fit: cover; }
.upsell h3 { margin: 0 0 4px; font-size: 17px; font-weight: 800; }
.upsell .muted { margin: 0 0 10px; }
.upsell-price { margin: 0 0 14px; }
.upsell-price s { color: var(--muted); font-size: 14px; margin-right: 6px; }
.upsell-price strong { color: var(--cta); font-size: 24px; font-weight: 800; }
.upsell .cta { margin-top: 0; }
.link-no { display: block; margin: 14px auto 0; padding: 4px; border: 0; background: none; color: var(--muted); font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; }

/* ---------- depoimentos ---------- */
.testimonials h2 { text-align: center; margin: 28px 0 14px; font-size: 18px; font-weight: 800; }
.review {
  display: flex;
  gap: 12px;
  max-width: 440px;
  margin: 0 auto 12px;
  padding: 16px 18px;
  background: var(--card);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.review img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: none; }
.review strong { display: block; font-size: 13.5px; }
.review .stars { color: #f5a524; letter-spacing: 2px; margin: 2px 0 4px; font-size: 14px; }
.review p { margin: 0; font-size: 13px; color: var(--muted); }

.footer {
  margin-top: 30px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}

/* ---------- desconto de saída ---------- */
.exit-modal {
  width: min(400px, calc(100vw - 32px));
  padding: 28px 22px 20px;
  border: 0;
  border-radius: 18px;
  background: var(--card);
  color: var(--ink);
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
}
.exit-modal::backdrop { background: rgba(10, 15, 30, .6); }
.exit-close { position: absolute; top: 8px; right: 10px; width: 36px; height: 36px; border: 0; background: none; color: var(--muted); font-size: 26px; line-height: 1; cursor: pointer; }
.exit-tag { display: inline-block; margin: 0 0 10px; padding: 4px 12px; border-radius: 999px; background: var(--cta); color: #fff; font-weight: 800; font-size: 13px; }
.exit-modal h2 { margin: 0 0 6px; font-size: 20px; font-weight: 800; }
.exit-price { margin: 14px 0 16px; }
.exit-price s { color: var(--muted); margin-right: 6px; }
.exit-price strong { color: var(--cta); font-size: 26px; font-weight: 800; }

/* ---------- aviso de compras recentes ---------- */
.alert-toast {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 20;
  max-width: min(320px, calc(100vw - 32px));
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
  font-size: 13.5px;
  font-weight: 600;
  animation: rise .3s ease-out;
}
@keyframes rise { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }

@media (max-width: 380px) {
  .checkout { padding: 22px 16px 18px; }
  .wrap { padding-left: 12px; padding-right: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; scroll-behavior: auto !important; }
}
