@font-face {
  font-family: "Inter";
  src: url("/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --vert: #2F5D50;
  --vert-pale: rgba(47, 93, 80, .14);
  --fond: #F4F3EE;
  --encre: #161A18;
  --gris: #5E6560;
  --trait: rgba(22, 26, 24, .10);
  --blanc: #FFFFFF;
  --brique: #9A3B2E;
  --colonne: 640px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--fond); }
body {
  color: var(--encre);
  font: 400 17px/1.55 "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}
[hidden] { display: none !important; }
.invisible { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--vert); outline-offset: 3px; }

/* La hauteur suit la partie visible de l'écran : sur iPhone, le champ reste au-dessus du clavier. */
#app {
  position: fixed;
  left: 0;
  top: var(--haut, 0px);
  width: 100%;
  height: var(--hauteur, 100dvh);
  display: flex;
  flex-direction: column;
}

.tete { flex: none; padding: max(10px, env(safe-area-inset-top)) 20px 0; }
.tete-ligne, .progression { max-width: var(--colonne); margin: 0 auto; }
.tete-ligne { height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.marque { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; font-size: 14px; letter-spacing: .16em; }
.marque img { display: block; }
/* 16/11 : le caméléon change de teinte à chaque étape (les couleurs du site). La crête garde son orange. */
.marque svg { display: block; }
.marque .peau { fill: var(--peau, #355034); transition: fill .9s ease; }
#app[data-peau="1"] { --peau: #4f7a4c; }
#app[data-peau="2"] { --peau: #5e8f84; }
#app[data-peau="3"] { --peau: #8c7b4f; }
#app[data-peau="4"] { --peau: #d6a13f; }
#app #segments li span { background: var(--peau, var(--vert)); transition: width .5s ease, background-color .9s ease; }
.tete-titre { font-size: 14px; font-weight: 500; color: var(--gris); letter-spacing: -.005em; }
.mode-accueil .tete-titre { display: none; }
.mode-echange .tete { border-bottom: 1px solid var(--trait); }

.progression { padding: 4px 0 12px; }
#segments { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
#segments li { height: 3px; border-radius: 2px; background: var(--trait); overflow: hidden; }
#segments li.courante { background: rgba(47, 93, 80, .22); }
#segments li span { display: block; width: 0; height: 100%; background: var(--vert); transition: width .5s ease; }
.rubrique { margin: 8px 0 0; font-size: 12.5px; line-height: 1.3; color: var(--gris); }

/* Accueil */
.accueil {
  flex: 1;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 0 28px 14vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
h1 {
  margin: 0 0 18px;
  font-size: clamp(36px, 9vw, 58px);
  line-height: 1.04;
  font-weight: 600;
  letter-spacing: -.035em;
}
.chapo { margin: 0 0 38px; font-size: clamp(18px, 4.8vw, 21px); line-height: 1.45; color: var(--gris); letter-spacing: -.01em; }
.bouton {
  align-self: flex-start;
  min-height: 48px;
  padding: 12px 28px;
  border: 0;
  border-radius: 999px;
  background: var(--vert);
  color: var(--blanc);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -.005em;
  cursor: pointer;
  transition: background-color .2s ease, opacity .2s ease;
}
.bouton:hover { background: #264D42; }
.bouton:disabled { opacity: .5; cursor: default; }
.mention { margin: 18px 0 0; font-size: 13.5px; color: var(--gris); }
.probleme { margin: 0; font-size: 16px; line-height: 1.5; color: var(--encre); }

/* Échange */
.echange { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.fil {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 30px 20px 20px;
}
.colonne { max-width: var(--colonne); margin: 0 auto; }
#messages { display: flex; flex-direction: column; gap: 26px; }
.msg { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; animation: apparition .24s ease-out both; }
.msg.assistant { max-width: 36em; }
.msg.user {
  align-self: flex-end;
  max-width: min(86%, 30em);
  padding: 1px 14px 1px 0;
  border-right: 2px solid var(--vert);
  color: var(--vert);
  font-weight: 500;
}
.msg.provisoire { opacity: .55; }
/* 17/11 : le message de fin, bien visible au-dessus du récapitulatif validé. */
.msg.conclusion {
  max-width: none;
  padding: 20px 22px;
  border-left: 3px solid var(--vert);
  border-radius: 4px;
  background: var(--vert-pale);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: -.01em;
}
@keyframes apparition { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.frappe { display: flex; gap: 6px; padding: 26px 0 4px; }
.frappe span { width: 6px; height: 6px; border-radius: 50%; background: #9DA39F; animation: pouls 1.2s ease-in-out infinite; }
.frappe span:nth-child(2) { animation-delay: .15s; }
.frappe span:nth-child(3) { animation-delay: .3s; }
@keyframes pouls { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

/* Réponses à toucher : sobres, grandes cibles pour le pouce. */
.choix { margin: 18px 0 0; animation: apparition .24s ease-out both; }
.choix .consigne { margin: 0 0 10px; font-size: 13.5px; line-height: 1.4; color: var(--gris); }
.options { display: flex; flex-wrap: wrap; gap: 8px; }
.option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 9px 16px;
  border: 1px solid rgba(22, 26, 24, .16);
  border-radius: 999px;
  background: var(--blanc);
  color: var(--encre);
  font-size: 15.5px;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}
.option:hover { border-color: var(--vert); }
.option[aria-pressed="true"] { border-color: var(--vert); background: var(--vert); color: var(--blanc); }
.option .rang:empty { display: none; }
.option .rang {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--blanc);
  color: var(--vert);
  font-size: 13px;
  font-weight: 600;
}
.options.echelle { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; max-width: 420px; }
.bulle {
  aspect-ratio: 1;
  min-height: 36px;
  padding: 0;
  border: 1px solid rgba(22, 26, 24, .16);
  border-radius: 50%;
  background: var(--blanc);
  color: var(--encre);
  font-size: 16px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}
.bulle:hover, .bulle:focus-visible { border-color: var(--vert); }
.bulle:active { background: var(--vert); color: var(--blanc); }
.bornes { display: flex; justify-content: space-between; gap: 12px; max-width: 420px; margin-top: 8px; font-size: 12.5px; line-height: 1.3; color: var(--gris); }
.bornes span:last-child { text-align: right; }
.option:disabled, .bulle:disabled { opacity: .45; cursor: default; }
.bouton.petit { min-height: 40px; margin-top: 12px; padding: 9px 20px; font-size: 15px; }
.choix .autre { display: block; margin-top: 10px; }

.erreur { margin: 22px 0 0; font-size: 15px; line-height: 1.5; color: var(--brique); }

.saisie {
  flex: none;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--trait);
  background: var(--fond);
}
.champ {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 6px 6px 6px 18px;
  background: var(--blanc);
  border: 1px solid rgba(22, 26, 24, .14);
  border-radius: 24px;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.champ:focus-within { border-color: var(--vert); box-shadow: 0 0 0 3px var(--vert-pale); }
.champ textarea {
  flex: 1;
  min-width: 0;
  max-height: 32vh;
  margin: 0;
  padding: 7px 0;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  color: var(--encre);
  font: 400 16px/1.45 "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
}
.champ textarea::placeholder { color: #8A908C; }
.envoyer {
  flex: none;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--vert);
  color: var(--blanc);
  cursor: pointer;
  transition: background-color .2s ease;
}
.envoyer:disabled { background: #C9CCC7; cursor: default; }
.aide { display: none; margin: 8px 0 0; text-align: center; font-size: 12px; color: var(--gris); }
@media (hover: hover) and (pointer: fine) { .aide { display: block; } }
.termine {
  flex: none;
  margin: 0;
  padding: 18px 20px calc(18px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--trait);
  text-align: center;
  font-size: 14px;
  color: var(--gris);
}

/* Récapitulatif */
.recap {
  margin-top: 34px;
  padding: 28px 24px 24px;
  background: var(--blanc);
  border-radius: 22px;
  box-shadow: 0 1px 2px rgba(22, 26, 24, .04), 0 10px 32px rgba(22, 26, 24, .06);
  animation: apparition .3s ease-out both;
}
.recap h2 { margin: 0 0 6px; font-size: 22px; line-height: 1.2; font-weight: 600; letter-spacing: -.02em; }
.recap .sous { margin: 0 0 18px; font-size: 15px; line-height: 1.45; color: var(--gris); }
.bloc { padding: 14px 0; border-top: 1px solid var(--trait); }
.bloc > label, .bloc > h3 { display: block; margin: 0 0 4px; font-size: 13px; font-weight: 500; line-height: 1.3; color: var(--gris); }
.recap textarea {
  display: block;
  width: 100%;
  margin: 0;
  padding: 4px 8px;
  margin-left: -8px;
  width: calc(100% + 16px);
  border: 0;
  border-radius: 8px;
  outline: 0;
  resize: none;
  background: transparent;
  color: var(--encre);
  font: 400 16px/1.5 "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  transition: background-color .2s ease;
}
.recap textarea:hover { background: #F8F8F5; }
.recap textarea:focus { background: #F2F2EC; }
.recap .valeur { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 16px; line-height: 1.5; }
.question { display: flex; align-items: flex-start; gap: 10px; }
.question::before { content: ""; flex: none; width: 5px; height: 5px; margin-top: 12px; border-radius: 50%; background: var(--vert); }
.question + .question { margin-top: 2px; }
.aide-liste { margin: 0 0 6px; font-size: 13px; line-height: 1.4; color: var(--gris); }
.lien-texte {
  margin: 8px 0 0;
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--vert);
  font-size: 14.5px;
  font-weight: 500;
  cursor: pointer;
}
.recap .bouton { width: 100%; margin-top: 18px; }
.recap .note { margin: 12px 0 0; font-size: 13.5px; line-height: 1.45; color: var(--gris); text-align: center; }
.recap .horodatage { margin: 16px 0 0; font-size: 13.5px; color: var(--vert); font-weight: 500; }

/* Vos données et vos droits : le lien reste accessible avant et pendant l'échange. */
.donnees { margin: 18px 0 0; font-size: 13.5px; line-height: 1.4; }
.donnees a, .termine a { color: var(--vert); }
.saisie .donnees { margin: 6px 0 0; text-align: center; font-size: 12px; }
.page-notice { overflow: auto; }
.notice { max-width: var(--colonne); margin: 0 auto; padding: 28px 20px 56px; }
.notice h1 { margin: 22px 0 10px; font-size: clamp(28px, 7vw, 40px); }
.notice h2 { margin: 26px 0 6px; font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.notice p { margin: 0 0 10px; font-size: 16px; }
.notice .note-notice { margin-top: 28px; font-size: 14px; color: var(--gris); }

@media (min-width: 720px) {
  .fil { padding-top: 40px; }
  .recap { padding: 34px 34px 28px; }
  .recap .bouton { width: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
