/* Diagnostic Shape — design system « Croqué · Management » (Figma « DS v3 · Croqué »).
   Thème clair fixe : papier crème, panneaux blancs, texte Espresso. Le Caramel est un fond, jamais une couleur de texte.
   Le vert et le rouge du design system sont réservés aux bonnes et mauvaises réponses : ce diagnostic n'en a pas. */

@font-face { font-family: "Poppins"; font-weight: 300; font-display: swap; src: url("../assets/fonts/Poppins-Light.ttf") format("truetype"); }
@font-face { font-family: "Poppins"; font-weight: 400; font-display: swap; src: url("../assets/fonts/Poppins-Regular.ttf") format("truetype"); }
@font-face { font-family: "Poppins"; font-weight: 500; font-display: swap; src: url("../assets/fonts/Poppins-Medium.ttf") format("truetype"); }
@font-face { font-family: "Poppins"; font-weight: 600; font-display: swap; src: url("../assets/fonts/Poppins-SemiBold.ttf") format("truetype"); }
@font-face { font-family: "Poppins"; font-weight: 700; font-display: swap; src: url("../assets/fonts/Poppins-Bold.ttf") format("truetype"); }

:root {
  color-scheme: light;
  --espresso: #2a160d;
  --cacao: #5a3423;
  --moka: #7e4630;
  --caramel: #e28e48;
  --latte: #f7e5d4;
  --creme: #fdf8f3;
  --blanc: #ffffff;
  --lilas: #e8d6f7;
  --blanc-80: rgba(255, 255, 255, .8);
  --blanc-94: rgba(255, 255, 255, .94);
  --espresso-20: rgba(42, 22, 13, .2);
  --espresso-30: rgba(42, 22, 13, .3);
  --inactif: #a08f85;
  --ombre-panneau: 0 16px 40px rgba(41, 23, 13, .14);
  --ombre-carte: 0 6px 18px rgba(41, 23, 13, .08);
  --rayon-panneau: 28px;
  --rayon-carte: 24px;
  --rayon-tuile: 20px;
  --rayon-encadre: 14px;
  --gouttiere: clamp(16px, 4vw, 48px);
  --hauteur-barre: 72px;
  --hauteur-pied: 84px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--creme);
  /* Grain papier : bruit monochrome teinté Moka, 5 %. */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .494 0 0 0 0 .275 0 0 0 0 .188 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  color: var(--espresso);
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 24px;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ol, ul, dl, dd, figure, blockquote { margin: 0; padding: 0; }
ol, ul { list-style: none; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
strong, b { font-weight: 700; }

.visuellement-masque { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.sans-js { padding: 2rem; }
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--espresso); outline-offset: 3px; }
.evitement { position: absolute; left: 16px; top: -80px; z-index: 20; background: var(--espresso); color: var(--creme); padding: 10px 18px; border-radius: 999px; font-weight: 500; text-decoration: none; }
.evitement:focus { top: 12px; }

/* --- Coque ------------------------------------------------------------------------------------------------------- */
.app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; position: relative; }

.barre {
  position: sticky; top: 0; z-index: 10;
  min-height: var(--hauteur-barre);
  display: flex; align-items: center; gap: 16px;
  padding: 14px var(--gouttiere);
  background: linear-gradient(to bottom, rgba(253, 248, 243, .96) 60%, rgba(253, 248, 243, 0));
}
.barre-marque { font-weight: 700; font-size: 15px; white-space: nowrap; }
.barre-sep { width: 1px; height: 18px; background: var(--espresso-30); flex: none; }
.barre-contexte { color: var(--cacao); font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: clip; min-width: 0; }
.barre-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex: none; }
.pastille-barre {
  background: var(--blanc-80); border: 1px solid var(--latte); border-radius: 999px;
  padding: 8px 16px; font-size: 14px; font-weight: 500; line-height: 20px; min-height: 40px;
  box-shadow: 0 2px 8px rgba(41, 23, 13, .06);
}
.pastille-barre:hover { background: var(--blanc); border-color: var(--espresso-30); }
.badge-demo { background: var(--lilas); border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 600; }

.progression { padding: 0 var(--gouttiere) 4px; display: flex; flex-direction: column; gap: 8px; }
.progression ol { display: flex; gap: 6px; }
.progression li { flex: 1 1 0; max-width: 44px; height: 8px; border-radius: 999px; border: 1.5px solid var(--cacao); background: transparent; }
.progression li.fait { background: var(--espresso); border-color: var(--espresso); }
.progression li.actuel { background: var(--caramel); border-color: var(--caramel); }
.progression p { font-size: 14px; line-height: 20px; color: var(--cacao); font-weight: 500; }

.scene { flex: 1; display: flex; flex-direction: column; }

.pied {
  position: sticky; bottom: 0; z-index: 10;
  min-height: var(--hauteur-pied);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px var(--gouttiere) max(16px, env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(253, 248, 243, .96) 65%, rgba(253, 248, 243, 0));
}
.pied-aide { flex: 1; text-align: center; font-size: 14px; line-height: 20px; color: var(--cacao); font-weight: 500; }

/* --- Composants -------------------------------------------------------------------------------------------------- */
.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 12px 24px; border-radius: 999px;
  font-size: 16px; font-weight: 500; line-height: 24px; text-decoration: none; white-space: nowrap;
  border: 1.5px solid var(--espresso);
  transition: transform .12s ease, background-color .12s ease, box-shadow .12s ease;
}
.bouton-primaire { background: var(--espresso); color: var(--creme); }
.bouton-primaire:hover { background: #40241a; box-shadow: var(--ombre-carte); }
.bouton-secondaire { background: var(--blanc); color: var(--espresso); }
.bouton-secondaire:hover { background: var(--creme); box-shadow: var(--ombre-carte); }
.bouton:active { transform: translateY(1px); }
.bouton[aria-disabled="true"] { background: var(--inactif); border-color: var(--inactif); color: var(--blanc); cursor: not-allowed; box-shadow: none; }
.bouton-secondaire[aria-disabled="true"] { background: transparent; color: var(--cacao); border-color: var(--espresso-30); }
.fleche { font-family: system-ui, sans-serif; font-weight: 400; }

.pastille { display: inline-flex; align-items: center; border-radius: 999px; padding: 6px 16px; font-size: 13px; font-weight: 600; line-height: 20px; }
.pastille-caramel { background: var(--caramel); color: var(--espresso); letter-spacing: .08em; text-transform: uppercase; }
.pastille-lilas { background: var(--lilas); color: var(--espresso); letter-spacing: .04em; }
.pastille-blanche { background: var(--blanc); color: var(--espresso); border: 1px solid var(--latte); }

.surtitre { font-size: 13px; font-weight: 600; line-height: 20px; letter-spacing: .12em; text-transform: uppercase; color: var(--cacao); }
.titre-display { font-size: clamp(44px, 6.4vw, 70px); line-height: 1.06; font-weight: 300; letter-spacing: -1.5px; }
.titre-1 { font-size: clamp(30px, 4.2vw, 48px); line-height: 1.13; font-weight: 300; letter-spacing: -1.5px; }
.titre-2 { font-size: clamp(24px, 3vw, 36px); line-height: 1.12; font-weight: 300; letter-spacing: -1px; }
.titre-3 { font-size: 22px; line-height: 28px; font-weight: 300; letter-spacing: -.5px; }
.titre-display b, .titre-1 b, .titre-2 b, .titre-3 b { font-weight: 700; }
.intertitre { font-size: 20px; line-height: 28px; font-weight: 700; }
.chapeau { font-size: clamp(17px, 1.6vw, 20px); line-height: 1.6; color: var(--cacao); }
.texte-fort { font-weight: 600; font-size: 17px; line-height: 26px; }
.secondaire { color: var(--cacao); }

.panneau {
  background: var(--blanc-94); border: 1px solid var(--latte); border-radius: var(--rayon-panneau);
  box-shadow: var(--ombre-panneau); padding: clamp(22px, 3vw, 36px);
}
.consigne {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--blanc); border: 1px solid var(--latte); border-radius: 999px;
  padding: 8px 18px 8px 10px; font-size: 15px; font-weight: 500; line-height: 22px;
  box-shadow: 0 2px 8px rgba(41, 23, 13, .06);
}
.consigne::before {
  content: "i"; flex: none; width: 24px; height: 24px; border-radius: 50%;
  background: var(--caramel); color: var(--espresso); font-weight: 700; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center;
}
.retenir { background: var(--lilas); border-radius: var(--rayon-encadre); padding: 16px 20px; }
.retenir-titre { font-size: 14px; line-height: 20px; color: var(--cacao); font-weight: 500; }
.retenir p + p { margin-top: 2px; }
.retenir .texte-fort + p { margin-top: 8px; font-size: 15px; }
.points-cles { display: grid; gap: 18px; }
.points-cles li { display: grid; grid-template-columns: 28px 1fr; gap: 14px; align-items: start; }
.puce {
  width: 28px; height: 28px; border-radius: 50%; background: var(--caramel); color: var(--espresso);
  font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; flex: none;
}
.points-cles .texte-fort { display: block; }
.points-cles span.secondaire { display: block; font-size: 15px; }

/* --- Accueil et mode d'emploi : décor croqué plein cadre, voile crème côté texte --------------------------------- */
.ecran-decor { position: relative; flex: 1; display: flex; align-items: center; padding: 24px var(--gouttiere) 56px; }
.decor {
  position: fixed; inset: 0; z-index: -1;
  background: var(--creme) url("../assets/images/decor-bureau.jpg") right center / cover no-repeat;
}
.decor::after {
  content: ""; position: absolute; inset: 0;
  /* Papier plein sous le texte, puis le voile s'efface vers le dessin : aucun texte ne passe sur un trait. */
  background: linear-gradient(to right, var(--creme) 0, var(--creme) 50%, rgba(253, 248, 243, .75) 62%, rgba(253, 248, 243, 0) 84%);
}
.accueil { max-width: min(600px, 46vw); display: grid; gap: 24px; justify-items: start; }
.accueil .pastilles { display: flex; flex-wrap: wrap; gap: 10px; }
.accueil-signature { display: flex; align-items: center; gap: 14px; margin-top: 12px; font-size: 14px; color: var(--cacao); font-weight: 500; }
.logo-skillsday { background: var(--blanc); border: 1px solid var(--latte); border-radius: 999px; padding: 9px 18px; display: inline-flex; }
.logo-skillsday img { height: 20px; width: auto; }

.mode { width: min(760px, 100%); display: grid; gap: 24px; }
.mode .panneau { display: grid; gap: 24px; }
.mode-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* --- Situation --------------------------------------------------------------------------------------------------- */
.ecran-situation {
  flex: 1; display: grid; grid-template-columns: minmax(300px, 440px) minmax(0, 1fr); gap: clamp(20px, 3vw, 40px);
  align-items: start; padding: 20px var(--gouttiere) 24px; max-width: 1280px; width: 100%; margin: 0 auto;
}
.situation-recit { display: grid; gap: 16px; justify-items: start; }
.situation-recit .panneau { display: grid; gap: 14px; width: 100%; }
.bulle {
  background: var(--blanc); border: 1px solid var(--latte); border-radius: 6px 20px 20px 20px;
  padding: 14px 18px; box-shadow: var(--ombre-carte); width: 100%;
}
.bulle cite { display: block; font-style: normal; font-size: 14px; line-height: 20px; color: var(--cacao); font-weight: 500; }
.bulle p { font-weight: 600; font-size: 17px; line-height: 26px; }

.choix { display: grid; gap: 14px; }
.choix-carte {
  position: relative; display: grid; grid-template-columns: 36px 1fr; gap: 16px; align-items: center; text-align: left; width: 100%;
  background: var(--blanc); border: 1px solid var(--latte); border-radius: var(--rayon-tuile);
  padding: 18px 22px; min-height: 76px; box-shadow: var(--ombre-carte);
  font-weight: 500; font-size: 16px; line-height: 24px;
  transition: box-shadow .12s ease, transform .12s ease;
}
.choix-carte:hover { box-shadow: var(--ombre-panneau); transform: translateY(-1px); }
.choix-carte .lettre {
  width: 36px; height: 36px; border-radius: 50%; background: var(--caramel); color: var(--espresso);
  font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
}
.choix-carte.est-plus { box-shadow: inset 0 0 0 2.5px var(--espresso), var(--ombre-carte); }
.choix-carte.est-moins { box-shadow: inset 0 0 0 2.5px var(--cacao), var(--ombre-carte); background: var(--creme); }
.choix-badge {
  position: absolute; top: -12px; right: 18px; border-radius: 999px; padding: 3px 14px;
  font-size: 13px; line-height: 20px; font-weight: 600; white-space: nowrap;
}
.est-plus .choix-badge { background: var(--espresso); color: var(--creme); }
.est-moins .choix-badge { background: var(--lilas); color: var(--espresso); box-shadow: inset 0 0 0 1.5px var(--cacao); }
.choix-rappel { font-size: 14px; line-height: 20px; color: var(--cacao); font-weight: 500; margin-top: 4px; }

/* --- Résultats --------------------------------------------------------------------------------------------------- */
.ecran-resultats { width: min(1040px, 100%); margin: 0 auto; padding: 20px var(--gouttiere) 72px; display: grid; gap: 28px; }
.resultats-tete { display: grid; gap: 18px; justify-items: start; padding: 20px 0 8px; max-width: 760px; }
.section { display: grid; gap: 20px; }
.section > .panneau { display: grid; gap: 20px; }
.section-intro { color: var(--cacao); max-width: 720px; }

.positions { display: grid; gap: 6px; }
.position {
  display: grid; grid-template-columns: minmax(180px, 1.2fr) minmax(150px, 1fr) minmax(170px, auto);
  gap: 8px 20px; align-items: center; padding: 12px 16px; border-radius: var(--rayon-encadre);
}
.position:nth-child(odd) { background: var(--creme); }
.position-nom { font-weight: 600; }
.position-nom small { display: block; font-weight: 400; font-size: 14px; line-height: 20px; color: var(--cacao); }
.segments { display: flex; gap: 5px; }
.segments i { flex: 1; height: 10px; border-radius: 999px; border: 1.5px solid var(--cacao); }
.segments i.plein { background: var(--espresso); border-color: var(--espresso); }
.position.est-priorite .segments i.plein { background: var(--caramel); border-color: var(--caramel); }
.position-palier { font-size: 15px; font-weight: 500; text-align: right; }
.position-palier small { display: block; font-size: 13px; line-height: 18px; color: var(--cacao); font-weight: 400; }
.legende { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 14px; line-height: 20px; color: var(--cacao); }
.legende span { display: inline-flex; align-items: center; gap: 8px; }
.legende i { width: 22px; height: 8px; border-radius: 999px; background: var(--espresso); }
.legende i.caramel { background: var(--caramel); }

.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.carte { background: var(--blanc-94); border: 1px solid var(--latte); border-radius: var(--rayon-carte); box-shadow: var(--ombre-carte); padding: 26px; display: grid; gap: 14px; align-content: start; }
.carte-tete { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.numero { width: 40px; height: 40px; border-radius: 50%; background: var(--caramel); color: var(--espresso); font-weight: 700; font-size: 20px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.rubrique { font-size: 13px; line-height: 20px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--cacao); }
.constat { border-left: 3px solid var(--caramel); padding-left: 14px; display: grid; gap: 4px; }
.constat q { quotes: none; font-weight: 600; }
.constat .secondaire { font-size: 15px; }
.bloc { display: grid; gap: 6px; }
.bloc .constat + .constat { margin-top: 10px; }

.barres { display: grid; gap: 10px; }
.barre-vote { position: relative; background: var(--blanc); border: 1px solid var(--latte); border-radius: 12px; min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 16px; overflow: hidden; }
.barre-vote .remplissage { position: absolute; inset: 0 auto 0 0; background: var(--lilas); border-radius: 12px 0 0 12px; }
.barre-vote.en-tete .remplissage { background: var(--caramel); }
.barre-vote span { position: relative; font-weight: 600; }
.barre-vote span small { font-weight: 400; color: var(--espresso); font-size: 14px; margin-left: 10px; }
.barre-vote b { position: relative; white-space: nowrap; }

.champs { display: grid; gap: 18px; }
.champ { display: grid; gap: 6px; }
.champ label { font-weight: 600; }
.champ small { color: var(--cacao); font-size: 14px; line-height: 20px; }
.champ input, .champ textarea {
  width: 100%; background: var(--blanc); border: 1.5px solid var(--cacao); border-radius: var(--rayon-encadre);
  padding: 12px 16px; font-size: 16px; line-height: 24px;
}
.champ textarea { min-height: 96px; resize: vertical; }
.champ .erreur { color: var(--espresso); font-weight: 600; }
.champ input[aria-invalid="true"] { border-width: 2.5px; border-color: var(--espresso); }
.champ input:focus-visible, .champ textarea:focus-visible { outline-offset: 1px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.etat-pdf { font-size: 15px; font-weight: 500; color: var(--cacao); min-height: 24px; }
.resultats-pied { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; color: var(--cacao); font-size: 14px; }

/* --- Fenêtre « Vos données » ------------------------------------------------------------------------------------- */
dialog.fenetre {
  border: 1px solid var(--latte); border-radius: var(--rayon-panneau); padding: 0; width: min(560px, calc(100vw - 32px));
  background: var(--blanc); color: var(--espresso); box-shadow: var(--ombre-panneau);
}
dialog.fenetre::backdrop { background: rgba(42, 22, 13, .35); }
.fenetre-corps { padding: 28px; display: grid; gap: 18px; }
.fenetre-corps ul { display: grid; gap: 10px; }
.fenetre-corps li { padding-left: 20px; position: relative; }
.fenetre-corps li::before { content: ""; position: absolute; left: 0; top: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--caramel); }

/* --- Mouvement --------------------------------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .entree > * { animation: entree .38s ease both; }
  .entree > *:nth-child(2) { animation-delay: .05s; }
  .entree > *:nth-child(3) { animation-delay: .1s; }
  .entree > *:nth-child(4) { animation-delay: .15s; }
  .entree > *:nth-child(n+5) { animation-delay: .2s; }
  /* Seul le déplacement est animé : le contenu reste lisible même si l'animation ne démarre pas (onglet en arrière-plan). */
  @keyframes entree { from { transform: translateY(10px); } to { transform: none; } }
  .barre-vote .remplissage { transition: width .6s ease; }
}

/* --- Mobile ------------------------------------------------------------------------------------------------------ */
@media (max-width: 860px) {
  :root { --hauteur-barre: 60px; }
  .barre { gap: 10px; }
  .barre-sep, .barre-contexte { display: none; }
  .ecran-situation { grid-template-columns: 1fr; padding-top: 12px; }
  .ecran-decor { align-items: flex-start; padding-top: 12px; }
  /* Sur téléphone, le dessin passe sous le contenu, en bas de page : le texte reste sur du papier crème. */
  .accueil { max-width: none; }
  .ecran-decor { padding-bottom: 250px; }
  .decor { position: absolute; inset: auto 0 0 0; height: 230px; background-size: auto 100%; background-position: 86% bottom; }
  .decor::after { background: linear-gradient(to bottom, var(--creme) 0, rgba(253, 248, 243, .3) 45%, rgba(253, 248, 243, 0) 100%); }
  .duo { grid-template-columns: 1fr; }
  .position { grid-template-columns: 1fr; gap: 8px; }
  .position-palier { text-align: left; }
  .pied-aide { display: none; }
  .choix-carte { padding: 16px; grid-template-columns: 32px 1fr; gap: 12px; }
  .choix-carte .lettre { width: 32px; height: 32px; }
  .bouton { padding: 12px 20px; }
  .barre-vote span small { display: block; margin-left: 0; }
}

@media print {
  .barre, .pied, .decor, .actions, .champs { display: none !important; }
  body { background: #fff; }
}
