/* =========================================================
   Checkout — Ebook 2 (tema escuro)
   Mesmos tokens da landing: radius 0, sem sombra, sem gradiente.
   ========================================================= */

:root {
  --bg: #0a0a0a;
  --surface: #121110;
  --accent: #ff2b17;
  --accent-hover: #ffffff;
  --accent-link: #ff6a58;
  --text: #f2efec;
  --text-strong: #ece7e3;
  --text-muted: #cfc8c4;
  --text-dim: #8a8482;
  --text-dimmer: #6f6a68;
  --hairline: rgba(255, 255, 255, .09);
  --border-card: rgba(255, 255, 255, .10);
  --field-bg: #161514;
  --ok: #3ddc84;

  --font-display: 'Archivo Black', system-ui, sans-serif;
  --font-body: 'IBM Plex Sans', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

  --gutter: 22px;
}
@media (min-width: 900px) { :root { --gutter: 40px; } }

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

/* O atributo [hidden] vale display:none, mas qualquer regra com
   display explícito (ex.: .card { display:flex }) tem mais
   especificidade e anula isso — foi o que deixou o formulário
   visível por baixo do painel do PIX. Esta regra fecha o buraco
   de uma vez, para todo elemento com [hidden]. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, p, legend { margin: 0; }
h1, h2, p { text-wrap: pretty; }

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

.mono {
  font-family: var(--font-mono);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: clamp(11px, .9vw, 13px);
}

/* ---------- header ---------- */
.hdr {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 18px var(--gutter);
  border-bottom: 1px solid var(--hairline);
}
.back {
  font-family: var(--font-mono); font-weight: 500; font-size: 13px;
  color: var(--text-dim); text-decoration: none;
}
.back:hover { color: var(--accent); }
.hdr-meta { color: var(--text-dim); letter-spacing: .16em; }

/* ---------- layout ---------- */
.wrap {
  max-width: 620px;
  margin-inline: auto;
  padding: 30px var(--gutter) 60px;
  display: flex; flex-direction: column; gap: 20px;
}

.title {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(28px, 4vw, 40px); line-height: 1.05; letter-spacing: -.025em;
  color: var(--text-strong);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border-card);
  padding: 22px 20px 24px;
  display: flex; flex-direction: column; gap: 16px;
}
@media (min-width: 900px) { .card { padding: 28px 28px 30px; } }

/* Rótulo de seção com a barra 44×3px do .kicker da landing —
   é o elemento que amarra cada bloco do checkout à página de vendas. */
.label {
  display: flex; align-items: center; gap: 10px;
  color: var(--accent); letter-spacing: .20em; font-weight: 500;
}
.label::before {
  content: ''; flex: none; width: 28px; height: 3px; background: var(--accent);
}
@media (min-width: 900px) { .label { gap: 14px; } .label::before { width: 44px; } }

/* Filete vermelho de 3px marcando os blocos de oferta desta página:
   o resumo do pedido e o painel do PIX. */
.summary, .pix-panel { border-left: 3px solid var(--accent); }

/* ---------- resumo ---------- */
.line {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 12px 0; border-top: 1px solid var(--hairline);
  font-size: 16px; color: var(--text-muted);
}
.line-price { font-family: var(--font-display); font-weight: 400; white-space: nowrap; color: var(--text-strong); }
.total { border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); font-size: 18px; }
.total .line-name { font-family: var(--font-display); color: var(--text-strong); }
/* Preço total na escala dos numerais de destaque da landing. */
.total .line-price { color: var(--accent); font-size: clamp(24px, 2.4vw, 30px); line-height: 1.1; }

/* ---------- order bump ---------- */
.bump {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 16px; cursor: pointer;
  background: var(--bg);
  border: 2px dashed var(--accent);
}
.bump input { position: absolute; opacity: 0; width: 0; height: 0; }
.bump-box {
  flex: none; width: 22px; height: 22px; margin-top: 1px;
  border: 2px solid var(--text-muted); background: var(--bg);
  display: grid; place-items: center;
}
.bump-box::after {
  content: ''; width: 12px; height: 12px; background: var(--accent);
  transform: scale(0); transition: transform 120ms ease;
}
.bump input:checked + .bump-box::after { transform: scale(1); }
.bump input:focus-visible + .bump-box { outline: 2px solid var(--accent); outline-offset: 3px; }
.bump-text { display: flex; flex-direction: column; gap: 4px; }
.bump-text strong { font-size: 15px; line-height: 1.4; color: var(--text-strong); }
.bump-text em { font-style: normal; font-size: 14px; line-height: 1.45; color: var(--text-muted); }
/* Preço "de" riscado + preço final em destaque. */
.bump-text s { color: var(--text-dim); font-weight: 400; text-decoration-thickness: 1px; }
.bump-text s[hidden] { display: none; }
.bump-price { color: var(--accent); font-family: var(--font-display); font-size: 16px; }

/* ---------- formulário ---------- */
.form { gap: 18px; }
.row { display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 560px) { .row { grid-template-columns: 1fr 1fr; } }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 14px; font-weight: 500; color: var(--text-muted); }
.field .opt { font-weight: 400; color: var(--text-dim); }
.field small { font-size: 12px; color: var(--text-dim); }

input[type=text], input[type=email], input[type=tel], textarea {
  font-family: var(--font-body); font-size: 16px; /* 16px evita zoom no iOS */
  color: var(--text); background: var(--field-bg);
  border: 1px solid var(--border-card); border-radius: 0;
  padding: 13px 12px; width: 100%;
  transition: border-color 120ms ease;
}
input::placeholder, textarea::placeholder { color: var(--text-dimmer); }
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }

/* ---------- método de pagamento ---------- */
.methods { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 560px) { .methods { grid-template-columns: 1fr 1fr; } }

.method { cursor: pointer; }
.method input { position: absolute; opacity: 0; width: 0; height: 0; }
.method-box {
  display: flex; flex-direction: column; gap: 3px;
  padding: 14px 16px; height: 100%;
  background: var(--bg); border: 1px solid var(--border-card);
  transition: border-color 120ms ease;
}
.method-box strong { font-size: 15px; color: var(--text-strong); }
.method-box em { font-style: normal; font-size: 13px; color: var(--text-dim); }
/* Selecionado: borda de acento + fundo levemente tingido, para o estado
   ficar legível também em tela pequena. */
.method input:checked + .method-box {
  border-color: var(--accent); border-width: 2px; padding: 13px 15px;
  background: rgba(255, 43, 23, .10);
}
.method input:checked + .method-box strong { color: var(--accent); }
.method input:focus-visible + .method-box { outline: 2px solid var(--accent); outline-offset: 2px; }
.method.is-disabled { opacity: .45; cursor: not-allowed; }

/* ---------- cartão ---------- */
.card-fields {
  display: flex; flex-direction: column; gap: 18px;
  margin: 0; padding: 18px 16px; border: 1px solid var(--border-card); background: var(--bg);
}
.card-fields[hidden] { display: none; }

/* ---------- botão ---------- */
.cta {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--font-display); font-weight: 400; font-size: 17px;
  padding: 18px 20px; min-height: 56px; width: 100%;
  background: var(--accent); color: #0a0a0a;
  border: 0; border-radius: 0; cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease;
}
.cta:hover { background: var(--accent-hover); color: #0a0a0a; }
.cta:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.cta[disabled] { opacity: .55; cursor: progress; }
.cta-ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); font-size: 14px; min-height: 48px; padding: 14px 18px; }
.cta-ghost:hover { background: var(--accent); color: #0a0a0a; }

.note { color: var(--text-dim); letter-spacing: .1em; line-height: 1.6; }
.note.center { text-align: center; }

.error {
  color: var(--accent-link); font-size: 14px; line-height: 1.5;
  border-left: 3px solid var(--accent); padding-left: 12px;
}
.error[hidden] { display: none; }

/* ---------- painel PIX ---------- */
.pix-panel[hidden] { display: none; }
/* fundo branco no QR: leitor de PIX precisa de contraste real */
.pix-qr { display: grid; place-items: center; background: #fff; padding: 16px; border: 1px solid var(--border-card); }
.pix-qr[hidden] { display: none; }
.pix-qr img { display: block; width: 100%; max-width: 260px; height: auto; image-rendering: pixelated; }
.pix-code { display: flex; flex-direction: column; gap: 8px; }
.pix-code[hidden] { display: none; }
.pix-code textarea { font-family: var(--font-mono); font-size: 12px; line-height: 1.5; resize: vertical; word-break: break-all; }
.pix-status { color: var(--text-dim); letter-spacing: .1em; }
.pix-status.is-paid { color: var(--ok); }
.pix-status.is-failed { color: var(--accent-link); }

/* ---------- rodapé ---------- */
footer { border-top: 1px solid var(--hairline); background: var(--surface); padding: 22px var(--gutter) 32px; }
.legal {
  font-family: var(--font-mono); font-weight: 500; font-size: 11px; line-height: 1.75;
  color: var(--text-dimmer); max-width: 90ch; margin-inline: auto;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* =========================================================
   12. Página /oferta (upsell avulso)
   Reaproveita todo o CSS acima; só o que é exclusivo dela
   fica aqui.
   ========================================================= */
.accent-title { color: var(--accent); }

.offer-desc {
  font-size: 16px; line-height: 1.55;
  color: var(--text-body, var(--text-muted));
}

/* Na /oferta a linha de total carrega o preço "de" riscado ao lado
   do preço final, então precisa alinhar os dois na base. */
.total .line-price { display: flex; align-items: baseline; gap: 10px; }
.total .line-price s {
  font-family: var(--font-body); font-size: 15px; font-weight: 400;
  color: var(--text-dim); text-decoration-thickness: 1px;
}
.total .line-price s[hidden] { display: none; }

.pay-note { text-align: center; }

/* =========================================================
   13. Bloco de upsell pós-compra (/obrigado)
   ========================================================= */
.upsell { border-left: 3px solid var(--accent); }
.upsell[hidden] { display: none !important; }
.upsell .big { font-size: clamp(22px, 2.8vw, 30px); }

.upsell-price {
  display: flex; align-items: baseline; gap: 12px;
  font-family: var(--font-display);
}
.upsell-price s {
  font-family: var(--font-body); font-weight: 400; font-size: 16px;
  color: var(--text-dim); text-decoration-thickness: 1px;
}
.upsell-price s[hidden] { display: none; }
.upsell-price strong {
  font-weight: 400; font-size: clamp(26px, 3vw, 34px); color: var(--accent);
}
