/* ============================================
   CONTRATOS — documento, assinatura e visualização
   Usado pelo app, pela impressão e pela página pública assinar.html
   ============================================ */

/* === Documento (papel) === */
.cdoc {
  background: #ffffff;
  color: #14182b;
  border-radius: 12px;
  padding: 2.4rem 2.6rem;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.95rem;
  line-height: 1.65;
  box-shadow: 0 20px 50px -30px rgba(0, 0, 0, 0.6);
}
.cdoc-body { white-space: pre-wrap; word-wrap: break-word; }
.cdoc-sigs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 2.6rem;
  page-break-inside: avoid;
}
.cdoc-sig { display: flex; flex-direction: column; gap: 0.15rem; text-align: center; font-family: 'Sora', Arial, sans-serif; }
.cdoc-sig-img { height: 74px; display: flex; align-items: flex-end; justify-content: center; }
.cdoc-sig-img img { max-height: 70px; max-width: 100%; }
.cdoc-sig-line { border-top: 1px solid #14182b; margin-top: 0.2rem; }
.cdoc-sig strong { font-size: 0.85rem; margin-top: 0.35rem; }
.cdoc-sig span { font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: #5a6178; }
.cdoc-sig small { font-size: 0.68rem; color: #5a6178; }
.cdoc-meta {
  margin-top: 2rem; padding-top: 0.9rem; border-top: 1px dashed #c3c8d8;
  font-family: 'Sora', Arial, sans-serif; font-size: 0.68rem; color: #5a6178; word-break: break-all;
}
.cdoc-meta code { font-size: 0.65rem; }
@media (max-width: 640px) {
  .cdoc { padding: 1.4rem 1.2rem; font-size: 0.9rem; }
  .cdoc-sigs { grid-template-columns: 1fr; }
}

/* Impressão / PDF */
body.cdoc-print { background: #fff; margin: 0; padding: 1.5rem; }
body.cdoc-print .cdoc { box-shadow: none; border-radius: 0; padding: 0; }
@media print {
  body.cdoc-print { padding: 0; }
  .cdoc { box-shadow: none; }
}

/* === Assinatura (canvas) === */
.sign-pad-wrap { border: 1px solid var(--border-strong, rgba(255,255,255,0.14)); border-radius: 10px; overflow: hidden; background: #fff; }
.sign-pad { display: block; width: 100%; height: 170px; cursor: crosshair; }
.sign-pad-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 0.4rem; font-size: 0.75rem; color: var(--text-muted, #6b7189); }

/* === Visualização do contrato no app === */
.cv-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem;
  margin-bottom: 1rem; font-size: 0.8rem; color: var(--text-secondary, #aab0c4);
}
.cv-bar .cv-link { flex: 1; min-width: 220px; display: flex; gap: 0.4rem; }
.cv-bar .cv-link input { flex: 1; min-width: 0; font-size: 0.75rem; }
.cv-scroll { max-height: 56vh; overflow-y: auto; padding-right: 4px; }
.sign-badges { display: inline-flex; gap: 0.3rem; flex-wrap: wrap; margin-top: 0.3rem; }
.sign-badge { font-size: 0.68rem; padding: 0.12rem 0.45rem; border-radius: 999px; border: 1px solid var(--border, rgba(255,255,255,0.08)); color: var(--text-secondary, #aab0c4); }
.sign-badge.ok { color: #22c55e; border-color: rgba(34,197,94,0.35); }
.sign-badge.wait { color: #f59e0b; border-color: rgba(245,158,11,0.35); }

/* === Contrato em PDF === */
.cdoc-pdf { display: flex; flex-direction: column; gap: 0.8rem; margin-bottom: 1rem; }
.cdoc-pdf-page { background: #fff; border-radius: 6px; overflow: hidden; box-shadow: 0 10px 30px -18px rgba(0,0,0,0.7); }
.cdoc-pdf-loading { text-align: center; padding: 2rem; color: var(--text-secondary, #aab0c4); font-size: 0.85rem; }
.cdoc-termo h2 { margin: 0 0 0.6rem; font-family: 'Sora', Arial, sans-serif; font-size: 1.05rem; }
.cdoc-termo p { margin: 0; }
.cdoc-is-termo .cdoc-sigs { margin-top: 1.8rem; }
.file-pick { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; }
.file-pick small { color: var(--text-muted, #6b7189); font-size: 0.75rem; }
