@charset "utf-8";

/* Prova de impressão | Agência 704, 06/12/2026.
   Ferramenta interna: o visual é sóbrio de propósito, para a atenção ficar nas
   miniaturas das páginas. O único acento é o ouro da capa do livro. */

:root {
  --fundo: #11161d;
  --fundo-alto: #171e27;
  --borda: #262f3b;
  --texto: #e7ecf3;
  --texto-fraco: #97a3b4;
  --ouro: #e0ae4a;
  --alerta: #ff8a5c;
  --bom: #6fcf97;
  --papel: #fdfcf9;
  --curva: cubic-bezier(0.16, 1, 0.3, 1);
  --sistema: ui-sans-serif, system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0 clamp(1rem, 4vw, 2.5rem) 4rem;
  background: var(--fundo);
  color: var(--texto);
  font-family: var(--sistema);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.topo { max-width: 72rem; margin: 0 auto; padding: 2.2rem 0 1.4rem; }
h1 { margin: 0; font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2rem); font-weight: 600; letter-spacing: -0.01em; }
.topo__linha { margin: 0.35rem 0 0; color: var(--texto-fraco); }

main { max-width: 72rem; margin: 0 auto; }

/* ---------- entrada ---------- */

.solta {
  display: grid;
  place-content: center;
  gap: 0.4rem;
  text-align: center;
  padding: clamp(2.5rem, 9vw, 5rem) 1.5rem;
  border: 2px dashed var(--borda);
  border-radius: 12px;
  background: var(--fundo-alto);
  cursor: pointer;
  transition: border-color 0.16s var(--curva), background-color 0.16s var(--curva);
}
.solta:hover, .solta.ativa { border-color: var(--ouro); background: #1b222c; }
.solta strong { font-size: 1.15rem; font-weight: 600; }
.solta span { color: var(--texto-fraco); }
.solta:focus-within { outline: 2px solid var(--ouro); outline-offset: 3px; }

.entrada__nota { margin: 0.8rem 0 0; color: var(--texto-fraco); font-size: 0.9rem; }
.entrada__erro { margin: 0.8rem 0 0; color: var(--alerta); }

/* ---------- progresso ---------- */

.progresso { margin: 1.5rem 0; }
.progresso p { margin: 0 0 0.5rem; color: var(--texto-fraco); }
.barra { height: 6px; border-radius: 3px; background: var(--borda); overflow: hidden; }
.barra__cheia { height: 100%; width: 0; background: var(--ouro); transition: width 0.2s linear; }

/* ---------- resumo ---------- */

.resumo { margin: 1.5rem 0 0; }

.numeros {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 1px;
  background: var(--borda);
  border: 1px solid var(--borda);
  border-radius: 10px;
  overflow: hidden;
}
.numero { background: var(--fundo-alto); padding: 0.9rem 1.1rem; }
.numero dt { margin: 0; color: var(--texto-fraco); font-size: 0.82rem; }
.numero dd { margin: 0.15rem 0 0; font-size: 1.35rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.numero dd small { display: block; font-size: 0.8rem; font-weight: 400; color: var(--texto-fraco); }
.numero--alerta dd { color: var(--alerta); }
.numero--bom dd { color: var(--bom); }

.avisos { margin: 1.2rem 0 0; display: grid; gap: 0.7rem; }
.aviso {
  padding: 0.85rem 1.1rem;
  border-left: 3px solid var(--alerta);
  border-radius: 0 8px 8px 0;
  background: #1d1a18;
}
.aviso--bom { border-left-color: var(--bom); background: #161d1a; }
.aviso h3 { margin: 0 0 0.2rem; font-size: 0.98rem; font-weight: 600; }
.aviso p { margin: 0; color: var(--texto-fraco); font-size: 0.92rem; }
.aviso code { color: var(--texto); font-size: 0.88em; }

/* ---------- abas ---------- */

.abas { display: flex; gap: 0.4rem; margin: 1.8rem 0 1.2rem; flex-wrap: wrap; }
.aba {
  padding: 0.5rem 1.1rem;
  border: 1px solid var(--borda);
  border-radius: 999px;
  background: transparent;
  color: var(--texto-fraco);
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
}
.aba[aria-pressed="true"] { background: var(--texto); color: var(--fundo); border-color: var(--texto); font-weight: 600; }
.aba:focus-visible { outline: 2px solid var(--ouro); outline-offset: 2px; }

/* ---------- livro em 3D ---------- */

.palco { perspective: 2400px; display: flex; justify-content: center; padding: 0.5rem 0 1.4rem; }

.livro {
  position: relative;
  display: flex;
  transform-style: preserve-3d;
  transform: rotateX(6deg);
}

.pagina {
  position: relative;
  width: var(--lp, 17rem);
  height: var(--ap, 24.4rem);
  background: var(--papel);
  box-shadow: 0 1.2rem 2.4rem rgba(0, 0, 0, 0.5);
}
.pagina--esq { border-radius: 3px 0 0 3px; }
.pagina--dir { border-radius: 0 3px 3px 0; }
.pagina canvas { display: block; width: 100%; height: 100%; }
.pagina--vazia { background: #0d1117; box-shadow: none; }
.pagina--vazia canvas { visibility: hidden; }

/* O vinco: sombra que nasce na lombada e morre no meio da folha. */
.pagina--esq::after, .pagina--dir::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  width: 2.2rem;
  pointer-events: none;
}
.pagina--esq::after { right: 0; background: linear-gradient(90deg, transparent, rgba(0,0,0,0.20)); }
.pagina--dir::after { left: 0; background: linear-gradient(270deg, transparent, rgba(0,0,0,0.20)); }

.etiqueta {
  position: absolute;
  left: 50%;
  bottom: -1.9rem;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 0.82rem;
  color: var(--texto-fraco);
  font-variant-numeric: tabular-nums;
}
.etiqueta b { color: var(--texto); font-weight: 600; }
.etiqueta .marca { color: var(--ouro); }

.folha {
  position: absolute;
  top: 0;
  left: 50%;
  width: var(--lp, 17rem);
  height: var(--ap, 24.4rem);
  transform-origin: left center;
  transform-style: preserve-3d;
  z-index: 3;
}
.folha--virando { transition: transform 0.62s var(--curva); }
.folha__face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  background: var(--papel);
  box-shadow: 0 1rem 2rem rgba(0,0,0,0.45);
}
.folha__face canvas { display: block; width: 100%; height: 100%; }
.folha__face--verso { transform: rotateY(180deg); }

.controles { display: flex; align-items: center; justify-content: center; gap: 0.8rem; flex-wrap: wrap; }
.controles button {
  padding: 0.55rem 1.2rem;
  border: 1px solid var(--borda);
  border-radius: 8px;
  background: var(--fundo-alto);
  color: var(--texto);
  font: inherit;
  cursor: pointer;
}
.controles button:hover:not(:disabled) { border-color: var(--ouro); }
.controles button:disabled { opacity: 0.4; cursor: default; }
.controles button:focus-visible, .pular input:focus-visible { outline: 2px solid var(--ouro); outline-offset: 2px; }
.pular { display: flex; align-items: center; gap: 0.5rem; color: var(--texto-fraco); font-size: 0.9rem; }
.pular input {
  width: 5.5rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--borda);
  border-radius: 8px;
  background: var(--fundo);
  color: var(--texto);
  font: inherit;
  font-variant-numeric: tabular-nums;
}
.dica { text-align: center; color: var(--texto-fraco); font-size: 0.85rem; margin: 1rem 0 0; }

/* ---------- grade ---------- */

.legenda { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; color: var(--texto-fraco); font-size: 0.88rem; margin: 0 0 1rem; }
.chip { padding: 0.1rem 0.55rem; border-radius: 999px; font-size: 0.78rem; font-weight: 600; color: #11161d; }
.chip--branca { background: #8fa3bb; }
.chip--abertura { background: var(--ouro); }
.chip--alerta { background: var(--alerta); }

.grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr)); gap: 0.9rem; }

.cel { border: 0; padding: 0; background: none; font: inherit; color: inherit; cursor: pointer; text-align: center; }
.cel__papel {
  position: relative;
  background: var(--papel);
  border-radius: 2px;
  overflow: hidden;
  box-shadow: 0 0.3rem 0.8rem rgba(0,0,0,0.4);
  outline: 2px solid transparent;
}
.cel canvas { display: block; width: 100%; height: auto; }
.cel:focus-visible .cel__papel { outline-color: var(--ouro); }
.cel--abertura .cel__papel { outline-color: var(--ouro); }
.cel--alerta .cel__papel { outline-color: var(--alerta); }
.cel--branca .cel__papel { opacity: 0.55; }

.cel__sel {
  position: absolute;
  top: 0.25rem;
  left: 0.25rem;
  padding: 0.05rem 0.4rem;
  border-radius: 3px;
  background: rgba(17,22,29,0.82);
  color: var(--texto);
  font-size: 0.68rem;
  font-weight: 600;
}
.cel__sel--d { left: auto; right: 0.25rem; }
.cel__pe { display: block; margin-top: 0.35rem; font-size: 0.76rem; color: var(--texto-fraco); font-variant-numeric: tabular-nums; }
.cel__pe b { color: var(--texto); }

/* ---------- lista ---------- */

.tabela-rolo { overflow-x: auto; border: 1px solid var(--borda); border-radius: 10px; }
.tabela { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.tabela th, .tabela td { padding: 0.5rem 0.8rem; text-align: left; border-bottom: 1px solid var(--borda); white-space: nowrap; }
.tabela th { background: var(--fundo-alto); color: var(--texto-fraco); font-weight: 600; position: sticky; top: 0; }
.tabela td { font-variant-numeric: tabular-nums; }
.tabela tr:last-child td { border-bottom: 0; }
.tabela .obs { color: var(--alerta); white-space: normal; }
.tabela .obs--ok { color: var(--texto-fraco); }

.rodape { max-width: 72rem; margin: 3rem auto 0; color: var(--texto-fraco); font-size: 0.85rem; }

@media (max-width: 640px) {
  .pagina, .folha { --lp: 8.6rem; --ap: 12.4rem; }
  .livro { transform: none; }
  /* Sem espaço para a etiqueta numa linha só: cada uma passa a ocupar a
     largura da própria página e quebra ali dentro, senão as duas se atropelam
     no meio da lombada. */
  .etiqueta {
    left: 0;
    width: 100%;
    transform: none;
    white-space: normal;
    text-align: center;
    font-size: 0.68rem;
    line-height: 1.3;
    bottom: -3.1rem;
  }
  .palco { padding-bottom: 3.6rem; }
  .controles { gap: 0.5rem; }
  .pular { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .folha--virando { transition: none; }
  .barra__cheia { transition: none; }
}
