/* ==========================================================
   Procuração Intenção de Venda e Emissão ATPV-E — form17
   Fonte de verdade: PDF gerado pelo sistema original
   ========================================================== */

*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Times New Roman', Times, serif;
  font-size: 10pt;
  color: #000;
  background: #fff;
  margin: 0;
  padding: 12px 0;
}

.pagina {
  max-width: 780px;
  margin: 0 auto;
  padding: 16px 24px 24px;
}

/* ============================================================
   Logo
   ============================================================ */
.logo-topo {
  text-align: center;
  margin-bottom: 6px;
}

.logo-img {
  height: 55px;
  margin: 0 10px;
  object-fit: contain;
}

.logo-img--despachante {
  height: 90px;
}

/* ============================================================
   Título
   ============================================================ */
.titulo-wrapper {
  margin: 4px 0 10px;
}

.titulo-doc {
  font-size: 13pt;
  font-weight: bold;
  text-align: center;
  margin: 0;
  line-height: 1.4;
}

/* ============================================================
   Campos — base
   ============================================================ */
.campo {
  font-family: 'Times New Roman', Times, serif;
  font-size: 10pt;
  border: 1px solid #555;
  padding: 1px 4px;
  background: #fff;
  color: #000;
  height: 20px;
  vertical-align: middle;
}

.campo:focus {
  outline: 2px solid #4a90d9;
  outline-offset: -1px;
}

/* ============================================================
   Rótulos (labels inline)
   ============================================================ */
.rotulo {
  font-size: 10pt;
  white-space: nowrap;
  vertical-align: middle;
  line-height: 20px;
}

.rot-esq {
  margin-left: 6px;
}

.rotulo-residente {
  margin-left: 6px;
  font-size: 10pt;
}

.rotulo-estadocivil {
  line-height: 1.1;
  white-space: normal;
  width: 4em;
  text-align: center;
  display: inline-block;
  vertical-align: middle;
}

/* ============================================================
   Linhas de campos (flex rows)
   ============================================================ */
.linha-campo {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  margin: 3px 0;
  gap: 2px;
}

.linha-nome-residente {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  margin: 8px 0 2px;
  gap: 4px;
}

.linha-a {
  margin: 0 0 2px;
  font-size: 10pt;
}

.linha-espacada {
  margin-top: 8px;
}

/* ============================================================
   Bloco de endereço (estrutura repetida)
   ============================================================ */
.bloco-endereco {
  margin: 2px 0 6px;
}

/* ============================================================
   Larguras específicas dos campos
   ============================================================ */
.campo-nome      { flex: 1; min-width: 0; }
.campo-full      { flex: 1; min-width: 0; }
.campo-cep       { width: 110px; flex: none; }
.campo-bairro    { flex: 2; min-width: 0; }
.campo-cidade    { flex: 2; min-width: 0; }
.campo-uf        { width: 36px; flex: none; }
.campo-qln       { flex: 1; min-width: 0; }

.campo-email        { flex: 3; min-width: 0; }
.campo-celular      { flex: 2; min-width: 0; }
.campo-estadocivil  { flex: 1.5; min-width: 0; }

.campo-rg    { flex: 2; min-width: 0; }
.campo-orgao { flex: 1.5; min-width: 0; }
.campo-cpf   { flex: 2; min-width: 0; }
.campo-cnpj  { flex: 2.5; min-width: 0; }

.campo-marcamodelo { flex: 3; min-width: 0; }
.campo-ano         { width: 56px; flex: none; }
.campo-placa       { width: 80px; flex: none; }
.campo-cor         { flex: 1.5; min-width: 0; }
.campo-chassi      { flex: 2.5; min-width: 0; }
.campo-renavam     { flex: 1.5; min-width: 0; }

.campo-comprador-nome { flex: 3; min-width: 0; }
.campo-cpfcnpj        { flex: 2; min-width: 0; }
.campo-valor          { flex: 1.5; min-width: 0; }

/* ============================================================
   Texto inline após campos de veículo
   ============================================================ */
.texto-inline {
  font-size: 10pt;
  white-space: nowrap;
  vertical-align: middle;
}

/* ============================================================
   Parágrafos de texto legal
   ============================================================ */
.texto-nomeia {
  font-size: 10pt;
  line-height: 1.5;
  margin: 10px 0 4px;
  text-align: justify;
}

.texto-poderes {
  font-size: 10pt;
  line-height: 1.5;
  margin: 2px 0 12px;
  text-align: justify;
}

.texto-declaracao {
  font-size: 10pt;
  line-height: 1.5;
  margin: 4px 0 6px;
  text-align: justify;
}

/* ============================================================
   Separador "Dados do comprador"
   ============================================================ */
.secao-comprador {
  text-align: center;
  font-size: 11pt;
  margin: 16px 0 8px;
}

/* ============================================================
   Data
   ============================================================ */
.linha-data {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 20px 0 0;
  justify-content: center;
}

.campo-dia      { width: 36px; }
.campo-mes      { width: 120px; }
.campo-ano-data { width: 36px; }

/* ============================================================
   Assinatura
   ============================================================ */
.assinatura {
  text-align: center;
  margin-top: 28px;
  margin-bottom: 16px;
}

.linha-assin {
  font-size: 11pt;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.label-assin {
  font-size: 10pt;
  margin-bottom: 4px;
}

.nota-firma {
  font-size: 9.5pt;
  line-height: 1.4;
}

/* ============================================================
   Botão imprimir
   ============================================================ */
.print {
  cursor: pointer;
  margin-top: 10px;
  margin-bottom: 10px;
}

.print img {
  width: 32px;
  height: 32px;
}

/* ============================================================
   Print
   ============================================================ */
@page {
  size: A4 portrait;
  margin: 8mm 10mm;
}

@media print {
  body { padding: 0; }

  .pagina {
    display: block !important;
    padding: 0;
    width: 190mm;
    max-width: 190mm;
    margin: 0 auto;
  }

  .print { display: none; }

  .campo {
    border: 1px solid #555 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* ============================================================
   Responsividade — mobile
   ============================================================ */
@media (max-width: 640px) {
  body { font-size: 9pt; }
  .pagina { padding: 8px 10px; }

  .linha-campo,
  .linha-nome-residente {
    flex-wrap: wrap;
  }

  .campo-full,
  .campo-nome,
  .campo-email,
  .campo-celular,
  .campo-estadocivil,
  .campo-bairro,
  .campo-cidade,
  .campo-rg,
  .campo-orgao,
  .campo-cpf,
  .campo-cnpj,
  .campo-marcamodelo,
  .campo-cor,
  .campo-chassi,
  .campo-renavam,
  .campo-comprador-nome,
  .campo-cpfcnpj,
  .campo-valor {
    flex: 1 1 100%;
    width: 100%;
  }

  .rotulo-residente { display: none; }

  .linha-data { flex-wrap: wrap; justify-content: flex-start; }
}
