/* Documento em páginas A4 — Roboto herdada de proposta-layout.css */

@page {
  size: A4;
  margin: 10mm;
}

.proposta-doc-structured {
  font-size: 11pt;
  line-height: 1.45;
  color: #0f172a;
}

/* Pregão + número e UASG + número: negrito e corpo maior */
.proposta-doc-linha-licitacao .proposta-doc-destaque-lg {
  font-weight: 700;
  font-size: 13pt;
  line-height: 1.35;
  letter-spacing: 0.01em;
}

/* “Declaramos ainda que:” — valor e validade em negrito */
.proposta-doc-decl-destaque {
  font-weight: 700;
}

.proposta-doc-decl-destaque .proposta-campo-chip {
  font-weight: 700;
}

/* Campos dinâmicos em chip; na pré-visualização/PDF a pega de arrasto fica oculta */
.proposta-campo-chip__handle {
  display: none;
}

/* Campos dinâmicos em chip: valor na pré-visualização */
.proposta-campo-chip {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.15rem 0.35rem;
  max-width: 100%;
  vertical-align: baseline;
  padding: 0.12rem 0.45rem 0.15rem;
  margin: 0 0.08rem;
  border-radius: 6px;
  border: 1px solid #94a3b8;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  font-size: inherit;
  font-weight: 500;
  line-height: 1.35;
  user-select: text;
  cursor: text;
}

.proposta-doc-linha-licitacao .proposta-campo-chip--inline-lg {
  font-size: 13pt;
  font-weight: 700;
}

.proposta-campo-chip__glyph {
  opacity: 0.7;
  font-size: 0.9em;
}

.proposta-campo-chip__meta {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #475569;
}

.proposta-campo-chip__valor {
  font-weight: 600;
  color: #0f172a;
  min-width: 0.35em;
  min-height: 1.1em;
  user-select: text;
  cursor: default;
}

.proposta-campo-chip__hint {
  font-size: 0.68rem;
  font-weight: 500;
  color: #64748b;
}

.proposta-campo-chip--header {
  padding: 0.35rem 0.55rem;
}

.proposta-campo-chip--imagens {
  vertical-align: middle;
}

.proposta-campo-chip--multilinha {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0.35rem 0;
}

.proposta-campo-chip__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}

.proposta-campo-chip__key {
  font-size: 0.7rem;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: #e2e8f0;
  color: #334155;
}

.proposta-campo-chip--multilinha .proposta-campo-chip__body {
  padding: 0.5rem 0.65rem;
  background: #fff;
  border-radius: 6px;
  border: 1px dashed #cbd5e1;
  text-align: justify;
  white-space: pre-wrap;
  word-break: break-word;
  font-weight: 400;
  user-select: text;
  cursor: text;
}

.proposta-campo-chip--bloco .proposta-campo-chip__bar {
  margin-bottom: 0;
}

.proposta-doc-p--chiplinha {
  margin: 0.25rem 0 0.5rem;
}

.proposta-doc-sheet {
  width: 210mm;
  max-width: 100%;
  margin: 0 auto 1.5rem;
  padding: 22mm;
  box-sizing: border-box;
  background: #fff;
}

/* Página 1 */
.proposta-doc-structured > .proposta-doc-sheet.proposta-doc-page--p1 {
  min-height: 297mm;
}

/* P2: fotos — conteúdo alinhado ao topo do bloco */
.proposta-doc-page--fotos {
  min-height: 297mm;
  display: flex;
  flex-direction: column;
}

.proposta-doc-fotos-stage {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  justify-content: flex-start;
}

.proposta-doc-fotos-grid {
  flex: 0 1 auto;
  display: grid;
  gap: 10px;
  align-content: start;
  justify-items: center;
  align-items: start;
  min-height: 0;
  width: 100%;
  box-sizing: border-box;
}

.proposta-doc-fotos-grid--empty {
  min-height: 120mm;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  color: #94a3b8;
  font-size: 10pt;
  place-content: center;
}

.proposta-doc-fotos-grid--empty::after {
  content: "Nenhuma imagem enviada";
}

.proposta-doc-fotos-grid img {
  object-fit: contain;
  max-width: 100%;
  width: auto;
  height: auto;
}

/* 1 foto: maior, central */
.proposta-doc-fotos-grid--n1 {
  grid-template-columns: 1fr;
}

.proposta-doc-fotos-grid--n1 img {
  max-height: 220mm;
  max-width: 70%;
}

/* 2 fotos: lado a lado */
.proposta-doc-fotos-grid--n2 {
  grid-template-columns: 1fr 1fr;
  align-items: center;
}

.proposta-doc-fotos-grid--n2 img {
  max-height: 195mm;
  max-width: 100%;
}

/* 3 fotos: 2 em cima + 1 centralizada em baixo */
.proposta-doc-fotos-grid--n3 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  align-items: start;
  align-content: start;
}

.proposta-doc-fotos-grid--n3 img:nth-child(3) {
  grid-column: 1 / -1;
  justify-self: center;
  max-width: 70%;
}

.proposta-doc-fotos-grid--n3 img {
  max-height: 85mm;
  max-width: 100%;
}

/* 4+ fotos: grelha 2×N */
.proposta-doc-fotos-grid--n4 {
  grid-template-columns: 1fr 1fr;
  align-items: start;
  align-content: start;
}

.proposta-doc-fotos-grid--n4 img {
  max-height: 80mm;
  max-width: 100%;
}

/* P3: só descrição */
.proposta-doc-page--descricao {
  min-height: 297mm;
}

.proposta-doc-header-slot {
  margin-bottom: 12.7mm;
  min-height: 1.2em;
}

.proposta-doc-header-slot--repeat {
  margin-bottom: 10mm;
}

.proposta-doc-p {
  margin: 0 0 0.2em;
  font-family: Roboto, "Segoe UI", system-ui, sans-serif;
}

.proposta-doc-p--center {
  text-align: center;
}

.proposta-doc-p--justify {
  text-align: justify;
}

.proposta-doc-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5rem 0 1rem;
  font-size: inherit;
}

.proposta-doc-table th,
.proposta-doc-table td {
  border: 1px solid #64748b;
  padding: 4px 6px;
  vertical-align: top;
  text-align: left;
}

.proposta-doc-table th {
  font-weight: 700;
}

.proposta-doc-descricao {
  text-align: justify;
  white-space: pre-wrap;
  word-break: break-word;
  margin-top: 0.35rem;
}

.proposta-doc-page--fotos {
  break-before: page;
  page-break-before: always;
}

.proposta-doc-page--descricao {
  break-before: page;
  page-break-before: always;
}

.proposta-doc-page--decl {
  break-before: page;
  page-break-before: always;
}

.proposta-doc-page--empresa {
  break-before: page;
  page-break-before: always;
}

.proposta-doc-page--pj {
  break-before: page;
  page-break-before: always;
}

@media print {
  /* Na exportação (PDF/impressão), os chips viram texto normal */
  .proposta-campo-chip {
    display: inline !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    line-height: inherit !important;
    font-weight: inherit !important;
    vertical-align: baseline !important;
  }

  .proposta-campo-chip__glyph,
  .proposta-campo-chip__meta,
  .proposta-campo-chip__hint,
  .proposta-campo-chip__key,
  .proposta-campo-chip__handle {
    display: none !important;
  }

  .proposta-campo-chip__valor {
    font-weight: inherit !important;
    color: inherit !important;
    min-width: 0 !important;
    min-height: 0 !important;
  }

  .proposta-campo-chip--multilinha {
    display: block !important;
    width: auto !important;
    margin: 0 !important;
  }

  .proposta-campo-chip--multilinha .proposta-campo-chip__bar {
    display: none !important;
  }

  .proposta-campo-chip--multilinha .proposta-campo-chip__body {
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    border-radius: 0 !important;
  }

  .proposta-campo-chip--imagens {
    display: none !important;
  }

  .proposta-doc-sheet {
    margin: 0;
    box-shadow: none;
    border: none;
    padding: 18mm;
  }

  .proposta-doc-page--fotos,
  .proposta-doc-page--descricao,
  .proposta-doc-page--decl,
  .proposta-doc-page--empresa,
  .proposta-doc-page--pj {
    break-before: page;
    page-break-before: always;
  }

  .proposta-doc-fotos-grid--empty {
    border-color: transparent;
  }

  .proposta-doc-fotos-grid--empty::after {
    content: "";
  }

  .proposta-doc-fotos-grid img {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
