/* ==========================================================================
   MediStrata - Resettaggio Globale del Testo (Dark Mode)
   ========================================================================== */

/* 1. Forzatura globale del colore testo su tutti gli elementi */
body, 
html, 
article, 
p, 
span, 
div, /* ==========================================================================
   MediStrata Custom Styles for LimeSurvey (fruity_twentythree)
   ========================================================================== */

/* 1. Sfondo e Tipografia Globale */
body, 
html, 
article, 
#dynamicreload, 
.outerframe,
.space-col {
    background-color: #0F2747 !important;
    color: #FFFFFF !important;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}

/* 2. Header Personalizzato MediStrata */
.ms-header {
    background-color: #0F2747;
    padding: 20px 0;
    border-bottom: 1px solid rgba(120, 160, 200, 0.2);
    margin-bottom: 30px;
}

.ms-logo-link {
    display: inline-block;
    text-decoration: none;
}

.ms-logo-link svg {
    height: 40px;
    width: auto;
}

.ms-lang-switcher select, 
.ms-lang-switcher button {
    background-color: #153258 !important;
    color: #FFFFFF !important;
    border: 1px solid #78A0C8 !important;
    border-radius: 6px;
    padding: 4px 10px;
}

/* 3. Card e Contenitori Domande */
.card, 
.well, 
.panel, 
.question-container,
.survey-welcome,
.completed-wrapper {
    background-color: #153258 !important; /* Blu leggermente più chiaro per evidenziare le schede */
    border: 1px solid rgba(120, 160, 200, 0.25) !important;
    border-radius: 12px !important;
    color: #FFFFFF !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25) !important;
    padding: 20px;
    margin-bottom: 25px;
}

/* Titoli, domande ed etichette */
h1, h2, h3, h4, h5, h6,
.question-text, 
.question-title,
.survey-name {
    color: #FFFFFF !important;
    font-family: 'Poppins', sans-serif !important;
    font-weight: 600 !important;
}

/* Sottotitoli e testi di aiuto in azzurro brand */
.help-block, 
.explanation-text, 
.question-valid-container,
.text-muted {
    color: #78A0C8 !important;
}

/* 4. Campi di Input e Selezione */
.form-control, 
.form-select, 
textarea, 
input[type="text"], 
input[type="email"], 
input[type="number"] {
    background-color: #0F2747 !important;
    border: 1px solid #78A0C8 !important;
    color: #FFFFFF !important;
    border-radius: 8px !important;
    padding: 10px 14px !important;
}

.form-control:focus, 
.form-select:focus {
    border-color: #E5873C !important;
    box-shadow: 0 0 0 0.25rem rgba(229, 135, 60, 0.3) !important;
    color: #FFFFFF !important;
}

/* Checkbox e Radio button */
.form-check-input:checked {
    background-color: #E5873C !important;
    border-color: #E5873C !important;
}

.form-check-label, 
.control-label {
    color: #FFFFFF !important;
}

/* 5. Pulsanti (Invia, Avanti, Indietro) */
.btn-primary, 
#ls-button-submit, 
.btn-submit,
.btn-next {
    background-color: #E5873C !important; /* Arancione MediStrata */
    border-color: #E5873C !important;
    color: #FFFFFF !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    padding: 10px 24px !important;
    transition: background-color 0.2s ease, border-color 0.2s ease !important;
}

.btn-primary:hover, 
#ls-button-submit:hover,
.btn-submit:hover,
.btn-next:hover {
    background-color: #d4762b !important;
    border-color: #d4762b !important;
}

.btn-outline-secondary, 
.btn-secondary,
.btn-prev {
    background-color: transparent !important;
    border: 1px solid #78A0C8 !important;
    color: #78A0C8 !important;
    border-radius: 8px !important;
}

.btn-outline-secondary:hover, 
.btn-secondary:hover,
.btn-prev:hover {
    background-color: rgba(120, 160, 200, 0.15) !important;
    color: #FFFFFF !important;
}

/* 6. Barra di avanzamento */
.progress {
    background-color: #153258 !important;
    border-radius: 10px !important;
    height: 12px !important;
    border: 1px solid rgba(120, 160, 200, 0.2);
}

.progress-bar {
    background-color: #78A0C8 !important;
}

/* 7. Footer MediStrata */
.ms-footer {
    background-color: #0F2747;
    padding: 25px 0;
    border-top: 1px solid rgba(120, 160, 200, 0.2);
    margin-top: 40px;
    color: #78A0C8;
    font-size: 0.9rem;
}

.ms-footer-email {
    color: #FFFFFF;
    text-decoration: none;
}

.ms-footer-email:hover {
    color: #E5873C;
}
li, 
label, 
td, 
th, 
h1, h2, h3, h4, h5, h6, 
input, 
select, 
textarea, 
button,
.survey-name,
.survey-description,
.welcome-text,
.group-name,
.group-description,
.question-text,
.answer-option,
.label-text,
.form-check-label {
    color: #FFFFFF !important;
}

/* 2. Menu a tendina e opzioni (<select> e <option>) */
select, 
.form-select, 
.form-control {
    background-color: #0F2747 !important;
    color: #FFFFFF !important;
    border: 1px solid #78A0C8 !important;
}

/* Fix specifico per il menu a discesa dei browser (il popup delle opzioni) */
select option {
    background-color: #0F2747 !important;
    color: #FFFFFF !important;
}

/* 3. Tabelle, Griglie e Matrici di domande */
.table, 
.table > :not(caption) > * > *, 
.table td, 
.table th,
.table-striped > tbody > tr:nth-of-type(odd) > *,
.ls-table-responsive {
    background-color: transparent !important;
    color: #FFFFFF !important;
    border-color: rgba(120, 160, 200, 0.25) !important;
}

/* Righe alternate delle tabelle con leggero contrasto */
.table-striped > tbody > tr:nth-of-type(odd) {
    background-color: rgba(255, 255, 255, 0.03) !important;
}

.table-hover > tbody > tr:hover > * {
    background-color: rgba(120, 160, 200, 0.1) !important;
    color: #FFFFFF !important;
}

/* 4. Pulsanti di scelta / Scale Likert (Bootstrap Buttons) */
.btn-outline-secondary,
.btn-outline-primary,
.btn-check + .btn {
    background-color: #0F2747 !important;
    border-color: #78A0C8 !important;
    color: #FFFFFF !important;
}

.btn-check:checked + .btn,
.btn-check:active + .btn,
.btn-primary {
    background-color: #E5873C !important;
    border-color: #E5873C !important;
    color: #FFFFFF !important;
}

/* 5. Finestre Popup, Alert e Modal */
.modal-content, 
.modal-header, 
.modal-body, 
.modal-footer,
.popover,
.tooltip-inner {
    background-color: #153258 !important;
    color: #FFFFFF !important;
    border: 1px solid #78A0C8 !important;
}

.btn-close {
    filter: invert(1) grayscale(100%) brightness(200%) !important; /* Rende la 'X' di chiusura bianca */
}

/* 6. Testi secondari e istruzioni di aiuto */
.text-muted, 
.help-block, 
.explanation-text, 
.ls-question-help,
.question-valid-container {
    color: #78A0C8 !important; /* Azzurro per differenziare i testi guida dal testo principale */
}