/**
 * Central de Execução de Alimentos - Automação de Petições - Estilos
 * Desenvolvido por: Def. Murillo Bahia Menezes
 * Todos os direitos reservados.
 */

/* Estilos Gerais */
body {
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: #e9ecef;
    color: #222;
    transition: background-color 0.3s, color 0.3s;
}
.container {
    max-width: 900px;
    margin: 30px auto;
    background: #ffffff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: background-color 0.3s, box-shadow 0.3s;
}
.header { 
    text-align: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 15px;
}
h1 { /* Estilo para o H1 principal da ferramenta de automação */
    color: #005522; 
    margin-top: 10px;
    margin-bottom: 5px;
    font-size: 1.8em;
    font-weight: bold;
}
h2 { /* Estilo para o H2 (subtítulo) da ferramenta de automação */
    color: #444;
    font-size: 1.2em;
    font-weight: normal;
    margin-top: 0;
    margin-bottom: 10px; 
}
fieldset {
    border: 1px solid #005522;
    border-radius: 5px;
    margin-bottom: 25px;
    padding: 20px;
    background-color: #f8f9fa;
    transition: background-color 0.3s, border-color 0.3s;
}
legend {
    font-weight: bold;
    padding: 0 10px;
    color: #005522;
    font-size: 1.1em;
    background-color: #ffffff;
    border: 1px solid #005522;
    border-radius: 3px;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}
label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #222;
    font-size: 1em;
}
input[type="text"], 
input[type="email"], 
input[type="tel"], 
input[type="number"],
input[type="date"],
textarea, 
select {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 1em; 
    font-family: Arial, Helvetica, sans-serif; 
    background-color: #fff;
    transition: border-color 0.3s, box-shadow 0.3s, background-color 0.3s;
}
/* Garante que a textarea de descrição da obrigação use a mesma fonte */
#obrigacao_descricao,
#pedidos_customizados {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1em;
}

input:focus, textarea:focus, select:focus {
    border-color: #005522;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 85, 34, 0.2);
}
input.invalid-step, select.invalid-step, textarea.invalid-step {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.2) !important;
}
textarea {
    height: 100px;
    resize: vertical;
}
.radio-group label, .checkbox-group label {
    display: inline-block;
    margin-right: 15px;
    font-weight: normal;
    cursor: pointer;
    color: #222;
}
.radio-group input[type="radio"], .checkbox-group input[type="checkbox"] {
    width: auto;
    margin-right: 5px;
    vertical-align: middle;
    cursor: pointer;
}
.checkbox-group label.label-checkbox {
    font-weight: normal;
    margin-bottom: 0;
}
.hidden-fields {
    display: none;
}
#empregador_dados_div {
    margin-top: 10px;
}
#juizo_outro_div {
    margin-top: -10px;
    margin-bottom: 15px;
}
button.add-button {
    padding: 10px 15px;
    font-size: 0.95em;
    background-color: #138496; /* Cor Info */
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
    margin-right: 5px;
    transition: background-color 0.2s ease;
}
button.add-button:hover {
    background-color: #0f6674; /* Cor Info Hover */
}
button.remove-button {
    padding: 5px 10px;
    font-size: 0.85em;
    background-color: #c82333; /* Cor Danger Hover */
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    vertical-align: middle;
    transition: background-color 0.2s ease;
}
button.remove-button:hover {
    background-color: #bd2130; 
}
#fieldset-tipo {
    background-color: #e0f0ff; 
    border-color: #004085; 
}
#fieldset-tipo legend {
    color: #004085;
    border-color: #004085;
    background-color: #ffffff;
}
hr {
    margin: 25px 0;
    border: 0;
    border-top: 1px solid #dee2e6;
}
h4, h5 {
    margin-top: 20px;
    margin-bottom: 10px;
    color: #222;
    border-bottom: 1px solid #ccc;
    padding-bottom: 5px;
    font-weight: bold;
}
h5 {
    font-size: 1em;
}
h4 .remove-button {
    float: right;
}
.document-alert {
    background-color: #e9ecef; 
    border-color: #ced4da; 
    color: #495057; 
    padding: 8px 12px; 
    margin-bottom: 12px; 
    border-radius: 4px;
    border: 1px solid transparent;
    font-size: 0.9em; 
}
.document-alert h4 {
    margin-top: 0;
    margin-bottom: 6px; 
    color: #495057;
    border-bottom-color: #ced4da;
    font-size: 0.9em; 
    font-weight: bold; 
}
.document-alert ul {
    margin-bottom: 0;
    padding-left: 18px; 
    list-style-type: disc; 
}
.document-alert li {
    margin-bottom: 2px; 
    font-size: 0.85em; 
}

.link-calculo, /* Estilo para o link de consulta CPF */
.link-alternativa { 
    font-size: 0.85em; 
    margin-bottom: 5px; 
    display: inline-block; 
    text-decoration: none;
    color: #007bff; 
    cursor: pointer;
}
.link-calculo:hover,
.link-alternativa:hover {
    text-decoration: underline;
}

/* Botão "Abrir Ferramenta de Cálculo" */
.button-calculadora {
    background-color: #007bff; /* Azul primário (Bootstrap) */
    color: white;
    border: 1px solid #007bff;
    padding: 8px 12px;
    font-size: 0.9em;
    margin-top: 5px; 
    margin-bottom: 10px; 
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}
.button-calculadora:hover {
    background-color: #0056b3; /* Azul mais escuro para hover */
    border-color: #0056b3;
    text-decoration: none;
}


.print-tips {
    background-color: #e9ecef; 
    border-color: #ced4da; 
    color: #495057; 
    padding: 8px 12px; 
    margin-top: 15px; 
    margin-bottom: 12px; 
    border-radius: 4px;
    border: 1px solid transparent;
    font-size: 0.9em; 
}
.print-tips h4 {
    margin-top: 0;
    margin-bottom: 6px; 
    color: #495057;
    border-bottom-color: #ced4da;
    font-size: 0.9em; 
    font-weight: bold; 
}
.print-tips p {
     margin-top: 10px;
     margin-bottom: 0;
     font-size: 0.9em; 
}
 .print-tips input[type="checkbox"] { 
     vertical-align: middle;
     margin-right: 5px;
 }
 .print-tips label.label-checkbox {
      vertical-align: middle;
      display: inline-block; 
      margin-bottom: 0; 
      font-weight: normal;
      font-size: 1em; 
 }

/* Estilo para o ícone de informação (se for usado na Automação) */
label .info-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    line-height: 16px; 
    text-align: center;
    border-radius: 50%;
    background-color: #999; 
    color: white;
    font-size: 0.70rem; 
    font-weight: bold;
    cursor: help;
    margin-left: 5px;
    font-family: 'Courier New', Courier, monospace;
    vertical-align: middle; 
}

/* Estilos para os campos de OAB */
.oab-group {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 15px; 
}
.oab-group input[type="text"] { 
    flex-grow: 1; 
    margin-bottom: 0; 
}
.oab-group select { 
    flex-basis: 100px; 
    flex-shrink: 0; 
    margin-bottom: 0; 
}

/* Estilos para blocos dinâmicos (Exequente e Assinatura) */
.exequente-bloco, .assinatura-bloco {
    padding: 15px;
    border: 1px dashed #ccc;
    border-radius: 4px;
    margin-bottom: 20px;
    background-color: #fdfdfd;
}
.exequente-bloco h4, .assinatura-bloco h4 {
    margin-top: 0;
    border-bottom: 1px solid #ddd;
    padding-bottom: 8px;
}


/* --- ESTILOS MULTI-STEP --- */
.form-step {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}
.form-step.active-step {
    display: block;
}
.form-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    flex-wrap: wrap;
    gap: 15px;
}
.form-navigation button {
    padding: 12px 25px;
    font-size: 1em;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    border: none;
    transition: background-color 0.3s ease, opacity 0.3s ease;
    min-width: 120px;
    text-align: center;
}
.form-navigation .prev-btn {
    background-color: #6c757d;
    color: white;
}
.form-navigation .prev-btn:hover:not(:disabled) {
    background-color: #5a6268;
}
.form-navigation .next-btn {
    background-color: #005522;
    color: white;
}
.form-navigation .next-btn:hover:not(:disabled) {
    background-color: #004d26;
}
.form-navigation .draft-btn {
    background-color: #ffc107;
    color: #212529; 
}
.form-navigation .draft-btn:hover:not(:disabled) {
    background-color: #e0a800;
}
.form-navigation .clear-btn { 
    background-color: #dc3545;
    color: white;
}
.form-navigation .clear-btn:hover:not(:disabled) {
    background-color: #c82333;
}
.form-navigation button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    opacity: 0.7;
}
.progress-indicator {
    display: flex;
    justify-content: space-between;
    list-style: none;
    padding: 0;
    margin-bottom: 30px;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 15px;
    counter-reset: step-counter;
    user-select: none;
}
.progress-indicator .step {
    flex: 1;
    text-align: center;
    position: relative;
    font-size: 0.9em;
    color: #555;
    cursor: pointer; 
}
.progress-indicator .step::before {
    content: counter(step-counter);
    counter-increment: step-counter;
    display: block;
    width: 30px;
    height: 30px;
    line-height: 30px;
    border-radius: 50%;
    background-color: #adb5bd;
    color: white;
    margin: 0 auto 5px;
    font-weight: bold;
    transition: background-color 0.3s ease;
    border: 2px solid #adb5bd;
    box-sizing: border-box;
}
.progress-indicator .step:hover:not(.active):not(.completed)::before {
    background-color: #99a4ac;
    border-color: #99a4ac;
}
.progress-indicator .step .step-name {
    display: block;
    font-size: 0.85em;
    font-weight: 600;
}
.progress-indicator .step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 15px;
    left: 50%;
    width: calc(100% - 30px);
    height: 2px;
    background-color: #dee2e6;
    transform: translateX(15px);
    z-index: -1;
    transition: background-color 0.3s ease;
}
.progress-indicator .step.active::before {
    background-color: #005522;
    border-color: #005522;
}
.progress-indicator .step.active .step-name {
    color: #005522;
    font-weight: bold;
}
.progress-indicator .step.completed::before {
    background-color: #28a745;
    border-color: #28a745;
    content: '✔';
    font-size: 0.9em;
    line-height: 26px; 
}
.progress-indicator .step.completed .step-name {
    color: #28a745;
}
.progress-indicator .step.completed::after {
    background-color: #28a745;
}
.progress-indicator .step:focus {
    outline: 2px solid #005522;
    outline-offset: 2px;
}
#petition-preview-container {
    margin-top: 20px;
    padding: 0;
    border: 1px solid #ccc;
    background-color: #fdfdfd;
    border-radius: 5px;
    min-height: 300px;
    text-align: center;
    display: flex;
    flex-direction: column;
}
#petition-preview-iframe {
    width: 100%;
    flex-grow: 1;
    border: none;
    border-radius: 5px;
    background-color: white;
    padding: 20px; 
    box-sizing: border-box;
}
#preview-actions { 
    margin-top: 15px;
    padding: 15px;
    background: #eee;
    border-top: 1px solid #ccc;
    border-radius: 0 0 5px 5px;
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}
#preview-actions button {
    padding: 10px 20px;
    font-size: 1em;
    cursor: pointer;
    border: none;
    border-radius: 5px;
    transition: background-color 0.2s ease;
}
#preview-actions .print-btn {
    background-color: #005522;
    color: white;
}
#preview-actions .print-btn:hover {
    background-color: #004d26;
}
#preview-actions .copy-html-btn {
    background-color: #17a2b8;
    color: white;
}
#preview-actions .copy-html-btn:hover {
    background-color: #138496;
}

/* Estilos para a seção de Pedidos (Etapa 6) */
#form-step-6 fieldset fieldset { 
    border-color: #6c757d;
    background-color: #f8f9fa;
    margin-top: 20px;
}
#form-step-6 fieldset fieldset legend {
    color: #495057;
    border-color: #6c757d;
}
#form-step-6 .checkbox-group {
    margin-bottom: 10px;
}
#form-step-6 textarea#pedidos_customizados {
    margin-top: 5px;
    min-height: 60px; /* Reduzido um pouco pois o placeholder é menor */
}


@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.sr-only { 
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}
.page-footer {
    text-align: center;
    font-size: 0.9em; 
    color: #6c757d;   
    margin-top: 40px; 
    padding-top: 20px; 
    border-top: 1px solid #dee2e6; 
}

/* Estilos de Impressão (Página Principal) */
@media print {
    body > *:not(#printable-content) { 
        display: none !important;
    }
    body { margin: 0; padding: 0; background: none; color: #000; }
    #printable-content { display: block !important; }
    .page-footer { display: none !important; }
    .no-print { display: none !important; } 
}
/* Estilos para a seção de upload de logo */
.logo-upload-section {
    margin-bottom: 20px;
}

.logo-preview {
    margin-top: 15px;
    padding: 10px;
    border: 1px dashed #ccc;
    border-radius: 4px;
    background-color: #f9f9f9;
    text-align: center;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.logo-placeholder {
    color: #777;
    margin: 0;
    font-style: italic;
}

.logo-info {
    margin: 5px 0 0;
    font-size: 0.85em;
    color: #28a745;
}

.input-hint {
    display: block;
    font-size: 0.85em;
    color: #6c757d;
    margin-top: 5px;
    margin-bottom: 10px;
    font-weight: normal;
}

#removerLogoSalva {
    margin-top: 10px;
    text-decoration: underline;
    color: #dc3545;
    background: none;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 0.9em;
}

#removerLogoSalva:hover {
    color: #bd2130;
    text-decoration: none;
}

/* Estilo para a logo na petição impressa */
@media print {
    .petition-logo {
        margin-bottom: 15px !important;
    }
    
    .petition-logo img {
        max-height: 50px !important;
    }
}
/* Ajustes para consistência nos tamanhos de fonte nas dicas de impressão */
.print-tips p,
.print-tips ul,
.print-tips li {
    font-size: 0.9em !important; /* Forçar tamanho consistente */
    line-height: 1.5 !important;
    margin-bottom: 5px !important;
}

.print-tips ul {
    margin-top: 8px !important;
    padding-left: 18px !important;
}

.print-tips li {
    margin-bottom: 5px !important;
    list-style-type: disc !important;
}

.print-tips li strong {
    font-weight: bold !important;
}