/* Cores e medidas — mude aqui para trocar o visual (a cor de destaque vem de lib/creator.js) */
:root {
  --brand: #ff3d7f;
  --brand-ink: #ffffff;
  --bg: #0b0b10;
  --surface: #14141b;
  --surface-2: #1c1c25;
  --line: #2a2a36;
  --text: #f4f4f7;
  --label: #c9c9d4;
  --muted: #9a9aab;
  --placeholder: #6b6b7c;
  --ok: #22c55e;
  --warn: #f59e0b;
  --err: #fb7185;
  --radius: 18px;
  --field-radius: 12px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; color-scheme: dark; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
body.lock { overflow: hidden; }

.demo-banner { background: #3b2a06; color: #fcd34d; text-align: center; font-size: 13px; padding: 8px 16px; }

/* ---------- Perfil ---------- */
.profile { max-width: 600px; margin: 0 auto; padding-bottom: 40px; }

.cover {
  height: 190px; background-size: cover; background-position: center;
  background-image:
    radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--brand) 85%, #7c3aed) 0%, transparent 55%),
    radial-gradient(120% 140% at 100% 100%, #7c3aed 0%, transparent 60%),
    linear-gradient(135deg, #2b1030, #120c1f);
}
@media (min-width: 640px) { .cover { border-radius: 0 0 var(--radius) var(--radius); height: 220px; } }

.head { display: flex; align-items: flex-end; gap: 14px; padding: 0 16px; margin-top: -48px; }
.avatar {
  flex: none; width: 104px; height: 104px; border-radius: 50%; border: 4px solid var(--bg);
  background: linear-gradient(135deg, var(--brand), #7c3aed) center/cover; display: grid; place-items: center;
  font-size: 36px; font-weight: 800; color: #fff; letter-spacing: -.02em;
}
.avatar-sm { width: 44px; height: 44px; border-width: 0; font-size: 16px; }
.who { padding-bottom: 8px; min-width: 0; }
.who h1 { margin: 0; font-size: 22px; letter-spacing: -.02em; display: flex; align-items: center; gap: 6px; }
.who h1 span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.verified { color: var(--brand); flex: none; }
.handle { margin: 2px 0 0; color: var(--muted); font-size: 15px; }

.bio { padding: 0 16px; margin: 16px 0 0; line-height: 1.55; font-size: 15px; color: var(--label); }

.stats { list-style: none; display: flex; gap: 8px; padding: 0 16px; margin: 16px 0 0; flex-wrap: wrap; }
.stats li { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); padding: 7px 11px; border-radius: 999px; }
.stats b { color: var(--text); font-weight: 600; }
.stats svg { opacity: .8; }

/* Prévia bloqueada */
.locked { position: relative; margin: 22px 16px 0; border-radius: var(--radius); overflow: hidden; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
.tile { aspect-ratio: 1; filter: blur(14px) saturate(1.3); transform: scale(1.15); }
.tile-wrap { overflow: hidden; }
.locked-overlay {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px;
  background: linear-gradient(180deg, rgb(11 11 16 / .15), rgb(11 11 16 / .55)); text-align: center; font-weight: 600; font-size: 15px; padding: 16px;
}
.locked-overlay svg { width: 46px; height: 46px; padding: 12px; border-radius: 50%; background: rgb(255 255 255 / .14); backdrop-filter: blur(6px); }

/* Planos */
.plans-box { margin: 22px 16px 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 18px; }
.plans-box h2 { margin: 0 0 14px; font-size: 18px; letter-spacing: -.01em; }
.plans { display: grid; gap: 10px; }
.plan {
  position: relative; width: 100%; display: flex; align-items: center; gap: 14px; text-align: left;
  padding: 16px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface-2);
  color: var(--text); font: inherit; cursor: pointer; transition: border-color .15s, background .15s;
}
.plan:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }
.plan[aria-checked="true"] { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 9%, var(--surface-2)); }
.radio { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--placeholder); display: grid; place-items: center; }
.plan[aria-checked="true"] .radio { border-color: var(--brand); }
.plan[aria-checked="true"] .radio::after { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); }
.plan-info { flex: 1; min-width: 0; }
.plan-name { font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.plan-sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.plan-price { text-align: right; font-weight: 800; font-size: 18px; letter-spacing: -.02em; white-space: nowrap; }
.plan-price small { display: block; font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.off { font-size: 11px; font-weight: 700; color: var(--ok); background: rgb(34 197 94 / .12); padding: 3px 7px; border-radius: 6px; }
.badge { position: absolute; top: -10px; right: 14px; font-size: 11px; font-weight: 700; letter-spacing: .02em; background: var(--brand); color: var(--brand-ink); padding: 3px 9px; border-radius: 999px; }

.benefits { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 10px; }
.benefits li { display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--label); }
.benefits li::before { content: '✓'; flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: var(--brand); background: color-mix(in srgb, var(--brand) 16%, transparent); }

.fine { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 12px 0 0; font-size: 12px; color: var(--muted); text-align: center; }

/* ---------- Botões ---------- */
.btn {
  margin-top: 18px; width: 100%; height: 56px; border: 0; border-radius: 14px; background: var(--brand); color: var(--brand-ink);
  font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  box-shadow: 0 10px 30px -10px color-mix(in srgb, var(--brand) 70%, transparent); transition: filter .15s, transform .05s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .75; cursor: progress; }
.btn.loading::before { content: ''; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); height: 48px; font-size: 14px; font-weight: 500; box-shadow: none; }
.btn-sm { margin: 0; width: auto; height: 50px; padding: 0 18px; flex: none; font-size: 14px; box-shadow: none; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--surface-2); color: var(--label); display: grid; place-items: center; cursor: pointer; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Checkout (sheet) ---------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 10; background: rgb(0 0 0 / .65); backdrop-filter: blur(4px); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s ease; }
.sheet {
  width: 100%; max-width: 480px; max-height: 94dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border: 1px solid var(--line); border-bottom: 0; border-radius: 22px 22px 0 0;
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); animation: up .25s cubic-bezier(.2, .8, .2, 1);
}
@media (min-width: 640px) {
  .sheet-backdrop { align-items: center; }
  .sheet { border-radius: 22px; border-bottom: 1px solid var(--line); padding: 22px; }
}
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

.sheet-head { display: flex; align-items: center; gap: 12px; padding-bottom: 16px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.sheet-who { flex: 1; min-width: 0; display: grid; gap: 2px; }
.sheet-who b { font-size: 16px; }
.sheet-who span { font-size: 13px; color: var(--muted); }
.sheet-foot { text-align: center; color: var(--placeholder); font-size: 12px; margin: 18px 0 0; }

.fields { display: grid; gap: 12px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: grid; gap: 6px; position: relative; min-width: 0; }
.field > span { font-size: 13px; font-weight: 500; color: var(--label); }
.field input, .input, .copy-row input {
  width: 100%; height: 50px; border: 1px solid var(--line); border-radius: var(--field-radius);
  padding: 0 14px; font: inherit; font-size: 16px; color: var(--text); background: var(--surface-2);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.field input::placeholder, .input input::placeholder { color: var(--placeholder); }
.input input { border: 0; padding: 0; height: 100%; width: 100%; font: inherit; color: inherit; background: transparent; outline: none; }
.secure-input iframe { height: 100% !important; width: 100% !important; }
.field input:focus, .input.focus, .input:focus-within {
  border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent);
}
.field .invalid, .input.invalid { border-color: var(--err); }
.card-number { padding-right: 90px; }
.card-brand { position: absolute; right: 12px; bottom: 15px; font-style: normal; font-size: 11px; font-weight: 800; letter-spacing: .04em; color: var(--label); background: var(--line); padding: 3px 8px; border-radius: 6px; }
.card-brand:empty { display: none; }

.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 20px 0 16px; padding: 5px; background: var(--surface-2); border-radius: 14px; }
.tabs button { height: 44px; border: 0; border-radius: 10px; background: transparent; font: inherit; font-weight: 600; font-size: 15px; color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 0 rgb(255 255 255 / .04), 0 4px 14px rgb(0 0 0 / .35); }
.tabs button[aria-selected="true"] svg { color: var(--brand); }

.note { margin: 14px 0 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
.note b { color: var(--label); }
.form-error { margin: 14px 0 0; padding: 12px 14px; border-radius: 12px; background: rgb(251 113 133 / .1); color: #fda4af; font-size: 14px; line-height: 1.45; }

/* Pix gerado */
.pix-view { text-align: center; }
.pix-amount { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.pix-view .muted { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 6px 0 16px; }
.qr { width: 232px; height: 232px; margin: 0 auto 16px; padding: 16px; border-radius: 18px; display: grid; place-items: center; background: #fff; }
.qr img, .qr canvas { width: 200px !important; height: 200px !important; image-rendering: pixelated; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { font-size: 14px; color: var(--muted); text-overflow: ellipsis; }
.waiting { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 18px; font-size: 14px; color: var(--label); font-weight: 500; }
.timer { color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--warn); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; transform: scale(.8); } }

/* Resultado */
.result { text-align: center; padding: 18px 0 4px; }
.result h2 { margin: 0 0 6px; font-size: 22px; }
.result .muted { color: var(--muted); margin: 0 auto; max-width: 340px; line-height: 1.5; }
.btn-telegram { background: #229ed9; text-decoration: none; box-shadow: 0 10px 30px -10px rgb(34 158 217 / .7); }
.result .note { margin-top: 12px; }
.result-icon { width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 16px; display: grid; place-items: center; font-size: 34px; font-weight: 800; color: #fff; background: var(--ok); }
.result-icon.pending { background: var(--warn); }
.result-icon.error { background: var(--err); }

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