/* Cobrança-hero — releitura própria da mudança de cobrança por mensagem (API oficial WhatsApp).
   Ângulo: lidera pelo CUSTO MENSAL ACUMULADO (não pela tarifa unitária). Paleta intencional:
   âmbar = custo/alerta · verde = ação. Animação CSS + contador JS. Respeita reduced-motion. */

.cbz {
  --cbz-bg: #0e1b16;
  --cbz-ink: #ffffff;
  --cbz-muted: #a0b2a9;
  --cbz-faint: #74877e;
  --cbz-cost: #f2b544;          /* âmbar: custo */
  --cbz-cost-soft: rgba(242, 181, 68, 0.14);
  --cbz-act: #4ee39a;           /* verde: ação */
  --cbz-in: #21302a;
  --cbz-out: #0e6b52;

  position: relative;
  background:
    radial-gradient(90% 120% at 100% 0%, rgba(242, 181, 68, 0.08) 0%, transparent 55%),
    radial-gradient(120% 140% at 0% 100%, #11271d 0%, var(--cbz-bg) 60%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  padding: 40px 40px 30px;
  margin-bottom: 40px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 34px;
  align-items: center;
}

.cbz__left { min-width: 0; }

.cbz__badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.01em;
  color: var(--cbz-cost);
  background: var(--cbz-cost-soft);
  border: 1px solid rgba(242, 181, 68, 0.28);
  padding: 7px 15px; border-radius: 999px; margin-bottom: 20px;
}
.cbz__badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--cbz-cost); box-shadow: 0 0 0 3px rgba(242, 181, 68, 0.25); }

.cbz__title {
  font-size: clamp(1.7rem, 3.1vw, 2.7rem); font-weight: 800; line-height: 1.1;
  letter-spacing: -0.03em; color: var(--cbz-ink); margin: 0 0 20px;
}
.cbz__title em { font-style: normal; color: var(--cbz-act); }

/* Número-herói: custo mensal acumulado */
.cbz__bignum {
  font-size: clamp(2.6rem, 5.4vw, 3.7rem); font-weight: 800; letter-spacing: -0.02em;
  color: var(--cbz-cost); line-height: 1; margin: 0;
  font-variant-numeric: tabular-nums;
}
.cbz__bignum-label { font-size: 1rem; color: var(--cbz-muted); margin: 8px 0 18px; }
.cbz__unit {
  display: inline-block; font-size: 0.9rem; color: #d8e6df;
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px; padding: 7px 12px; margin: 0;
}
.cbz__unit strong { color: var(--cbz-cost); }

.cbz__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.cbz__btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.95rem; font-weight: 700; padding: 12px 22px; border-radius: 999px;
  text-decoration: none; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, color .2s ease;
}
.cbz__btn--primary { background: var(--cbz-act); color: #08281c; }
.cbz__btn--primary:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(78, 227, 154, 0.3); }
.cbz__btn--ghost { color: #dceee6; border: 1px solid rgba(255, 255, 255, 0.22); }
.cbz__btn--ghost:hover { border-color: var(--cbz-act); color: var(--cbz-act); }

.cbz__foot {
  font-size: 0.84rem; color: var(--cbz-faint); margin: 28px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06); padding-top: 16px;
}

/* ---- Chat + medidor ---- */
.cbz__right { min-width: 0; }
.cbz__chat { display: flex; flex-direction: column; gap: 12px; }
.cbz__row { display: flex; }
.cbz__row--in { justify-content: flex-start; }
.cbz__row--out { justify-content: flex-end; }
.cbz__bubble {
  position: relative; max-width: 86%;
  font-size: 0.98rem; line-height: 1.34; padding: 12px 16px; border-radius: 16px;
}
.cbz__row--in .cbz__bubble { background: var(--cbz-in); color: #e6ede9; border-bottom-left-radius: 5px; }
.cbz__row--out .cbz__bubble { background: var(--cbz-out); color: #eafff5; border-bottom-right-radius: 5px; }

/* mini-chip de custo por resposta (discreto, âmbar-outline — diferente do original) */
.cbz__tick {
  display: flex; width: max-content; align-items: center; gap: 4px;
  margin-top: 8px; font-size: 0.74rem; font-weight: 700;
  color: var(--cbz-cost); background: var(--cbz-cost-soft);
  border: 1px solid rgba(242, 181, 68, 0.3); border-radius: 6px; padding: 2px 7px;
}

/* medidor de custo acumulado da conversa (a referência não tem) */
.cbz__meter {
  margin-top: 16px; display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.1);
  border-left: 3px solid var(--cbz-cost); border-radius: 12px; padding: 12px 16px;
}
.cbz__meter-label { font-size: 0.82rem; color: var(--cbz-muted); }
.cbz__meter-label b { display: block; color: var(--cbz-faint); font-weight: 400; font-size: 0.74rem; margin-top: 2px; }
.cbz__meter-val { font-size: 1.35rem; font-weight: 800; color: var(--cbz-cost); font-variant-numeric: tabular-nums; }

/* ---- Animação de entrada ---- */
@keyframes cbz-rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes cbz-pop  { 0% { opacity: 0; transform: scale(0.6); } 70% { opacity: 1; transform: scale(1.06); } 100% { transform: scale(1); } }

.cbz__badge, .cbz__title, .cbz__bignum, .cbz__bignum-label, .cbz__unit, .cbz__cta, .cbz__foot,
.cbz__row, .cbz__tick, .cbz__meter { animation-fill-mode: both; }

.cbz__badge        { animation: cbz-rise .5s .05s both; }
.cbz__title        { animation: cbz-rise .5s .15s both; }
.cbz__bignum       { animation: cbz-rise .5s .28s both; }
.cbz__bignum-label { animation: cbz-rise .5s .40s both; }
.cbz__unit         { animation: cbz-rise .5s .50s both; }
.cbz__cta          { animation: cbz-rise .5s .62s both; }
.cbz__foot         { animation: cbz-rise .6s 2.5s both; }

.cbz__row--in-1  { animation: cbz-rise .45s .55s both; }
.cbz__row--out-1 { animation: cbz-rise .45s .95s both; }
.cbz__row--out-1 .cbz__tick { animation: cbz-pop .45s 1.3s both; }
.cbz__row--in-2  { animation: cbz-rise .45s 1.65s both; }
.cbz__row--out-2 { animation: cbz-rise .45s 2.0s both; }
.cbz__row--out-2 .cbz__tick { animation: cbz-pop .45s 2.35s both; }
.cbz__meter { animation: cbz-pop .5s 2.6s both; }

/* ---- Responsivo ---- */
@media (max-width: 720px) {
  .cbz { grid-template-columns: 1fr; padding: 28px 22px; gap: 26px; }
  .cbz__foot { margin-top: 22px; }
}

/* ---- Acessibilidade ---- */
@media (prefers-reduced-motion: reduce) {
  .cbz *, .cbz__meter { animation: none !important; }
}
