/******************
    User custom CSS
    ---------------

    In this file you can add your own custom CSS
    It will be loaded last, so you can override any other property.
    Also, it will never be updated. So if you inheritate a core template and just add here some CSS, you'll still benefit of all the updates
*/

/* --------------------------------------------------
   TABLES
-------------------------------------------------- */

.table-bordered > thead > tr > th,
.table-bordered > thead > tr > td {
  border: 1px solid #dadada;
}

.table > :not(:first-child) {
  border-top: 2px solid #e0e1ec;
}

[class*="array-"] .answer-container.col-12 {
 padding-left: 0;
 padding-right: 0;
}


/* --------------------------------------------------
   NAVBAR
-------------------------------------------------- */

.container-fluid {
  justify-content: initial !important;
}

.navbar {
 padding-top: 0;
}

#navbar {
  padding-top: 0 !important;    
  padding-bottom: 40px;
}

#survey-nav {
  box-shadow: 
    0 2px 4px rgba(0,0,0,0.075),
    0 10px 0 rgba(0,0,0,0.01);
}

.navbar-toggler {
  border-color: rgba(0,0,0,.1);
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath stroke='rgba(0, 0, 0, 0.55)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
}

.navbar-nav {
  flex-direction: unset;
  float: right;
}

.progress-bar {
  background-color:#152a7a;
}

.top-container {
  margin-top: 0 !important;
  margin-left: auto;
  margin-right: auto;
}


/* --------------------------------------------------
   TYPOGRAPHIE & COULEURS
-------------------------------------------------- */

body, html {
    font-family: "Noto Sans" !important;
}

.group-description *,
#welcome-container,
#welcome-container * {
    font-family: inherit !important;
    font-size: initial;
    line-height: inherit;
}


body {
  color: #152a7a;
  padding-bottom: 0;
  display: flex;
  flex-direction: column;
}

html, body {
  height: 100%;
  margin: 0;
}

a {
  color: #337ab7;
  text-decoration: none;
}

.text-info {
  color: #46507A !important;
}

.text-danger,
.text-warning {
  color: #EF7757 !important;
  top: 0;
}

.text-primary {
  color: #337ab7 !important;
}

.text-danger.fa.fa-asterisk.small {
  margin-right: 5px;
}

.h1, h1 {
  font-size: 24px;
}

.survey-name {
  margin: 2rem;
  text-align: left !important;
  font-size: 24px;
}

.radio-item label::before,
.checkbox-item label::before {
    border-color: #A2A2A2;
}

.bg-danger {
  background-color: whitesmoke !important;
}

.bg-warning {
  background-color: whitesmoke !important;
}

.dropdown-item.disabled,
.dropdown-item:disabled {
  color:#777;
}

.table,
.table-hover>tbody>tr:hover>* {
  color:inherit;
}

.bg-primary {
    background-color: #f7f7f7 !important;
}

.ls-label-question {
  font-size: 16px;
  line-height: 24px;
}




/* Cible toutes les questions, mais surtout les questions à choix (radio) */
#limesurvey .question-text,
#limesurvey .question-text * {
  font-family: inherit !important;
  /*font-size: 16px !important;*/
  line-height: inherit !important;
}

/* Optionnel : neutralise les balises <font> collées depuis Word/Google Docs */
#limesurvey font,
#limesurvey font * {
  all: unset !important;
  font-family: inherit !important;
  font-size: inherit !important;
}



/* --------------------------------------------------
   BOUTONS
-------------------------------------------------- */

.btn-success,
.btn-info,
.btn-primary {
  color: #fff;
  background-color: #152a7a;
  border-color: #20204F;
}

.btn-success:hover,
.btn-info:hover,
.btn-primary:hover,
.btn-success:focus,
.btn-info:focus,
.btn-primary:focus,
.btn-success.active,
.btn-info.active,
.btn-primary.active {
  color: #fff;
  background-color: #5970B4;
  border-color: #475A91;
}


/* --------------------------------------------------
   BLOCS & CONTENEURS
-------------------------------------------------- */

.bg-light {
  background: #FFF !important;
}

.footer {
  background-color: #F3F3F3;
  border-width: 0;
  margin-top: 21px;
  padding: 15px 0 15px 30px;
  display: flex;
}


.link-cerema a,
.link-cerema a:hover,
.link-cerema a:focus {
  color: #EF7757;
  text-decoration: none;
}

.group-title {
  background: #152a7a;
  padding: 1rem;
  text-align: left !important;
  text-transform: uppercase;
  color: white;
}

.group-description {
  margin-left: 0;
  margin-right: 0;
  margin-top: -1.5em;
}

.question-container {
  margin-left: 0;
  margin-right: 0;
  background-color: transparent;
}

.question-title-container {
  background: #e0e1ec;
}

.question-help-container,
.question-valid-container {
  background: whitesmoke;
}

.ls-questionhelp {
  margin: 10px 0;
}

.ls-question-mandatory {
  margin-top: 15px;
  margin-bottom: 15px;
}


.row {
  --bs-gutter-x: 25px;
}


.question-item.answer-item.checkbox-item {
  margin-bottom: 14px !important;
}

article {
  flex: 1 1 auto;
}

.container {
  height: inherit;
}

li.nav-item.ls-no-js-hidden {
  padding-left: 8px;
}

.control-label {
  margin-bottom: 5px;
}

.control-label.label-radio {
  padding-bottom: 5px;
}

.save-survey-label.control-label,
.load-survey-label.control-label {
  margin-bottom: 5px;
}

.sortable-choice.sortable-list.list-group,
.sortable-rank.sortable-list.list-group {
 margin-top: 5px;
}

.leaflet-container {
 margin-top: 15px;
 margin-bottom: 15px;
}

.row.alert.alert-warning.alert-dismissible.fade.in.show {
 --bs-gutter-x: 0;
 /*margin-bottom: 2.5rem;*/
}

.question-text .ls-label-question table {
    max-width: fit-content;
}

.question-text tbody, td, tfoot, th, thead, tr {
    border-width: 0;
}

.survey-description {
  text-align: left !important;
}

.ls-privacy-head {
  padding-top: 1rem;
}


/* --------------------------------------------------
   RESPONSIVE
-------------------------------------------------- */

@media (min-width: 768px) {
  .navbar-toggler {
    display: none;
  }
  
  .marianne-footer {
  margin-right: 30px;
}

.dropdown-menu {
  right: 0 !important;
  left: auto !important;
}

.navbar-expand-md .navbar-nav .nav-link {
  padding-left:15px;
  padding-right:15px;
}

.ls-link-saveall, .ls-link-loadall, .ls-link-clearall, .ls-link-resume, .dropdown-toggle {
  padding-left: 15px !important;
  padding-right: 15px !important;
}
  
.dropdown-toggle,  
a[data-limesurvey-submit*="saveall"],
a[data-limesurvey-submit*="loadall"],
a[data-limesurvey-submit*="clearall"],
a[data-limesurvey-submit*="resume"] {
    font-weight: 500;
    color: #152a7a !important; /* bleu discret */
    /*text-decoration: underline;*/
    padding: 15px;
    border-radius: 3px;
    transition: color 0.2s ease, background 0.2s ease;
}

a.dropdown-toggle:hover,
a[data-limesurvey-submit*="saveall"]:hover,
a[data-limesurvey-submit*="loadall"]:hover,
a[data-limesurvey-submit*="clearall"]:hover,
a[data-limesurvey-submit*="resume"]:hover {
    background: #f5f5f5;
    color: #00345a !important;
}

a[data-limesurvey-submit]::after {
    font-family: Fontawesome;
    content: "\f105";
    margin-left: 0.2rem;
}
}

@media (min-width: 1200px) {
  .h1, h1 {
    font-size: 24px;
  }
}

@media (max-width: 768px) {
  .answer-container {
  padding: 1rem;
  }

/*.question-container .answer-container.only-hidden.col-12 {
  padding: 0 !important;
}*/

  .control-label {
    margin-bottom: 0.5rem;
  }
    
    .navbar{
    padding: 0.5rem;
    }
    
  .navbar-nav {
    flex-direction: column;
    float: left;
  }
}

@media only screen and (max-device-width: 760px) {
  .question-title-container {
    padding-top: 1rem;
    padding-bottom: 1rem;
  }
}

@media (min-width:768px) {
  .top-container {
    max-width:720px
  }
}


@media (min-width:992px) {
  .top-container {
    max-width:960px
  }
}
@media (min-width:1200px) {
  .top-container {
    max-width:1140px;
  }
}

/*@media (min-width:1400px) {
  .top-container {
    max-width:1320px;
  }
}*/

@media (min-width: 1400px) {
.container, .container-lg, .container-md, .container-sm, .container-xl, .container-xxl {
max-width: 1140px;
}
}


a[target="_blank"]::after {
    font-family: Fontawesome;
    content: "\f08e"; /* icône lien externe */
    font-weight: 500; /* solide mais tu peux mettre 400 pour plus fin */
    font-size: 0.85em;
    opacity: 0.8;
    margin-right: 0.35rem;
    margin-left: 0.35rem;
    position: relative;
}

.display-none {
  display: none;
}



/* --------------------------------------------------
   ADMIN
-------------------------------------------------- */


#theme-options-tabs .nav-item:nth-child(2) {
  display: none !important;
}

button.nav-link.tab_action_hide_on_inherit {
    display: none !important;
}

#theme-options-tabs > li:nth-child(2) {
  display: none !important;
}

#theme-options-tabs > li:nth-child(3) {
  visibility: hidden !important;
}


/* --------------------------------------------------
   IMAGE
-------------------------------------------------- */


/* 1. Empêcher les images de déborder du questionnaire */
/*#limesurvey, */
#limesurvey .survey-wrapper,
#limesurvey .question-container {
  overflow: hidden;
}

/* 2. Rendre les images responsives et contenues */
#limesurvey img {
  max-width: 100%;
  height: auto;
  /*display: block;*/
  margin: 0 auto;          /* centre l'image */
}

/* 3. Si l'image est en fond dans un bloc spécifique */
#limesurvey .question-container .some-image-class {
  background-size: contain;   /* l'image reste entièrement visible */
  background-repeat: no-repeat;
  background-position: center;
}

/* --------------------------------------------------
Liste déroulante Bootstrap (type !)
-------------------------------------------------- */

/* Fix LimeSurvey — choix de réponses qui masquent la question */

/* Conteneur de la question : espace suffisant en bas */
.question-container,
.ls-answers,
.answer-container {
  overflow: visible !important;
  /*margin-bottom: 2rem !important;*/
}


.list-with-comment .answer-item.text-item.col-md-6.col-12 {
    width: 50% !important ;
    max-width: initial !important;
}

.list-with-comment.question-container .answer-item.radio-item {
    width: auto !important;
}


/* Les labels radio/checkbox : affichage en bloc, pas de float */
.answer-item label,
.radio label,
.checkbox label,
.ls-label-xs-12 label {
  /*display: flex !important;
  align-items: flex-start !important;
  gap: 8px !important;*/
  white-space: normal !important;
  word-break: break-word !important;
  /*float: none !important;*/
  overflow: visible !important;
  max-width: 100% !important;
  line-height: 1.5 !important;
  margin-bottom: 8px !important;
}

/* Input radio/checkbox bien aligné en haut du texte */
.answer-item input[type="radio"],
.answer-item input[type="checkbox"] {
  flex-shrink: 0 !important;
  margin-top: 3px !important;
  float: none !important;
}

/* Évite le débordement des groupes de réponses */
.answer-item,
.radio-item,
.checkbox-item {
  clear: both !important;
  overflow: visible !important;
  width: 100% !important;
}

/* Texte de question : z-index au-dessus des réponses */
.question-text,
.ls-label-xs-12 > .question {
  position: relative !important;
  z-index: 10 !important;
}


/* 1. On configure le conteneur pour s'adapter au texte sans retour à la ligne */
.bootstrap-select.list-question-select {
    display: inline-block !important; 
    width: max-content !important;    
    max-width: 100% !important;       
}

/* 2. On empêche le texte des options de revenir à la ligne ou d'être coupé */
.bootstrap-select.list-question-select .dropdown-menu li a span.text,
.bootstrap-select.list-question-select .dropdown-toggle .filter-option-inner-inner {
    white-space: nowrap !important; /* Force le texte à tenir sur une seule ligne */
    overflow: visible !important;   /* Empêche le masquage des lettres */
}

/* 3. On ajuste le bouton et le menu à cette nouvelle largeur "dépliée" */
.bootstrap-select.list-question-select .btn.dropdown-toggle,
.bootstrap-select.list-question-select .dropdown-menu {
    width: 100% !important;
    min-width: 100% !important;
}

/* 4. Sécurité pour le conteneur Bootstrap de LimeSurvey */
.ls-answers.answer-item.col-auto {
    width: max-content !important;
    max-width: 100% !important;
}


/* 1. On applique une largeur minimale fixe basée sur votre choix le plus long */
/* "reponse longue longue longue reponse longue longue longue" fait environ 450px */

.dropdown.bootstrap-select.list-question-select {
    width: 450px !important; 
    display: inline-block !important;
}

/* 2. On force le bouton gris à prendre toute cette largeur */
.dropdown.bootstrap-select.list-question-select .dropdown-toggle {
    width: 450px !important;
}

/* 3. On force la liste blanche à faire exactement la même taille */
.dropdown.bootstrap-select.list-question-select .dropdown-menu {
    width: 450px !important;
    min-width: 450px !important;
}

/* 4. On empêche le texte de revenir à la ligne ou d'être coupé */
.dropdown.bootstrap-select.list-question-select .dropdown-menu li a span.text {
    white-space: nowrap !important;
}

/* 5. On débloque le conteneur parent de LimeSurvey pour qu'il accepte les 450px */
.ls-answers.answer-item.col-auto {
    width: max-content !important;
    max-width: 100% !important;
}


/* Force une couleur de fond bleue et un texte blanc lisible lors du survol (hover) */
.bootstrap-select.list-question-select .dropdown-menu li a:hover,
.bootstrap-select.list-question-select .dropdown-menu li a:focus {
    background-color: #152a7a !important; /* Bleu standard Bootstrap (ajustable selon votre charte) */
    color: #ffffff !important;            /* Texte blanc pur */
}

/* Force également une bonne lisibilité pour l'élément actuellement sélectionné (active) dans la liste */
.bootstrap-select.list-question-select .dropdown-menu li.selected.active a,
.bootstrap-select.list-question-select .dropdown-menu li.active a {
    background-color: #0d6efd  !important;
    color: #ffffff !important;
}

/* Sécurité : s'assurer que le composant textuel interne hérite bien de la couleur blanche */
.bootstrap-select.list-question-select .dropdown-menu li a:hover span.text,
.bootstrap-select.list-question-select .dropdown-menu li.selected.active a span.text {
    color: #ffffff !important;
}


.btn-outline-secondary:hover,
.btn-check:active+.btn-outline-secondary,
.btn-check:checked+.btn-outline-secondary,
.btn-outline-secondary.active,
.btn-outline-secondary.dropdown-toggle.show,
.btn-outline-secondary:active {
  background-color:#f5f5f5;
}

/*.array-flexible-dual-scale.question-container label.ls-label-xs-visibility:before {
	display: none;
}*/

/*.answer-item.radio-item label.ls-label-xs-visibility {
    display: none !important;
}*/

.array-multi-flexi.question-container  label.ls-label-xs-visibility,
.answer-item.radio-item label.ls-label-xs-visibility {
    font-size: 0 !important;
    color: transparent !important;
    line-height: 0 !important;
}

.choice-5-pt-radio.question-container div.answer-container.col-12 {
    margin-bottom: 2rem;
}


