/* Reset e base */
* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial; }
html, body { height: 100%; background: #f5f7fa; color: #0f172a; -webkit-font-smoothing:antialiased; }
a { color: inherit; text-decoration: none; }

/* Container */

/*.container {
  max-width: 1100px;
  margin: 28px auto;
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 8px 30px rgba(2,6,23,0.08);
  overflow: visible;*/ /* evita cortar painéis internos */
/*}*/

/* Titulos */
h1 { text-align: center; color: #0b4a8b; margin-bottom: 18px; font-size: 1.6rem; font-weight:800; }
h2 { color: #1e3a8a; margin-bottom: 12px; font-size: 1.05rem; border-bottom: 1px solid #eef2ff; padding-bottom: 10px; font-weight:700; }
h3, h4 {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  margin: 0 0 10px 0;
  color: #0b3b82;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
h3 { font-size: 1.06rem; }
h4 { font-size: 0.96rem; }

/* Grid do formulário */
.form-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; align-items: start; }
.form-group { display: flex; flex-direction: column; }
.form-group.full { grid-column: 1 / -1; }
.form-group.span-2 { grid-column: span 2; }

label { margin-bottom: 6px; font-weight: 600; font-size: 0.92rem; color: #0f172a; }
input[type="text"], input[type="email"], input[type="tel"], input[type="date"], textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #e6e9ef;
  font-size: 0.95rem;
  background: #fff;
  transition: box-shadow .15s, border-color .15s;
}
input:focus, textarea:focus { outline: none; border-color: #2563eb; box-shadow: 0 6px 18px rgba(37,99,235,0.08); }

/* Radios / checkboxes */
.radio-group { display: flex; gap: 12px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.inline-label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; }
.inline-label input { accent-color: #2563eb; }

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  padding: 2px 0;
  font-size: 0.95rem;
  line-height: 1.25;
  color: #0b1220;
}
.checkbox-label input[type="checkbox"], .checkbox-label input[type="radio"] {
  width: 18px; height: 18px; margin-top: 2px; accent-color: #2563eb; cursor: pointer;
}

/* Toggle button (accordion header) */
.toggle-button {
  width: 100%;
  background: linear-gradient(180deg,#2563eb,#1e40af);
  color: #fff;
  border: 0;
  padding: 12px 14px;
  border-radius: 10px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  margin-top: 0px;
}
.toggle-button .toggle-icon { transition: transform .25s ease; }
.toggle-button[aria-expanded="true"] .toggle-icon { transform: rotate(90deg); }

/* Painel do toggle */
.toggle-panel { max-height: 0; overflow: hidden; transition: max-height 360ms cubic-bezier(.2,.9,.2,1); margin-bottom: 0px; border-radius: 0 0 10px 10px; background: #f8fbff; }
.toggle-panel.open { overflow: visible; }

/* Categorias */
.radio-category, .checkbox-category, .regional-category {
  width: 100%;
  box-sizing: border-box;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #e6eefc;
  background: #fff;
  margin-bottom: 8px;
  box-shadow: 0 2px 8px rgba(2,6,23,0.03);
}

/* Lista de regionais em colunas */
.regional-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; }

/* Observações */
.observacoes-text { margin-top: 8px; padding: 12px; border-left: 4px solid #2563eb; background: #f1f5ff; color: #334155; border-radius: 6px; line-height: 1.45; }

/* Ações */
.actions { display:flex; gap:12px; justify-content:center; margin-top:18px; }
.btn { padding: 10px 16px; border-radius: 9px; border: 0; cursor: pointer; font-weight: 700; }
.btn-primary { background: #2563eb; color: #fff; }
.btn-ghost { background: #f1f5f9; color: #0b1220; border: 1px solid #e2e8f0; }

/* Cabeçalho com logos laterais */
.form-header { display: grid; grid-template-columns: 90px 1fr 90px; gap: 16px; align-items: center; justify-items: center; margin-bottom: 18px; padding: 6px 12px; background: transparent; }
.header-logo img { display: block; max-height: 150px; width: auto; object-fit: contain; }
.header-logo--left img, .header-logo--right img { max-width: 100%; height: auto; }
.header-title { text-align: center; line-height: 1.05; padding: 0 6px; }
.header-title .title-line { font-weight: 700; color: #0b3b82; font-size: 0.92rem; letter-spacing: 0.6px; margin-bottom: 2px; text-transform: uppercase; }
.header-title .main-title { margin: 6px 0; font-size: 1.06rem; font-weight: 900; color: #000; letter-spacing: 0.8px; }
.header-title .subtitle { font-weight: 700; font-size: 0.95rem; margin-top: 2px; text-transform: uppercase; color: #0b3b82; }

/* estilo para preview/pdf (mantido aqui por conveniência) */
.pdf-container {
    width: 190mm;
    min-height: 297mm;
    padding: 12mm 10mm;
    box-sizing: border-box;
    font-family: "Inter", system-ui, Arial, sans-serif;
    color: #0b1220;
    background: #fff;
    margin: 0 auto;
    font-size: 12px;
    line-height: 1.3;
}

/* Cabeçalho */
.pdf-header {
    margin-bottom: 8px;
    border-bottom: 2px solid #0d204b;
    padding-bottom: 6px;
}

.pdf-title {
    text-align: center;
}

    .pdf-title .institution {
        font-weight: bold;
        text-transform: uppercase;
        font-size: 14px;
        color: #0d204b;
        line-height: 1.2;
    }

    .pdf-title .department {
        font-weight: bold;
        text-transform: uppercase;
        font-size: 12px;
        color: #0d204b;
        line-height: 1.2;
    }

    .pdf-title .main {
        font-size: 16px;
        margin: 4px 0;
        font-weight: bold;
        color: #0d204b;
        line-height: 1.2;
    }

    .pdf-title .system {
        font-weight: bold;
        text-transform: uppercase;
        font-size: 12px;
        color: #0d204b;
        line-height: 1.2;
    }

/* Seções */
.pdf-section {
    margin-top: 10px;
    margin-bottom: 8px;
}

    .pdf-section h2 {
        font-size: 13px;
        margin-bottom: 6px;
        color: #0d204b;
        border-bottom: 1px solid #ccc;
        padding-bottom: 3px;
        text-transform: uppercase;
    }

/* Sistema de grid com campos maiores */
.pdf-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px 8px;
}

.pdf-field {
    margin-bottom: 6px;
}

    .pdf-field strong {
        display: block;
        font-size: 11px;
        color: #334155;
        margin-bottom: 3px;
        font-weight: 600;
    }

    .pdf-field .field-value {
        font-size: 12px;
        padding: 8px 10px;
        background: #f8fafc;
        border-radius: 4px;
        border: 1px solid #e2e8f0;
        min-height: 28px;
        display: flex;
        align-items: center;
        line-height: 1.3;
    }

    /* Campos específicos para dados longos */
    .pdf-field.email-field .field-value,
    .pdf-section:last-child .field-value {
        min-height: 32px;
        font-size: 12px;
    }

/* Observações */
.observacoes-container {
    background-color: white;
    border: 1px solid #ddd;
    padding: 12px;
    margin-top: 6px;
    border-radius: 4px;
}

.observacoes-titulo {
    font-weight: bold;
    font-size: 13px;
    margin-bottom: 8px;
    text-align: start;
    text-transform: uppercase;
    color: #0d204b;
}

.observacoes-lista {
    list-style-type: none;
    padding-left: 0;
    margin: 0;
}

.observacoes-item {
    margin-bottom: 6px;
    display: flex;
    align-items: flex-start;
}

.observacoes-marcador {
    font-weight: bold;
    margin-right: 6px;
    flex-shrink: 0;
    font-size: 12px;
    color: #0d204b;
}

.observacoes-texto {
    flex-grow: 1;
    font-size: 12px;
    line-height: 1.4;
}

/* Campos específicos */
.pdf-field.email-field {
    grid-column: 1 / -1;
}

/* Assinaturas lado a lado */
.assinatura-section {
    margin-top: 20px;
    padding: 10px;
}

.assinatura-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.assinatura-item {
    margin-bottom: 0;
}

.assinatura-line {
    border-bottom: 1px dashed #000;
    height: 25px;
    margin: 5px 0;
}

.assinatura-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 12px;
}

/* Rodapé */
.pdf-footer {
    margin-top: 15px;
    padding-top: 8px;
    border-top: 1px solid #0d204b;
    text-align: right;
    font-size: 10px;
    color: #666;
}

/* Para garantir boa impressão em A4 */
@media print {
    .pdf-container {
        padding: 01mm 01mm;
        box-shadow: none;
        height: 297mm;
    }

    body {
        background: white;
        margin: 0;
        padding: 0;
    }
}
/* Responsividade: em telas pequenas empilha verticalmente */
@media (max-width: 720px) {
  .form-header { grid-template-columns: 1fr; gap: 8px; padding: 10px 12px; text-align: center; }
  .header-logo { order: 0; }
  .header-title { order: 1; }
  .header-logo img { max-height: 70px; }
}

/* Em telas muito largas, garantir que o header não fique esticado demais */
@media (min-width: 1500px) {
  .form-header { grid-template-columns: 110px 1fr 110px; }
  .header-logo img { max-height: 110px; }
}

/* Responsividade do formulário */
@media (max-width: 980px) { .form-grid { grid-template-columns: repeat(2, 1fr); } .form-group.span-2 { grid-column: span 2; } .regional-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } .form-group.span-2, .form-group.full { grid-column: span 1; } .regional-list { grid-template-columns: 1fr; } .toggle-button { padding: 10px; font-size: 0.95rem; } }
