/* Lojinha.bio — UI do app (mobile-first). Tokens da marca da landing. */
:root {
  --cream: #FFF4E8;
  --cream2: #FFE9D6;
  --paper: #FFFAF4;
  --card: #FFFFFF;
  --ink: #14110F;
  --ink-2: #3D3530;
  --coral: #FF6B4A;
  --coral-dark: #E2502F;
  --coral-soft: #FFE1D9;
  --pix: #1FB5A5;
  --pix-soft: #D7F3EF;
  --pix-ink: #0F7D72;
  --line: #EBDCCB;
  --muted: #8A7C70;
  --danger: #C2381B;
  --radius: 20px;
  --shadow: 0 18px 40px -22px rgba(20, 17, 15, .35);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); background: var(--cream); color: var(--ink); line-height: 1.5; min-height: 100vh; }
a { color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.02em; }
h1 { font-size: 1.6rem; font-weight: 700; }
h2 { font-size: 1.2rem; font-weight: 700; }
small, .muted { color: var(--muted); }
.wrap { max-width: 560px; margin: 0 auto; padding: 24px 16px 64px; }
.wrap-wide { max-width: 880px; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 12px; align-items: center; }
.between { justify-content: space-between; }
.wrap-row { flex-wrap: wrap; }

/* Marca */
.brand { font-weight: 800; font-size: 1.15rem; text-decoration: none; letter-spacing: -.03em; }
.brand span { color: var(--coral); }

/* Cartões */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card-soft { background: var(--paper); }
.hero-card { background: var(--card); border-radius: 28px; padding: 28px 20px; box-shadow: var(--shadow); }

/* Botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 .95rem var(--font); border: 0; border-radius: 999px; padding: 12px 20px;
  background: var(--ink); color: #fff; text-decoration: none; cursor: pointer; min-height: 44px;
}
.btn:hover { opacity: .92; }
.btn-coral { background: var(--coral); }
.btn-coral:hover { background: var(--coral-dark); opacity: 1; }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-pix { background: var(--pix); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; min-height: 36px; font-size: .85rem; }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid #F3C7BB; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); text-decoration: underline; cursor: pointer; }

/* Formulários */
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.field + .field { margin-top: 14px; }
.hint { font-size: .8rem; color: var(--muted); margin-top: 4px; font-weight: 400; }
.err { font-size: .82rem; color: var(--danger); margin-top: 4px; }
input[type=text], input[type=email], input[type=date], input[type=url], input[type=tel], textarea, select {
  width: 100%; font: 1rem var(--font); color: var(--ink); background: #fff;
  border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; min-height: 46px;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--coral); outline-offset: 1px; border-color: transparent; }
input[type=file] { font: .9rem var(--font); width: 100%; }
.prefix { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 14px; background: #fff; overflow: hidden; }
.prefix span { padding: 0 4px 0 14px; color: var(--muted); white-space: nowrap; }
.prefix input { border: 0; padding-left: 2px; }
.prefix:focus-within { outline: 2px solid var(--coral); }
.prefix input:focus { outline: none; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 500; }
.check input { width: 20px; height: 20px; accent-color: var(--coral); }
fieldset { border: 0; padding: 0; }
.radio-cards { display: grid; gap: 10px; }
.radio-card { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-radius: 16px; padding: 14px; background: #fff; font-weight: 500; cursor: pointer; }
.radio-card input { margin-top: 3px; accent-color: var(--coral); }
.radio-card.disabled { opacity: .55; cursor: not-allowed; }
.radio-card strong { display: block; }
.radio-card small { display: block; font-weight: 400; }

/* Avisos */
.alert { border-radius: 14px; padding: 12px 14px; font-size: .9rem; }
.alert-ok { background: var(--pix-soft); color: var(--pix-ink); }
.alert-warn { background: #FFF0C2; color: #6B5300; }
.alert-err { background: var(--coral-soft); color: var(--coral-dark); }
.devbar { background: var(--ink); color: #fff; font-size: .78rem; text-align: center; padding: 6px 12px; }
.devbar b { color: var(--coral); }

/* Badges */
.badge { display: inline-block; font-size: .72rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--cream2); color: var(--ink-2); white-space: nowrap; }
.badge-paid, .badge-approved { background: var(--pix-soft); color: var(--pix-ink); }
.badge-pending { background: #FFF0C2; color: #6B5300; }
.badge-refunded, .badge-failed, .badge-expired, .badge-rejected { background: var(--coral-soft); color: var(--coral-dark); }
.badge-soon { background: var(--cream2); color: var(--muted); }

/* Vitrine (igual ao mockup da landing) */
.store { max-width: 460px; margin: 0 auto; padding: 32px 16px 48px; }
.profile { text-align: center; margin-bottom: 22px; }
.avatar { width: 88px; height: 88px; border-radius: 50%; margin: 0 auto 12px; object-fit: cover;
  background: linear-gradient(135deg, #FFB199, var(--coral)); display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 2rem; }
.avatar-sm { width: 44px; height: 44px; font-size: 1.1rem; margin: 0; }
.profile h1 { font-size: 1.25rem; }
.profile p { color: var(--ink-2); font-size: .92rem; margin-top: 4px; }
.item { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 12px; margin-bottom: 10px; text-decoration: none; transition: transform .15s ease; }
.item:hover { transform: translateY(-1px); border-color: #E0CBB5; }
.thumb { width: 48px; height: 48px; border-radius: 14px; flex: none; display: grid; place-items: center; font-size: 1.5rem; background: var(--coral-soft); }
.thumb-1 { background: var(--pix-soft); } .thumb-2 { background: #FFF0C2; } .thumb-3 { background: #EDE4FF; }
.item-info { flex: 1; min-width: 0; }
.item-info strong { display: block; font-size: .95rem; line-height: 1.25; }
.item-info small { font-size: .78rem; }
.price { font-weight: 700; font-size: .85rem; background: var(--ink); color: #fff; padding: 7px 12px; border-radius: 999px; white-space: nowrap; }
.foot { text-align: center; margin-top: 28px; font-size: .8rem; color: var(--muted); }
.foot a { text-decoration: none; font-weight: 700; color: var(--ink); }
.empty { text-align: center; padding: 32px 16px; color: var(--muted); }

/* Produto / checkout */
.product-hero { text-align: center; }
.product-hero .thumb { width: 72px; height: 72px; font-size: 2.2rem; border-radius: 20px; margin: 0 auto 12px; }
.big-price { font-size: 1.8rem; font-weight: 800; letter-spacing: -.03em; }
.desc { white-space: pre-line; color: var(--ink-2); }
.trust { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; font-size: .78rem; color: var(--muted); }

/* PIX */
.qr { width: 240px; height: 240px; margin: 0 auto; border-radius: 16px; border: 1px solid var(--line); background: #fff; padding: 8px; image-rendering: pixelated; }
.copy { display: flex; gap: 8px; }
.copy input { font-family: ui-monospace, monospace; font-size: .8rem; }
.status-line { display: flex; gap: 10px; align-items: center; justify-content: center; font-weight: 600; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--pix); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .dot { animation: none; } .item { transition: none; } }

/* Painel */
.topbar { background: var(--paper); border-bottom: 1px solid var(--line); }
.topbar .inner { max-width: 880px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tabs { display: flex; gap: 4px; overflow-x: auto; max-width: 880px; margin: 0 auto; padding: 0 12px; scrollbar-width: none; }
.tabs a { text-decoration: none; font-size: .9rem; font-weight: 500; padding: 10px 12px; border-bottom: 2px solid transparent; color: var(--ink-2); white-space: nowrap; }
.tabs a.on { border-color: var(--coral); color: var(--ink); font-weight: 600; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 16px; }
.stat b { display: block; font-size: 1.4rem; letter-spacing: -.02em; }
.stat small { font-size: .8rem; }
@media (min-width: 720px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.list { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.list-row { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-top: 1px solid var(--line); }
.list-row:first-child { border-top: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row strong { display: block; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row small { font-size: .78rem; }
.amount { font-weight: 700; white-space: nowrap; }
.inline { display: inline; }
.share { font-family: ui-monospace, monospace; font-size: .85rem; background: var(--cream2); padding: 4px 10px; border-radius: 8px; word-break: break-all; }
.plans { display: grid; gap: 12px; }
@media (min-width: 640px) { .plans { grid-template-columns: 1fr 1fr; } }
.plan.on { border: 2px solid var(--coral); }

/* Utilitários (o CSP bloqueia style="" inline) */
.center { text-align: center; }
.right { text-align: right; }
.pt-xl { padding-top: 56px; }
.plain { text-decoration: none; }
.coral { color: var(--coral); }
.brand-lg { font-size: 1.6rem; }
.dashed { border-style: dashed; }
.grow { flex: 1; min-width: 0; }
.top { align-items: flex-start; }
.mt0 { margin-top: 0 !important; }
.w-emoji { width: 84px; flex: none; }
.w-num { width: 110px; flex: none; }
.row > .field + .field { margin-top: 0; }
.hero-card.center .copy input { text-align: left; }

/* Fase A: checkout externo, cliques e assinatura */
.badge-authorized { background: var(--pix-soft); color: var(--pix-ink); }
.badge-cancelled, .badge-paused { background: var(--coral-soft); color: var(--coral-dark); }
.radio-card .badge { margin: 4px 0 2px; white-space: normal; }
.radio-card > span { min-width: 0; }
.thumb-img { object-fit: cover; padding: 0; background: var(--cream2); }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.chart { width: 100%; height: auto; display: block; }
.chart .bar { fill: var(--coral); }
.chart .bar-empty { fill: var(--line); }
.chart .axis { font: 600 7px var(--font); fill: var(--muted); }
.list-head { font-size: .75rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding-top: 10px; padding-bottom: 10px; }
.num { width: 44px; text-align: right; font-variant-numeric: tabular-nums; flex: none; }
.feats { padding-left: 18px; color: var(--ink-2); font-size: .92rem; }
.feats li + li { margin-top: 4px; }

/* Banner de estado da conta (trial / past_due / expired) */
.banner { position: sticky; top: 0; z-index: 5; border-bottom: 1px solid var(--line); font-size: .9rem; }
.banner .inner { max-width: 880px; margin: 0 auto; padding: 10px 16px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.banner-trial { background: var(--cream2); }
.banner-warn { background: #FFF0C2; color: #6B5300; }
.banner-expired { background: var(--coral-soft); color: var(--coral-dark); }
.badge-trial { background: var(--cream2); color: var(--ink-2); }
.badge-active { background: var(--pix-soft); color: var(--pix-ink); }
.badge-past_due { background: #FFF0C2; color: #6B5300; }
.badge-expired { background: var(--coral-soft); color: var(--coral-dark); }
