:root {
  --pink: #ff3d9a; --violet: #7b2ff7; --deep: #24093f; --red: #ff3b5c; --gold: #ffc94d;
  --bg: #fbf7ff; --surface: #ffffff; --surface-2: #f3ecfb; --line: #e7dcf4;
  --text: #1f1230; --muted: #6e5d84; --ok: #12a86b; --warn: #e38b00; --bad: #e0244a;
  --grad: linear-gradient(135deg, var(--pink), var(--violet));
  --radius: 18px; --shadow: 0 8px 24px rgba(76, 17, 140, .10);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
:root[data-theme="dark"] {
  --bg: #120a1d; --surface: #1c1229; --surface-2: #261936; --line: #35244a;
  --text: #f6f0ff; --muted: #b3a3c9; --shadow: 0 8px 24px rgba(0, 0, 0, .35);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* Rolagem: só o documento rola (nada de overflow em html+body, que no WebView do Android cria dois
   contêineres e o gesto cai no errado). overflow-x: clip corta o excesso lateral sem virar contêiner de rolagem. */
html { margin: 0; background: var(--bg); color: var(--text); height: auto; overflow-y: auto; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); overflow-x: clip; touch-action: pan-x pan-y; overscroll-behavior-y: contain;
       font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
       min-height: calc(var(--tg-viewport-stable-height, 100vh) + 1px); }
button, input, textarea, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.ic { flex: none; }

/* splash */
.splash { position: fixed; top: 0; left: 0; right: 0; bottom: 0; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  background: radial-gradient(circle at 50% 35%, #3a1366, var(--deep) 70%); color: #fff; transition: opacity .35s; }
.splash.out { opacity: 0; pointer-events: none; }
.splash-logo { width: 104px; height: 104px; animation: pop .8s cubic-bezier(.2, 1.4, .4, 1) both; filter: drop-shadow(0 12px 30px rgba(255, 61, 154, .45)); }
.splash-name { font-size: 26px; letter-spacing: .3px; animation: rise .6s .25s both; }
.splash-name b { background: linear-gradient(90deg, #ff8ac4, #c9a2ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.splash-bar { width: 120px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .15); overflow: hidden; animation: rise .6s .35s both; }
.splash-bar i { display: block; height: 100%; width: 40%; background: var(--grad); border-radius: 4px; animation: load 1.1s ease-in-out infinite; }
@keyframes pop { from { transform: scale(.4) rotate(-12deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes rise { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes load { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }

/* layout */
.app { padding: 16px 16px calc(110px + var(--safe-b)); max-width: 560px; margin: 0 auto; animation: rise .3s; overflow-x: clip; }
.top { display: flex; align-items: center; gap: 10px; margin: 4px 0 16px; }
.top h1 { font-size: 22px; margin: 0; flex: 1; }
.top .back { border: 0; background: var(--surface-2); width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; }
.hello { font-size: 14px; color: var(--muted); margin: 0; }
h2 { font-size: 17px; margin: 22px 0 10px; }
p { margin: 6px 0; }
.muted { color: var(--muted); font-size: 14px; }
.small { font-size: 13px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 12px; }
.hero { color: #fff; border: 0; background: var(--grad); position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: rgba(255, 255, 255, .12); }
.hero .muted { color: rgba(255, 255, 255, .85); }
.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 10px; }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tile { border: 1px solid var(--line); background: var(--surface); border-radius: 16px; padding: 14px 8px; display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.tile .ic { color: var(--violet); }
:root[data-theme="dark"] .tile .ic { color: #c9a2ff; }

/* botões */
.btn { border: 0; border-radius: 14px; padding: 14px 18px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; transition: transform .1s, opacity .2s; }
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn.primary { background: var(--grad); color: #fff; box-shadow: 0 8px 20px rgba(123, 47, 247, .3); }
.btn.light { background: #fff; color: var(--deep); }
.btn.soft { background: var(--surface-2); color: var(--text); }
.btn.danger { background: transparent; color: var(--bad); border: 1px solid currentColor; }
.btn.block { width: 100%; }
.btn.sm { padding: 9px 12px; font-size: 14px; border-radius: 12px; }
.btn.ghost { background: transparent; color: var(--text); border: 1.5px solid var(--line, rgba(127,127,127,.35)); }
.btn.stars-btn { margin-top: 8px; }
.btn.stars-btn .ic { color: #f5b301; fill: #f5b301; }

/* formulários */
label.f { display: block; font-size: 14px; font-weight: 600; margin: 14px 0 6px; }
.in { width: 100%; border: 1.5px solid var(--line); background: var(--surface); border-radius: 14px; padding: 13px 14px; outline: none; }
.in:focus { border-color: var(--violet); }
textarea.in { min-height: 96px; resize: vertical; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px; padding: 9px 14px; font-size: 14px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.chip.on { border-color: transparent; background: var(--grad); color: #fff; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; }
.switch input { width: 48px; height: 28px; appearance: none; background: var(--line); border-radius: 999px; position: relative; transition: background .2s; flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; background: #fff; border-radius: 50%; transition: transform .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.switch input:checked { background: var(--violet); }
.switch input:checked::after { transform: translateX(20px); }
input[type=range] { width: 100%; accent-color: var(--violet); }

/* passos */
.steps { display: flex; gap: 6px; margin: 0 0 14px; }
.steps i { flex: 1; height: 5px; border-radius: 5px; background: var(--line); }
.steps i.on { background: var(--grad); }
.foot { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(12px + var(--safe-b)); background: linear-gradient(transparent, var(--bg) 30%); display: flex; gap: 10px; max-width: 560px; margin: 0 auto; z-index: 5; }
.foot .btn { flex: 1; }

/* fotos */
.photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ph { position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: var(--surface-2); border: 2px solid transparent; }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph.sel { border-color: var(--violet); }
.ph .n { position: absolute; top: 6px; right: 6px; min-width: 24px; height: 24px; border-radius: 12px; background: var(--grad); color: #fff; font-size: 13px; font-weight: 800; display: grid; place-items: center; }
.ph .x { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .55); color: #fff; display: grid; place-items: center; }
.add { border: 2px dashed var(--line); background: transparent; aspect-ratio: 1; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 600; }

/* listas */
.list { display: flex; flex-direction: column; gap: 10px; }
.item { display: flex; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 10px; }
.item img.thumb { width: 54px; height: 96px; object-fit: cover; border-radius: 10px; background: var(--surface-2); }
.item .t { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iconbtn { border: 0; background: var(--surface-2); width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.iconbtn.on { background: var(--grad); color: #fff; }

/* progresso */
.prog { height: 12px; border-radius: 12px; background: var(--surface-2); overflow: hidden; }
.prog i { display: block; height: 100%; background: var(--grad); border-radius: 12px; transition: width .6s; }
.big { font-size: 34px; font-weight: 800; }
.badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 4px 10px; font-size: 12.5px; font-weight: 700; background: var(--surface-2); }
.badge.ok { background: rgba(18, 168, 107, .14); color: var(--ok); }
.badge.warn { background: rgba(227, 139, 0, .14); color: var(--warn); }
.hero .badge { background: rgba(255, 255, 255, .2); color: #fff; }

/* planos */
.plan { border: 2px solid var(--line); }
.plan.best { border-color: var(--violet); position: relative; }
.plan.best::before { content: "Mais escolhido"; position: absolute; top: -11px; right: 14px; background: var(--grad); color: #fff; font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 999px; }
.price { font-size: 28px; font-weight: 800; }
.price s { font-size: 15px; color: var(--muted); font-weight: 600; margin-right: 6px; }
.feat { list-style: none; padding: 0; margin: 10px 0; }
.feat li { display: flex; gap: 8px; align-items: flex-start; margin: 6px 0; font-size: 14.5px; }
.feat .ic { color: var(--ok); margin-top: 1px; }
.qr { width: 220px; height: 220px; display: block; margin: 8px auto; background: #fff; padding: 8px; border-radius: 16px; }
.code { word-break: break-all; font-family: ui-monospace, monospace; font-size: 12px; background: var(--surface-2); padding: 10px; border-radius: 12px; max-height: 80px; overflow: auto; }

/* abas */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 8px 8px calc(8px + var(--safe-b)); background: var(--surface); border-top: 1px solid var(--line); }
.tabs button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 600; color: var(--muted); padding: 4px 0; }
.tabs button.on { color: var(--violet); }
:root[data-theme="dark"] .tabs button.on { color: #c9a2ff; }

.toast { position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); transform: translateX(-50%) translateY(20px); background: var(--deep); color: #fff; padding: 12px 16px; border-radius: 14px; font-size: 14px; opacity: 0; pointer-events: none; transition: .25s; max-width: calc(100% - 32px); z-index: 60; text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%); }

/* onboarding / gate */
.center { min-height: 80vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 12px; padding: 20px; }
.bubble-ic { width: 84px; height: 84px; border-radius: 26px; display: grid; place-items: center; background: var(--grad); color: #fff; box-shadow: 0 14px 30px rgba(123, 47, 247, .35); }
.dots { display: flex; gap: 6px; justify-content: center; }
.dots i { width: 8px; height: 8px; border-radius: 4px; background: var(--line); transition: width .2s; }
.dots i.on { width: 22px; background: var(--violet); }
.swatch { display: flex; height: 26px; border-radius: 8px; overflow: hidden; margin-top: 6px; }
.swatch i { flex: 1; }
.pal { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border: 2px solid var(--line); border-radius: 14px; padding: 8px; font-size: 13px; font-weight: 600; background: var(--surface); text-align: left; }
.pal.on { border-color: var(--violet); }
.preview { width: 100%; max-width: 270px; aspect-ratio: 9/16; display: block; margin: 10px auto; border-radius: 16px; background: var(--surface-2); object-fit: cover; }
.faq details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.faq summary { font-weight: 700; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 8px; }
.faq summary::-webkit-details-marker { display: none; }
.spin { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--violet); border-radius: 50%; animation: sp 0.8s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Fallbacks para WebView antigo do Android (Chrome < 88: sem aspect-ratio) */
@supports not (aspect-ratio: 1 / 1) {
  .ph::before, .add::before { content: ""; display: block; padding-top: 100%; }
  .add { position: relative; min-height: 96px; }
  .add > * { position: relative; }
  .ph img { position: absolute; top: 0; left: 0; }
  .preview { height: 480px; }
}

/* janela de confirmação */
.modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 80; display: flex; align-items: flex-end; justify-content: center; background: rgba(12, 2, 24, .6); }
.modal .sheet { width: 100%; max-width: 560px; background: var(--surface); border-radius: 22px 22px 0 0; padding: 22px 18px calc(18px + var(--safe-b)); box-shadow: 0 -10px 40px rgba(0, 0, 0, .35); animation: rise .2s; }
.modal .sheet h2 { margin: 0 0 6px; font-size: 19px; }
.modal .sheet .stack { margin-top: 16px; }
.btn.danger.block { color: var(--bad); }
.modal .btn.danger { background: var(--bad); color: #fff; border-color: transparent; }
.note { margin: 6px 0; padding: 10px 12px; border-radius: 12px; font-size: 13.5px; background: rgba(227, 139, 0, .14); color: var(--warn); }

/* prévia da capa ao vivo */
.cvbox { text-align: center; margin: 0 0 12px; }
.cvbox.sticky { position: sticky; top: 0; z-index: 6; padding: 8px 0 6px; background: var(--bg); box-shadow: 0 8px 14px -10px rgba(0, 0, 0, .35); }
.cvframe { position: relative; height: 30vh; width: calc(30vh * 9 / 16); max-height: 300px; max-width: 169px; margin: 0 auto; border-radius: 14px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); }
.cvbox:not(.sticky) .cvframe { height: 52vh; width: calc(52vh * 9 / 16); max-height: 480px; max-width: 270px; }
.cvimg { width: 100%; height: 100%; object-fit: cover; display: block; }
.cvspin { position: absolute; top: 0; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .35); }
:root[data-theme="dark"] .cvspin { background: rgba(0, 0, 0, .35); }
.cvmsg { margin: 8px auto 0; border: 0; border-radius: 12px; padding: 8px 12px; font-size: 13px; background: rgba(224, 36, 74, .12); color: var(--bad); }
.cvhint { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.cvbox.sticky .cvhint { display: none; }
.lightbox { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 90; display: flex; align-items: center; justify-content: center; background: rgba(8, 0, 16, .88); padding: 12px; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 16px; }
