/* Préparation du workshop Green SURF.
   Palette reprise du site (forest, leaf, spring, sand, cream, rain, sun).
   L'élément marquant : les post-its de couleur du workshop (rouge irritants,
   vert rêves, bleu inspirations) qui annoncent chaque rubrique. */

:root {
  --forest: #1B4332;
  --forest-light: #2D6A4F;
  --leaf: #52B788;
  --leaf-dark: #3D9A6E;
  --spring: #B7E4C7;
  --sand: #F5F0E8;
  --cream: #FEFCF7;
  --earth: #5C4033;
  --rain: #3B82C4;
  --sun: #F4A261;
  --encre: #22302A;
  --encre-douce: #5B6A62;
  --trait: #DED6C8;
  --postit-rouge: #F2B8AE;
  --postit-vert: #B7E4C7;
  --postit-bleu: #BFD9F2;
  --postit-neutre: #F1E3A6;
  --rouge-texte: #9A3B2C;
  --bleu-texte: #24588F;
  --focus: #F4A261;
  --rayon: 6px;
  --police: 'DM Sans', system-ui, sans-serif;
  --police-titre: 'Playfair Display', Georgia, serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }

body {
  margin: 0;
  font-family: var(--police);
  font-size: 17px;
  line-height: 1.55;
  color: var(--encre);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}

.saut { position: absolute; left: -999px; top: 0; background: var(--forest); color: #fff; padding: .5rem 1rem; z-index: 100; }
.saut:focus { left: 1rem; top: 1rem; }
.visuellement-cache { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ---------- En-tête ---------- */
.entete { background: var(--forest); color: #fff; }
.entete-int { max-width: 1120px; margin: 0 auto; padding: 1rem 16px; display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.marque { margin: 0; font-weight: 700; font-size: 1.25rem; letter-spacing: -.01em; }
.marque span { color: var(--leaf); }
.entete-note { margin: 0; font-size: .9rem; color: rgba(255,255,255,.75); }

/* ---------- Mise en page ---------- */
.page { max-width: 1120px; margin: 0 auto; padding: 0 16px 4rem; }

.intro { max-width: 680px; padding: 3rem 0 2rem; }
.surtitre { margin: 0 0 .75rem; color: var(--forest-light); font-weight: 500; }
h1 {
  font-family: var(--police-titre);
  font-weight: 400;
  font-size: clamp(2rem, 4.5vw, 3rem);
  line-height: 1.12;
  letter-spacing: -.01em;
  margin: 0 0 1.5rem;
  color: var(--forest);
}
h1 em { font-style: italic; color: var(--forest-light); }
.intro-texte p { margin: 0 0 1rem; max-width: 62ch; }

.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 2rem; }
.mode {
  display: block; text-align: left; font: inherit; color: inherit; text-decoration: none; cursor: pointer;
  background: #fff; border: 1.5px solid var(--trait); border-radius: var(--rayon); padding: 1.15rem 1.25rem;
  transition: border-color .15s, transform .15s;
}
.mode strong { display: block; font-size: 1.05rem; color: var(--forest); margin-bottom: .35rem; }
.mode span { display: block; font-size: .93rem; color: var(--encre-douce); line-height: 1.45; }
.mode:hover { border-color: var(--leaf); }
.mode-chat { border-color: var(--leaf); background: linear-gradient(0deg, rgba(183,228,199,.25), rgba(183,228,199,.25)), #fff; }
.mode-chat strong::before { content: ''; display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; background: var(--leaf); margin-right: .5rem; vertical-align: .05rem; }

/* ---------- Formulaire : rail + sections ---------- */
.formulaire { display: grid; grid-template-columns: 220px minmax(0, 680px); gap: 2rem 3.5rem; align-items: start; }
.rail { position: sticky; top: 1.5rem; }
.rail ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--trait); }
.rail li a {
  display: block; padding: .45rem 0 .45rem 1rem; margin-left: -2px; border-left: 2px solid transparent;
  color: var(--encre-douce); text-decoration: none; font-size: .93rem; line-height: 1.3;
}
.rail li a.actif { color: var(--forest); border-left-color: var(--forest); font-weight: 500; }
.rail li a.complet::after { content: ' ✓'; color: var(--leaf-dark); }
.sections { min-width: 0; }

.bandeau { grid-column: 1 / -1; background: var(--spring); color: var(--forest); padding: .9rem 1.1rem; border-radius: var(--rayon); margin-bottom: .5rem; }

.rubrique { padding: 2.25rem 0 1.5rem; border-top: 1px solid var(--trait); scroll-margin-top: 1rem; }
.rubrique:first-child { border-top: 0; padding-top: .5rem; }
.rubrique-tete { position: relative; padding-left: 3.25rem; margin-bottom: 1.5rem; }
.rubrique h2 { font-family: var(--police-titre); font-weight: 600; font-size: 1.55rem; line-height: 1.2; margin: 0 0 .5rem; color: var(--forest); }
.rubrique-intro { margin: 0; color: var(--encre-douce); max-width: 58ch; }

/* Le post-it : carré teinté, légèrement penché, ombre courte comme collé au mur */
.postit {
  position: absolute; left: 0; top: .1rem; width: 2.25rem; height: 2.25rem;
  background: var(--postit-neutre); transform: rotate(-4deg);
  box-shadow: 1px 2px 3px rgba(34,48,42,.18);
}
.postit::after { content: ''; position: absolute; left: 35%; top: -6px; width: 30%; height: 10px; background: rgba(255,255,255,.55); }
.teinte-rouge .postit { background: var(--postit-rouge); transform: rotate(3deg); }
.teinte-vert .postit { background: var(--postit-vert); transform: rotate(-2deg); }
.teinte-bleu .postit { background: var(--postit-bleu); transform: rotate(5deg); }
.teinte-rouge h2 { color: var(--rouge-texte); }
.teinte-vert h2 { color: var(--forest-light); }
.teinte-bleu h2 { color: var(--bleu-texte); }

.champ { margin-bottom: 1.6rem; }
.label { display: block; font-weight: 500; margin: 0 0 .45rem; line-height: 1.35; }
.facultatif { font-weight: 400; color: var(--encre-douce); font-size: .9rem; }
.aide { margin: -.2rem 0 .5rem; font-size: .93rem; color: var(--encre-douce); }
input[type="text"], textarea {
  width: 100%; font: inherit; color: var(--encre); background: #fff;
  border: 1.5px solid var(--trait); border-radius: var(--rayon); padding: .7rem .85rem;
  transition: border-color .15s;
}
textarea { resize: vertical; min-height: 6.5rem; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: #9AA59E; }
input:focus, textarea:focus { border-color: var(--leaf-dark); outline: none; box-shadow: 0 0 0 3px rgba(82,183,136,.25); }
.manquant input, .manquant textarea { border-color: #C8553F; }
.erreur { margin: .35rem 0 0; font-size: .9rem; color: #A8412D; min-height: 0; }
.erreur:empty { display: none; }
.prerempli textarea, .prerempli input { background: #F1FAF4; border-color: var(--leaf); }

.choix { display: flex; flex-wrap: wrap; gap: .5rem; }
.puce { display: inline-flex; align-items: center; gap: .5rem; padding: .5rem .9rem; border: 1.5px solid var(--trait); border-radius: 999px; background: #fff; cursor: pointer; }
.puce input { accent-color: var(--forest-light); margin: 0; }
.puce:has(input:checked) { border-color: var(--forest-light); background: var(--spring); }

.envoi { grid-column: 2; padding-top: 1.5rem; border-top: 1px solid var(--trait); }
.envoi-note { color: var(--encre-douce); margin: 0 0 1rem; }
.hp { position: absolute; left: -9999px; }
.message { margin: .75rem 0 0; color: #A8412D; }
.message:empty { display: none; }

.bouton {
  font: inherit; font-weight: 500; cursor: pointer; border-radius: var(--rayon); padding: .8rem 1.4rem; border: 1.5px solid transparent;
  transition: background .15s, border-color .15s;
}
.bouton.primaire { background: var(--forest); color: #fff; }
.bouton.primaire:hover { background: var(--forest-light); }
.bouton.primaire:disabled { background: #8FA59A; cursor: default; }
.bouton.secondaire { background: #fff; color: var(--forest); border-color: var(--forest); text-decoration: none; display: inline-block; }
.bouton.secondaire:hover { background: var(--sand); }
.bouton.secondaire:disabled { color: #9AA59E; border-color: var(--trait); cursor: default; background: #fff; }

.merci { max-width: 640px; padding: 3rem 0; }
.merci h2 { font-family: var(--police-titre); font-weight: 400; font-size: 2rem; color: var(--forest); margin: 0 0 1rem; }
.signature { margin-top: 2rem; line-height: 1.5; }
.signature span { color: var(--encre-douce); }
.signature a { color: var(--forest-light); }

.pied { border-top: 1px solid var(--trait); background: var(--sand); }
.pied p { max-width: 1120px; margin: 0 auto; padding: 1.25rem 16px; font-size: .85rem; color: var(--encre-douce); }

/* ---------- Entretien (panneau latéral) ---------- */
.voile { position: fixed; inset: 0; background: rgba(27,67,50,.35); z-index: 40; }
.chat {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 100%);
  background: var(--sand); z-index: 50; display: flex; flex-direction: column;
  box-shadow: -8px 0 24px rgba(27,67,50,.15);
}
.chat[hidden], .voile[hidden] { display: none; }
.chat-entete { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: 1.1rem 1.25rem .9rem; background: var(--forest); color: #fff; }
.chat-entete h2 { margin: 0 0 .2rem; font-family: var(--police-titre); font-weight: 400; font-size: 1.3rem; }
.chat-entete p { margin: 0; font-size: .9rem; color: rgba(255,255,255,.75); }
.fermer { background: transparent; border: 0; color: #fff; font-size: 1.8rem; line-height: 1; cursor: pointer; padding: 0 .25rem; }
.chat-fil { flex: 1; overflow-y: auto; padding: 1.25rem; display: flex; flex-direction: column; gap: .75rem; }
.bulle { max-width: 88%; padding: .7rem .95rem; border-radius: 14px; white-space: pre-wrap; line-height: 1.5; font-size: .98rem; }
.bulle.assistant { background: #fff; border-bottom-left-radius: 4px; align-self: flex-start; }
.bulle.moi { background: var(--spring); color: var(--forest); border-bottom-right-radius: 4px; align-self: flex-end; }
.bulle.en-attente { color: var(--encre-douce); }
.bulle.en-attente::after { content: 'Je réfléchis…'; }
.bulle.erreur-bulle { background: #FBE6E1; color: var(--rouge-texte); }
.chat-saisie { display: flex; gap: .5rem; padding: .75rem 1.25rem 0; align-items: flex-end; }
.chat-saisie textarea { min-height: 3rem; }
.chat-saisie .bouton { padding: .75rem 1rem; }
.chat-pied { padding: .75rem 1.25rem 1.1rem; display: flex; flex-direction: column; gap: .5rem; }
.chat-note { margin: 0; font-size: .85rem; color: var(--encre-douce); }
body.chat-ouvert { overflow: hidden; }

/* ---------- Admin ---------- */
.page-admin { max-width: 860px; padding-top: 2rem; }
.admin-barre { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.admin-barre p { margin: 0; color: var(--encre-douce); }
.vide { color: var(--encre-douce); }
.fiche { background: #fff; border: 1px solid var(--trait); border-radius: var(--rayon); padding: 1.25rem 1.5rem; margin-bottom: 1.5rem; }
.fiche header { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; border-bottom: 1px solid var(--trait); padding-bottom: .75rem; margin-bottom: .75rem; }
.fiche header h2 { margin: 0; font-family: var(--police-titre); font-weight: 600; font-size: 1.3rem; color: var(--forest); }
.fiche header p { margin: 0; color: var(--encre-douce); font-size: .9rem; flex: 1; }
.fiche h3 { font-size: 1rem; margin: 1.25rem 0 .5rem; padding-left: .6rem; border-left: 4px solid var(--postit-neutre); }
.fiche .teinte-rouge h3 { border-color: var(--postit-rouge); }
.fiche .teinte-vert h3 { border-color: var(--postit-vert); }
.fiche .teinte-bleu h3 { border-color: var(--postit-bleu); }
.fiche .q { margin: .6rem 0 .1rem; font-size: .88rem; color: var(--encre-douce); }
.fiche .r { margin: 0; white-space: normal; }
.fiche details { margin-top: 1rem; font-size: .93rem; }
.fiche summary { cursor: pointer; color: var(--forest-light); }
.supprimer { font: inherit; font-size: .85rem; background: transparent; border: 1px solid var(--trait); border-radius: var(--rayon); padding: .3rem .7rem; cursor: pointer; color: var(--rouge-texte); }

/* ---------- Écrans étroits ---------- */
@media (max-width: 900px) {
  .formulaire { grid-template-columns: 1fr; gap: 1rem; }
  .rail { position: sticky; top: 0; background: var(--cream); z-index: 10; margin: 0 -16px; padding: .5rem 16px; border-bottom: 1px solid var(--trait); }
  .rail ol { display: flex; gap: .25rem; overflow-x: auto; border-left: 0; scrollbar-width: none; }
  .rail ol::-webkit-scrollbar { display: none; }
  .rail li a { white-space: nowrap; border-left: 0; margin: 0; padding: .35rem .7rem; border-radius: 999px; border: 1px solid transparent; font-size: .88rem; }
  .rail li a.actif { border-color: var(--forest); }
  .envoi { grid-column: 1; }
  .modes { grid-template-columns: 1fr; }
  .rubrique-tete { padding-left: 2.75rem; }
  .postit { width: 1.9rem; height: 1.9rem; }
  body { font-size: 16px; }
}
