:root {
    --bg: #f3f4f6;
    --card: #ffffff;
    --text: #171717;
    --muted: #666;
    --border: #d8d8d8;
    --button: #202020;
    --button-hover: #000;
  }

  * { box-sizing: border-box; }

  body {
    margin: 0;
    padding: 24px;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
  }

  .container {
    width: min(1160px, 100%);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 370px 1fr;
    gap: 24px;
    align-items: start;
  }

  .form-card {
    background: var(--card);
    border: 1px solid #e5e5e5;
    border-radius: 14px;
    padding: 22px;
    box-shadow: 0 6px 24px rgba(0,0,0,.06);
  }

  h1 {
    margin: 0 0 6px;
    font-size: 23px;
  }

  .intro {
    margin: 0 0 20px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
  }

  .field {
    margin-bottom: 12px;
  }

  .row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  label {
    display: block;
    margin-bottom: 5px;
    font-size: 12px;
    font-weight: 700;
  }

  input, select {
    width: 100%;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0 10px;
    font-size: 14px;
    outline: none;
    background: #fff;
  }

  input:focus, select:focus {
    border-color: #777;
    box-shadow: 0 0 0 3px rgba(0,0,0,.05);
  }

  button {
    width: 100%;
    min-height: 44px;
    border: 0;
    border-radius: 9px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    margin-top: 8px;
  }

  .primary {
    background: var(--button);
    color: #fff;
  }

  .primary:hover { background: var(--button-hover); }

  .secondary {
    background: #e9e9e9;
    color: #171717;
  }

  .privacy {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #ececec;
    color: #6c6c6c;
    font-size: 11px;
    line-height: 1.45;
  }

  .preview-area {
    padding: 20px;
    border-radius: 14px;
    background: #dedede;
    overflow: auto;
  }

  #visualizadorPDF {
    width: 210mm;
    height: 297mm;
    margin: 0 auto;
    padding: 27mm 23mm 22mm;
    background: #fff;
    box-shadow: 0 4px 18px rgba(0,0,0,.13);
    color: #000;
    font-family: "Times New Roman", Times, serif;
    font-size: 13pt;
    line-height: 1.72;
    overflow: hidden;
  }

  #visualizadorPDF h2 {
    margin: 7mm 0 19mm;
    text-align: center;
    font-size: 17pt;
  }

  .texto {
    margin: 0 0 6mm;
    text-align: justify;
    text-indent: 12mm;
  }

  .data {
    margin-top: 23mm;
    text-align: center;
  }

  .assinatura {
    width: 72%;
    margin: 31mm auto 0;
    text-align: center;
  }

  .linha-assinatura {
    border-top: 1px solid #000;
    margin-bottom: 6px;
  }

  .assinatura-label {
    font-size: 12pt;
  }

  @media (max-width: 930px) {
    body { padding: 12px; }
    .container { grid-template-columns: 1fr; }
    .preview-area { padding: 8px; }
  }

  @page {
    size: A4 portrait;
    margin: 0;
  }

  @media print {
    body {
      margin: 0;
      padding: 0;
      background: #fff;
    }

    .form-card {
      display: none !important;
    }

    .container {
      display: block;
      width: auto;
      margin: 0;
    }

    .preview-area {
      padding: 0;
      background: #fff;
      border-radius: 0;
      overflow: visible;
    }

    #visualizadorPDF {
      width: 210mm;
      height: 297mm;
      min-height: 297mm;
      max-height: 297mm;
      margin: 0;
      box-shadow: none;
      page-break-after: avoid;
      page-break-inside: avoid;
    }
  }