/* ==========================================================================
   FOLHA DE ESTILO CUSTOMIZADA - PALETA AZUL SELETA (CONTROLE ABSOLUTO)
   ========================================================================== */

:root {
    --bg-dark-blue: #1C2B3E;    /* Azul Marinho Fechado (Fundo Principal) */
    --panel-blue: #3C678E;      /* Azul Muted (Fundo dos Cards/Containers) */
    --primary-blue: #2181BD;    /* Azul Real (Títulos, Cabeçalhos e Destaques) */
    --accent-light: #6DADD8;    /* Azul Céu (Linhas, Bordas e Elementos Secundários) */
    --highlight-blue: #80CBF3;  /* Azul Brilhante (Botões de Ação, Focos e Progresso) */
    --error-terracota: #832300; /* Alerta de Erro - Mantido para Destaque Crítico */
}

/* ==========================================================================
   1. ESTRUTURA GERAL E FUNDO (BODY)
   ========================================================================== */
html body, 
html body.surveys-list,
html body #outerframeContainer,
html #outerframeContainer {
    background-color: var(--bg-dark-blue) !important;
    background-image: none !important;
    color: #ffffff !important;
}

/* ==========================================================================
   2. CONTAINERS DE PERGUNTA (CARDS)
   ========================================================================== */
html body .question-container {
    background: var(--panel-blue) !important;
    color: #ffffff !important;
    border-bottom: 3px solid var(--accent-light) !important;
    border-radius: 12px !important;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25) !important;
    padding: 25px !important;
    margin-bottom: 2em !important;
}

html body .question-title-container {
    color: var(--highlight-blue) !important;
    font-weight: 700 !important;
    border-bottom: 2px solid var(--accent-light) !important;
    padding-top: 1em !important;
    padding-bottom: 1em !important;
}

/* Textos Auxiliares e Dicas da Pergunta */
html body .ls-questionhelp, 
html body .help-block, 
html body .question-help-container {
    color: var(--highlight-blue) !important;
    border-color: var(--accent-light) !important;
}

/* ==========================================================================
   3. ELEMENTOS DE FORMULÁRIO (INPUTS, RADIOS, CHECKBOXES e DROPDOWNS)
   ========================================================================== */
/* Caixas de Texto e Textareas */
html body .form-control, 
html body input[type="text"], 
html body textarea {
    background-color: var(--bg-dark-blue) !important;
    border: 1px solid var(--accent-light) !important;
    color: #ffffff !important;
    border-radius: 6px !important;
}

html body .form-control:focus {
    border-color: var(--highlight-blue) !important;
    box-shadow: 0 0 0 0.25rem rgba(128, 203, 243, 0.25) !important;
}

/* Seleções Suspensas (Dropdowns / Selects) */
html body select.form-select {
    background-color: var(--bg-dark-blue) !important;
    color: #ffffff !important;
    border: 1px solid var(--accent-light) !important;
}

html body select.form-select option {
    background-color: var(--panel-blue) !important;
    color: #ffffff !important;
}

/* Radio Buttons e Checkboxes Estilizados (Bootstrap) */
html body .form-check-input:checked {
    background-color: var(--highlight-blue) !important;
    border-color: var(--highlight-blue) !important;
}

html body .form-check-input:focus {
    border-color: var(--accent-light) !important;
    box-shadow: 0 0 0 0.25rem rgba(109, 173, 216, 0.25) !important;
}

/* ==========================================================================
   4. BOTÕES DE NAVEGAÇÃO E AÇÃO
   ========================================================================== */
/* Botão Avançar / Enviar (Destaque Máximo) */
html body .btn-primary, 
html body #ls-button-submit, 
html body .move-next-button {
    background-image: none !important;
    background-color: var(--highlight-blue) !important;
    border-color: var(--highlight-blue) !important;
    color: var(--bg-dark-blue) !important; /* Texto escuro para forte contraste */
    font-weight: bold !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    border-radius: 8px !important;
    padding: 12px 30px !important;
    box-shadow: 0 4px 12px rgba(128, 203, 243, 0.3) !important;
    transition: all 0.3s ease !important;
}

html body .btn-primary:hover, 
html body #ls-button-submit:hover, 
html body .move-next-button:hover {
    background-color: var(--accent-light) !important;
    border-color: var(--accent-light) !important;
    color: #ffffff !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 18px rgba(109, 173, 216, 0.4) !important;
}

/* Botão Anterior / Voltar (Outline Discreto) */
html body .btn-default, 
html body .move-prev-button {
    background-image: none !important;
    background-color: transparent !important;
    border: 2px solid var(--accent-light) !important;
    color: var(--accent-light) !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    padding: 12px 25px !important;
    transition: all 0.2s ease !important;
}

html body .btn-default:hover, 
html body .move-prev-button:hover {
    background-color: rgba(109, 173, 216, 0.1) !important;
    color: var(--highlight-blue) !important;
    border-color: var(--highlight-blue) !important;
}

/* ==========================================================================
   5. MATRIZES, TABELAS E LINHAS (ARRAY QUESTIONS) - CORREÇÃO DE CONTRASTE
   ========================================================================== */
/* Cabeçalho Superior da Matriz */
html body .ls-answers .ls-heading th {
    background-color: var(--primary-blue) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    border: 1px solid var(--panel-blue) !important;
}

/* Força TODOS os textos de dentro da tabela (perguntas e labels) a ficarem brancos */
html body .table td, 
html body .table th,
html body .ls-answers td,
html body .ls-answers label,
html body .answertext {
    color: #ffffff !important;
    font-weight: 600 !important; /* Deixa o texto levemente mais grosso para facilitar a leitura */
}

/* Ajusta as linhas zebradas (ls-even) com um fundo ligeiramente mais claro que o principal */
html body .ls-even {
    background-color: rgba(255, 255, 255, 0.07) !important; /* Injeção de brilho sutil em vez de azul escuro */
}

/* Linhas ímpares (as que não são ls-even) ganham um fundo sutil para não sumirem no escuro */
html body .ls-answers tr {
    background-color: rgba(255, 255, 255, 0.02) !important;
}

/* Linha ativa ao passar o mouse: Brilha em Azul Real para guiar o olhar do usuário */
html body .table-hover tbody tr:hover,
html body .ls-answers tbody tr:hover,
html body .ls-answers tr:hover td {
    background-color: rgba(33, 129, 189, 0.35) !important; 
}

/* Bordas Gerais de Tabelas - Mudadas para o azul céu para delimitar bem o espaço */
html body .table td, 
html body .table th,
html body .table-bordered {
    border-color: rgba(109, 173, 216, 0.3) !important;
}

/* ==========================================================================
   6. BARRAS DE NAVEGAÇÃO (NAVBAR SUPERIOR)
   ========================================================================== */
html body .navbar-default, 
html body .navbar.navbar-fixed-top {
    background-color: var(--bg-dark-blue) !important;
    border-bottom: 2px solid var(--primary-blue) !important;
}

html body .navbar-nav .nav-link, 
html body .navbar-brand {
    color: #ffffff !important;
}

html body .navbar-nav .nav-link:hover {
    color: var(--highlight-blue) !important;
}

/* ==========================================================================
   7. BARRAS DE PROGRESSO E ALERTAS CRÍTICOS
   ========================================================================= */
/* Trilha da Barra de Progresso */
html body .top-container .progress {
    height: 21px !important;
    background-color: var(--bg-dark-blue) !important;
    border: 1px solid var(--accent-light) !important;
    border-radius: 10px !important;
    overflow: hidden !important;
}

/* Preenchimento Dinâmico */
html body .progress .progress-bar {
    background-color: var(--primary-blue) !important;
    background-image: none !important;
    line-height: 21px !important;
    color: #ffffff !important;
    font-weight: bold !important;
}

/* Alertas Críticos de Validação (Omissão de Resposta) */
html body .alert-danger, 
html body .question-valid-container .text-danger {
    background-color: var(--error-terracota) !important;
    color: #ffffff !important;
    border: 1px solid var(--accent-light) !important;
    border-radius: 8px !important;
}

/* Alertas Informativos / Balões de Instrução */
html body .alert-info, 
html body .question-valid-container .text-info {
    background-color: var(--panel-blue) !important;
    color: var(--highlight-blue) !important;
    border: 1px solid var(--accent-light) !important;
}

/* ==========================================================================
   8. CUSTOMIZAÇÃO DA BARRA DE INQUÉRITO NÃO ATIVO (ALERT-WARNING)
   ========================================================================== */
html body .alert-warning,
html body .survey-warning-container,
html body #yii-flash-message .alert-warning {
    background-image: none !important;
    background-color: var(--panel-blue) !important;
    border: 2px solid var(--highlight-blue) !important;
    color: #ffffff !important;
    border-radius: 8px !important;
    padding: 15px 20px !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
}

html body .alert-warning a,
html body .alert-warning .glyphicon,
html body .alert-warning .fa {
    color: var(--highlight-blue) !important;
    font-weight: bold !important;
}

/* ==========================================================================
   9. REMOVER LOGO GIGANTE ACIMA DA LISTA DE INQUÉRITOS (PÁGINA PRINCIPAL)
   ========================================================================== */
/* Alvo agressivo e total no container do jumbotron e em qualquer logo de listagem */
html body #surveys-list-jumbotron,
html body .surveys-list-jumbotron,
html body .jumbotron,
html body img.site-surveylist-logo,
html body .site-surveylist-logo,
html body #surveys-list-container img {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    width: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Mantém o rodapé e a logo inferior visíveis e operacionais */
html body #surveyListFooter,
html body .poweredby {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* ==========================================================================
   10. DESATIVAR CAIXA EXTERNA VIA HIERARQUIA
   ========================================================================== */

/* 1. FORÇA TRANSPARÊNCIA ABSOLUTA EM TODA A ESTRUTURA E CONTAINERS DA DESCRIÇÃO */
html body .group-description-container,
html body .group-description,
html body [id*="group-description"],
html body .space-col,
html body div.row:has(.group-description) {
    background-color: transparent !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* 2. CONFIGURA APENAS O CONTEÚDO INTERNO REAL (A CAIXA QUE CONTÉM O TEXTO)
   Aqui aplicamos o card azul correto, a fonte branca e a borda azul céu */
html body .group-description p,
html body .group-description div.text-center,
html body .group-description > div {
    background-color: var(--panel-blue) !important;   /* Fundo azul do card */
    color: #ffffff !important;                        /* Texto 100% branco e legível */
    border: 1px solid var(--accent-light) !important; /* Borda azul céu */
    border-radius: 8px !important;                    /* Arredondamento harmônico */
    padding: 20px !important;                         /* Espaçamento interno para o texto */
    margin-top: 10px !important;
    margin-bottom: 2em !important;                    /* Afastamento seguro das perguntas */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
    display: block !important;                        /* Garante que se comporte como um card isolado */
}

/* 3. RESET DE SEGURANÇA PARA SUB-TAGS (Evita conflitos com o editor de texto) */
html body .group-description p *,
html body .group-description span {
    background-color: transparent !important;
    background: transparent !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: none !important;
}

/* Links internos */
html body .group-description p a {
    color: var(--highlight-blue) !important;
    font-weight: bold !important;
}

/* ==========================================================================
   11. CORREÇÃO DE CONTRASTE EM POPUPS E MODAIS
   ========================================================================== */

/* Garante o fundo correto no corpo do modal e no cabeçalho/rodapé */
html body .modal-content,
html body .modal-header,
html body .modal-body,
html body .modal-footer,
html body .file-upload-modal {
    background-color: var(--panel-blue) !important;
    border-color: var(--accent-light) !important;
    color: #ffffff !important;
}

/* Força os títulos e textos de dentro do popup a respeitarem o contraste */
html body .modal-title,
html body .modal-body p,
html body .modal-body div,
html body .modal-body label {
    color: #ffffff !important;
}

/* Ajuste específico para o botão de fechar (o 'X' do modal) */
html body .modal-header .btn-close,
html body .modal-header .close {
    color: #ffffff !important;
    filter: invert(1) !important; /* Caso o LimeSurvey use o ícone em SVG do Bootstrap 5 */
    opacity: 0.8 !important;
}

html body .modal-header .btn-close:hover {
    opacity: 1 !important;
}

/* Se as notificações utilizarem alertas estilo Toast/Flash internos flutuantes */
html body .bootbox,
html body .modal-dialog {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5) !important;
}

/* ==========================================================================
   12. FORÇAR CONTRASTE NA MENSAGEM DE ERRO DO SISTEMA
   ========================================================================== */

/* Se o LimeSurvey estiver usando o container geral de mensagens de erro do Yii */
html body #outerframeContainer .error,
html body .message-box.error,
html body .main-error-container,
html body #surveys-list-container {
    background-color: var(--error-terracota) !important;
    color: #ffffff !important;
}

/* Captura qualquer container genérico que o editor de templates use para erro */
html body div[class*="error"],
html body div[id*="error"] {
    background-color: var(--error-terracota) !important;
    color: #ffffff !important;
}

/* Garante que TODAS as tags de texto dentro desse bloco fiquem legíveis */
html body div[class*="error"] p,
html body div[class*="error"] td,
html body div[class*="error"] span,
html body div[id*="error"] p,
html body div[id*="error"] td,
html body div[id*="error"] span {
    color: #ffffff !important;
}

/* Estilização cirúrgica para o link do seu e-mail dentro do erro */
html body div[class*="error"] a,
html body div[id*="error"] a {
    color: var(--highlight-blue) !important;
    text-decoration: underline !important;
    font-weight: bold !important;
}