/* ===================================================
   Visualizador de PDF (componente <visualizador-pdf>)

   As páginas são desenhadas em <canvas> pelo pdf.js, sem <embed>/<iframe> e
   sem URLs blob:, porque o servidor de produção envia um cabeçalho CSP
   (`default-src 'self' https: data:`) que bloqueia o plugin nativo de PDF do
   navegador. Ver app/system/services/visualizador-pdf.service.js.
   =================================================== */

/* Barra de ferramentas cinza, no topo do visor */
.pdfjs-barra {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  background-color: #e8eaed;
  border: 1px solid #d4d7db;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
}
.pdfjs-barra-grupo {
  display: flex;
  align-items: center;
  gap: 4px;
}
.pdfjs-barra-espaco {
  flex: 1 1 auto;
}
.pdfjs-btn {
  border: none;
  background-color: transparent;
  color: #3c4043;
  padding: 5px 9px;
  border-radius: 4px;
  line-height: 1;
  font-size: 14px;
  transition: background-color 0.15s ease;
}
.pdfjs-btn:hover:enabled {
  background-color: rgba(0, 0, 0, 0.08);
}
.pdfjs-btn:active:enabled {
  background-color: rgba(0, 0, 0, 0.14);
}
.pdfjs-btn:disabled {
  opacity: 0.35;
  cursor: default;
}
.pdfjs-btn:focus {
  outline: 2px solid #2e7d32;
  outline-offset: -2px;
}
.pdfjs-separador {
  width: 1px;
  height: 20px;
  margin: 0 4px;
  background-color: #c4c8cd;
}
.pdfjs-pagina-input {
  width: 44px;
  height: 26px;
  text-align: center;
  padding: 2px 4px;
  border: 1px solid #c4c8cd;
  border-radius: 4px;
  background-color: #fff;
  font-size: 13px;
  color: #3c4043;
}
.pdfjs-pagina-input:disabled {
  opacity: 0.5;
}
.pdfjs-pagina-total {
  font-size: 13px;
  color: #5f6368;
  white-space: nowrap;
}
.pdfjs-zoom-nivel {
  display: inline-block;
  min-width: 46px;
  text-align: center;
  font-size: 13px;
  color: #3c4043;
}

.pdfjs-visor {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1.414;
  border: 1px solid #d4d7db;
  border-radius: 0 0 6px 6px;
  overflow-x: auto;
  /* barra vertical sempre reservada: mantém o clientWidth estável entre a
     medição inicial e o documento já renderizado */
  overflow-y: scroll;
  background-color: #f5f5f5;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}
/* Uma página por vez: o container recebe sempre uma única .pdfjs-pagina */
.pdfjs-paginas {
  padding: 12px 0;
}
.pdfjs-pagina {
  position: relative;
  margin: 0 auto;
  background-color: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}
.pdfjs-pagina canvas {
  display: block;
}

.pdfjs-estado {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px;
  text-align: center;
  color: #777;
  font-size: 14px;
}
.pdfjs-estado i {
  font-size: 28px;
}

/* ---------------------------------------------------
   Camada de texto do pdf.js (extraída de pdf_viewer.css 3.11.174):
   spans transparentes sobre o canvas que permitem selecionar/copiar o texto e
   dão acesso ao conteúdo para leitores de tela.
   --------------------------------------------------- */
.textLayer {
  position: absolute;
  text-align: initial;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  opacity: 0.25;
  line-height: 1;
  -webkit-text-size-adjust: none;
  -moz-text-size-adjust: none;
  text-size-adjust: none;
  forced-color-adjust: none;
  transform-origin: 0 0;
  z-index: 2;
}
.textLayer span,
.textLayer br {
  color: transparent;
  position: absolute;
  white-space: pre;
  cursor: text;
  transform-origin: 0% 0%;
}
.textLayer span.markedContent {
  top: 0;
  height: 0;
}
.textLayer ::-moz-selection {
  background: blue;
}
.textLayer ::selection {
  background: blue;
}
.textLayer br::-moz-selection {
  background: transparent;
}
.textLayer br::selection {
  background: transparent;
}
.textLayer .endOfContent {
  display: block;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  cursor: default;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
}
.textLayer .endOfContent.active {
  top: 0;
}
