body {
    font-family: Arial, sans-serif;
    /* background: linear-gradient(to left, #ffbf009b, #03841b9b); */
    background: #e8e8e8;
    margin: 0;
    padding: 0;
    
    
}

h1 {
    text-align: center;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.45);
    margin-top: 1.2em;
    margin-bottom: 0.8em; /* Aumentado o espaçamento inferior */
    color: #ffffff;
    font-size: 3em;
    padding: 0 1rem; /* Garante espaçamento lateral em telas pequenas */
}

#form-container {
    width: 90%; /* Largura aumentada para melhor espaçamento */
    height: 100%;
    max-width: 1400px;
    margin: 1.5em auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: auto;
    gap: 1em 1em; /* gap vertical 4em, horizontal 3em */
    justify-items: stretch;
    align-items: start;
    background: none;
    box-shadow: none;
    padding: 0 1.5%; /* Espaçamento lateral interno adicional */
    box-sizing: border-box;
    
}

.formulario-bloco {
    overflow: hidden;
    margin-bottom: 2.5em;
    perspective: 1200px;
    position: relative;
    height: 800px;
    min-height: 800px;
    max-height: 800px;
    width: 1300px;
    overflow: visible;
    /* background: none; */
    box-shadow: none;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    min-width: 0;
    min-height: 0;
    
    /* box-sizing: border-box; */
    
}

.formulario-bloco .flip-inner {
    position: relative;
    width: 100%;
    height: 100%;
    left: 0;
    right: 0;
    transition: transform 0.7s cubic-bezier(0.4,0.2,0.2,1);
    transform-style: preserve-3d;
    min-width: 0;
    min-height: 0;
    flex: 1 1 0;
    /* backface-visibility: hidden; */
    will-change: transform;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.45);
    color: #ffffff;
}

.formulario-bloco.flip-card .flip-inner {
    transform: rotateY(180deg);
}

.formulario-bloco .flip-front,
.formulario-bloco .flip-back {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(234, 1, 1, 0.08);
    padding: 1.6em 1.3em 4em 1.3em;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    overflow-y: auto;
    
}

.formulario-bloco .flip-back {
    transform: rotateY(180deg);
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    overflow-y: auto;
    flex: 1 1 0;
    min-height: 0;
    height: 100%;
}

.resultado-scroll {
    flex: 1 1 0;
    min-height: 0;
    height: 100%;
    overflow-y: auto;
}

.formulario-bloco .flip-front {
    z-index: 1;
}

.formulario-bloco .flip-front button[type="submit"] {
    /* Removido position: absolute e transform para evitar sobreposição */
    position: static;
    left: auto;
    bottom: auto;
    transform: none;
    width: 65%;
    margin: 1.2em auto 0 auto;
    display: block;
    transition: transform 0.15s cubic-bezier(.4,0,.2,1), box-shadow 0.15s cubic-bezier(.4,0,.2,1);
    box-shadow: 0 0px 5px rgba(0, 0, 0, 0.42);
}

.formulario-bloco .flip-front button[type="submit"]:hover {
    transform: scale(1.045);
    box-shadow: 0 0px 5px rgba(255, 255, 255, 0.43);
}

.formulario-bloco .flip-front button[type="submit"]:active {
    transform: scale(0.97);
    box-shadow: 0 0px 5px rgba(255, 255, 255, 0.43);
}

.formulario-bloco .flip-back .btn-voltar {
    position: static;
    left: auto;
    bottom: auto;
    transform: none;
    width: 65%;
    margin: 0 auto 0.5em auto;
    z-index: 3;
}

.formulario-bloco form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    height: 100%;
    
}

.formulario-bloco form button[type="submit"] {
    margin-top: auto !important;
    margin-bottom: 1.2em;
    align-self: center;
    width: 65%;
    z-index: 2;
    background: #1b7f71;
    box-shadow: 0 4px 16px rgba(0,0,0,0.18), 0 1.5px 6px rgba(0,0,0,0.12);
}

.campos-wrapper {
    /* flex: 1 1 auto; removido para não forçar preenchimento vertical */
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.7em 1em !important; /* gap vertical menor e fixo */
    align-items: start;
    overflow-y: auto;
    max-height: calc(100% - 50px);
    
}

.formulario-bloco form h2 {
    grid-column: 1 / -1;
    font-size: 1.15em;
    margin-bottom: 1em;
    padding: 0 0.5em; /* Previne quebras de linha indesejadas */
    
}

.formulario-bloco form .campo-formulario {
    margin-bottom: 0.08em; /* margem inferior reduzida */
    
}

.formulario-bloco form button[type="submit"] {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    margin-top: 1.2em;
    margin-bottom: 0.5em;
    align-self: center;
    width: 65%;
    z-index: 2;
    background: #1b7f71;
    box-shadow: 0 4px 16px rgba(0,0,0,0.18), 0 1.5px 6px rgba(0,0,0,0.12);
}

@media (max-width: 1100px) {
    #form-container {
        grid-template-columns: repeat(2, 1fr);
        width: 94%;
        padding: 0 2%;
        gap: 3em 2em;
    }
    .formulario-bloco {
    overflow: hidden;
        font-size: 0.93em;
    }
}
@media (max-width: 700px) {
    #form-container {
        grid-template-columns: 1fr;
        width: 90%;
        gap: 2em;
        padding: 0 3%;
    }
    .formulario-bloco {
    overflow: hidden;
        font-size: 0.9em;
        padding: 1.4em 1.1em;
    }
    
    .formulario-bloco form {
        gap: 1em;
        font-size: 0.95em;
        
    }
    .formulario-bloco form h2 {
        font-size: 1.08em;
        
    }
    .formulario-bloco form button[type="submit"] {
        width: 80%;
        font-size: 0.95em;
    }
    .campos-wrapper {
        grid-template-columns: 1fr;
        gap: 1.2em;
    }
    .formulario-bloco {
    overflow: hidden;
        margin-bottom: 2em;
    }
}

form h2 {
    margin-top: 0;
    margin-bottom: 1.1em;
    font-size: 1.18em;
    color: #ffffff;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.45);
    text-align: center;
}

.campo-formulario {
    margin-bottom: 0.2em;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    width: 100%;
}
.campo-formulario label {
    width: 100%;
    display: block;
    color: #f1f1f1;
}
     */
.campo-formulario label {
    color: #fff !important;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.45);
}

.campo-formulario.checkbox {
    flex-direction: row;
    color: #f1f1f1;
    align-items: center;
    gap: 0.6em;
    margin-bottom: 0.9em;
    /* Garante que o input e o label fiquem na mesma linha e o input sempre alinhado à esquerda */
    justify-content: flex-start;
}
.campo-formulario.checkbox label {
    margin-bottom: 0;
    font-weight: normal;
    font-size: 0.92em;
    word-break: break-word;
    white-space: normal;
    color: #fff !important;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.45);
}
.campo-formulario.checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-left: 0;
    margin-right: 0;
}

.campo-formulario:not(.checkbox) label {
    margin-bottom: 0.35em; /* leve aumento para separar label do input */
    font-weight: 600;
    color: #ffffff;
    font-size: 0.92em;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.45);
    
}

input, select, textarea {
    width: 100%;
    padding: 0.55em;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 0.95em;
    background: #fafbfc;
    transition: border-color 0.2s;
    
}
input:focus, select:focus, textarea:focus {
    border-color: #1976d2;
    outline: none;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.1);
}

button[type="submit"] {
    background: #1976d2;
    color: #fff;
    border: none;
    padding: 0.75em 1.2em;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.98em;
    font-weight: 600;
    transition: background 0.2s, transform 0.1s;
}
button[type="submit"]:hover {
    background: #1565c0;
    ;
}
button[type="submit"]:active {
    transform: scale(0.98);
}

@media (max-width: 900px) {
    #form-container {
        flex-direction: column;
        align-items: center;
        gap: 1.5em;
    }
    .formulario-bloco {
    overflow: hidden;
        max-width: 100%;
    }
}

button[type="button"] {
    background: #e0e0e0;
    color: #333;
    border: none;
    padding: 0.65em 1.2em;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 500;
    margin-left: auto;
    margin-right: auto;
    display: block;
}

button[type="button"]:hover {
    background: #d5d5d5;
}

.btn-voltar {
    background: #f1f1f1;
    color: #333;
    border: 1px solid #bbb;
    padding: 0.6em 1.2em;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 500;
    transition: background 0.2s ease, border-color 0.2s ease;
    display: inline-block;
    margin: 1em auto 0;
    align-self: center;
}
.btn-voltar:hover {
    background: #e0e0e0;
    border-color: #999;
}

.lista-resultado {
    list-style: none;
    padding-left: 0;
    margin-top: 0.5em;
}
.lista-resultado li {
    margin-bottom: 0.6em;
    font-size: 0.95em;
    color: #000000;
}
.lista-resultado li strong {
    color: #dded03;
}

.resultado-formatado {
    display: flex;
    flex-direction: column;
    gap: 0.8em;
    font-size: 0.96em;
    margin-bottom: 1.5em;
    line-height: 1.45em;
}

.linha-resultado {
    display: flex;
    flex-direction: column;
    word-break: break-word;
}

.linha-resultado strong {
    color: #ffcd05;
    margin-bottom: 0.2em;
    font-weight: 600;
}

.linha-resultado pre {
    background: #d5d5d5;
    color: #373737;
    padding: 0.6em;
    text-shadow: none;
    border-radius: 4px;
    white-space: pre-wrap;
    font-family: inherit;
    font-size: 0.95em;
    margin: 0;
}

.btn-voltar {
    background: #e0e0e0;
    color: #333;
    border: 1px solid #bbb;
    padding: 0.6em 1.4em;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.96em;
    font-weight: 500;
    transition: background 0.2s ease;
    display: inline-block;
    margin: 0 auto;
    align-self: center;
}
.btn-voltar:hover {
    background: #d5d5d5;
}



.formulario-bloco .flip-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.7s cubic-bezier(0.4,0.2,0.2,1);
}

.formulario-bloco .flip-front,
.formulario-bloco .flip-back {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    /* background: #fff; */
    background: #1156b871;
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    padding: 1.6em 1.3em 4em 1.3em;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    overflow-y: auto;
    box-sizing: border-box;
}

.formulario-bloco .flip-back {
    transform: rotateY(180deg);
    z-index: 2;
}

.formulario-bloco .flip-front {
    z-index: 1;
}

.formulario-bloco.flip-card .flip-inner {
    transform: rotateY(180deg);
}

/* Card principal ocupa 100% da largura e ganha destaque */
.formulario-principal {
    grid-column: 1 / -1;
    width: 100%;
    background: linear-gradient(to right, #3CAF4E, #F2C500);
    box-shadow: 0 4px 16px rgba(0,0,0,0.18), 0 1.5px 6px rgba(0,0,0,0.12), 0 0.5px 1.5px rgba(0,0,0,0.10);
    border-radius: 16px;
    margin-bottom: 1em;
    min-height: unset;
    max-height: 320px;
    padding: 0.0em 0em;
    overflow-y: visible !important;
}

.formulario-principal .flip-front,
.formulario-principal .flip-back {
    min-height: unset;
    max-height: 320px;
    padding: 0.5em 0.7em;
    overflow-y: hidden;
}

.formulario-principal .campos-wrapper {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.6em 1.5em;
    margin-top: 0.1em;
    overflow: hidden !important;
    
}

.formulario-principal form h2 {
    font-size: 1.15em;
    margin-bottom: 0.1em;
    padding: 0 0.5em;
    overflow-y: visible !important;
}

@media (max-width: 900px) {
    .formulario-principal {
        padding: 1.2em 1em;
    }
}


/* Aplica o mesmo visual do card principal aos demais */
.formulario-bloco:not(.formulario-principal) {
    background: #5e8c6a;
    /* background: #1156b871; */
    /* border: 1.5px solid #1976d2; */
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.1);
    box-shadow: 0 4px 16px rgba(0,0,0,0.18), 0 1.5px 6px rgba(0,0,0,0.12), 0 0.5px 1.5px rgba(0,0,0,0.10);
    border-radius: 12px;
    padding: 0.5em 0em;
    min-height: auto;
    margin-bottom: 1;
}

.formulario-bloco:not(.formulario-principal) .flip-front,
.formulario-bloco:not(.formulario-principal) .flip-back {
    background: transparent;
    box-shadow: none;
    padding: 0.5em 0.7em;
    border-radius: 0;
}

.formulario-bloco:not(.formulario-principal) .campos-wrapper {
    gap: 0.7em 1em !important;
    padding-right: 0.6em; /* ou ajuste fino se necessário */
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); /* responsivo e mais estreito */
    
}

/* Barra de rolagem fina e discreta nos cards e campos do formulário */
.formulario-bloco .flip-front,
.formulario-bloco .flip-back,
.campos-wrapper,
.resultado-scroll {
    scrollbar-width: thin;
    scrollbar-color: #b0b8c1 #f5f7fa;
}
.formulario-bloco .flip-front::-webkit-scrollbar,
.formulario-bloco .flip-back::-webkit-scrollbar,
.campos-wrapper::-webkit-scrollbar,
.resultado-scroll::-webkit-scrollbar {
    width: 6px;
    background: #f5f7fa;
}
.formulario-bloco .flip-front::-webkit-scrollbar-thumb,
.formulario-bloco .flip-back::-webkit-scrollbar-thumb,
.campos-wrapper::-webkit-scrollbar-thumb,
.resultado-scroll::-webkit-scrollbar-thumb {
    background: #b0b8c1;
    border-radius: 8px;
}
.formulario-bloco .flip-front::-webkit-scrollbar-thumb:hover,
.formulario-bloco .flip-back::-webkit-scrollbar-thumb:hover,
.campos-wrapper::-webkit-scrollbar-thumb:hover,
.resultado-scroll::-webkit-scrollbar-thumb:hover {
    background: #a0a8b1;
}


.logo-img[src*='logo_calc0.png'] {
    display: block;
    margin: 2em auto 0.5em auto;
    max-width: 600px;
    width: 100%;
    height: auto;
    /* filter: drop-shadow(0 0px 5px #00000067)  */
}

.logo-estado-img {
    display: block;
    margin: 2.5em auto 0.5em auto;
    max-width: 300px;
    width: 100%;
    height: auto;
}

footer {
    margin-top: 2.5em;
    padding-bottom: 2.5em;
    text-align: center;
    background: transparent;
    height: auto;
    pointer-events: none;
}

.campo-formulario input[type="text"],
.campo-formulario input[type="number"],
.campo-formulario textarea {
    color: #000000 !important;
}

.mensagem-erro {
    color: red;
    font-size: 0.8em;
    display: block;
    min-height: 1.2em;
    line-height: 1.2em;
    margin-top: 4px;
    transition: color 0.2s;
}
.mensagem-erro:empty {
    color: transparent;
}


/* Alinha os checkboxes na grid do card principal */
.formulario-principal .campos-wrapper .campo-formulario.checkbox {
    display: flex;
    align-items: center;
    height: 100%; /* Garante altura igual aos outros campos */
    margin-top: 1.3em; /* Ajuste fino para alinhar verticalmente */
    margin-bottom: 0;
    padding-top: 0.35em;
    /* Se necessário, ajuste o padding/margin para alinhar perfeitamente */
}

/* Opcional: diminui o espaço entre o checkbox e o label */
.formulario-principal .campo-formulario.checkbox label {
    font-size: 1em; /* ou ajuste para o valor desejado, ex: 1.1em, 1.15em */
    margin-left: 0.4em;
}

.formulario-principal .campo-formulario.checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
}

.campos-wrapper .campo-formulario:not(.checkbox) {
    align-self: end;
    min-height: 90px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.formulario-principal .mensagem-erro {
    min-height: 1.3em; /* ou ajuste conforme necessário */
    display: block;
    line-height: 1.3em;
    margin-top: 4px;
    transition: color 0.2s;
    /* Garante que o espaço sempre será reservado */
}
.formulario-principal .mensagem-erro:empty {
    color: transparent;
    /* O espaço continua reservado mesmo sem mensagem */
}

.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    color: #1976d2;
    background-color: #e3f2fd;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 12px;
    font-weight: bold;
    cursor: help;
    user-select: none;
    vertical-align: middle;
}

.form-subtitle {
    text-align: center;
    color: #f0f0f0;
    font-size: 1em;
    font-weight: 500;
    margin-top: -0.8em;
    margin-bottom: 1.2em;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.4);
}

.pdf-export-style {
  position: absolute;
  left: -9999px;
  top: auto;
  background: #ffffff;
  color: #000000;
  padding: 1.5em;
  width: 800px;
  max-height: none;
  overflow: visible;
  font-size: 20px;
  line-height: 1.6;
  font-family: Arial, sans-serif;
  box-sizing: border-box;
}

.pdf-export-style strong {
  color: #333333;
}

.pdf-export-style pre {
  background: #f9f9f9;
  color: #000000;
  padding: 0.5em;
  border-radius: 4px;
  font-size: 18px;
  white-space: pre-wrap;
}


.btn-voltar,
.btn-exportar-pdf {
  padding: 0.6em 1.2em;
  border: none;
  border-radius: 6px;
  background-color: #e3e3e3;
  font-size: 1em;
  cursor: pointer;
  min-height: 42px;
  transition: background 0.2s ease;
}

.btn-voltar:hover,
.btn-exportar-pdf:hover {
  background-color: #d6d6d6;
}

.duas-colunas {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}