:root{
  --bg:#FFF5E1;--card:#FFFFFF;--ink:#1B2347;--muted:#555B84;--line:#EADFC8;--navy:#1B2B6B;
  --blue:#2F54D9;--blue-ink:#1F3BA8;--blue-soft:#E6ECFD;
  --coral:#EF6A4E;--sun:#F6B93B;--sky:#3FA7E0;--mint:#35A06B;
  --coral-soft:#FDE9E4;--sun-soft:#FDF1D3;--sky-soft:#DDF0FB;--mint-soft:#DBF2E5;
  --shadow:0 1px 2px rgba(27,35,71,.08),0 8px 20px rgba(27,35,71,.10);
}
@media (prefers-color-scheme:dark){:root{
  --bg:#12172E;--card:#1B2244;--navy:#0C1030;--ink:#F2F3FA;--muted:#A9AFCF;--line:#2C3560;
  --blue:#6F8CFF;--blue-ink:#9FB2FF;--blue-soft:#25306A;
  --coral-soft:#4A2A2E;--sun-soft:#4A3F22;--sky-soft:#1F3B52;--mint-soft:#1E4034;
  --shadow:0 1px 2px rgba(0,0,0,.3),0 6px 18px rgba(0,0,0,.25);
}
}
*{box-sizing:border-box;margin:0;padding:0;-webkit-tap-highlight-color:transparent}
html,body{background:var(--bg);color:var(--ink);font-family:'Figtree',system-ui,sans-serif;font-size:17px;line-height:1.5}
h1,h2,h3,.brand,.price{font-family:'Fredoka','Figtree',system-ui,sans-serif;line-height:1.12;letter-spacing:0}
button{font:inherit;cursor:pointer;border:0;color:inherit;background:none}
a{color:var(--blue-ink)}
:focus-visible{outline:3px solid var(--blue);outline-offset:2px;border-radius:8px}
.wrap{max-width:560px;margin:0 auto;padding:22px 16px 96px}

/* ---------- cabeçalho ---------- */
header{position:sticky;top:0;z-index:5;background:var(--card);border-bottom:1px solid var(--line)}
.bar{max-width:560px;margin:0 auto;padding:10px 16px;display:flex;align-items:center;gap:10px}
.mark{display:flex;align-items:flex-end;gap:3px;height:26px;flex:none}
.mark i{display:block;width:6px;border-radius:3px 3px 1px 1px}
.mark i:nth-child(1){height:14px;background:var(--coral)}
.mark i:nth-child(2){height:22px;background:var(--sun)}
.mark i:nth-child(3){height:18px;background:var(--mint)}
.mark i:nth-child(4){height:26px;background:var(--blue)}
.brand{font-size:18px;font-weight:700;flex:1;min-width:0;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pill{background:var(--blue-soft);color:var(--blue-ink);border-radius:999px;padding:4px 10px;font-weight:700;font-size:13px;white-space:nowrap;font-variant-numeric:tabular-nums}
.pill.warn{background:var(--coral-soft);color:var(--coral)}

/* ---------- botões ---------- */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;background:#E2492C;color:#fff;font-weight:700;font-size:17px;padding:13px 24px;border-radius:999px;text-decoration:none;min-height:50px;transition:background .15s,transform .1s}
.btn:hover{background:#C93A1F}
.btn:active{transform:translateY(1px)}
.btn.sun{background:var(--sun);color:#2A2205}
.btn.sun:hover{background:#E8AA26}
.btn.ghost{background:transparent;color:var(--ink);border:1.5px solid var(--line)}
.btn.ghost:hover{background:var(--card)}
.btn.full{width:100%}
.btn[disabled]{opacity:.45;pointer-events:none}
.btn.sm{min-height:40px;padding:8px 16px;font-size:15px;border-radius:10px}
.stack>*+*{margin-top:12px}

/* ---------- blocos ---------- */
.card{background:var(--card);border:1px solid var(--line);border-radius:16px;padding:18px;margin:14px 0;box-shadow:var(--shadow)}
h1{font-size:32px;font-weight:700;margin:2px 0 4px}
h2{font-size:27px;font-weight:700;margin:6px 0 4px}
h3{font-size:19px;font-weight:700}
.sub{color:var(--muted);margin-bottom:12px}
.back{display:inline-flex;align-items:center;gap:6px;color:var(--muted);font-weight:700;padding:6px 0 10px;font-size:16px}
.back svg{width:18px;height:18px}
.section-title{display:flex;align-items:baseline;justify-content:space-between;margin:26px 0 10px}
.section-title h3{font-size:18px}
.section-title button{color:var(--blue-ink);font-weight:700;font-size:15px}

/* painel de créditos (início) */
.wallet{background:var(--ink);color:#fff;border-radius:18px;padding:18px 18px 16px;margin:16px 0 8px;display:flex;align-items:center;gap:16px;position:relative;overflow:hidden}
@media (prefers-color-scheme:dark){.wallet{background:var(--blue-soft)}}
.wallet .num{font-family:'Fredoka',sans-serif;font-size:46px;font-weight:700;line-height:1}
.wallet small{display:block;color:rgba(255,255,255,.75);font-size:14px;line-height:1.35}
.wallet .meta{flex:1;position:relative;z-index:1}
.wallet .meta b{display:block;font-size:16px}
.wallet a{position:relative;z-index:1}

/* lista de ações */
.actions{display:grid;gap:10px;margin:14px 0}
.big-card{display:flex;gap:14px;align-items:center;width:100%;text-align:left;background:var(--card);border:1px solid var(--line);border-radius:16px;padding:14px;box-shadow:var(--shadow);text-decoration:none;color:inherit;transition:border-color .15s,transform .1s}
.big-card:hover{border-color:var(--blue)}
.big-card:active{transform:translateY(1px)}
.big-card .ico{width:52px;height:52px;border-radius:14px;display:flex;align-items:center;justify-content:center;flex:none}
.big-card .ico svg{width:28px;height:28px}
.big-card .tx{flex:1;min-width:0}
.big-card h3{font-size:18px}
.big-card small{display:block;color:var(--muted);font-size:14.5px;line-height:1.35;margin-top:2px}
.big-card .chev{width:20px;height:20px;color:var(--muted);flex:none}
.i1{background:var(--coral-soft);color:var(--coral)}
.i2{background:var(--sky-soft);color:var(--sky)}
.i3{background:var(--sun-soft);color:#B07A00}
.i4{background:var(--mint-soft);color:var(--mint)}
@media (prefers-color-scheme:dark){.i3{color:var(--sun)}}

/* ---------- livros (biblioteca) ---------- */
.shelf{display:grid;grid-template-columns:repeat(2,1fr);gap:22px 16px}
.strip{display:flex;gap:14px;overflow-x:auto;padding:4px 2px 14px;scroll-snap-type:x proximity;margin:0 -16px;padding-left:16px;padding-right:16px}
.strip .book{flex:none;width:132px;scroll-snap-align:start}
.book{display:block;text-decoration:none;color:inherit;text-align:left;width:100%}
.book .cover{position:relative;display:block;aspect-ratio:3/4;border-radius:4px 10px 10px 4px;overflow:hidden;background:#fff;box-shadow:0 1px 2px rgba(27,35,71,.2),0 10px 22px rgba(27,35,71,.16);transition:transform .15s}
.book:hover .cover{transform:translateY(-3px)}
.book .cover::before{content:"";position:absolute;left:0;top:0;bottom:0;width:9px;background:linear-gradient(90deg,rgba(0,0,0,.28),rgba(255,255,255,.35) 45%,rgba(0,0,0,.06));z-index:2}
.book .cover img{width:100%;height:100%;object-fit:cover;object-position:top;display:block}
.book .cover.ph{display:flex;align-items:flex-end;padding:16px 14px 14px 22px;color:#fff;font-family:'Fredoka',sans-serif;font-weight:700;font-size:19px;line-height:1.1}
.book .cover.ph0{background:linear-gradient(160deg,var(--blue),#1F3BA8)}
.book .cover.ph1{background:linear-gradient(160deg,var(--coral),#C94A31)}
.book .cover.ph2{background:linear-gradient(160deg,var(--mint),#237A4D)}
.book .cover.ph3{background:linear-gradient(160deg,var(--sun),#D99A1E);color:#2A2205}
.book .tag-pdf,.book .tag-free{position:absolute;bottom:8px;right:8px;z-index:3;font-size:12px;font-weight:800;padding:3px 8px;border-radius:99px;background:rgba(255,255,255,.95);color:var(--ink);box-shadow:0 1px 3px rgba(0,0,0,.2)}
.book .tag-free{right:auto;bottom:auto;top:8px;left:16px;background:var(--mint);color:#fff}
.book b{display:block;margin-top:10px;font-size:15.5px;line-height:1.25;font-weight:700}
.book small{display:block;color:var(--muted);font-size:13.5px;margin-top:1px}
.book .go{display:inline-flex;margin-top:8px;font-weight:700;font-size:14.5px;color:var(--blue-ink)}

.chips{display:flex;gap:8px;overflow-x:auto;margin:6px -16px 18px;padding:2px 16px}
.chip{flex:none;padding:8px 16px;border-radius:99px;border:1.5px solid transparent;background:var(--card);font-weight:700;font-size:15px;color:var(--muted)}
.chip.sel{background:var(--ink);border-color:var(--ink);color:#fff}
@media (prefers-color-scheme:dark){.chip.sel{background:var(--blue);border-color:var(--blue);color:#0E1328}}

/* ---------- formulários e grades ---------- */
.grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.tile{background:var(--card);border:1.5px solid var(--line);border-radius:14px;padding:12px;text-align:center;font-weight:700;color:var(--ink);text-decoration:none;display:block}
.tile.sel{border-color:var(--blue);background:var(--blue-soft)}
.tile .e{font-size:30px;display:block;margin-bottom:2px}
.tile small{display:block;color:var(--muted);font-weight:500;font-size:13px}
.thumb{aspect-ratio:2/3;width:100%;object-fit:contain;background:#fff;border-radius:12px;border:1.5px solid var(--line)}
.thumb.sel{border-color:var(--blue);box-shadow:0 0 0 3px var(--blue-soft)}
.locked{aspect-ratio:2/3;display:flex;align-items:center;justify-content:center;background:repeating-linear-gradient(45deg,var(--line),var(--line) 8px,var(--card) 8px,var(--card) 16px);border-radius:12px;font-size:30px}
input[type=text],input[type=file],input[type=password],input[type=tel]{width:100%;padding:13px 14px;border-radius:12px;border:1.5px solid var(--line);background:var(--card);color:var(--ink);font:inherit}
input[type=text]:focus,input[type=password]:focus,input[type=tel]:focus{outline:none;border-color:var(--blue);box-shadow:0 0 0 3px var(--blue-soft)}
label.check{display:flex;gap:10px;align-items:flex-start;font-size:15px;color:var(--muted);margin:12px 0}
label.check input{width:22px;height:22px;margin-top:2px;flex:none;accent-color:var(--blue)}
.preview{width:100%;max-height:340px;object-fit:contain;border-radius:12px;margin:10px 0;background:#fff}
.result{text-align:center}
.result img{width:100%;border-radius:12px;border:1px solid var(--line);background:#fff}
.page{margin:14px 0}
.page p{font-size:18px;font-weight:600;margin-top:8px;text-align:left}
.progress{height:10px;background:var(--line);border-radius:99px;overflow:hidden;margin:12px 0}
.progress>i{display:block;height:100%;width:0;background:var(--blue);transition:width .5s}

/* ---------- aviso de créditos / teste ---------- */
.overlay{position:fixed;inset:0;background:rgba(18,23,46,.68);display:none;align-items:flex-end;justify-content:center;z-index:20}
.overlay.on{display:flex}
.sheet{background:var(--bg);border-radius:22px 22px 0 0;width:100%;max-width:560px;padding:24px 18px 30px;max-height:92vh;overflow:auto}
.price{font-size:28px;font-weight:700;color:var(--blue-ink)}
.plan{border:1.5px solid var(--blue);background:var(--card);border-radius:16px;padding:16px;margin:12px 0}
.plan ul{margin:8px 0 0 20px;color:var(--muted);font-size:16px}
.err{background:var(--coral-soft);color:#A33B25;border-radius:12px;padding:12px;margin:10px 0;font-weight:600}
@media (prefers-color-scheme:dark){.err{color:#FFB4A5}}
.hidden{display:none!important}

/* ---------- impressão ---------- */
#print-root{display:none}
@media print{
  body>*:not(#print-root){display:none!important}
  #print-root{display:block}
  .pp{page-break-after:always;text-align:center;padding:10mm}
  .pp img{width:100%;max-height:230mm;object-fit:contain}
  .pp p{font-size:20pt;margin-top:8mm;font-family:'Fredoka',sans-serif;color:#000}
  html,body{background:#fff}
}
@media (prefers-reduced-motion:reduce){*{transition:none!important}}

/* ---------- cena do topo, faixas e blocos coloridos ---------- */
.stage{position:relative;max-width:560px;margin:0 auto}
.scene{position:absolute;left:0;right:0;top:0;height:330px;overflow:hidden;z-index:0;pointer-events:none}
.scene svg{display:block;width:100%;height:100%}
.scene::after{content:"";position:absolute;left:0;right:0;bottom:-1px;height:34px;background:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 34' preserveAspectRatio='none'><path d='M0 18C70 40 130 0 200 14S340 34 400 12V34H0Z' fill='%23FFF5E1'/></svg>") center/100% 100% no-repeat}
body.inner .scene{height:78px}
body.inner .back{margin-bottom:16px}
.stage .wrap{position:relative;z-index:1}
@media (prefers-color-scheme:dark){
  .scene svg{filter:brightness(.5) saturate(.9)}
  .scene::after{background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 34' preserveAspectRatio='none'><path d='M0 18C70 40 130 0 200 14S340 34 400 12V34H0Z' fill='%2312172E'/></svg>")}
}
.hero-text{padding-bottom:104px}
.hero-text h1{font-size:34px;color:var(--ink);}
.hero-text .sub{color:#233067;font-weight:600;margin:0}

.tiles{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:16px 0 4px}
.tile-act{display:flex;flex-direction:column;align-items:flex-start;gap:10px;text-align:left;border-radius:22px;padding:14px 14px 16px;color:#fff;min-height:170px;box-shadow:0 8px 18px rgba(27,35,71,.18);transition:transform .12s}
.tile-act:active{transform:translateY(1px) scale(.99)}
.tile-act .med{width:58px;height:58px;border-radius:50%;background:#fff;display:flex;align-items:center;justify-content:center;box-shadow:0 3px 0 rgba(0,0,0,.12)}
.tile-act .med svg{width:30px;height:30px}
.tile-act h3{font-size:19px;line-height:1.1;color:inherit}
.tile-act small{display:block;font-size:13.5px;line-height:1.3;opacity:.95;margin-top:3px}
.ta1{background:linear-gradient(160deg,#F2684A,#D8412A)}.ta1 .med{color:#D8412A}
.ta2{background:linear-gradient(160deg,#4C7DFF,#2A4BC9)}.ta2 .med{color:#2A4BC9}
.ta3{background:linear-gradient(160deg,#FFD65C,#F6B93B);color:#2A2205}.ta3 .med{color:#B07A00}
.ta4{background:linear-gradient(160deg,#35A872,#1E7F52)}.ta4 .med{color:#1E7F52}

.band{position:relative;background:var(--navy);color:#fff;margin:56px -16px -96px;padding:8px 16px 120px;background-image:radial-gradient(circle at 12% 30%,rgba(255,255,255,.7) 0 1.5px,transparent 2px),radial-gradient(circle at 70% 18%,rgba(255,255,255,.6) 0 1.5px,transparent 2px),radial-gradient(circle at 88% 62%,rgba(255,255,255,.55) 0 1.5px,transparent 2px),radial-gradient(circle at 36% 80%,rgba(255,255,255,.5) 0 1.5px,transparent 2px)}
.band::before{content:"";position:absolute;left:0;right:0;top:-33px;height:34px;background:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 34' preserveAspectRatio='none'><path d='M0 34V16C60 -4 130 30 200 14S340 0 400 18V34Z' fill='%231B2B6B'/></svg>") center/100% 100% no-repeat}
@media (prefers-color-scheme:dark){.band::before{background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 34' preserveAspectRatio='none'><path d='M0 34V16C60 -4 130 30 200 14S340 0 400 18V34Z' fill='%230C1030'/></svg>")}}
.band .section-title{margin-top:18px}
.band .section-title h3,.band h2,.band h1{color:#fff}
.band .section-title button{color:#FFD65C}
.band .sub{color:rgba(255,255,255,.8)}
.band .book b{color:#fff}.band .book small{color:rgba(255,255,255,.72)}.band .book .go{color:#FFD65C}
.band .strip{margin:0 -16px}
.band .shelf{margin-top:6px}

h1,h2,h3,.brand,.price,.wallet .num{font-weight:600}
