/* =====================================================================
   PSYNERGIA – Questionnaires en ligne · Style « Échelle douce »
   ---------------------------------------------------------------------
   Installation : charger CE fichier APRÈS /css/styles2.css
   (ou coller son contenu à la fin de styles2.css), puis charger
   psynergia-questionnaire.js juste avant </body>.
   Remplace le fichier psynergia-animations.css (déjà inclus ici).
   ===================================================================== */

:root {
  --psy-bordeaux: #7B2D3A;
  --psy-bordeaux-fonce: #5A1F2A;
  --psy-rose: #F7E9ED;
  --psy-marine: #233F71;
  --psy-bleu: #4D6C98;
  --psy-bleu-pale: #EEF2F8;
  --psy-fond: #FBF7F9;
  --psy-trait: #EADDE3;
  --psy-texte: #3A3A40;
  --psy-gris: #6E6E78;
  --psy-degrade: linear-gradient(90deg, #F2994A, #E85D4A 35%, #D9455F 60%, #8E44AD);
  --psy-ease: cubic-bezier(.4, 0, .2, 1);
  --psy-lent: .7s;
}

/* ---------- Page ---------- */
body.psy-douce,
body.psy-douce .site_wrapper,
body.psy-douce .content_fullwidth {
  background: var(--psy-fond);
}
body.psy-douce {
  font-family: 'Open Sans', sans-serif;
  color: var(--psy-texte);
  scroll-behavior: smooth;
}

/* ---------- En-tête : barre de progression en dégradé ---------- */
body.psy-douce .header {
  background: rgba(251, 247, 249, .95);
  box-shadow: 0 1px 0 var(--psy-trait);
}
body.psy-douce .progress-container {
  background: #EFE4EA;
  border-radius: 8px;
  height: 8px;
  overflow: visible;
}
body.psy-douce .progress-bar {
  background: var(--psy-degrade);
  border-radius: 8px;
  transition: width .9s var(--psy-ease);
}
body.psy-douce .progress-text {
  font-family: 'Open Sans', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--psy-bordeaux);
  background: #FFFFFF;
  border: 1.5px solid var(--psy-bordeaux);
  border-radius: 999px;
  padding: 1px 8px;
}
body.psy-douce .bouton-enregistrer-container .submito {
  background: transparent;
  color: var(--psy-bordeaux);
  border: 1.5px solid var(--psy-bordeaux);
  border-radius: 999px;
  font-weight: 600;
  transition: background-color .3s var(--psy-ease), color .3s var(--psy-ease);
}
body.psy-douce .bouton-enregistrer-container .submito:hover {
  background: var(--psy-bordeaux);
  color: #FFFFFF;
}

/* ---------- Titre de page ---------- */
body.psy-douce .page_title2 {
  background: transparent;
}
body.psy-douce .page_title2 h1 {
  font-family: 'Raleway', sans-serif;
  font-weight: 600;
  color: var(--psy-marine);
}

/* ---------- Bandeau + texte d'introduction ---------- */
body.psy-douce img.etude-illustration {
  display: block;
  width: 100%;
  max-width: 860px;
  height: auto;
  margin: 8px auto 40px;
  border-radius: 22px;
}
body.psy-douce img.etude-illustration ~ p {
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
  font-size: 17px;
  line-height: 1.75;
  text-align: center;
  color: var(--psy-texte);
}
body.psy-douce img.etude-illustration ~ p:first-of-type {
  font-family: 'Raleway', sans-serif;
  font-size: 21px;
  line-height: 1.6;
  color: var(--psy-marine);
}
body.psy-douce img.etude-illustration ~ p strong,
body.psy-douce img.etude-illustration ~ p b {
  color: var(--psy-bordeaux);
}

/* ---------- Conteneur des questions ---------- */
body.psy-douce #questionnaire {
  max-width: 860px;
  margin: 48px auto 0;
}

/* Apparition au défilement */
body.psy-douce .question.fade {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity .55s cubic-bezier(.2, .7, .2, 1),
    transform .55s cubic-bezier(.2, .7, .2, 1),
    box-shadow var(--psy-lent) var(--psy-ease),
    border-color var(--psy-lent) var(--psy-ease);
}
body.psy-douce .question.fade.visible { opacity: 1; transform: none; }
body.psy-douce .question.fade:hover,
body.psy-douce .question.fade.visible:hover { transform: none; }

/* Carte de question */
body.psy-douce .question {
  background: #FFFFFF;
  border: 2px solid transparent;
  border-radius: 24px;
  padding: 32px 32px 28px;
  margin: 0 0 24px;
}
body.psy-douce .question:hover {
  border-color: var(--psy-marine);
  box-shadow: 0 18px 44px rgba(35, 63, 113, .22);
}
body.psy-douce .question .head {
  background: transparent !important;
  padding: 0 0 22px;
  border-radius: 0;
  text-align: center;
}
body.psy-douce .question .head,
body.psy-douce .question .head p {
  font-family: 'Raleway', sans-serif;
  font-weight: 600;
  font-size: 22px;
  line-height: 1.4;
  color: var(--psy-marine) !important;
  margin: 0;
}
body.psy-douce .question .reponse {
  background: transparent !important;
  border: 0;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

/* Questions verrouillées */
body.psy-douce .question:has(.reponse.wait) {
  background: #F4EEF1;
}
body.psy-douce .question:has(.reponse.wait):hover {
  border-color: transparent;
  box-shadow: none;
}
body.psy-douce .question:has(.reponse.wait) .head,
body.psy-douce .question:has(.reponse.wait) .head p {
  color: var(--psy-gris) !important;
}
body.psy-douce .question .reponse.wait { opacity: .5; }
body.psy-douce .question .reponse.wait p,
body.psy-douce .question .reponse.wait label { cursor: not-allowed !important; }

/* ---------- Socle commun des réponses (boutons radio) ---------- */
body.psy-douce .question .reponse p:has(input[type="radio"]) {
  position: relative;
  margin: 0;
  cursor: pointer;
}
/* le vrai bouton radio couvre toute la zone : clic partout, clavier conservé */
body.psy-douce .question .reponse p > input[type="radio"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}
body.psy-douce .question .reponse p > input[type="radio"] + label {
  font-size: 15px;
  font-weight: 600;
  color: var(--psy-texte);
  margin: 0;
  transition: color .35s var(--psy-ease), background-color .35s var(--psy-ease),
              border-color .35s var(--psy-ease), box-shadow .35s var(--psy-ease);
}
body.psy-douce .question .reponse p > input[type="radio"]:focus-visible + label {
  outline: 3px solid var(--psy-bleu);
  outline-offset: 3px;
  border-radius: 12px;
}

/* ================= FORMAT 1 : ÉCHELLE (ronds reliés) ================= */
body.psy-douce .psy-fmt-echelle .reponse {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
body.psy-douce .psy-fmt-echelle .reponse::before {
  content: "";
  position: absolute;
  top: 22px;
  left: 12.5%;
  right: 12.5%;
  height: 2px;
  background: var(--psy-trait);
}
body.psy-douce .psy-fmt-echelle .reponse p > input + label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  font-size: 14px;
}
body.psy-douce .psy-fmt-echelle .reponse p > input + label::before {
  content: "";
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid #D9C3CC;
  background: #FFFFFF;
  box-sizing: border-box;
  transition: all .35s var(--psy-ease);
}
body.psy-douce .psy-fmt-echelle .reponse p:hover > input + label::before {
  border-color: var(--psy-marine);
  background: var(--psy-bleu-pale);
  transform: scale(1.08);
}
body.psy-douce .psy-fmt-echelle .reponse p:has(input:checked) > label { color: var(--psy-bordeaux); }
body.psy-douce .psy-fmt-echelle .reponse p:has(input:checked) > label::before {
  border-color: var(--psy-bordeaux);
  background: var(--psy-bordeaux) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l4 4 10-10'/%3E%3C/svg%3E") center / 20px no-repeat;
  box-shadow: 0 0 0 6px var(--psy-rose);
  transform: none;
}

/* ================= FORMAT 2 : BOUTONS (horizontal) ================= */
body.psy-douce .psy-fmt-boutons .reponse {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
body.psy-douce .psy-fmt-boutons .reponse p > input + label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 10px 14px;
  border: 1.5px solid #E2D6DC;
  border-radius: 14px;
  text-align: center;
  box-sizing: border-box;
}
body.psy-douce .psy-fmt-boutons .reponse p:hover > input + label {
  border-color: var(--psy-bordeaux);
  background: var(--psy-fond);
  color: var(--psy-bordeaux);
}
body.psy-douce .psy-fmt-boutons .reponse p:has(input:checked) > label {
  background: var(--psy-bordeaux);
  border-color: var(--psy-bordeaux);
  color: #FFFFFF;
}

/* ================= FORMAT 3 : LISTE (vertical) ================= */
body.psy-douce .psy-fmt-liste .reponse {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 520px;
  margin: 0 auto;
}
body.psy-douce .psy-fmt-liste .reponse p > input + label {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border: 1.5px solid #ECE3E8;
  border-radius: 14px;
}
body.psy-douce .psy-fmt-liste .reponse p > input + label::before {
  content: "";
  flex: 0 0 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #A9B7CB;
  box-sizing: border-box;
  background: #FFFFFF;
  transition: all .35s var(--psy-ease);
}
body.psy-douce .psy-fmt-liste .reponse p:hover > input + label {
  background: var(--psy-bleu-pale);
  border-color: var(--psy-bleu);
}
body.psy-douce .psy-fmt-liste .reponse p:has(input:checked) > label {
  background: var(--psy-bleu-pale);
  border-color: var(--psy-marine);
  color: var(--psy-marine);
}
body.psy-douce .psy-fmt-liste .reponse p:has(input:checked) > label::before {
  border: 6px solid var(--psy-marine);
}

/* ================= FORMAT 4 : CARTES (2 × 2) ================= */
body.psy-douce .psy-fmt-cartes .reponse {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-width: 620px;
  margin: 0 auto;
}
body.psy-douce .psy-fmt-cartes .reponse p > input + label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 20px;
  min-height: 92px;
  border-radius: 18px;
  background: var(--psy-fond);
  border: 1.5px solid transparent;
  box-sizing: border-box;
  font-size: 16px;
}
body.psy-douce .psy-fmt-cartes .reponse p > input + label::before {
  content: "";
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid #D9C3CC;
  box-sizing: border-box;
  background: #FFFFFF;
  transition: all .35s var(--psy-ease);
}
body.psy-douce .psy-fmt-cartes .reponse p:hover > input + label {
  border-color: var(--psy-bordeaux);
  background: #FFFFFF;
}
body.psy-douce .psy-fmt-cartes .reponse p:has(input:checked) > label {
  background: var(--psy-rose);
  border-color: var(--psy-bordeaux);
  color: var(--psy-bordeaux);
}
body.psy-douce .psy-fmt-cartes .reponse p:has(input:checked) > label::before {
  border-color: var(--psy-bordeaux);
  background: var(--psy-bordeaux) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l4 4 10-10'/%3E%3C/svg%3E") center / 14px no-repeat;
}

/* ---------- Listes déroulantes (profil) ---------- */
body.psy-douce .question select {
  display: block;
  margin: 0 auto;
  min-width: 280px;
  max-width: 100%;
  padding: 12px 16px;
  font-family: 'Open Sans', sans-serif;
  font-size: 16px;
  color: var(--psy-texte);
  background-color: #FFFFFF;
  border: 1.5px solid #E2D6DC;
  border-radius: 12px;
  transition: border-color .35s var(--psy-ease), box-shadow .35s var(--psy-ease);
}
body.psy-douce .question select:hover,
body.psy-douce .question select:focus {
  border-color: var(--psy-marine);
  box-shadow: 0 0 0 4px var(--psy-bleu-pale);
  outline: none;
}

/* ---------- Question ouverte ---------- */
body.psy-douce .question textarea {
  width: 100%;
  min-height: 160px;
  box-sizing: border-box;
  padding: 16px 18px;
  font-family: 'Open Sans', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  border: 1.5px solid #E2D6DC;
  border-radius: 16px;
  background: var(--psy-fond);
  transition: border-color .35s var(--psy-ease), background-color .35s var(--psy-ease);
}
body.psy-douce .question textarea:focus {
  border-color: var(--psy-marine);
  background: #FFFFFF;
  outline: none;
}

/* ---------- Encarts (pauses : « Bravo ! », « Comment allez-vous ? ») ---------- */
body.psy-douce .question.psy-pause {
  background: transparent;
  border: 0;
  padding: 8px 0;
  box-shadow: none !important;
}
body.psy-douce .question.psy-pause .reponse.encart {
  opacity: 1;
  position: relative;
  padding: 28px 32px !important;
  border-radius: 24px;
  background: #FFFFFF !important;
  text-align: center;
  font-family: 'Raleway', sans-serif;
  font-size: 20px;
  line-height: 1.55;
  color: var(--psy-bordeaux);
  overflow: hidden;
}
body.psy-douce .question.psy-pause .reponse.encart::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 5px;
  background: var(--psy-degrade);
}

/* ---------- Bouton final ---------- */
body.psy-douce .subquest {
  text-align: center;
  margin: 32px 0 64px;
}
body.psy-douce .subquest .submito {
  display: inline-block;
  background: var(--psy-bordeaux);
  color: #FFFFFF;
  border: 0;
  border-radius: 999px;
  padding: 16px 44px;
  font-family: 'Raleway', sans-serif;
  font-size: 18px;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(123, 45, 58, .25);
  transition: background-color .35s var(--psy-ease), transform .35s var(--psy-ease);
}
body.psy-douce .subquest .submito:hover {
  background: var(--psy-bordeaux-fonce);
  transform: translateY(-2px);
}


/* ---------- Tailles de texte (priorité sur les anciennes règles) ---------- */
body.psy-douce .question .reponse p > input + label {
  font-family: 'Open Sans', sans-serif !important;
  font-size: 16px !important;
  line-height: 1.35;
}
body.psy-douce .psy-fmt-echelle .reponse p > input + label { font-size: 15px !important; }
body.psy-douce .psy-fmt-cartes .reponse p > input + label { font-size: 17px !important; }
body.psy-douce .question.psy-pause .reponse.encart,
body.psy-douce .question.psy-pause .reponse.encart * {
  font-family: 'Raleway', sans-serif !important;
  font-size: 21px !important;
  font-weight: 600 !important;
  line-height: 1.55;
  color: var(--psy-bordeaux) !important;
}

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
  body.psy-douce .question { padding: 24px 16px 20px; }
  body.psy-douce .question .head,
  body.psy-douce .question .head p { font-size: 19px; }
  body.psy-douce .psy-fmt-boutons .reponse,
  body.psy-douce .psy-fmt-cartes .reponse { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.psy-douce .psy-fmt-echelle .reponse p > input + label { font-size: 12px !important; }
  body.psy-douce .psy-fmt-echelle .reponse p > input + label::before { width: 38px; height: 38px; }
  body.psy-douce .psy-fmt-echelle .reponse::before { top: 19px; }
}

/* ---------- Réglage « réduire les animations » ---------- */
@media (prefers-reduced-motion: reduce) {
  body.psy-douce { scroll-behavior: auto; }
  body.psy-douce .question.fade,
  body.psy-douce .question.fade.visible { opacity: 1; transform: none; transition: none; }
  body.psy-douce .question *,
  body.psy-douce .question *::before { transition: none !important; }
}
