/********************************************************
    OLTRE – Limesurvey Custom Theme
    Versione Definitiva SOLO Palette Oltre
********************************************************/
/* ===================================================== */
/* 1️⃣ OVERRIDE BOOTSTRAP COMPLETO                       */
/* ===================================================== */
html:root {
    --bs-primary: #A74767 !important;
    --bs-success: #A74767 !important;
    --bs-info: #A74767 !important;
    --bs-link-color: #A74767 !important;
}
/* ===================================================== */
/* 2️⃣ RESET TOTALE COLORI BOOTSTRAP (ANTI VERDE)       */
/* ===================================================== */
body .text-primary,
body .text-success,
body .text-info,
body .text-warning,
body .text-danger {
    color: #A74767 !important;
}
body .bg-primary,
body .bg-success,
body .bg-info {
    background-color: #A74767 !important;
    color: #ffffff !important;
}
/* ===================================================== */
/* 3️⃣ BASE                                               */
/* ===================================================== */
body {
    background-color: #F9FBFB;
    color: #383A3A !important;
    font-family: 'Montserrat', sans-serif !important;
}
body, button, input, select, textarea {
    font-family: 'Montserrat', sans-serif !important;
}
h1 {
    color: #A74767 !important;
    font-weight: 700;
}
h2, h3 {
    font-weight: 600;
}
label {
    font-weight: 600;
}
/* ===================================================== */
/* 4️⃣ WELCOME SECTION (FIX VERDE)                       */
/* ===================================================== */
body .survey-welcome,
body .survey-welcome.text-primary,
body #welcome-container .survey-welcome {
    color: #A74767 !important;
    font-weight: 600;
}
body #welcome-container {
    position: relative;
    padding: 30px 30px 30px 40px;
    background: linear-gradient(
        135deg,
        rgba(167,71,103,0.08),
        rgba(167,71,103,0.03)
    );
    border-radius: 14px;
}
body #welcome-container::before {
    content: "";
    position: absolute;
    left: 18px;
    top: 20px;
    bottom: 20px;
    width: 4px;
    background: #A74767;
    border-radius: 10px;
}
/* ===================================================== */
/* 5️⃣ PRIVACY HEADER                                    */
/* ===================================================== */
body .ls-privacy-head,
body .ls-privacy-head.text-primary,
body .ls-privacy-head.h4.text-primary {
    color: #A74767 !important;
    font-weight: 600;
}
/* ===================================================== */
/* 6️⃣ PULSANTI (RADIUS COERENTE)                        */
/* ===================================================== */
body .btn,
body .btn-primary,
body .btn-success,
body .btn-outline-secondary,
body .btn-default {
    border-radius: 14px !important;
}
body .btn-primary {
    background-color: #A74767 !important;
    border-color: #A74767 !important;
    color: #ffffff !important;
    padding: 10px 22px;
}
body .btn-primary:hover {
    background-color: #8B3652 !important;
    border-color: #8B3652 !important;
}
body .btn-success {
    background-color: #A74767 !important;
    border-color: #A74767 !important;
}
body .btn-success:hover {
    background-color: #8B3652 !important;
}
body .btn-outline-secondary,
body .btn-default {
    border: 2px solid #A74767 !important;
    color: #A74767 !important;
    background: transparent !important;
}
body .btn-outline-secondary:hover,
body .btn-default:hover {
    background-color: #A74767 !important;
    color: #ffffff !important;
}
/* ===================================================== */
/* 7️⃣ PROGRESS BAR                                       */
/* ===================================================== */
body .progress-bar {
    background-color: #A74767 !important;
}
/* ===================================================== */
/* 8️⃣ RADIO & CHECKBOX                                   */
/* ===================================================== */
body input[type="radio"],
body input[type="checkbox"] {
    accent-color: #A74767 !important;
}
body .radio-item input[type="radio"] + label::before {
    border: 2px solid #A74767 !important;
    background-color: #ffffff !important;
}
body .radio-item input[type="radio"]:checked + label::after {
    background-color: #A74767 !important;
}
/* SOLO COLORE FONT (niente background sulle righe selezionate/hover) */
body .radio-item input[type="radio"]:checked + label {
    background-color: transparent !important;
    color: #A74767 !important;
    font-weight: 600;
}
body .radio-item:hover label {
    background-color: transparent !important;
}
body .checkbox-item input[type="checkbox"]:checked + label {
    background-color: transparent !important;
    color: #A74767 !important;
    font-weight: 600;
}
/* ===================================================== */
/* 9️⃣ INPUT FOCUS                                        */
/* ===================================================== */
body .form-control:focus {
    border-color: #A74767 !important;
    box-shadow: 0 0 0 0.2rem rgba(167,71,103,0.25) !important;
}
/* ===================================================== */
/* 🔟 PRIVACY BOX – STESSO RADIUS                        */
/* ===================================================== */
.card-primary .card-header.bg-primary {
    background-color: #A74767 !important;
    border-color: #A74767 !important;
    color: #ffffff !important;
}
body .card.card-primary {
    border: 1px solid #A74767 !important;
    border-radius: 14px !important;
    overflow: hidden;
}
body .card.card-primary .card-header {
    border-top-left-radius: 14px !important;
    border-top-right-radius: 14px !important;
}
body .card.card-primary .card-footer {
    border-bottom-left-radius: 14px !important;
    border-bottom-right-radius: 14px !important;
}
/* ===================================================== */
/* 11️⃣ TESTO GENERALE                                    */
/* ===================================================== */
body .top-container,
body .group-description,
body .survey-description,
body #welcome-container p {
    color: #383A3A !important;
}
body .asterisk {
    color: #A74767 !important;
}
/* ===================================================== */
/* 12️⃣ FIX PREVIEW EDITOR                                */
/* ===================================================== */
html body .emtip.error,
html body .fruity .emtip.error {
    color: #A74767 !important;
}
html body .emtip.error .fa,
html body .fruity .emtip.error .fa {
    color: #A74767 !important;
}
/* ===================================================== */
/* 13️⃣ OVERRIDE VARIATION SEA_GREEN (ANTI VERDE RESIDUO) */
/*     Specificità rinforzata: body.fruity + doppia class */
/*     per vincere SEMPRE su .fruity .text-* di sea_green */
/*     a prescindere dall'ordine di caricamento.          */
/* ===================================================== */

/* --- Text color classes (hint, tip, help, valid, descrizioni) --- */
body.fruity .text-primary,
body.fruity .text-info,
body.fruity .text-success,
body.fruity .text-warning,
body.fruity .text-danger,
body.fruity a.text-primary,
body.fruity a.text-info,
body.fruity a.text-success,
.fruity .text-info.text-info,
.fruity .text-primary.text-primary,
.fruity .text-success.text-success,
.fruity .text-warning.text-warning,
.fruity .text-danger.text-danger {
    color: #A74767 !important;
}

/* --- Descrizione survey (testo in .survey-description + <p> figli) --- */
/*     Il div ha classe .text-info che lo farebbe verde. Forziamo        */
/*     grigio brand e copriamo sia nodi testo liberi sia <p> annidati.   */
body.fruity .survey-description,
body.fruity .survey-description.text-info,
body.fruity .survey-description.text-info.text-center,
body.fruity .survey-description p,
body.fruity .survey-description > *,
.fruity .survey-description.survey-description,
.fruity .survey-description.survey-description p {
    color: #383A3A !important;
    background-color: transparent !important;
}

/* --- Descrizioni di gruppo / welcome text / question text --- */
/*     Stesso pattern: se LimeSurvey li marca .text-info non devono      */
/*     diventare verdi.                                                   */
body.fruity .group-description,
body.fruity .group-description.text-info,
body.fruity .group-description p,
body.fruity .welcome-text,
body.fruity .welcome-text.text-info,
body.fruity .question-text,
body.fruity .question-text.text-info,
body.fruity #welcome-container p {
    color: #383A3A !important;
}

/* --- LimeSurvey EM tip / hint / valid containers --- */
/*     "Scegliere solo una delle seguenti voci"           */
/*     "Selezionare al massimo 3 risposte" ecc.            */
/*     SOLO colore font (no background, no border).        */
body.fruity .question-valid-container,
body.fruity .question-valid-container.text-info,
body.fruity .ls-em-tip,
body.fruity .em_default,
body.fruity .ls-question-message,
body.fruity .ls-question-message.ls-em-success,
body.fruity .ls-question-message.em_default,
body.fruity .ls-question-message.em_default.ls-em-success,
body.fruity .ls-em-success,
body.fruity .ls-questionhelp,
.fruity .question-valid-container,
.fruity .question-valid-container.text-info,
.fruity .ls-em-tip,
.fruity .em_default,
.fruity .ls-question-message,
.fruity .ls-question-message.ls-em-success,
.fruity .ls-question-message.em_default,
.fruity .ls-question-message.em_default.ls-em-success,
.fruity .ls-em-success,
.fruity .ls-questionhelp {
    color: #A74767 !important;
    background-color: transparent !important;
    background: transparent !important;
    border-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* --- EM tip / success / error icons (font-awesome) --- */
.fruity .ls-em-tip .fa,
.fruity .ls-em-success .fa,
.fruity .em_default .fa,
.fruity .question-valid-container .fa {
    color: #A74767 !important;
}

/* --- Alert / badge success (caso Bootstrap/LimeSurvey) --- */
.fruity .alert-success,
.fruity .badge-success,
.fruity .bg-success {
    background-color: #A74767 !important;
    border-color: #A74767 !important;
    color: #ffffff !important;
}

/* --- Awesome-Bootstrap-Checkbox override: box (::before) e spunta (::after) --- */
/*     Specificità rinforzata con body.fruity + varianti wrapper possibili     */
/*     (checkbox-item / abc-checkbox / checkbox / answer-item) per vincere     */
/*     il verde di sea_green in qualsiasi struttura DOM LimeSurvey generi.      */
body.fruity .checkbox-item input[type="checkbox"]:checked + label::before,
body.fruity .radio-item input[type="radio"]:checked + label::before,
body.fruity .abc-checkbox input[type="checkbox"]:checked + label::before,
body.fruity .abc-radio input[type="radio"]:checked + label::before,
body.fruity .checkbox input[type="checkbox"]:checked + label::before,
body.fruity .answer-item input[type="checkbox"]:checked + label::before,
body.fruity .answer-item input[type="radio"]:checked + label::before,
body.fruity li.checkbox-item input[type="checkbox"]:checked + label::before,
body.fruity li.radio-item input[type="radio"]:checked + label::before {
    background-color: #A74767 !important;
    border-color: #A74767 !important;
}
body.fruity .checkbox-item input[type="checkbox"]:checked + label::after,
body.fruity .radio-item input[type="radio"]:checked + label::after,
body.fruity .abc-checkbox input[type="checkbox"]:checked + label::after,
body.fruity .abc-radio input[type="radio"]:checked + label::after,
body.fruity .checkbox input[type="checkbox"]:checked + label::after,
body.fruity .answer-item input[type="checkbox"]:checked + label::after,
body.fruity .answer-item input[type="radio"]:checked + label::after {
    color: #ffffff !important;
    border-color: #ffffff !important;
}
body.fruity .checkbox-item input[type="checkbox"] + label::before,
body.fruity .radio-item input[type="radio"] + label::before,
body.fruity .abc-checkbox input[type="checkbox"] + label::before,
body.fruity .abc-radio input[type="radio"] + label::before,
body.fruity .answer-item input[type="checkbox"] + label::before,
body.fruity .answer-item input[type="radio"] + label::before {
    border-color: #A74767 !important;
}

/* --- Label checkbox/radio: SOLO COLORE FONT (niente background riga) --- */
body.fruity .checkbox-item input[type="checkbox"]:checked + label,
body.fruity .radio-item input[type="radio"]:checked + label,
.fruity .checkbox-item input[type="checkbox"]:checked + label,
.fruity .radio-item input[type="radio"]:checked + label {
    background-color: transparent !important;
    color: #A74767 !important;
}
body.fruity .radio-item:hover label,
body.fruity .checkbox-item:hover label,
.fruity .radio-item:hover label,
.fruity .checkbox-item:hover label {
    background-color: transparent !important;
}

/* --- Array/matrix selected cells --- */
.fruity .ls-answers .answer-item.highlighted,
.fruity .array-flexible-row .answer-item.highlighted,
.fruity table.ls-answers td.answer-item.highlighted {
    background-color: rgba(167,71,103,0.12) !important;
    color: #A74767 !important;
}

/* --- Progress bar (vince anche su .fruity) --- */
.fruity .progress-bar,
.fruity .progress .progress-bar {
    background-color: #A74767 !important;
}

/* --- Slider (noUiSlider / jQuery UI) --- */
.fruity .noUi-connect,
.fruity .ui-slider-range,
.fruity .ui-slider .ui-slider-handle {
    background-color: #A74767 !important;
    border-color: #A74767 !important;
}

/* --- Datepicker jQuery UI --- */
.fruity .ui-datepicker .ui-state-active,
.fruity .ui-datepicker .ui-state-highlight {
    background: #A74767 !important;
    border-color: #A74767 !important;
    color: #ffffff !important;
}