/* Prova de álbum — página do cliente (visual claro e limpo; o tema escuro é opcional por álbum) */
:root { --bg: #ffffff; --palco: #f4f3ef; --card: #ffffff; --texto: #262624; --suave: #85857d; --linha: #e8e6df; --acento: #a36a48; --botao: #232321; --botao-t: #ffffff; --sombra: 0 24px 60px rgba(40, 36, 28, .14); --h-topo: 66px; --h-tiras: 84px; --h-barra: 72px; }
[data-tema=escuro] { --bg: #171717; --palco: #202020; --card: #2a2a2a; --texto: #ecebe6; --suave: #a09e96; --linha: rgba(255,255,255,.12); --botao: #f1efe9; --botao-t: #171717; --sombra: 0 24px 70px rgba(0, 0, 0, .55); }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--texto); font-family: 'Jost', system-ui, -apple-system, 'Segoe UI', sans-serif; -webkit-tap-highlight-color: transparent; }
body { overscroll-behavior: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
#app { height: 100%; display: flex; flex-direction: column; min-height: 0; }
.serif { font-family: 'Cormorant Garamond', Georgia, serif; }

/* topo */
.topo { height: var(--h-topo); flex: none; display: flex; align-items: center; gap: 16px; padding: 0 28px; background: var(--bg); border-bottom: 1px solid var(--linha); }
.topo .logo { height: 30px; width: auto; max-width: 130px; object-fit: contain; }
.topo .logo.escurece { filter: brightness(0) opacity(.85); }
.logo-t { letter-spacing: .26em; font-size: 13px; font-weight: 500; }
.topo-album .titulo { flex: 1; min-width: 0; text-align: center; line-height: 1.15; }
.topo-album .titulo b { display: block; font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 500; font-size: 26px; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topo-album .titulo small { display: block; color: var(--suave); font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; margin-top: 2px; }
.topo-acoes { display: flex; gap: 10px; align-items: center; min-width: 130px; justify-content: flex-end; }
.pilula { display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; border: 1px solid var(--linha); border-radius: 999px; font-size: 13px; font-weight: 500; letter-spacing: .04em; background: var(--card); }
.pilula:hover { border-color: var(--texto); }
.pilula svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.redondo { width: 38px; height: 38px; border: 1px solid var(--linha); border-radius: 50%; display: grid; place-items: center; font-size: 15px; background: var(--card); }
.aviso-topo { flex: none; padding: 10px 24px; background: #f6efe5; color: #7a5a3a; text-align: center; font-size: 14px; border-bottom: 1px solid var(--linha); }
[data-tema=escuro] .aviso-topo { background: #2c2a24; color: #e6d9bb; }

.aviso { margin: auto; max-width: 480px; padding: 30px 24px; text-align: center; }
.aviso h1 { font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 500; font-size: 34px; margin: 0 0 10px; }
.aviso p { color: var(--suave); font-size: 16px; line-height: 1.6; margin: 0; }

/* senha */
.senha-tela { position: relative; flex: 1; display: grid; place-items: center; padding: 20px; overflow: hidden; background: var(--palco); }
.senha-fundo { position: absolute; inset: -40px; background: center / cover; filter: blur(40px) saturate(1.1); opacity: .45; }
.senha-caixa { position: relative; width: min(400px, 100%); padding: 38px 32px; background: var(--card); border-radius: 18px; box-shadow: var(--sombra); text-align: center; }
.senha-caixa .logo { height: 40px; margin-bottom: 16px; }
.senha-caixa h1 { margin: 0 0 8px; font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 500; font-size: 32px; }
.senha-caixa p { margin: 0 0 22px; color: var(--suave); font-size: 15px; }
.senha-caixa input { width: 100%; padding: 14px 16px; background: var(--palco); border: 1px solid transparent; border-radius: 10px; color: var(--texto); font: inherit; font-size: 16px; text-align: center; outline: none; }
.senha-caixa input:focus { border-color: var(--acento); background: var(--card); }
.senha-caixa button { width: 100%; margin-top: 12px; padding: 14px; background: var(--botao); color: var(--botao-t); border-radius: 999px; letter-spacing: .14em; text-transform: uppercase; font-size: 13px; font-weight: 500; }
.senha-caixa button:disabled { opacity: .6; }
.senha-caixa small { display: block; margin-top: 12px; color: #c0553d; font-size: 14px; }

/* palco do álbum */
.palco { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 22px 76px; background: var(--palco); overflow: hidden; --stage-h: calc(100dvh - var(--h-topo) - var(--h-tiras) - var(--h-barra) - 54px); }
.palco.zoom { overflow: auto; align-items: flex-start; justify-content: flex-start; }
.livro { position: relative; aspect-ratio: var(--r); width: min(100%, calc(var(--stage-h) * var(--r))); background: #fff; box-shadow: var(--sombra); flex: none; border-radius: 2px; }
.palco.zoom .livro { width: max(210%, 900px); margin: 0 auto; }
.livro.meia { background: transparent; box-shadow: none; }
.folha { position: relative; z-index: 1; line-height: 0; width: 100%; height: 100%; }
.folha img { width: 100%; height: 100%; display: block; object-fit: fill; user-select: none; -webkit-user-drag: none; }
.pin { position: absolute; z-index: 3; width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 50%; background: var(--acento); color: #fff; border: 2px solid #fff; box-shadow: 0 3px 10px rgba(0,0,0,.35); font-size: 13px; font-weight: 600; line-height: 1; display: grid; place-items: center; transition: transform .15s; }
.pin:hover { transform: scale(1.12); }
.pin.fixo { position: static; margin: 0; flex: none; }
.seta { position: absolute; top: 50%; width: 46px; height: 46px; margin-top: -23px; z-index: 5; border-radius: 50%; background: var(--card); box-shadow: 0 4px 16px rgba(0,0,0,.14); display: grid; place-items: center; transition: transform .15s, opacity .15s; }
.seta svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.seta:hover { transform: scale(1.06); }
.seta.esq { left: 18px; } .seta.dir { right: 18px; }
.seta:disabled { opacity: .3; cursor: default; transform: none; }
.lupa { position: absolute; right: 22px; bottom: 16px; z-index: 6; width: 40px; height: 40px; border-radius: 50%; background: var(--card); box-shadow: 0 4px 14px rgba(0,0,0,.14); font-size: 22px; line-height: 1; }

.tiras { height: var(--h-tiras); flex: none; display: flex; gap: 10px; overflow-x: auto; padding: 10px 24px; background: var(--bg); border-top: 1px solid var(--linha); scrollbar-width: thin; align-items: center; }
.tiras button { position: relative; flex: none; display: grid; justify-items: center; gap: 3px; opacity: .6; transition: opacity .15s; }
.tiras button:hover { opacity: .9; }
.tiras button.on { opacity: 1; }
.tiras img { height: 46px; width: auto; max-width: 120px; object-fit: cover; border-radius: 4px; box-shadow: 0 0 0 1px var(--linha); }
.tiras button.on img { box-shadow: 0 0 0 2px var(--acento); }
.tiras span { font-size: 11px; color: var(--suave); white-space: nowrap; letter-spacing: .04em; }
.pontos { position: absolute; top: -5px; right: -5px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--acento); color: #fff; font: 600 11px/19px 'Jost', sans-serif; text-align: center; font-style: normal; }

.barra { height: var(--h-barra); flex: none; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 0 28px calc(0px + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--linha); }
.barra .pos small { display: block; font-size: 11.5px; letter-spacing: .12em; color: var(--suave); text-transform: uppercase; }
.barra .alts { font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 600; font-size: 26px; font-variant-numeric: lining-nums; line-height: 1.1; text-align: left; }
.barra .alts:hover { color: var(--acento); }
.barra .acao { padding: 15px 30px; background: var(--botao); color: var(--botao-t); border-radius: 999px; font-weight: 500; font-size: 12.5px; letter-spacing: .16em; text-transform: uppercase; white-space: nowrap; transition: transform .15s; }
.barra .acao:hover:not(:disabled) { transform: translateY(-1px); }
.barra .acao.ok { background: #6f8a3d; color: #fff; }
.barra .acao:disabled { opacity: .55; cursor: default; }

/* janelas */
.fundo { position: fixed; inset: 0; z-index: 60; background: rgba(24, 22, 18, .5); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 16px; animation: aparece .18s ease both; }
@keyframes aparece { from { opacity: 0; } to { opacity: 1; } }
.dlg { width: min(520px, 100%); max-height: 88dvh; overflow: auto; background: #fff; color: #262624; padding: 30px 30px 22px; border-radius: 18px; box-shadow: 0 30px 80px rgba(0,0,0,.3); }
[data-tema=escuro] .dlg { background: #2a2a2a; color: #ecebe6; }
.dlg h2 { margin: 0 0 12px; font-family: 'Cormorant Garamond', Georgia, serif; font-size: 30px; font-weight: 500; }
.dlg h3 { margin: 18px 0 6px; font-size: 15px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.dlg-texto { margin: 0 0 8px; font-size: 16px; line-height: 1.6; color: var(--suave); white-space: pre-line; }
.dlg textarea, .dlg input[type=text] { width: 100%; padding: 14px; border: 1px solid var(--linha); border-radius: 12px; font: inherit; font-size: 16px; color: inherit; background: transparent; outline: none; }
.dlg textarea:focus, .dlg input[type=text]:focus { border-color: var(--acento); }
.dlg textarea { resize: vertical; }
.dlg-chk { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; font-size: 15px; line-height: 1.4; }
.dlg-chk input { margin-top: 4px; accent-color: var(--acento); }
.dlg-erro { display: block; margin-top: 10px; color: #c0553d; font-size: 14px; }
.dlg-bt { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.dlg-bt button { padding: 12px 24px; border: 1px solid var(--linha); border-radius: 999px; font-weight: 500; font-size: 12.5px; letter-spacing: .12em; text-transform: uppercase; }
.dlg-bt button.principal { background: #232321; color: #fff; border-color: #232321; }
[data-tema=escuro] .dlg-bt button.principal { background: #f1efe9; color: #171717; border-color: #f1efe9; }
.dlg-bt button:disabled { opacity: .5; }
.lista-alt { list-style: none; margin: 0; padding: 0; }
.lista-alt li { display: flex; gap: 14px; align-items: flex-start; padding: 14px 4px; border-top: 1px solid var(--linha); cursor: pointer; }
.lista-alt li small { font-size: 12px; color: var(--suave); letter-spacing: .06em; text-transform: uppercase; }
.lista-alt li p { margin: 3px 0 0; font-size: 16px; line-height: 1.45; }

/* ---------- Visualização 3D ---------- */
.v3d { position: fixed; inset: 0; z-index: 70; overflow: hidden; display: grid; place-items: center; color: #fff; animation: aparece .25s ease both; --amb: #2b2b2b; background: var(--amb); }
.v3d.estudio { background: radial-gradient(ellipse at 50% 38%, #fbfaf8 0%, #e9e6df 55%, #d6d2c8 100%); color: #262624; }
.v3d.madeira { background: linear-gradient(180deg, #2a1f17 0%, #3b2a1d 60%, #2a1f17 100%); }
.v3d.madeira::before { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(95deg, rgba(255,255,255,.035) 0 2px, rgba(0,0,0,.05) 2px 9px, rgba(255,255,255,.02) 9px 14px), radial-gradient(ellipse at 50% 45%, rgba(255,190,120,.16), transparent 60%); }
.v3d.marmore { background: radial-gradient(ellipse at 30% 20%, #ffffff 0%, #ecebe8 45%, #d9d7d2 100%); color: #262624; }
.v3d.marmore::before { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(115deg, transparent 0 60px, rgba(120,120,120,.07) 61px 62px, transparent 63px 140px); }
.v3d.escuro { background: radial-gradient(ellipse at 50% 40%, #3a3a3a 0%, #1b1b1b 70%); }
.v3d.areia { background: linear-gradient(180deg, #f1e6d6 0%, #e4d3bb 100%); color: #3a2f22; }
.v3d-topo { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; padding: 18px 24px; z-index: 5; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; }
.v3d-topo button { padding: 9px 18px; border: 1px solid currentColor; border-radius: 999px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; opacity: .85; background: rgba(255,255,255,.06); }
.v3d-topo button:hover { opacity: 1; }
.v3d-cena { position: relative; width: 100%; height: 100%; display: grid; place-items: center; perspective: 2600px; touch-action: pan-y; }
.v3d-livro { position: relative; transform-style: preserve-3d; transition: transform .9s cubic-bezier(.45, .05, .25, 1); }
.v3d-sombra { position: absolute; left: 50%; bottom: -3%; width: 100%; height: 7%; transform: translateX(-50%); background: radial-gradient(ellipse at center, rgba(0,0,0,.4) 0%, rgba(0,0,0,0) 70%); filter: blur(8px); pointer-events: none; transition: width .9s; }
.v3d-folha { position: absolute; top: 0; left: 50%; width: 50%; height: 100%; transform-origin: left center; transform-style: preserve-3d; transition: transform .95s cubic-bezier(.45, .05, .25, 1); }
.v3d-folha.virada { transform: rotateY(-180deg); }
.v3d-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; background-color: #fff; background-repeat: no-repeat; overflow: hidden; }
.v3d-face.verso { transform: rotateY(180deg); }
.v3d-face::after { content: ''; position: absolute; inset: 0; pointer-events: none; }
.v3d-face.frente::after { background: linear-gradient(90deg, rgba(0,0,0,.28) 0%, rgba(0,0,0,.08) 5%, rgba(0,0,0,0) 14%, rgba(0,0,0,0) 94%, rgba(0,0,0,.06) 100%); }
.v3d-face.verso::after { background: linear-gradient(270deg, rgba(0,0,0,.28) 0%, rgba(0,0,0,.08) 5%, rgba(0,0,0,0) 14%, rgba(0,0,0,0) 94%, rgba(0,0,0,.06) 100%); }
.v3d-face.capa-dura { box-shadow: inset 0 0 0 1px rgba(0,0,0,.18); }
.v3d-nav { position: absolute; bottom: 22px; left: 0; right: 0; display: flex; justify-content: center; align-items: center; gap: 16px; z-index: 5; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; }
.v3d-nav .seta { position: static; margin: 0; width: 44px; height: 44px; color: #262624; background: #fff; }
.v3d-zona { position: absolute; top: 0; bottom: 0; width: 50%; z-index: 4; cursor: pointer; }
.v3d-zona.esq { left: 0; } .v3d-zona.dir { right: 0; }

@media (max-width: 700px) {
  :root { --h-topo: 58px; --h-tiras: 74px; --h-barra: 66px; }
  .topo { padding: 0 14px; gap: 10px; }
  .topo .logo { height: 24px; max-width: 90px; }
  .topo-album .titulo b { font-size: 21px; }
  .topo-album .titulo small { display: none; }
  .topo-acoes { min-width: 0; gap: 8px; }
  .pilula span { display: none; }
  .pilula { padding: 9px 12px; }
  .palco { padding: 12px 38px; }
  .seta { width: 36px; height: 36px; margin-top: -18px; }
  .seta.esq { left: 4px; } .seta.dir { right: 4px; }
  .lupa { right: 10px; bottom: 8px; }
  .barra { padding: 0 14px; }
  .barra .alts { font-size: 22px; }
  .barra .acao { padding: 13px 18px; font-size: 11.5px; letter-spacing: .1em; }
  .tiras { padding: 8px 14px; }
  .v3d-topo { padding: 12px 14px; }
}

/* ---------- Visualização 3D (WebGL) ---------- */
.v3w { position: fixed; inset: 0; z-index: 80; background: #1a1a1a; color: #fff; font-family: 'Jost', system-ui, sans-serif; animation: aparece .25s ease both; touch-action: none; }
.v3w-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; outline: none; cursor: grab; }
.v3w-canvas:active { cursor: grabbing; }
.v3w-x { position: absolute; top: 14px; left: 14px; width: 40px; height: 40px; background: rgba(30,30,30,.75); color: #fff; border-radius: 6px; font-size: 16px; backdrop-filter: blur(4px); }
.v3w-titulo { position: absolute; top: 20px; left: 0; right: 0; text-align: center; font-size: 13px; letter-spacing: .2em; text-transform: uppercase; text-shadow: 0 1px 8px rgba(0,0,0,.6); pointer-events: none; }
.v3w-dica { position: absolute; top: 62px; left: 0; right: 0; text-align: center; font-size: 13px; letter-spacing: .04em; text-shadow: 0 1px 8px rgba(0,0,0,.7); pointer-events: none; transition: opacity .8s; }
.v3w-dica.some { opacity: 0; }
.v3w-zoom { position: absolute; right: 16px; bottom: 22px; display: grid; gap: 8px; }
.v3w-zoom button { width: 40px; height: 40px; background: rgba(30,30,30,.75); color: #fff; border-radius: 6px; font-size: 20px; backdrop-filter: blur(4px); }
.v3w-nav { position: absolute; bottom: 22px; left: 0; right: 0; display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; padding: 0 70px; pointer-events: none; }
.v3w-nav > * { pointer-events: auto; }
.v3w-nav button { padding: 11px 18px; background: rgba(30,30,30,.78); color: #fff; border-radius: 6px; font-size: 14px; backdrop-filter: blur(4px); }
.v3w-nav button:disabled { opacity: .4; cursor: default; }
.v3w-nav #w-pos { min-width: 90px; text-align: center; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; text-shadow: 0 1px 6px rgba(0,0,0,.7); }
.v3w-carrega { position: absolute; inset: 0; display: grid; place-items: center; background: #1a1a1a; color: #ddd; letter-spacing: .12em; font-size: 14px; text-transform: uppercase; z-index: 3; }
.v3w-carrega.solto { position: fixed; z-index: 90; background: rgba(20,20,20,.7); }
@media (max-width: 700px) { .v3w-nav { padding: 0 12px; bottom: 74px; } .v3w-nav #w-verso { order: 5; } .v3w-zoom { bottom: 16px; } .v3w-titulo { font-size: 11px; left: 60px; right: 20px; text-align: left; top: 25px; } }

/* ajustes inspirados na Alboom: capa sozinha no centro, números das páginas e barra de miniaturas */
.livro.unica { box-shadow: var(--sombra); }
.numeros { position: absolute; left: 0; right: 0; top: 100%; margin-top: 14px; display: flex; pointer-events: none; }
.numeros span { flex: 1; text-align: center; }
.numeros span { font-size: 12px; color: var(--suave); }
.tiras { background: #e9e9e7; }
[data-tema=escuro] .tiras { background: #121212; }
.tiras button { padding: 6px 10px; border-radius: 4px; opacity: 1; }
.tiras button.on { background: rgba(0,0,0,.09); }
[data-tema=escuro] .tiras button.on { background: rgba(255,255,255,.12); }
.tiras button span { display: flex; gap: 18px; justify-content: center; }
.tiras button span b { font-weight: 400; }
.tiras img { box-shadow: 0 1px 4px rgba(0,0,0,.18); border-radius: 0; background: #fff; }
.tiras button.on img { box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.palco { padding-bottom: 54px; }
.v3w-x { width: auto; padding: 0 16px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }

/* ---------- efeito de virar a página (álbum de capa dura) ---------- */
.vt { position: absolute; inset: 0; z-index: 8; perspective: 2400px; perspective-origin: 50% 50%; pointer-events: none; }
.vt-m { position: absolute; top: 0; bottom: 0; width: 50%; background-repeat: no-repeat; background-color: #fff; }
.vt-e { left: 0; } .vt-d { right: 0; }
.vt-folha { position: absolute; top: 0; bottom: 0; width: 50%; transform-style: preserve-3d; transition: transform .9s cubic-bezier(.5, .05, .25, 1); }
.vt-folha.avanca { left: 50%; transform-origin: left center; transform: rotateY(0deg); }
.vt-folha.volta { left: 0; transform-origin: right center; transform: rotateY(0deg); }
.vt.rodando .vt-folha.avanca { transform: rotateY(-180deg); }
.vt.rodando .vt-folha.volta { transform: rotateY(180deg); }
.vt-f { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; background-repeat: no-repeat; background-color: #fff; }
.vt-verso { transform: rotateY(180deg); }
.vt-f::after { content: ''; position: absolute; inset: 0; opacity: 0; background: linear-gradient(90deg, rgba(0,0,0,.35), rgba(0,0,0,0) 55%); transition: opacity .9s; }
.vt-folha.volta .vt-f::after { background: linear-gradient(270deg, rgba(0,0,0,.35), rgba(0,0,0,0) 55%); }
.vt.rodando .vt-f::after { animation: vt-sombra .9s ease both; }
@keyframes vt-sombra { 0%, 100% { opacity: 0; } 45% { opacity: .9; } }
/* a marca do meio só aparece enquanto a folha está virando */
.vt-meio { position: absolute; top: 0; bottom: 0; left: 50%; width: 3.5%; transform: translateX(-50%); opacity: 0; background: linear-gradient(90deg, rgba(0,0,0,0), rgba(0,0,0,.22) 46%, rgba(0,0,0,.32) 50%, rgba(255,255,255,.12) 53%, rgba(0,0,0,0)); }
.vt.rodando .vt-meio { animation: vt-meio .9s ease both; }
@keyframes vt-meio { 0% { opacity: 0; } 20%, 75% { opacity: 1; } 100% { opacity: 0; } }
/* sombra projetada pela folha na página de baixo */
.vt-som { position: absolute; top: 0; bottom: 0; width: 50%; opacity: 0; }
.vt-som.avanca { right: 0; background: linear-gradient(270deg, rgba(0,0,0,0), rgba(0,0,0,.28)); }
.vt-som.volta { left: 0; background: linear-gradient(90deg, rgba(0,0,0,0), rgba(0,0,0,.28)); }
.vt.rodando .vt-som { animation: vt-som .9s ease both; }
@keyframes vt-som { 0%, 100% { opacity: 0; } 50% { opacity: 1; } }
