/* ============================================================
   Checkout Balaclava Ads: card único branco, tokens monocromáticos,
   accent verde só em cupom/bump. Mudou algo aqui = bump ?v=N no index.html.
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --ink: #1F1F1F;
  --ink-soft: #4b5563;
  --muted: #9aa1b1;
  --line: #e6e8ee;
  --line-strong: #c7ccd6;
  --navy: #1F1F1F;
  --navy-hover: #111111;
  --green: #15803d;
  --green-soft: #e7f4ec;
  --ring: rgba(31,31,31,.14);
  --ls: -0.02em;
  --shadow-card: 0 4px 6px -2px rgba(16,24,40,.04), 0 24px 48px -12px rgba(16,24,40,.12);
  --shadow-field: 0 1px 2px rgba(16,24,40,.06);
}
html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', -apple-system, sans-serif;
  letter-spacing: var(--ls);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 56px 20px;
}

.checkout {
  width: 100%; max-width: 468px;
  background: var(--card);
  border-radius: 22px;
  padding: 38px 18px 26px;
  box-shadow: var(--shadow-card);
  animation: bc-enter .6s cubic-bezier(.16,1,.3,1) backwards;
}
@keyframes bc-enter {
  from { opacity: 0; transform: translateY(26px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) { .checkout { animation: none; } }

/* header do produto */
.co-head { display: flex; align-items: center; gap: 16px; }
.co-head .product { width: 72px; height: 72px; border-radius: 18px; object-fit: cover; box-shadow: var(--shadow-field); }
.co-head-info { display: flex; flex-direction: column; line-height: 1.2; flex: 1; min-width: 0; }
.plan-name { font-size: 25px; font-weight: 700; letter-spacing: -0.04em; white-space: nowrap; }
/* preço + badge na MESMA linha (faz wrap só se faltar largura) */
.plan-price-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 7px; }
.plan-price { font-size: 14px; color: var(--muted); font-weight: 600; }
/* selo de bônus incluso — preto e simples (monocromático); R$ 0,00 cinza DENTRO do pill */
.bonus-tag {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  background: var(--navy); color: #fff;
  font-size: 11px; font-weight: 700; letter-spacing: .01em;
  padding: 3px 9px; border-radius: 6px;
}
.bonus-tag .bonus-free { color: #fff; opacity: .55; font-weight: 600; }
.slogan { font-size: 13px; font-weight: 400; letter-spacing: -0.01em; line-height: 1.5; margin: 12px 0 22px; color: var(--muted); }

/* campos */
.lbl { display: block; font-size: 14px; font-weight: 500; color: var(--ink-soft); margin: 16px 0 7px; }
.field {
  width: 100%; background: #fff; color: var(--ink);
  border: 1px solid var(--line); border-radius: 11px;
  padding: 13px 14px; font-family: inherit; letter-spacing: inherit; font-size: 14.5px;
  box-shadow: none; transition: border-color .15s;
  -webkit-appearance: none; appearance: none;
}
.field::placeholder { color: var(--muted); }
.field:focus { outline: none; border-color: var(--ink); box-shadow: none; }
select.field {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' stroke='%234b5563' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
  padding-right: 36px; cursor: pointer;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* métodos de pagamento */
.methods { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 22px 0 6px; }
.method {
  display: flex; align-items: center; justify-content: center; gap: 10px; position: relative;
  background: #fff; border: 1.5px solid var(--line); border-radius: 12px;
  padding: 16px; font-size: 16px; font-weight: 500; color: var(--ink);
  font-family: inherit; letter-spacing: inherit;
  box-shadow: var(--shadow-field); transition: .15s; cursor: pointer;
}
.method svg { width: 22px; height: 22px; }
.method:hover { border-color: var(--line-strong); }
.method.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.method:active { transform: scale(.985); }

/* sanfona do cartão (a classe .show é controlada pelo app.js) */
#bc-card {
  max-height: 0; opacity: 0; overflow: hidden;
  transform: translateY(-4px);
  transition: max-height .38s cubic-bezier(.4,0,.2,1), opacity .3s ease, transform .3s ease;
}
#bc-card.show { max-height: 560px; opacity: 1; transform: translateY(0); }

/* order bump */
.bump {
  display: flex; align-items: flex-start; gap: 12px;
  background: #fff; border: 1.5px dashed var(--line-strong); border-radius: 14px;
  padding: 16px; margin-top: 22px; cursor: pointer;
  box-shadow: var(--shadow-field);
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.bump:hover { border-color: var(--muted); }
.bump.active { border-color: var(--green); border-style: solid; background: var(--green-soft); }
.bump input { display: none; }
.bump-check {
  flex-shrink: 0; width: 22px; height: 22px; margin-top: 1px;
  border: 1.5px solid var(--line-strong); border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  background: #fff; transition: all .2s;
}
.bump-check svg { width: 13px; height: 13px; fill: none; stroke: #fff; stroke-width: 3; opacity: 0; transition: opacity .15s; }
.bump.active .bump-check { background: var(--green); border-color: var(--green); }
.bump.active .bump-check svg { opacity: 1; }
.bump-body { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
/* wrap: no passo do desconto são dois chips (riscado + verde) ao lado do título,
   que não cabem em tela estreita — aí os preços descem pra segunda linha */
.bump-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bump-title { font-size: 15px; font-weight: 600; }
.bump-desc { font-size: 12px; color: var(--ink-soft); line-height: 1.5; }
.bump-prices { margin-left: auto; display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 7px; }
.bump-price {
  flex-shrink: 0; white-space: nowrap;
  background: var(--navy); color: #fff;
  font-size: 13px; font-weight: 700; padding: 2.5px 10px; border-radius: 7px;
}
.bump.active .bump-price { background: var(--green); color: #fff; }
/* preço cheio riscado — só aparece quando o bump está com preço de downsell */
.bump-price-old {
  font-size: 11px; font-weight: 600; color: var(--muted);
  text-decoration: line-through; white-space: nowrap;
}
/* + de um bump: empilha com respiro menor que a margem do primeiro */
#bc-bumps .bump + .bump { margin-top: 10px; }

/* ============================================================
   Downsell — modal disparado no Finalizar quando faltou marcar bump.
   Reaproveita .bump/.bump-check/.bump-price: item do modal é o MESMO
   componente do checkout, só que já com .active.
   ============================================================ */
.ds-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(16,24,40,.55); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  /* o escuro entra junto com o sheet. Sem isto o fundo aparece de estalo e a
     subida parece dura mesmo estando certa. Só dispara quando sai o .hidden
     (display:none -> flex reinicia animação), nunca na troca de passo.
     ⚠️ Anima background-color, NÃO opacity: opacity no overlay deixaria o
     sheet translúcido junto (é filho), virando cross-fade em vez de um objeto
     opaco subindo. O blur fica estático de propósito — animar backdrop-filter
     é caro e a 2px ninguém percebe. */
  animation: ds-fade .3s ease both;
}
@keyframes ds-fade { from { background-color: rgba(16,24,40,0); } }
/* .hidden precisa vencer o display:flex — por isso classe, não o atributo [hidden] */
.ds-overlay.hidden { display: none; }
/* ⚠️ A caixa NÃO pode ter animação na regra base. Se tiver, ela volta a valer no
   momento em que o .ds-in é removido e o browser redispara a entrada do zero —
   era exatamente o "pisca" depois da troca de passo. Entrada e saída vivem só
   nas classes, postas/tiradas pelo app.js. */
.ds-box {
  background: var(--card); border-radius: 20px; padding: 26px 20px 22px;
  width: 100%; max-width: 440px; max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-card);
}
/* Três momentos distintos, e é isso que faz parecer natural:
   .ds-open = o pop-up APARECENDO (percurso longo)
   .ds-out  = conteúdo saindo na troca de passo (curto)
   .ds-in   = conteúdo novo entrando na troca de passo (curto)
   Usar o mesmo percurso pra abrir e pra trocar de passo deixava a abertura
   com cara de tranco: 30px é pouco demais pra ler como "deslizou". */
.ds-box.ds-open { animation: ds-open .34s cubic-bezier(.16,1,.3,1); }
.ds-box.ds-out { animation: ds-out .19s cubic-bezier(.4,0,1,1) forwards; }
.ds-box.ds-in { animation: ds-in .34s cubic-bezier(.16,1,.3,1); }
@keyframes ds-open { from { opacity: 0; transform: translateY(18px) scale(.97); } }
/* .ds-close = pop-up SAINDO (clique fora / Esc). Espelho do .ds-open. */
.ds-box.ds-close { animation: ds-close .32s cubic-bezier(.32,0,.3,1) forwards; }
@keyframes ds-close { to { opacity: 0; transform: translateY(18px) scale(.97); } }
/* o escuro some junto, senão o fundo fica preto sozinho até o display:none */
.ds-overlay.ds-closing { animation: ds-unfade .32s ease-in-out forwards; }
@keyframes ds-unfade { to { background-color: rgba(16,24,40,0); } }
@keyframes ds-out { to { opacity: 0; transform: translateY(-12px) scale(.97); } }
@keyframes ds-in { from { opacity: 0; transform: translateY(16px) scale(.97); } }

/* Versões pro bottom sheet do mobile (trocadas por animation-name lá embaixo).
   Sem scale e saindo pra BAIXO: encolher descolaria o sheet das laterais e subir
   abriria um vão embaixo, os dois deixando a página borrada aparecer por fora. */
@keyframes ds-out-sheet { to { opacity: 0; transform: translateY(26px); } }
@keyframes ds-in-sheet { from { opacity: 0; transform: translateY(30px); } }
/* Abertura no celular: sobe INTEIRO de fora da tela, como sheet de app nativo.
   Sem fade no sheet — quem escurece é o overlay; o sheet chega opaco, que é o
   que dá a sensação de objeto físico subindo em vez de imagem surgindo. */
@keyframes ds-open-sheet { from { transform: translateY(100%); } }
/* Saída no celular: desce inteiro pra fora da tela, o inverso da abertura.
   Sem opacity: o sheet some porque saiu, não porque desbotou. */
@keyframes ds-close-sheet { to { transform: translateY(100%); } }

@media (prefers-reduced-motion: reduce) {
  .ds-box.ds-in, .ds-box.ds-open { animation: none; }
  .ds-overlay { animation: none; }
  .ds-box.ds-out { animation: ds-out .01s linear forwards; }
}
.ds-badge {
  display: inline-block; background: var(--green-soft); color: var(--green);
  border: 2.5px dashed var(--green); border-radius: 6px; padding: 2px 8px;
  font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
}
.ds-back {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; margin: -8px 0 10px -6px;
  border: 0; border-radius: 999px; background: transparent; color: var(--muted);
  font: inherit; font-size: 24px; line-height: 1; cursor: pointer;
}
.ds-back:hover { background: #f4f6f9; color: var(--ink-soft); }
.ds-back.hidden { display: none; }
.ds-title { font-size: 21px; font-weight: 700; letter-spacing: -0.03em; margin: 12px 0 6px; }
.ds-sub { font-size: 13px; color: var(--muted); line-height: 1.5; margin-bottom: 4px; }
/* o .bump já traz margin-top 22px; no modal o espaçamento é menor */
#bc-ds-list .bump { margin-top: 14px; }
/* Bordas mais grossas SÓ dentro do pop-up. O .bump é o mesmo componente da
   página do checkout — engrossar na regra base mudaria os bumps de lá também. */
#bc-ds-list .bump { border-width: 2.5px; }
#bc-ds-list .bump-check { border-width: 2.5px; }
/* auto 1fr, não 1fr 1fr: a recusa ocupa só o texto dela e o CTA leva o resto.
   Com metade fixa, "Aproveitar oferta (2)" quebrava em 2 linhas a 320px. */
.ds-actions { display: grid; grid-template-columns: auto 1fr; gap: 10px; margin-top: 20px; }
.ds-btn {
  border-radius: 12px; padding: 14px 10px; font-family: inherit;
  font-size: 14.5px; font-weight: 600; letter-spacing: var(--ls);
  cursor: pointer; transition: background .15s, border-color .15s;
}
.ds-btn.ghost { background: #fff; border: 2.5px solid var(--line-strong); color: var(--ink); }
.ds-btn.ghost:hover { border-color: var(--muted); }
.ds-btn.solid { background: var(--navy); border: 2.5px solid var(--navy); color: #fff; box-shadow: 0 6px 16px -6px rgba(31,31,31,.5); }
.ds-btn.solid:hover { background: var(--navy-hover); }
.ds-btn:active { transform: scale(.985); }
.ds-btn:disabled { opacity: .7; cursor: default; transform: none; }
/* botão da oferta enquanto o pagamento roda — o pop-up não fecha mais nessa hora */
.ds-btn.loading { display: inline-flex; align-items: center; justify-content: center; gap: 9px; }
.ds-spin {
  display: inline-block; width: 16px; height: 16px; flex-shrink: 0;
  border: 2.5px solid rgba(255,255,255,.3); border-top-color: #fff;
  border-radius: 50%; animation: bcSpin .6s linear infinite;
}
@media (prefers-reduced-motion: reduce) { .ds-spin { animation-duration: 2s; } }

/* cupom */
.coupon-row { display: flex; gap: 8px; align-items: stretch; }
.coupon-row .field { flex: 1; text-transform: uppercase; letter-spacing: .05em; min-width: 0; }
.coupon-btn {
  background: var(--navy); color: #fff; border: 0; border-radius: 11px;
  padding: 0 20px; min-width: 96px; font-family: inherit; font-weight: 600; font-size: 14px;
  letter-spacing: var(--ls); cursor: pointer; transition: background .15s, opacity .15s;
}
.coupon-btn:hover { background: var(--navy-hover); }
.coupon-btn:disabled { opacity: .6; cursor: default; }
.coupon-row.valid .field { border-color: var(--green); background: var(--green-soft); box-shadow: 0 0 0 4px rgba(26,138,79,.10); }
.bc-coupon-msg { font-size: 12.5px; margin-top: 7px; display: none; font-weight: 500; }
.bc-coupon-msg.ok { display: block; color: var(--green); }
.bc-coupon-msg.err { display: block; color: #c0392b; }
.bc-coupon-spin {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%;
  animation: bcSpin .6s linear infinite; vertical-align: middle;
}
@keyframes bcSpin { to { transform: rotate(360deg); } }

/* resumo */
.summary { margin-top: 26px; border: 1px solid var(--line); border-radius: 14px; padding: 18px 18px 8px; background: #fcfcfd; }
.summary h3 { font-size: 14px; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }
.srow, .bc-item { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); color: var(--ink); }
.bc-item { font-size: 13.5px; color: var(--ink-soft); }
.bc-item span:last-child { color: var(--ink); font-weight: 500; }
.disc { color: var(--green); font-weight: 600; }
.srow.total { font-weight: 700; font-size: 16px; border-bottom: none; }
.coupon-tag {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--green-soft); border: 1.5px dashed var(--green);
  border-radius: 6px; padding: 2px 7px 2px 6px;
  font-size: 11.5px; font-weight: 700; color: var(--green);
  letter-spacing: 0.05em; text-transform: uppercase;
}

/* botão de pagar */
.pay-btn {
  width: 100%; margin-top: 24px; background: var(--navy); color: #fff;
  border: none; border-radius: 12px; padding: 16px; font-family: inherit;
  font-size: 16.5px; font-weight: 600; letter-spacing: var(--ls); cursor: pointer;
  transition: background .15s; box-shadow: 0 6px 16px -6px rgba(31,31,31,.5);
}
.pay-btn:hover { background: var(--navy-hover); }
.pay-btn:disabled { opacity: .6; cursor: default; }
/* spinner do Finalizar. Fica girando também enquanto o modal está aberto: o
   botão está ABAIXO do overlay, então aparece borrado pelo blur — a ideia é
   justamente parecer um pagamento em espera da resposta do pop-up. */
.bc-sl { align-items: center; justify-content: center; gap: 9px; }
.bc-spin {
  display: inline-block; width: 18px; height: 18px; flex-shrink: 0;
  border: 2.5px solid rgba(255,255,255,.3); border-top-color: #fff;
  border-radius: 50%; animation: bcSpin .6s linear infinite;
}
.bc-sl-txt:empty { display: none; }
@media (prefers-reduced-motion: reduce) { .bc-spin { animation-duration: 2s; } }
.co-msg { font-size: 14px; text-align: center; margin-top: 10px; min-height: 0; color: #c0392b; display: none; }

/* Aviso de erro do pagamento.
   Deliberadamente NÃO é um bloco vermelho de alarme: quem acabou de ter o
   cartão recusado já está com o dedo no botão de fechar a aba. Fundo âmbar
   claro, texto escuro legível e um caminho pra frente (o botão do Pix). */
.bc-alert {
  display: grid; grid-template-columns: 18px 1fr; gap: 8px 10px;
  align-items: start; text-align: left;
  margin-top: 12px; padding: 13px 14px;
  border: 1px solid #f0d9a8; border-radius: 12px;
  background: #fdf7ec; color: #6b4d12;
}
.bc-alert.one { align-items: center; }
.bc-alert-ico { width: 18px; height: 18px; color: #b7791f; margin-top: 1px; }
.bc-alert.one .bc-alert-ico { margin-top: 0; }
.bc-alert-ico svg { width: 100%; height: 100%; display: block; }
.bc-alert-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.bc-alert-txt b { font-size: 14px; font-weight: 600; line-height: 1.35; color: #4a3409; }
.bc-alert-txt em { font-style: normal; font-size: 13px; line-height: 1.45; color: #7a5b1c; }
.bc-alert-act {
  grid-column: 1 / -1;
  margin-top: 4px; width: 100%; padding: 11px 14px;
  border: 0; border-radius: 10px; cursor: pointer;
  background: var(--navy); color: #fff;
  font-family: inherit; font-size: 14px; font-weight: 600; letter-spacing: var(--ls);
}
.bc-alert-act:hover { background: var(--navy-hover); }
.bc-alert-act:active { transform: translateY(1px); }

/* rodapé */
.co-foot {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; margin-top: 30px; color: var(--muted); font-size: 12px;
  white-space: nowrap;
}
.co-foot a { color: var(--muted); text-decoration: none; }
.co-foot a:hover { color: var(--ink-soft); }
.co-foot .powered { display: inline-flex; align-items: center; gap: 5px; }
.co-foot .stripe-logo { height: 14px; width: auto; color: #737373; }
.co-foot .sep { opacity: .5; }
.foot-wordmark { height: 14px; width: auto; vertical-align: middle; }
.co-copy { text-align: center; font-size: 11px; color: var(--muted); margin-top: 10px; }

@media (max-width: 520px) {
  body { padding: 16px 3px; }
  .checkout { padding: 24px 14px 24px; border-radius: 16px; }
  /* header compactado pra "R$ 197,00 + badge" caber numa linha só */
  .co-head { gap: 12px; }
  .co-head .product { width: 56px; height: 56px; border-radius: 14px; }
  .plan-name { font-size: 24px; }
  .plan-price-row { gap: 6px; margin-top: 6px; }
  .plan-price { font-size: 14px; }
  .bonus-tag { font-size: 11px; padding: 3px 7px; gap: 5px; }
  /* downsell vira bottom sheet, igual ao padrão do console */
  .ds-overlay { align-items: flex-end; padding: 0; }
  .ds-box {
    max-width: 100%;
    max-height: 92vh;
    max-height: 92dvh; /* iOS: vh conta a barra do navegador, dvh não */
    border-radius: 20px 20px 0 0;
    /* 30px fixos porque o env() abaixo vale 0 aqui: o <meta viewport> do
       checkout não tem viewport-fit=cover. Sem isso os botões encostam na
       barra de gestos do iPhone. */
    padding: 22px 14px calc(36px + env(safe-area-inset-bottom));
  }
  /* troca de passo: só a curva muda; duração e easing vêm da regra base */
  .ds-box.ds-out { animation-name: ds-out-sheet; }
  .ds-box.ds-in { animation-name: ds-in-sheet; }
  /* abertura: percurso inteiro, mais devagar e com curva de sheet nativo
     (sai rápido, freia longo) — é o que tira a sensação de duro */
  .ds-box.ds-open { animation: ds-open-sheet .44s cubic-bezier(.32,.72,0,1); }
  /* ease-in-out: a saída ANTES era cubic-bezier(.32,.72,0,1), que é ease-out —
     arranca em velocidade máxima e por isso parecia um tranco. Agora sai devagar,
     acelera no meio e desacelera na borda. */
  .ds-box.ds-close { animation: ds-close-sheet .4s cubic-bezier(.32,0,.3,1) forwards; }
  .ds-overlay { animation-duration: .38s; }
  .ds-overlay.ds-closing { animation-duration: .4s; }
  .ds-title { font-size: 19px; }
  .ds-btn { padding: 15px 10px; font-size: 14px; }
}
