@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,400;0,600;1,400&display=swap');
/* ============================================================
   contrato-venda.css
   Estilos específicos do Contrato Venda de Equipamentos.
   Reaproveita os blocos .ci-* (compartilhados com o Instalador).
   Prefixo cv- só para o conteúdo único: form fields, equipamento
   selector, tabela de pagamentos, render do documento.
   ============================================================ */

/* ---------- Form fields (paralelos aos ci-*) ---------- */
.cv-field { display: flex; flex-direction: column; gap: 4px; }
.cv-field--full   { grid-column: 1 / -1; }
.cv-field--wide   { grid-column: span 2; }
.cv-field--narrow { grid-column: span 1; max-width: 200px; }

.cv-field label {
  font-size: 10.5px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: #4a4a4a;
}
.cv-req { color: #dc2626; margin-left: 2px; }

.cv-input-wrap { position: relative; display: flex; align-items: center; }
.cv-input-wrap--suffix .cv-input { padding-right: 38px; }
.cv-input-wrap--prefix { padding: 0 11px; gap: 6px; border: 1px solid #e5e7eb; border-radius: 3px; background: #fff; }
.cv-input-wrap--prefix:focus-within { border-color: #FBB039; box-shadow: 0 0 0 3px rgba(251,176,57,.18); }
.cv-input-wrap--prefix .cv-input { border: none; padding: 9px 0; flex: 1; }
.cv-input-prefix { font-size: 11px; font-weight: 700; color: #8a8a8a; flex-shrink: 0; }
.cv-input-suffix { position: absolute; right: 11px; font-size: 11px; font-weight: 700; color: #8a8a8a; pointer-events: none; }

.cv-input {
  font-family: inherit; font-size: 13px;
  padding: 9px 11px;
  border: 1px solid #e5e7eb; background: #fff;
  border-radius: 3px; transition: border .12s; width: 100%;
  box-sizing: border-box;
}
.cv-input:focus { outline: none; border-color: #FBB039; box-shadow: 0 0 0 3px rgba(251,176,57,.18); }
.cv-input--error { border-color: #dc2626; background: #fef2f2; }
.cv-mono { font-family: 'Courier New', monospace; letter-spacing: .03em; }
.cv-textarea { resize: vertical; min-height: 60px; }
.cv-select { appearance: none; padding-right: 28px; cursor: pointer; background-image: linear-gradient(45deg, transparent 50%, #8a8a8a 50%), linear-gradient(135deg, #8a8a8a 50%, transparent 50%); background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }

.cv-field-hint { font-size: 11px; color: #8a8a8a; }
.cv-field-err { font-size: 11px; color: #dc2626; font-weight: 600; }

.cv-contratante-note {
  padding: 12px 14px; background: #f7f7f7; border: 1px solid #e5e7eb;
  border-radius: 4px; margin-bottom: 16px;
  display: flex; flex-direction: column; gap: 2px;
}
.cv-contratante-note span:first-child { font-size: 9.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #8a8a8a; }
.cv-contratante-note small { font-size: 11px; color: #8a8a8a; }
.cv-contratante-note strong { font-size: 12.5px; }

.cv-mini-label { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #4a4a4a; display: block; margin: 8px 0 6px; }

/* ---------- Equipamento selector (3 cards) ---------- */
.cv-eq-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.cv-eq-card {
  padding: 18px 14px; background: #fff; border: 1px solid #e5e7eb;
  border-radius: 4px; cursor: pointer; text-align: center;
  font-size: 13px; font-weight: 700; transition: border .12s;
}
.cv-eq-card:hover { border-color: #cbd5e1; }
.cv-eq-card.on { border-color: #FBB039; background: #fffbeb; }
.cv-eq-card-l { font-weight: 700; }

/* ---------- Toggle ---------- */
.cv-toggle {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 10px 12px;
  background: #fff; border: 1px solid #e5e7eb; border-radius: 3px;
  cursor: pointer; text-align: left;
}
.cv-toggle:hover { background: #fafafa; }
.cv-toggle.on { background: #fffbeb; border-color: #FBB039; }
.cv-toggle-sw {
  width: 36px; height: 20px; background: #e5e7eb; border-radius: 10px;
  position: relative; flex-shrink: 0; transition: background .15s;
}
.cv-toggle.on .cv-toggle-sw { background: #E89A1F; }
.cv-toggle-dot {
  width: 14px; height: 14px; background: #fff; border-radius: 50%;
  position: absolute; top: 3px; left: 3px; transition: left .15s;
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.cv-toggle.on .cv-toggle-dot { left: 19px; }
.cv-toggle-l { font-size: 12.5px; }

/* ---------- Conditional alert ---------- */
.cv-cond-alert {
  margin-top: 16px; padding: 12px 14px;
  background: #fef3c7; border-left: 3px solid #FBB039;
  font-size: 12px; color: #92400e; line-height: 1.4;
  display: flex; align-items: flex-start; gap: 10px;
}
.cv-cond-dot { width: 8px; height: 8px; border-radius: 50%; background: #FBB039; flex-shrink: 0; margin-top: 4px; }
.cv-cond-alert b { color: #78350f; }

/* ---------- Resumo do pagamento ---------- */
.cv-pay-summary {
  margin-top: 16px; padding: 14px 16px;
  background: #f7f7f7; border: 1px solid #e5e7eb; border-radius: 4px;
}
.cv-pay-row {
  display: flex; justify-content: space-between;
  font-size: 13px; padding: 5px 0;
}
.cv-pay-row b.cv-mono { font-family: 'Courier New', monospace; font-weight: 700; }
.cv-pay-total {
  margin-top: 4px; padding-top: 10px;
  border-top: 1px solid #e5e7eb; font-weight: 700; font-size: 14px;
}

/* ---------- Step header ---------- */
.cv-step-head { margin-bottom: 24px; }
.cv-step-kicker { font-size: 10px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; color: #E89A1F; }
.cv-step-title { font-size: 22px; font-weight: 800; margin: 4px 0 8px; letter-spacing: -.01em; }
.cv-step-desc { font-size: 13px; color: #4a4a4a; margin: 0; line-height: 1.5; }
.cv-step { padding: 0; }
.cv-field-group { margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid #e5e7eb; }
.cv-field-group:last-child { border-bottom: none; }
.cv-group-title { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 12px; }
.cv-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 8px; }

.cv-check-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; background: #fff;
  border: 1px solid #e5e7eb; border-radius: 3px;
  cursor: pointer; text-align: left; width: 100%; margin-bottom: 4px;
}
.cv-check-row:hover { background: #fafafa; }
.cv-check-row.on { background: #fffbeb; border-color: #FBB039; }
.cv-check-box {
  width: 20px; height: 20px;
  border: 2px solid #8a8a8a; border-radius: 3px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: #fff; font-weight: 700; font-size: 12px;
}
.cv-check-row.on .cv-check-box { background: #E89A1F; border-color: #E89A1F; }
.cv-check-label { font-size: 12.5px; color: #111; }
.cv-check-label b { font-weight: 700; }

/* ---------- Summary (revisão) ---------- */
.cv-summary { border: 1px solid #e5e7eb; border-radius: 4px; overflow: hidden; }
.cv-summary-row {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 11px 14px; font-size: 13px;
  border-bottom: 1px solid #f5f5f5;
}
.cv-summary-row:last-child { border-bottom: none; }
.cv-summary-k { color: #8a8a8a; }
.cv-summary-v { text-align: right; font-weight: 700; }

/* ============================================================
   DOCUMENT preview (template do contrato CVE)
   ============================================================ */
.cv-doc-sheet {
  background: #fff;
  padding: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  /* Poppins 10pt justificado, como a minuta oficial (o PDF usa a mesma fonte) */
  font-family: 'Poppins', Arial, sans-serif;
  font-size: 10pt; line-height: 1.72; color: #000;
  max-width: 720px; margin: 0 auto; overflow: hidden;
}
.cv-doc-banner, .cv-doc-foot-img { display: block; width: 100%; height: auto; }
.cv-doc-body { padding: 14px 12% 24px 12%; }
.cv-doc-title {
  text-align: center; font-size: 12pt; font-weight: 600;
  text-decoration: underline; margin: 4pt 0 34pt; line-height: 1.5;
}
.cv-doc-numero { text-align: right; font-weight: 600; text-decoration: underline; margin-bottom: 34pt; }

.cv-doc-section { margin: 17pt 0; }
.cv-doc-preamble { margin-top: 8pt; }
/* Título de cláusula = faixa preta cheia, texto branco em negrito */
.cv-doc-section-title {
  background: #000; color: #fff;
  font-size: 9pt; font-weight: 600; line-height: 1.6;
  margin: 0 0 17pt; padding: 2pt 6pt;
}

.cv-doc-p { text-align: justify; margin: 0 0 17pt; }
.cv-doc-p b { font-weight: 600; }
.cv-doc-li { position: relative; padding-left: 14pt; margin: 0; }
.cv-doc-li::before { content: '\27A2'; position: absolute; left: 0; top: 0; font-size: 8pt; }
/* Sub-cláusulas (2.1.1, 8.2.2, alíneas, incisos) — recuadas, sem marcador */
.cv-doc-indent { padding-left: 14pt; }
.cv-doc-li.cv-doc-indent { padding-left: 28pt; margin-bottom: 0; }
.cv-doc-li.cv-doc-indent::before { content: '\2713'; left: 14pt; }
/* Blocos de dados (local de entrega, dados bancários, contatos): na minuta
   são texto simples recuado, sem caixa */
.cv-doc-callout { padding-left: 28pt; text-align: left; }
.cv-doc-injected {
  background: #fef3c7; border-left: 3px solid #E89A1F;
  padding: 8pt 12pt; margin: 8pt 0;
  position: relative;
}
.cv-doc-tag {
  display: block; font-size: 8.5pt; color: #92400e;
  font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
  margin-bottom: 4pt;
}
.cv-doc-center { text-align: center; margin-top: 24pt; margin-bottom: 40pt; }
.cv-doc-sign-line { margin-top: 24pt; }

/* Tabelas — mesmo estilo da minuta: cabeçalho cinza, bordas finas cinza-escuro */
.cv-doc-table, .cv-doc-anexos {
  width: 88%; margin: 0 auto 17pt; border-collapse: collapse;
  font-size: 10pt; line-height: 1.5; border: 1px solid #7f7f7f;
}
.cv-doc-table th, .cv-doc-anexos th {
  background: #bfbfbf; color: #000; padding: 1pt 8pt; text-align: center;
  font-weight: 600; border: 1px solid #7f7f7f;
}
.cv-doc-table td, .cv-doc-anexos td { padding: 1pt 8pt; border: 1px solid #7f7f7f; }
.cv-doc-table tfoot td { font-weight: 600; }
.cv-mono { font-family: inherit; }
.cv-doc-anexos td:first-child { width: 26%; }

/* Assinaturas empilhadas (VENDEDORA, depois COMPRADOR) + TESTEMUNHAS */
.cv-doc-signatures { display: block; margin-top: 30pt; }
.cv-doc-sign-col { margin-bottom: 30pt; }
.cv-doc-sign-role { font-weight: 600; margin-bottom: 22pt; }
.cv-doc-sign-x { font-size: 20pt; line-height: 1.1; }
.cv-doc-sign-line2 { width: 190pt; border-top: 1.2pt solid #000; margin: 0 0 2pt; }
.cv-doc-sign-name, .cv-doc-sign-cpf { font-size: 8pt; line-height: 1.4; margin-left: 6pt; }

.cv-doc-witnesses { padding-top: 6pt; }
.cv-doc-witness-title { font-weight: 600; }
.cv-doc-witness-row { display: flex; gap: 30pt; margin-top: 16pt; }
.cv-doc-witness-col { flex: 1; }
.cv-doc-witness-line { font-weight: 600; }

/* ---------- Impressão nativa (fallback do "Baixar PDF" em /assinar/:token) ----------
   O PDF oficial vem do motor react-pdf (pdf-bundle/contrato-venda-reactpdf.entry.js),
   que repete cabeçalho e rodapé em toda página. Esta impressão do navegador é só o
   plano B se o motor não carregar: cabeçalho e rodapé 1x cada (fixos em toda página
   o Chromium cobria o título — ver histórico). */
@media print {
  @page { size: A4; margin: 0; }
  .cv-doc-sheet { max-width: none; margin: 0; box-shadow: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .cv-doc-banner { page-break-inside: avoid; }
  .cv-doc-signatures, .cv-doc-witnesses { break-inside: avoid-page; }
}
