/* Spriteoven billing UI styles — Wave 5 Ciclo 7 Track O frontend wiring.
 *
 * Paired with public/billing.js (SovBilling IIFE). Lives in three surfaces:
 *   1. Pricing grid (renderPricingCards)      — 5 LS variant cards
 *   2. Balance widget (renderBalanceWidget)   — header credit chip + topup modal
 *   3. /thanks page  (renderThanksPage)       — post-checkout confirmation
 *
 * Palette is the Bakery palette already declared in index.html / landing.html
 * (--sov-brand caramel / --sov-accent butter / --sov-cta pumpkin / --sov-text
 * cream / --sov-chrome oven-black / --sov-surface toasted-brown).
 */

/* ── Pricing grid ─────────────────────────────────────────────────────── */
.sov-billing-pricing {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 18px 0 12px;
}
.sov-billing-tier {
  background: rgba(68, 64, 60, 0.42);
  border: 1px solid var(--sov-surface, #44403c);
  border-radius: 14px;
  padding: 22px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.12s, border-color 0.12s, box-shadow 0.15s;
}
.sov-billing-tier:hover {
  transform: translateY(-3px);
  border-color: var(--sov-brand, #d97706);
  box-shadow: 0 8px 24px rgba(217, 119, 6, 0.18);
}
.sov-billing-tier.featured {
  border-color: var(--sov-brand, #d97706);
  box-shadow: 0 6px 22px rgba(217, 119, 6, 0.22);
}
.sov-billing-tier .sov-billing-tag {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--sov-accent, #fcd34d);
  font-weight: 800;
}
.sov-billing-tier .sov-billing-name {
  font-size: 18px;
  font-weight: 800;
  color: var(--sov-text, #fef3c7);
  margin-top: 2px;
}
.sov-billing-tier .sov-billing-price {
  font-size: 26px;
  font-weight: 900;
  color: var(--sov-text, #fef3c7);
  margin: 4px 0;
}
.sov-billing-tier .sov-billing-credits {
  font-size: 13px;
  color: var(--sov-accent, #fcd34d);
  font-weight: 600;
}
.sov-billing-tier .sov-billing-perk {
  font-size: 12px;
  color: rgba(254, 243, 199, 0.78);
  margin-top: 4px;
  line-height: 1.5;
}
.sov-billing-tier .sov-billing-buy {
  margin-top: 12px;
  background: var(--sov-cta, #f97316);
  color: var(--sov-chrome, #1c1917);
  border: none;
  border-radius: 10px;
  padding: 11px 16px;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.12s, transform 0.1s;
}
.sov-billing-tier .sov-billing-buy:hover {
  background: var(--sov-brand, #d97706);
  transform: translateY(-1px);
}
.sov-billing-tier .sov-billing-buy[disabled] {
  opacity: 0.55;
  cursor: progress;
  transform: none;
}

/* ── Anti-slop USP anchor (Item 5, Pilar 1 storytelling) ────────────────
 * Pilar 1 anchor copy DECISIONES §"Spriteoven no escupe slop AI genérico…"
 * Ubicado arriba del free callout + pricing grid en pricing tab para que
 * usuario lea el "why pay" antes de mirar precios. */
.sov-billing-usp {
  background: rgba(217, 119, 6, 0.08);
  border: 1px solid var(--sov-brand, #d97706);
  border-radius: 14px;
  padding: 18px 20px 16px;
  margin: 4px 0 14px;
  color: var(--sov-text, #fef3c7);
}
.sov-billing-usp .sov-billing-usp-title {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: var(--sov-accent, #fcd34d);
  margin-bottom: 8px;
}
.sov-billing-usp ul { list-style: none; padding: 0; margin: 0 0 10px; }
.sov-billing-usp li {
  padding: 4px 0 4px 18px;
  font-size: 13px;
  line-height: 1.55;
  position: relative;
}
.sov-billing-usp li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--sov-accent, #fcd34d);
  font-weight: 900;
}
.sov-billing-usp li strong { color: var(--sov-accent, #fcd34d); }
.sov-billing-usp-foot {
  font-size: 12px;
  font-style: italic;
  opacity: 0.78;
  border-top: 1px dashed rgba(252, 211, 77, 0.25);
  padding-top: 8px;
  margin-top: 4px;
}

/* ── Free callout (Item 4 — prominent CTA + no-card badge) ─────────── */
.sov-billing-free {
  background: rgba(252, 211, 77, 0.08);
  border: 1px solid var(--sov-accent, #fcd34d);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 12px 0 18px;
  color: var(--sov-text, #fef3c7);
  font-size: 13px;
}
.sov-billing-free strong { color: var(--sov-accent, #fcd34d); }
.sov-billing-free ul { margin: 6px 0 0 18px; padding: 0; }
.sov-billing-free li { padding: 2px 0; font-size: 12.5px; }
.sov-billing-free .sov-billing-free-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.sov-billing-free .sov-billing-free-head strong { font-size: 16px; }
.sov-billing-free .sov-billing-no-card {
  display: inline-block;
  background: rgba(217, 119, 6, 0.22);
  border: 1px solid var(--sov-brand, #d97706);
  color: var(--sov-accent, #fcd34d);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.sov-billing-free .sov-billing-free-cta {
  font-size: 14px;
  font-weight: 700;
  color: var(--sov-text, #fef3c7);
  margin: 4px 0 2px;
}

/* ── Per-card additions (Items 2 + 6) ──────────────────────────────── */
/* Item 2 — "X credits = X generations" microcopy bajo la línea de créditos. */
.sov-billing-tier .sov-billing-credits-eq {
  font-size: 11px;
  color: rgba(254, 243, 199, 0.68);
  font-weight: 600;
  margin-top: -2px;
  letter-spacing: 0.2px;
}
/* Item 6 — predictability anti-pattern PixelLab badge. Bakery caramel
 * border + cream bg + bold "Always.". Solo Founder + Starter cards. */
.sov-billing-tier .sov-billing-predictability {
  display: inline-block;
  background: rgba(252, 211, 77, 0.12);
  border: 1px solid var(--sov-brand, #d97706);
  color: var(--sov-text, #fef3c7);
  border-radius: 8px;
  padding: 5px 9px;
  font-size: 11px;
  line-height: 1.35;
  margin: 6px 0 2px;
  font-weight: 600;
  align-self: flex-start;
}
.sov-billing-tier .sov-billing-predictability strong {
  color: var(--sov-accent, #fcd34d);
  font-weight: 900;
}

/* ── Balance widget (header chip) ─────────────────────────────────────── */
.sov-billing-widget {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(28, 25, 23, 0.55);
  border: 1px solid var(--sov-brand, #d97706);
  border-radius: 999px;
  color: var(--sov-text, #fef3c7);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  transition: background 0.12s, border-color 0.12s;
}
.sov-billing-widget:hover {
  background: rgba(217, 119, 6, 0.18);
  border-color: var(--sov-accent, #fcd34d);
}
.sov-billing-widget.low {
  border-color: var(--sov-warning, #dc2626);
  color: var(--sov-warning, #dc2626);
}
.sov-billing-widget.zero {
  background: rgba(245, 158, 11, 0.16);
  border-color: #f59e0b;
  color: #f59e0b;
}
.sov-billing-widget .sov-billing-icon { font-size: 13px; }
.sov-billing-widget .sov-billing-wow {
  font-size: 10px;
  opacity: 0.78;
  margin-left: 4px;
  font-weight: 600;
}

/* ── Topup modal ──────────────────────────────────────────────────────── */
.sov-billing-modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 8, 8, 0.78);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 24px;
}
.sov-billing-modal.open { display: flex; }
.sov-billing-modal-inner {
  background: var(--sov-chrome, #1c1917);
  border: 1px solid var(--sov-brand, #d97706);
  border-radius: 16px;
  max-width: 720px;
  width: 100%;
  padding: 24px 22px 18px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.6);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}
.sov-billing-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 6px;
}
.sov-billing-modal-head h2 {
  font-size: 18px;
  color: var(--sov-accent, #fcd34d);
  margin: 0;
}
.sov-billing-modal-head .sov-billing-close {
  background: none;
  border: none;
  color: var(--sov-text, #fef3c7);
  font-size: 22px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.sov-billing-modal-head .sov-billing-close:hover { color: var(--sov-cta, #f97316); }
.sov-billing-modal-lead {
  font-size: 13px;
  color: rgba(254, 243, 199, 0.8);
  margin-bottom: 10px;
}

/* ── /thanks page ─────────────────────────────────────────────────────── */
.sov-billing-thanks {
  max-width: 560px;
  margin: 64px auto;
  text-align: center;
  background: rgba(68, 64, 60, 0.34);
  border: 1px solid var(--sov-brand, #d97706);
  border-radius: 18px;
  padding: 40px 28px 32px;
  color: var(--sov-text, #fef3c7);
}
.sov-billing-thanks .sov-billing-thanks-emoji {
  font-size: 56px;
  margin-bottom: 10px;
  display: block;
}
.sov-billing-thanks h2 {
  font-size: 24px;
  color: var(--sov-accent, #fcd34d);
  margin-bottom: 8px;
}
.sov-billing-thanks p { font-size: 14px; opacity: 0.85; margin-bottom: 18px; }
.sov-billing-thanks .sov-billing-thanks-balance {
  display: inline-block;
  font-size: 14px;
  background: rgba(217, 119, 6, 0.18);
  border: 1px solid var(--sov-brand, #d97706);
  border-radius: 999px;
  padding: 6px 16px;
  margin-bottom: 18px;
  font-weight: 700;
}
.sov-billing-thanks .sov-billing-thanks-cta {
  background: var(--sov-cta, #f97316);
  color: var(--sov-chrome, #1c1917);
  border: none;
  border-radius: 10px;
  padding: 12px 22px;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
}
.sov-billing-thanks .sov-billing-thanks-cta:hover { background: var(--sov-brand, #d97706); }

/* ── Toast (error/info) ───────────────────────────────────────────────── */
.sov-billing-toast {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 2100;
  background: var(--sov-chrome, #1c1917);
  border: 1px solid var(--sov-brand, #d97706);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--sov-text, #fef3c7);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
  max-width: 320px;
}
.sov-billing-toast.err { border-color: var(--sov-warning, #dc2626); color: var(--sov-warning, #dc2626); }
.sov-billing-toast.ok  { border-color: var(--sov-accent, #fcd34d); color: var(--sov-accent, #fcd34d); }
