/**
 * =================================================================
 * ARQUIVO: style-form.css
 * DESCRIÇÃO: Estilos CSS para o Formulário de Avaliação SENAR
 * VERSÃO: 3.8.1
 * ATUALIZAÇÃO: Controles de Zoom Fixos e Semi-Transparentes
 * =================================================================
 */

/* =================================================================
   1. ESTILOS BASE DO CONTAINER E FIELDSETS
   ================================================================= */
.senar-form-container {
    max-width: 1450px;
    margin: 20px auto;
    padding: 30px 40px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    font-family: 'Open Sans', Arial, sans-serif;
    box-sizing: border-box;
}

#senar-avaliacao-form {
    display: block;
}

.form-step {
    border: none;
    padding: 0;
    margin: 0;
    width: 100%;
}

.form-step.step-hidden {
    display: none !important; 
}

/* TÍTULOS DAS SEÇÕES (AUMENTADO) */
.form-step legend {
    font-size: 3.2rem; /* AUMENTADO DRASTICAMENTE */
    font-weight: 800;
    color: #215a36; /* Verde Escuro Senar */
    padding: 0 0 20px 0;
    margin-bottom: 35px;
    border-bottom: 3px solid #008000;
    width: 100%;
    line-height: 1.2;
}

/* =================================================================
   2. ESTILOS GERAIS DE CAMPO (INPUT, TEXTAREA, SELECT)
   ================================================================= */
.form-group {
    margin-bottom: 35px; /* Espaço maior entre perguntas */
    position: relative;
    width: 100%;
}

/* PERGUNTAS / LABELS (AUMENTADO) */
.form-group label {
    display: block;
    font-weight: 700;
    margin-bottom: 15px;
    color: #333;
    font-size: 2.4rem; /* AUMENTADO DRASTICAMENTE (Aprox 3x o padrão) */
    line-height: 1.3;
}

/* INPUTS GERAIS (AUMENTADO) */
input[type="text"],
input[type="tel"],
input[type="email"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 20px; /* Área de toque muito maior */
    border: 2px solid #ccc; /* Borda mais grossa */
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 1.8rem; /* Texto digitado maior */
    line-height: 1.5;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: #fff;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    height: auto;
}

/* Input de Telefone (Destaque) */
#q02_telefone {
    text-align: center;
    font-weight: 600;
    letter-spacing: 1px;
}

input:focus,
textarea:focus,
select:focus {
    border-color: #008000;
    outline: none;
    box-shadow: 0 0 0 4px rgba(0, 128, 0, 0.15);
}

.form-inline {
    display: flex;
    gap: 30px;
    width: 100%;
    flex-wrap: wrap; /* Permite quebrar linha se ficar apertado */
}

.form-inline .form-group {
    flex: 1;
    min-width: 300px; /* Garante tamanho mínimo */
}

/* Erros de Validação */
.invalid-field {
    border-color: #dc3545 !important; 
    box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.2) !important;
}

/* =================================================================
   3. AUTOCOMPLETE (SUGGESTIONS)
   ================================================================= */
.suggestions-wrapper {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: #ffffff;
    border: 2px solid #008000;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    z-index: 100;
    max-height: 300px;
    overflow-y: auto;
    box-sizing: border-box;
}

.suggestion-item {
    padding: 15px 20px;
    cursor: pointer;
    font-size: 1.6rem; /* Fonte maior nas sugestões */
    color: #333;
    border-bottom: 1px solid #f0f0f0;
}

.suggestion-item:last-child { border-bottom: none; }

.suggestion-item:hover,
.suggestion-item.active { 
    background-color: #f1f8f2;
    color: #006400;
}

/* =================================================================
   4. RÁDIO E CHECKBOX (OPÇÕES) - AUMENTADO
   ================================================================= */
.radio-options,
.checkbox-options {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.radio-options input[type="radio"],
.checkbox-options input[type="checkbox"] {
    display: none;
}

.radio-options label,
.checkbox-options label {
    flex-basis: 100%; 
    flex-grow: 1;
    box-sizing: border-box;
    border-radius: 8px; 
    padding: 15px 10px;
    border: 2px solid #ccc;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: normal;
    text-align: center;
    background: #fff;
    color: #555;
    font-size: 1.6rem; /* Opções maiores */
}

.radio-options label:hover,
.checkbox-options label:hover {
    background-color: #f9f9f9;
    border-color: #bbb;
}

.radio-options input[type="radio"]:checked + label,
.checkbox-options input[type="checkbox"]:checked + label {
    background-color: #008000;
    color: white;
    border-color: #006400;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* Cores Específicas Gênero */
.radio-options input[name="q04_genero"][value="Feminino"]:checked + label {
    background-color: #f1b2dc; border-color: #d68cb9; color: #333;
}
.radio-options input[name="q04_genero"][value="Masculino"]:checked + label {
    background-color: #73d1ea; border-color: #5bb2ca; color: #333;
}
.radio-options input[name="q04_genero"][value="Outro"]:checked + label {
    background-color: #8d73ea; border-color: #6f56c4; color: white;
}

@media (min-width: 768px) {
    .radio-options label {
        flex-basis: 30%; 
    }
}

/* Botões Binários (Sim/Não) */
.radio-options.binary-full-width {
    gap: 20px; 
}
.radio-options.binary-full-width label {
    font-size: 2rem; /* SIM/NAO bem grandes */
    font-weight: bold;
    padding: 20px;
}
.radio-options.binary-full-width input[value="sim"]:checked + label,
.radio-options.binary-full-width input[value="Sim"]:checked + label {
    background-color: #2ECC71; border-color: #27ae60; color: white;
}
.radio-options.binary-full-width input[value="nao"]:checked + label,
.radio-options.binary-full-width input[value="Não"]:checked + label {
    background-color: #e74c3c; border-color: #c0392b; color: white;
}

/* =================================================================
   5. ESCALA DE NOTAS (RATING SCALE 0-10)
   ================================================================= */
.rating-scale {
    display: flex;
    justify-content: space-between; 
    align-items: center;
    padding: 10px 0; 
    gap: 8px; 
    border: none;
    width: 100%;
}

.rating-scale label {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    aspect-ratio: 1 / 1;
    font-size: 1.5rem; /* Aumentei o número da nota */
    color: transparent; 
    border-radius: 6px; 
    cursor: pointer;
    box-sizing: border-box;
    border: 3px solid transparent; 
    opacity: 0.6; 
    transition: transform 0.2s, opacity 0.2s; 
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: relative; 
}

.rating-scale label::before {
    content: attr(data-value); 
    position: absolute;
    font-size: 1.8rem; /* Número visível maior */
    font-weight: bold;
    color: white; 
}

/* Cores de Fundo */
.rating-scale label[data-value="0"] { background-color: #C0392B; }
.rating-scale label[data-value="1"] { background-color: #E74C3C; }
.rating-scale label[data-value="2"] { background-color: #E64A19; }
.rating-scale label[data-value="3"] { background-color: #F38734; }
.rating-scale label[data-value="4"] { background-color: #F79D3A; }
.rating-scale label[data-value="5"] { background-color: #F9C338; }
.rating-scale label[data-value="6"] { background-color: #FDEB60; }
.rating-scale label[data-value="7"] { background-color: #C2DF6E; }
.rating-scale label[data-value="8"] { background-color: #9AC959; }
.rating-scale label[data-value="9"] { background-color: #6FBB51; }
.rating-scale label[data-value="10"] { background-color: #2ECC71; }

.rating-scale label[data-value="6"]::before,
.rating-scale label[data-value="7"]::before { color: #333; }

.rating-scale label:hover {
    opacity: 1; 
    transform: translateY(-5px); 
    z-index: 10;
}

.rating-scale label.selected {
    opacity: 1; 
    transform: scale(1.15); 
    border-color: rgba(0,0,0,0.2);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3); 
    z-index: 20; 
}

/* =================================================================
   6. BOTÕES E FOOTER (CORRIGIDO E PADRONIZADO)
   ================================================================= */
.form-footer {
    display: flex;
    justify-content: space-between; /* Botões nas extremidades */
    align-items: center;
    gap: 20px; /* Espaço entre eles */
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid #eee;
    width: 100%;
}

.form-footer button {
    flex: 1; /* Garante que tenham tamanhos equilibrados */
}

.prev-step-btn, .next-step-btn, .submit-btn {
    padding: 20px 30px; /* Botões maiores */
    border: none;
    border-radius: 8px;
    font-size: 1.4rem; /* Fonte do botão maior */
    font-weight: 800;
    cursor: pointer;
    transition: background-color 0.2s;
    text-transform: uppercase;
}

.prev-step-btn { background-color: #6c757d; color: white; }
.prev-step-btn:hover { background-color: #5a6268; }

.next-step-btn { background-color: #007bff; color: white; }
.next-step-btn:hover { background-color: #0056b3; }

.submit-btn { background-color: #2ECC71; color: white; }
.submit-btn:hover { background-color: #27ae60; }

/* Rodapé Fixo da Página */
.senar-page-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    text-align: center;
    padding: 15px;
    background: #fff;
    font-size: 1.2rem;
    color: #888;
    border-top: 1px solid #eee;
    z-index: 9999; 
    font-family: sans-serif;
    box-sizing: border-box;
}
body { padding-bottom: 70px !important; }


/* =================================================================
   7. BARRA DE PROGRESSO
   ================================================================= */
.progress-bar-container {
    margin: 20px 0 60px;
    position: relative;
    padding-top: 20px; 
}
.progress-bar-line {
    position: absolute;
    top: 45px; left: 0; right: 0; 
    height: 6px;
    background-color: #e0e0e0; 
    z-index: 0;
}
.progress-fill {
    height: 100%;
    width: 0%; 
    background-color: #2ECC71; 
    transition: width 0.4s ease;
}
.progress-steps {
    display: flex;
    justify-content: space-between;
    position: relative;
    z-index: 1; 
}
.step-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-grow: 1;
    color: #999;
}
.step-indicator::before {
    content: attr(data-step);
    width: 40px; height: 40px; /* Bolinha maior */
    line-height: 36px;
    border-radius: 50%;
    background-color: #fff; 
    border: 3px solid #ddd;
    text-align: center;
    font-weight: bold;
    font-size: 1.2rem;
    margin-bottom: 10px;
    transition: all 0.3s;
}
.step-indicator.active::before,
.step-indicator.completed::before { 
    background-color: #2ECC71; 
    color: white;
    border-color: #2ECC71;
}
.step-label {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    display: none;
}
@media (min-width: 800px) {
    .step-label { display: block; }
}

/* =================================================================
   8. ESTADOS ESPECIAIS (LOADING, READ-ONLY)
   ================================================================= */
@keyframes senarSpinner { to { transform: rotate(360deg); } }

.submit-btn.is-loading, .senar-btn-validate.is-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}
.submit-btn.is-loading::after, .senar-btn-validate.is-loading::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 20px; height: 20px;
  margin: -10px;
  border: 2px solid rgba(255,255,255,0.5); 
  border-top-color: #fff; 
  border-radius: 50%;
  animation: senarSpinner 0.6s linear infinite;
}

.alert-success-read-only {
    background-color: #d1e7dd; 
    color: #0f5132; 
    border: 1px solid #badbcc;
    padding: 15px; border-radius: 6px; 
    font-size: 1.4rem;
}

/* =================================================================
   9. MODAIS E JANELAS DE VALIDAÇÃO
   ================================================================= */
#validation-modal,
.senar-modal,
#modal-success-overlay, 
#senar-dynamic-modal {
    position: fixed;
    top: 0; left: 0; 
    width: 100%; height: 100%;
    background: rgba(28, 28, 28, 0.95);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    padding: 15px;
    overflow-y: auto;
    box-sizing: border-box;
    backdrop-filter: blur(4px);
    -webkit-overflow-scrolling: touch;
}

.senar-clean-card,
.modal-success-content,
.modal-content {
    background: #ffffff;
    width: 100%; 
    max-width: 600px; 
    margin: auto; 
    border-radius: 16px;
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    animation: senarSlideUp 0.4s ease-out backwards;
}

@keyframes senarSlideUp {
    from { opacity: 0; transform: scale(0.95) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.senar-clean-card h3,
#success-modal-title {
    color: #215a36;
    font-size: 2.5rem; /* Título Modal */
    font-weight: 800;
    margin: 0 0 20px 0;
    line-height: 1.2;
}

.senar-clean-card p,
#success-modal-body {
    color: #555;
    font-size: 1rem; /* Texto Modal */
    line-height: 1.5;
    margin-bottom: 30px;
}

/* Texto de Rodapé do Modal (CINZA ESCURO E ESPAÇADO) */
.modal-copyright-text {
    display: block;
    margin-top: 35px !important;
    color: #666 !important;
    font-size: 1.4rem !important;
    text-decoration: none;
    width: 100%;
    text-align: center;
    font-weight: normal;
}

#validation-modal #validation_phone {
    width: 100%;
    height: 70px;
    padding: 10px;
    font-size: 3.5rem; 
    font-weight: 600;
    text-align: center;
    color: #333;
    border: 2px solid #ccc;
    border-radius: 8px;
    background: #f9f9f9;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.senar-btn-validate {
    background-color: #28a745;
    color: white;
    font-size: 2.2rem;
    font-weight: 800;
    text-transform: uppercase;
    border: none;
    border-radius: 8px;
    height: 65px;
    width: 100%;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 15px;
    box-shadow: 0 4px 10px rgba(40, 167, 69, 0.3);
}

.senar-btn-validate:hover {
    background-color: #218838;
    transform: translateY(-2px);
}

.modal-close-btn {
    background: #215a36;
    color: #fff;
    padding: 15px;
    width: 100%;
    border-radius: 8px;
    border: none;
    font-weight: bold;
    font-size: 2rem;
    cursor: pointer;
    text-transform: uppercase;
    margin-top: 15px;
}

/* =================================================================
   10. CONTROLES DE ZOOM E RESPONSIVIDADE
   ================================================================= */
.guidance-zoom-controls {
    position: fixed; /* MUDANÇA: AGORA É FIXO */
    top: 30px;
    right: 20px;
    display: flex;
    gap: 12px;
    z-index: 10005; /* ACIMA DE TUDO */
    opacity: 0.3; /* SEMI-TRANSPARENTE POR PADRÃO */
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.guidance-zoom-controls:hover, 
.guidance-zoom-controls:active,
.guidance-zoom-controls:focus-within {
    opacity: 1; /* TOTALMENTE VISÍVEL AO INTERAGIR */
}

.senar-zoom-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid #215a36;
    background-color: rgba(255, 255, 255, 0.95);
    color: #215a36;
    font-weight: 800;
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: all 0.2s;
}

.senar-zoom-btn:hover, .senar-zoom-btn:active {
    background-color: #215a36;
    color: #fff;
    transform: scale(1.15);
}

@media (max-width: 768px) {
    .senar-form-container { padding: 20px 15px; margin: 10px 5px; }
    
    /* Fontes um pouco menores no mobile, mas ainda GRANDES */
    .form-step legend { font-size: 2.5rem; }
    .form-group label { font-size: 1.8rem; }
    input[type="text"], select, textarea { font-size: 1.5rem; }
    
    .senar-clean-card,
    .modal-success-content {
        padding: 30px 20px;
        width: 100%; 
    }

    #validation-modal h3 { font-size: 2.8rem; }
    #validation-modal p { font-size: 1.5rem; }
    
    #validation-modal #validation_phone,
    .senar-btn-validate {
        height: 60px;
        font-size: 2.5rem;
    }

    /* Botões de zoom em posições seguras no mobile */
    .guidance-zoom-controls {
        top: 25px;
        right: 15px;
        opacity: 0.4; /* Um pouco mais visível no mobile */
    }
}