/* ═══════════════════════════════════════════════════════════════════════════
   Thème « these_flyer » — inspiré du flyer de la thèse (aquarelle bleue, titres
   serif marine, cartes blanches arrondies). Dérivé de Fruity TwentyThree.
   Polices hébergées dans le thème (aucun appel à Google : pas de fuite d'IP).
   ═══════════════════════════════════════════════════════════════════════════ */

@font-face {
  font-family: 'DM Serif Display';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/dm-serif-display-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Nunito Sans';
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url('../fonts/nunito-sans-latin-var.woff2') format('woff2');
}

:root {
  --navy: #13294b;
  --navy-2: #1f3b66;
  --text: #2b3a55;
  --muted: #6b7a90;
  --blue: #5b8dc9;
  --blue-soft: #e6f0fa;
  --line: #d6e4f2;
  --bg: #eef5fb;
  --peach: #fbeadc;
  --card: #ffffff;
}

/* ── Fond aquarelle ─────────────────────────────────────────────────────── */
html, body {
  background:
    radial-gradient(ellipse 55% 40% at 8% 12%, rgba(167, 201, 236, 0.55), transparent 70%),
    radial-gradient(ellipse 45% 35% at 95% 30%, rgba(196, 220, 244, 0.6), transparent 70%),
    radial-gradient(ellipse 50% 40% at 90% 92%, rgba(250, 222, 200, 0.55), transparent 70%),
    radial-gradient(ellipse 40% 30% at 5% 88%, rgba(250, 230, 210, 0.45), transparent 70%),
    var(--bg) !important;
  background-attachment: fixed !important;
}
body, body * {
  font-family: 'Nunito Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-hyphens: manual !important;
  hyphens: manual !important;
  overflow-wrap: normal;
  word-break: normal;
}
body { color: var(--text); }

/* ── Carte centrale ─────────────────────────────────────────────────────── */
#outerframeContainer { min-height: 0 !important; }
#main-col {
  background: var(--card);
  border-radius: 24px;
  box-shadow: 0 10px 40px rgba(19, 41, 75, 0.08), 0 1px 3px rgba(19, 41, 75, 0.06);
  padding: 36px 40px 28px !important;
  margin-top: 28px !important;
  margin-bottom: 40px !important;
  max-width: 760px;
}

/* ── Barre de progression ───────────────────────────────────────────────── */
.ls-progress-container .progress, .progress {
  height: 6px !important;
  background: #dce8f5 !important;
  border-radius: 99px !important;
  overflow: hidden;
}
.progress-bar { background: var(--blue) !important; border-radius: 99px !important; }

/* ── Accueil ────────────────────────────────────────────────────────────── */
h1.survey-name {
  font-family: 'DM Serif Display', Georgia, serif !important;
  font-weight: 400 !important;
  color: var(--navy) !important;
  text-align: center;
  font-size: clamp(1.9rem, 4.2vw, 2.8rem) !important;
  line-height: 1.08 !important;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  margin-bottom: 14px !important;
}
.survey-description { text-align: center; color: var(--muted); font-size: 0.98rem; }
.survey-description strong { color: var(--navy); }
.survey-welcome {
  background: linear-gradient(135deg, var(--blue-soft), #f3f8fd);
  border-radius: 18px;
  padding: 22px 24px;
  margin: 18px 0 8px;
  line-height: 1.55;
}
.survey-welcome strong { color: var(--navy); }
.survey-welcome h3 { font-size: 1rem !important; font-weight: 400; margin: 12px 0 0; }
.survey-welcome a { color: var(--blue); }
.number-of-questions { display: none !important; }

/* Encadré « Ce questionnaire est anonyme » */
.privacy, .ls-privacy-block {
  background: var(--peach) !important;
  border: none !important;
  border-radius: 16px !important;
  color: var(--text) !important;
  font-size: 0.85rem;
}
.ls-privacy-head, .privacy .text-uppercase { color: var(--navy) !important; font-weight: 700; }

/* ── Titre de section : petit surtitre façon flyer ──────────────────────── */
.group-title {
  font-family: 'Nunito Sans', sans-serif !important;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--blue) !important;
  text-align: center;
  margin: 0 0 18px !important;
  padding-bottom: 10px;
  position: relative;
}
.group-title::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 56px;
  height: 2px;
  transform: translateX(-50%);
  background: var(--blue);
  border-radius: 2px;
  opacity: 0.6;
}

/* ── Question ───────────────────────────────────────────────────────────── */
.question-container { border: none !important; background: transparent !important; padding: 0 !important; }
.question-title-container { margin-bottom: 6px !important; }
.question-text, .ls-label-question {
  font-family: 'DM Serif Display', Georgia, serif !important;
  font-weight: 400 !important;
  color: var(--navy) !important;
  font-size: 1.55rem !important;
  line-height: 1.2 !important;
}
.ls-label-question h2, .ls-label-question h3, .ls-label-question p { font: inherit !important; color: inherit !important; margin: 0; }
.asterisk, .ls-question-mandatory { color: var(--muted) !important; font-size: 0.8rem !important; }
.ls-questionhelp, .ls-em-tip, .question-help-container {
  color: var(--muted) !important;
  font-style: italic;
  font-size: 0.9rem !important;
}
.ls-em-error, .text-danger { color: #c0392b !important; font-style: normal; }

/* ── Réponses en pastilles ──────────────────────────────────────────────── */
.answers-list { margin-top: 10px; }
.answer-item {
  display: flex !important;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 12px 16px !important;
  margin: 0 0 10px !important;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  cursor: pointer;
}
.answer-item:hover { border-color: var(--blue); box-shadow: 0 2px 10px rgba(91, 141, 201, 0.12); }
.answer-item:has(input:checked) { background: var(--blue-soft); border-color: var(--navy); }
.answer-item label {
  flex: 1;
  margin: 0 !important;
  cursor: pointer;
  color: var(--text) !important;
  font-weight: 600 !important;
  font-size: 1rem !important;
  line-height: 1.35 !important;
}
.answer-item input[type=radio], .answer-item input[type=checkbox],
.ls-answers input[type=radio], .ls-answers input[type=checkbox] {
  -webkit-appearance: auto !important;
  appearance: auto !important;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  accent-color: var(--navy);
  width: 19px;
  height: 19px;
  margin: 0 !important;
  flex-shrink: 0;
  position: static !important;
  opacity: 1 !important;
}
.answer-item input[type=text], .form-control {
  border: 1.5px solid var(--line) !important;
  border-radius: 10px !important;
  padding: 8px 12px !important;
  box-shadow: none !important;
}
.answer-item input[type=text]:focus, .form-control:focus { border-color: var(--blue) !important; outline: none; }
textarea.form-control { min-height: 120px; }

/* Grille (Q14) */
.ls-answers table, table.ls-answers { border-collapse: separate; border-spacing: 0 6px; }
.ls-answers thead th { color: var(--navy); font-weight: 700; font-size: 0.85rem; text-align: center; }
.ls-answers tbody tr { background: var(--card); }
.ls-answers tbody th, .ls-answers tbody td { border-top: 1.5px solid var(--line); border-bottom: 1.5px solid var(--line); padding: 10px 8px; }
.ls-answers tbody th { border-left: 1.5px solid var(--line); border-radius: 12px 0 0 12px; color: var(--text); font-weight: 600; }
.ls-answers tbody td:last-child { border-right: 1.5px solid var(--line); border-radius: 0 12px 12px 0; }
.ls-answers input[type=checkbox], .ls-answers input[type=radio] { accent-color: var(--navy); width: 19px; height: 19px; }

/* ── Boutons ────────────────────────────────────────────────────────────── */
#navigator-container { margin-top: 22px !important; }
.btn {
  border-radius: 999px !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em;
  padding: 11px 28px !important;
}
.btn-primary {
  background: var(--navy) !important;
  border-color: var(--navy) !important;
  color: #fff !important;
  box-shadow: 0 6px 16px rgba(19, 41, 75, 0.18);
}
.btn-primary:hover, .btn-primary:focus { background: var(--navy-2) !important; border-color: var(--navy-2) !important; }
.btn-outline-secondary {
  background: #fff !important;
  border: 1.5px solid var(--line) !important;
  color: var(--navy) !important;
}
.btn-outline-secondary:hover { border-color: var(--navy) !important; }

/* ── Fin ────────────────────────────────────────────────────────────────── */
.completed-text, .survey-completed { text-align: left; line-height: 1.6; }
.completed-text strong { color: var(--navy); }

/* ── « ⓘ » (bloc dépliable sous une question / à côté d'une réponse) ────── */
.info-def { margin: 6px 0 2px; }
.info-def summary, .info-choix summary {
  display: inline-block;
  list-style: none;
  cursor: pointer;
  color: var(--blue);
  font-weight: 600 !important;
  font-size: 0.95rem;
}
.info-def summary::-webkit-details-marker, .info-choix summary::-webkit-details-marker { display: none; }
.info-def p, .info-def li { font-family: 'Nunito Sans', sans-serif !important; font-size: 0.9rem !important; color: var(--muted) !important; margin: 4px 0 0 !important; }
.info-choix { display: inline; margin-left: 4px; }
.info-choix summary { padding: 0 4px; }
.info-choix > span { display: block; font-weight: 400 !important; font-size: 0.85rem !important; color: var(--muted); margin: 3px 0 0; }

/* ── Mobile : compact, sans défilement inutile ──────────────────────────── */
@media (max-width: 768px) {
  body { padding-top: 4px !important; }
  #main-col {
    border-radius: 18px;
    padding: 20px 16px 16px !important;
    margin: 10px 8px 16px !important;
  }
  h1.survey-name { font-size: 1.7rem !important; }
  .survey-welcome { padding: 16px; font-size: 0.95rem; }
  .group-title { font-size: 0.7rem !important; margin-bottom: 12px !important; }
  .question-text, .ls-label-question { font-size: 1.25rem !important; }
  .answer-item { padding: 10px 12px !important; margin-bottom: 7px !important; border-radius: 12px; }
  .answer-item label { font-size: 0.95rem !important; }
  .ls-questionhelp, .ls-em-tip { font-size: 0.82rem !important; }
  #navigator-container { margin-top: 12px !important; margin-bottom: 4px !important; }
  .btn { padding: 10px 22px !important; }
}

/* Le thème d'origine dessine ses propres boutons (pseudo-éléments) : on les neutralise */
.answer-item input[type=radio]::before, .answer-item input[type=radio]::after,
.answer-item input[type=checkbox]::before, .answer-item input[type=checkbox]::after,
.answer-item label::before, .answer-item label::after { display: none !important; content: none !important; }

/* Espacements : pas de grand vide entre les réponses et les boutons */
.group-outer-container, .group-container { margin-bottom: 0 !important; }
.question-container { margin-bottom: 4px !important; }
/* Pas de « ? » ou de mot seul en fin de titre */
.question-text, .ls-label-question, h1.survey-name, .group-title { text-wrap: balance; }
.survey-welcome p, .answer-item label { text-wrap: pretty; }
.group-outer-container, .group-container { margin-top: 0 !important; }
#main-col > :first-child, #limesurvey { margin-top: 0 !important; padding-top: 0 !important; }

/* Cases à cocher : la case et le libellé restent sur la même ligne */
.answer-item > .row { flex: 1; flex-wrap: nowrap; margin: 0 !important; }
.answer-item > .row > [class^="col"] {
  display: flex !important;
  align-items: center;
  gap: 12px;
  flex: 1;
  padding: 0 !important;
}
.answer-item label { padding-left: 0 !important; }
/* Surtitre sur deux lignes : interligne normal */
.group-title { line-height: 1.6 !important; }
.answer-item input[type=radio], .answer-item input[type=checkbox] { z-index: 1 !important; }
/* « Autre : » + champ texte */
.othertext-label-checkox-container { display: flex !important; align-items: center; gap: 12px; padding: 0 !important; margin: 0 !important; }
.answer-item > .row > .col-auto:has(.other-text-item) { flex: 1 1 auto; }
.other-text-item, .other-text-item .form-control { width: 100%; margin: 0 !important; }
.answer-item > .row > .col-auto + .col-auto { flex: 1 1 auto; }
.answer-item > .row > .col-auto:has(+ .col-auto) { flex: 0 0 auto; }
.answer-item > .row:has(.other-text-item) { gap: 12px; }
.othertext-label-checkox-container label { white-space: nowrap; }

/* Grille (n° 18) — ordinateur : vrai tableau, cases centrées */
@media (min-width: 769px) {
  .ls-answers td.answer-item {
    display: table-cell !important;
    border-radius: 0;
    border-left: none;
    border-right: none;
    margin: 0 !important;
    padding: 10px 8px !important;
    text-align: center;
    vertical-align: middle;
    box-shadow: none !important;
  }
  .ls-answers td.answer-item:last-child { border-right: 1.5px solid var(--line); border-radius: 0 12px 12px 0; }
  .ls-answers td.answer-item input { margin: 0 auto !important; display: inline-block; }
  .ls-answers td.answer-item label { display: none; }
  .ls-answers tbody tr:has(input:checked) th { color: var(--navy); }
  .ls-answers tbody tr:hover td, .ls-answers tbody tr:hover th { background: #f7fafd; }
  .table-bordered > :not(caption) > * > * { border-width: 0; }
}
/* Grille — mobile : le nom de l'outil devient un intitulé */
@media (max-width: 768px) {
  .ls-answers tbody th {
    border: none !important;
    background: transparent !important;
    padding: 14px 2px 6px !important;
    font-family: 'DM Serif Display', Georgia, serif !important;
    font-weight: 400 !important;
    font-size: 1.15rem !important;
    color: var(--navy) !important;
  }
  .ls-answers tbody tr:first-child th { padding-top: 0 !important; }
  .ls-answers tbody td.answer-item { border-radius: 12px !important; }
}

/* Notice automatique « Ce questionnaire est anonyme… » (parle de codes d'accès, inutilisés ici) :
   masquée, l'accueil dit déjà que le questionnaire est anonyme. */
.privacy, .ls-privacy-block { display: none !important; }

/* Logo Université de Toulouse au-dessus du titre (page d'accueil uniquement) */
h1.survey-name::before {
  content: '';
  display: block;
  width: 200px;
  height: 64px;
  margin: 0 auto 18px;
  background: url('../files/logo-ut.png') center / contain no-repeat;
}
@media (max-width: 768px) {
  h1.survey-name::before { width: 160px; height: 52px; margin-bottom: 14px; }
}

/* Liens (page de fin, ressources) aux couleurs du thème, pas le vert par défaut */
#main-col a:not(.btn) { color: #2F6DB5 !important; text-decoration: underline; text-underline-offset: 2px; }
#main-col a:not(.btn):hover { color: var(--navy) !important; }
