﻿*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
    body {
      font-family: Arial, sans-serif;
      background:
        radial-gradient(circle at top, rgba(32, 114, 57, 0.07), transparent 28%),
        linear-gradient(180deg, #f3f7f4 0%, #eef4f0 100%);
      padding: 18px;
      color: #183b25;
    }
    .container {
      background: #fff; padding: 26px 28px 24px; border-radius: 16px;
      margin: 10px auto; box-shadow: 0 0 18px #b5d8c2;
      border-top: 10px solid #207239; border-bottom: 10px solid #207239;
      width: 100%; max-width: 1000px; min-width: 640px;
    }
    .logo-dpe {
      display: flex;
      justify-content: center;
      align-items: center;
      margin-bottom: 6px;
    }
    .logo-dpe img {
      height: 150px;
      width: auto;
      display: block;
      object-fit: contain;
      image-rendering: auto;
      filter: none;
    }
    h2 { color: #207239; text-align: center; font-size: 1.5em; margin: 8px 0 2px; font-weight: bold; letter-spacing: 0.4px; }
    .subtitulo { text-align: center; color: #619c73; font-size: 0.88em; margin: -2px 0 18px; }
    hr { margin: 14px 0; border: none; border-top: 1px solid #d8ead9; }
    .secao { background: #f7faf8; border: 1px solid #b5d8c2; border-radius: 8px; padding: 14px 16px 10px; margin-bottom: 12px; }
    .secao-titulo {
      display: inline-flex; align-items: center; gap: 8px;
      font-weight: 800; color: #175728; font-size: 0.9em;
      text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 12px;
      padding: 4px 10px; border-radius: 999px; background: #e8f3ec;
      border: 1px solid #cfe5d6;
    }
    .form-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
    .form-row:last-child { margin-bottom: 0; }
    .fg { display: flex; flex-direction: column; flex: 1; min-width: 150px; position: relative; }
    .fg.w2 { flex: 2; min-width: 240px; }
    .fg.w3 { flex: 3; min-width: 300px; }
    .fg.fix80  { flex: none; width: 80px; }
    .fg.fix100 { flex: none; width: 100px; }
    .fg.fix120 { flex: none; width: 120px; }
    .fg.fix140 { flex: none; width: 140px; }
    .fg.fix160 { flex: none; width: 160px; }
    .fg.fix170 { flex: none; width: 170px; }
    .fg.fix180 { flex: none; width: 180px; }
    .fg.fix220 { flex: none; width: 220px; }
    .fg.fix200 { flex: none; width: 200px; }
    .fg.fix260 { flex: none; width: 260px; }
    .fg > label { font-weight: 700; color: #245c35; font-size: 0.78em; letter-spacing: 0.01em; margin-bottom: 4px; }
    .fg > label .req { color: #c0392b; }
    .fg input, .fg select, .fg textarea { padding: 7px 9px; font-size: 0.9em; font-family: Arial, sans-serif; border: 1.2px solid #b5d8c2; border-radius: 5px; color: #1a1a1a; background: #fff; width: 100%; }
    .fg input:focus, .fg select:focus, .fg textarea:focus { outline: none; border-color: #207239; box-shadow: 0 0 0 2px rgba(32,114,57,.12); }
    .fg textarea { min-height: 94px; resize: vertical; }
    .fg input.readonly-field { background: #e8f3ec; color: #175728; font-weight: 600; cursor: default; }
    .fg input.disabled-field, .fg select.disabled-field { background: #eef2ef; color: #8a948c; border-color: #d6dfd8; cursor: not-allowed; box-shadow: none; }
    /* cards */
    .card-grid { display: grid; gap: 8px; }
    .card-grid-4 { grid-template-columns: repeat(4,1fr); }
    .card-grid-5 { grid-template-columns: repeat(5,1fr); }
    .card-grid-6 { grid-template-columns: repeat(6,1fr); }
    .card-grid-2 { grid-template-columns: repeat(2,1fr); }
    .selector-grid { max-width: 940px; margin: 0 auto; }
    .registro-grid { width: fit-content; max-width: 100%; margin: 0 auto; justify-content: center; grid-template-columns: repeat(3,minmax(150px,170px)); }
    .registro-grid .sel-card { min-height: 86px; padding: 11px 10px; }
    .card-grid-3 { grid-template-columns: repeat(3,1fr); }
    .card-grid-3x { display: flex; gap: 10px; flex-wrap: wrap; }
    .sel-card {
      border: 2px solid #b5d8c2; background: #fff; border-radius: 8px;
      padding: 9px 6px 7px; cursor: pointer; text-align: center;
      font-family: Arial, sans-serif; font-size: 0.8em; font-weight: 600;
      color: #207239; transition: all .18s; line-height: 1.3; flex: 1;
    }
    .sel-card:hover { background: #e8f3ec; border-color: #207239; }
    .sel-card.ativo { background: #207239; color: #fff; border-color: #175728; }
    .sel-card .ico { font-size: 1.4em; display: block; margin-bottom: 3px; }
    @media (max-width: 900px) {
      .card-grid-5, .card-grid-6 { grid-template-columns: repeat(2,1fr); }
      .registro-grid { max-width: none; grid-template-columns: 1fr; }
      .registro-grid .sel-card { min-height: 0; }
    }
    /* dado */
    .dado-item { background: #fff; border: 1px solid #d8ead9; border-radius: 6px; padding: 10px; margin-bottom: 8px; }
    .dado-item-top { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
    .dado-docs { margin-top: 8px; padding-top: 8px; border-top: 1px dashed #d8ead9; }
    .docs-label { font-size: 0.79em; font-weight: bold; color: #207239; margin-bottom: 5px; display: block; }
    .docs-checks { display: flex; flex-wrap: wrap; gap: 5px 14px; }
    .docs-checks label { display: flex; align-items: center; gap: 5px; font-size: 0.84em; color: #333; font-weight: normal; cursor: pointer; }
    .docs-checks input[type=checkbox],
    .docs-checks input[type=radio] { width: auto; accent-color: #207239; flex: none; }
    .family-row { display: none; }
    .btn-remover { background: #e74c3c; color: #fff; border: none; border-radius: 50%; width: 28px; height: 28px; font-size: 1.1em; cursor: pointer; flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: background .18s; }
    .btn-remover:hover { background: #c0392b; }
    .btn-add { background: #f0fdf4; border: 1.5px dashed #b5d8c2; color: #207239; padding: 8px; border-radius: 5px; cursor: pointer; font-size: 0.88em; font-family: Arial, sans-serif; font-weight: 600; width: 100%; text-align: center; margin-top: 8px; transition: background .18s; }
    .btn-add:hover { background: #dcf0e3; }
    .cond { display: none; }
    .cond.show { display: block; }
    .outros-campo { margin-top: 6px; display: none; }
    /* info */
    .info-box { background: #e8f3ec; border-left: 3px solid #207239; border-radius: 0 5px 5px 0; padding: 8px 12px; font-size: 0.82em; color: #175728; margin-top: 12px; line-height: 1.5; }
    .info-box strong { display: block; margin-bottom: 2px; }
    /* matricula */
    .mat-input { font-family: 'Courier New', monospace; letter-spacing: .8px; min-width: 41ch; }
    .fg.mat-field { flex: 1 1 460px; min-width: 460px; }
    @media (max-width: 900px) {
      .fg.mat-field { min-width: 100%; }
      .mat-input { min-width: 0; letter-spacing: .45px; font-size: 0.96em; }
    }
    /* separador */
    .sep { margin-top: 14px; border-top: 1px dashed #b5d8c2; padding-top: 12px; }
    /* botões */
    .btn-area { position: relative; display: flex; flex-wrap: nowrap; align-items: stretch; justify-content: center; gap: 8px; margin-top: 16px; min-height: 44px; }
    #btnGerar, #btnGerarOficioRec { background: #207239; color: #fff; border: none; border-radius: 8px; padding: 11px 20px; font-size: 0.94em; font-weight: bold; cursor: pointer; font-family: Arial, sans-serif; display: flex; align-items: center; justify-content: center; gap: 7px; transition: background .18s; white-space: nowrap; }
    #btnGerar:hover, #btnGerarOficioRec:hover { background: #175728; }
    #btnGerar .spinner, #btnGerarOficioRec .spinner { display: none; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
    #btnGerar.busy .spinner, #btnGerarOficioRec.busy .spinner { display: block; }
    @keyframes spin { to { transform: rotate(360deg); } }
    #btnLimpar { position: absolute; left: 0; top: 0; background: transparent; color: #888; border: 1.5px solid #ccc; border-radius: 8px; padding: 10px 16px; font-size: 0.88em; cursor: pointer; font-family: Arial, sans-serif; transition: all .18s; white-space: nowrap; }
    #btnLimpar:hover { border-color: #999; color: #555; }
    .btn-sec { background: #f0fdf4; color: #175728; border: 1.5px solid #b5d8c2; border-radius: 8px; padding: 10px 12px; font-size: 0.82em; cursor: pointer; font-family: Arial, sans-serif; font-weight: 600; transition: all .18s; white-space: nowrap; }
    .btn-sec:hover { background: #dcf0e3; border-color: #207239; }
    @media (max-width: 900px) {
      .btn-area { position: static; flex-wrap: wrap; justify-content: center; min-height: 0; }
      #btnLimpar { position: static; }
    }
    .align-labels .fg > label { min-height: 2.35em; display: flex; align-items: flex-end; }
    .selector-stack { display: flex; flex-direction: column; gap: 10px; }
    .selector-group label { display: block; font-weight: bold; color: #207239; font-size: 0.81em; margin-bottom: 4px; }
    .selector-group .card-grid { width: fit-content; max-width: 100%; margin: 0 auto; justify-content: center; }
    .selector-group .sel-card { min-height: 58px; padding: 10px 8px; }
    .selector-group .sel-card .ico { font-size: 1.2em; margin-bottom: 2px; }
    #erroBox { display: none; background: #fff3cd; border: 1px solid #ffc107; border-radius: 6px; padding: 9px 14px; font-size: 0.9em; color: #856404; margin-top: 10px; }
    .powered-by { text-align: center; font-size: 0.8em; color: #619c73; margin-top: 12px; }
    select option { font-family: Arial, sans-serif; }
    #blocoAverbacao .form-row { align-items: flex-end; }
    .subgrp-title {
      font-weight: 700; color: #1e6a3e; font-size: 0.8em;
      margin: 2px 0 8px; padding-left: 8px; border-left: 3px solid #9ec9ac;
      text-transform: uppercase; letter-spacing: 0.04em;
    }
    .combo-list {
      position: absolute;
      left: 0;
      right: 0;
      top: calc(100% + 2px);
      max-height: 220px;
      overflow-y: auto;
      background: #fff;
      border: 1.2px solid #b5d8c2;
      border-radius: 6px;
      box-shadow: 0 10px 18px rgba(0,0,0,.08);
      z-index: 30;
      display: none;
    }
    .combo-list.show { display: block; }
    .combo-option {
      padding: 8px 10px;
      font-size: 0.88em;
      color: #1a1a1a;
      cursor: pointer;
      background: #fff;
    }
    .combo-option:hover,
    .combo-option.active {
      background: #e8f3ec;
      color: #175728;
    }
    .combo-empty {
      padding: 8px 10px;
      font-size: 0.85em;
      color: #6b7c71;
      font-style: italic;
    }


/* Inline styles extraidos do HTML */
.inline-style-1 { display:none;; }
.inline-style-2 { font-weight:bold;color:#207239;font-size:0.81em;margin:2px 0 6px;; }
.inline-style-3 { max-width:520px; margin:0 0 10px;; }
.inline-style-4 { max-width:940px; margin:0 0 10px; grid-template-columns:repeat(3,minmax(160px,1fr));; }
.inline-style-5 { margin-top:12px;; }
.inline-style-6 { max-width:760px;; }
.inline-style-7 { max-width:520px;; }
.inline-style-8 { max-width:940px;; }
.inline-style-9 { max-width:760px; margin-bottom:10px; display:none;; }
.inline-style-10 { font-size:.82em;color:#555;margin-bottom:10px;; }
.inline-style-11 { margin-top:8px; margin-bottom:8px;; }
.inline-style-12 { display:none; margin-top:8px; margin-bottom:8px;; }
.inline-style-13 { margin-top:4px;; }

/* Layout unificado */
:root {
  --font-ui: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --surface: #ffffff;
  --surface-soft: #f7faf8;
  --primary: #207239;
  --primary-dark: #175728;
  --text-main: #183b25;
  --text-soft: #5f8670;
  --border: #d6e4db;
  --border-strong: #b5d8c2;
  --shadow-lg: 0 20px 48px rgba(24, 59, 37, 0.08), 0 8px 18px rgba(32, 114, 57, 0.08);
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --container-max: 1160px;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-ui);
  background:
    radial-gradient(circle at top, rgba(32, 114, 57, 0.08), transparent 28%),
    linear-gradient(180deg, #f4f8f5 0%, #eef4f0 100%);
  padding: 24px;
  color: var(--text-main);
  zoom: 0.75;
}

.container {
  background: var(--surface);
  padding: 28px 32px 24px;
  border-radius: var(--radius-lg);
  margin: 24px auto;
  box-shadow: var(--shadow-lg);
  border-top: 8px solid var(--primary);
  border-bottom: 8px solid var(--primary);
  width: 100%;
  max-width: var(--container-max);
  min-width: 0;
}

.logo-dpe {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 8px;
  width: 100%;
}

.logo-dpe img {
  height: auto;
  width: auto;
  max-width: min(100%, 180px);
  display: block;
}

.container > .logo-dpe + h2 {
  color: var(--primary);
  text-align: center;
  font-size: clamp(1.55rem, 1.1rem + 1vw, 2rem);
  margin: 10px 0;
  letter-spacing: 0.02em;
  font-weight: 700;
}

.subtitulo,
.container > .logo-dpe + h2 + p {
  max-width: 760px;
  text-align: center;
  color: var(--text-soft);
  font-size: 0.94rem;
  line-height: 1.5;
  margin: 0 auto 22px;
}

.secao-central {
  margin-bottom: 18px;
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.hub-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 132px;
  padding: 13px 14px;
  border-radius: 14px;
  text-decoration: none;
  background: linear-gradient(180deg, #ffffff 0%, #f2f8f4 100%);
  border: 1px solid var(--border-strong);
  box-shadow: 0 10px 24px rgba(24, 59, 37, 0.05);
  color: var(--text-main);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.hub-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: 0 14px 28px rgba(24, 59, 37, 0.08);
}

.hub-card.ativo {
  background: linear-gradient(180deg, #207239 0%, #175728 100%);
  border-color: var(--primary-dark);
  color: #fff;
}

.hub-card strong {
  font-size: 0.92rem;
  line-height: 1.2;
}

.hub-card span:last-child {
  font-size: 0.8rem;
  line-height: 1.35;
  color: inherit;
  opacity: 0.94;
}

.hub-ico {
  font-size: 1.45rem;
  line-height: 1;
}

hr {
  margin: 18px 0;
  border-top: 1px solid var(--border);
}

.secao {
  background: var(--surface-soft);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 16px 18px 14px;
  margin-bottom: 14px;
}

.secao-titulo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 5px 11px;
  border-radius: 999px;
  background: #e8f3ec;
  border: 1px solid #cfe5d6;
  color: var(--primary-dark);
  font-size: 0.88rem;
  letter-spacing: 0.06em;
}

.form-row {
  gap: 12px;
  margin-bottom: 12px;
}

.fg {
  min-width: 170px;
}

.fg > label {
  color: var(--primary);
  font-size: 0.82em;
}

.fg input,
.fg select,
.fg textarea,
select option,
.sel-card,
.btn-add,
.btn-sec,
#btnGerar,
#btnGerarOficioRec,
#btnLimpar {
  font-family: var(--font-ui);
}

.fg input,
.fg select,
.fg textarea {
  min-height: 42px;
  padding: 9px 10px;
  font-size: 0.95em;
  border: 1.2px solid var(--border-strong);
  border-radius: 8px;
  color: var(--text-main);
}


.fg input:focus,
.fg select:focus,
.fg textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(32, 114, 57, 0.12);
}

.sel-card {
  border-radius: var(--radius-sm);
  border-color: var(--border-strong);
  padding: 11px 8px 9px;
  font-size: 0.84em;
  color: var(--primary);
}

.sel-card:hover {
  background: #e8f3ec;
  border-color: var(--primary);
}

.sel-card.ativo {
  background: var(--primary);
  border-color: var(--primary-dark);
}

.info-box {
  border-left-color: var(--primary);
  border-radius: 0 8px 8px 0;
  padding: 10px 12px;
  color: var(--primary-dark);
}

.btn-add,
.btn-sec,
#btnLimpar,
#btnGerar,
#btnGerarOficioRec {
  border-radius: 10px;
}

#btnGerar,
#btnGerarOficioRec {
  background: var(--primary);
  font-size: 0.95em;
  padding: 12px 20px;
}

#btnLimparFormulario {
  background: #eef4ef;
  color: var(--primary-dark);
  border: 1px solid var(--border-strong);
  font-size: 0.95em;
  padding: 12px 20px;
}

.docx-final-action {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.docx-final-action #btnGerar,
.docx-final-action #btnImprimirPdf,
.docx-final-action #btnLimparFormulario {
  width: auto;
  min-width: 160px;
  padding: 10px 18px;
  font-size: 0.9em;
}

#btnGerar:hover,
#btnGerarOficioRec:hover {
  background: var(--primary-dark);
}

#btnLimparFormulario:hover {
  background: #e3ede5;
}

.powered-by {
  text-align: center;
  color: var(--text-soft);
  margin-top: 16px;
  font-size: 0.73rem;
  line-height: 1.45;
  letter-spacing: 0.01em;
}

@media (max-width: 920px) {
  body {
    zoom: 1;
    padding: 12px;
  }

  .container {
    padding: 20px 16px 16px;
    margin: 16px auto;
    border-top-width: 6px;
    border-bottom-width: 6px;
  }

  .logo-dpe img {
    max-width: min(100%, 140px);
  }

  .subtitulo {
    font-size: 0.89rem;
    margin-bottom: 18px;
  }

  .hub-grid {
    grid-template-columns: 1fr;
  }

  .hub-card {
    min-height: 0;
  }

  .fg,
  .fg.w2,
  .fg.w3,
  .fg.fix80,
  .fg.fix100,
  .fg.fix120,
  .fg.fix140,
  .fg.fix160,
  .fg.fix170,
  .fg.fix180,
  .fg.fix200,
  .fg.fix220,
  .fg.fix260 {
    width: 100%;
    min-width: 0;
    flex: 1 1 100%;
  }

  .card-grid-4,
  .card-grid-5,
  .card-grid-6,
  .card-grid-3,
  .card-grid-2 {
    grid-template-columns: 1fr;
  }

  .selector-group .card-grid,
  .registro-grid {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .docx-final-action #btnGerar,
  .docx-final-action #btnLimparFormulario {
    width: 100%;
    max-width: 320px;
    min-width: 0;
  }
}

.assinatura-preview-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 96px;
  padding: 10px;
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  background: #fff;
}

.assinatura-preview {
  max-width: 220px;
  max-height: 72px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: none;
}

