/* Socle de la démo Bessé : couleurs et typographies du site besse.fr, barre, étapes, composants communs.
   Cyan : ce que la machine a fait. Sable : ce que l'équipe décide. Rouge et vert : écarts défavorables et améliorations. */
:root {
  --papier: #edf1f5;
  --feuille: #ffffff;
  --marine: #012b65;
  --marine-2: #0a3a7c;
  --bleu: #00559c;
  --bleu-voile: #e5eef7;
  --cyan: #60c5db;
  --cyan-texte: #12768d;
  --cyan-voile: #e3f4f8;
  --sable: #c1b093;
  --sable-texte: #76623c;
  --sable-voile: #f5f0e6;
  --encre: #17243b;
  --encre-2: #5a6577;
  --filet: #dce2ea;
  --filet-fort: #b8c2cf;
  --moins: #a6372f;
  --moins-voile: #fbe9e6;
  --mieux: #22704e;
  --mieux-voile: #e2f1e9;
  --police: 'Barlow', system-ui, sans-serif;
  --police-titre: 'Playfair Display', Georgia, serif;
  --rayon: 8px;
  --rayon-petit: 5px;
  --ombre: 0 1px 2px rgba(1, 43, 101, 0.06), 0 10px 28px rgba(1, 43, 101, 0.07);
  --largeur: 1280px;
  --marge: clamp(16px, 3vw, 32px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--papier);
  color: var(--encre);
  font: 400 16px/1.5 var(--police);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--police-titre); font-weight: 500; line-height: 1.15; margin: 0; font-variant-numeric: lining-nums; }
sup { font-size: 0.62em; line-height: 0; vertical-align: 0.48em; margin-left: 0.04em; }
p, ul, ol { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--bleu); outline-offset: 2px; border-radius: 3px; }

.evitement { position: absolute; left: -9999px; top: 8px; background: var(--feuille); padding: 8px 12px; z-index: 10; }
.evitement:focus { left: 8px; }
.invisible { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.noscript { padding: 40px var(--marge); }

/* Barre du haut, marine comme le site de Bessé */
.barre {
  display: flex; align-items: center; gap: 28px;
  padding: 0 var(--marge);
  min-height: 60px;
  background: var(--marine);
  color: #fff;
  position: sticky; top: 0; z-index: 5;
}
.barre__logo { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.barre__logo img { border-radius: 6px; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25); }
.barre__marque { font-family: var(--police-titre); font-size: 25px; font-style: italic; letter-spacing: 0.01em; }
.onglets { display: flex; gap: 4px; align-self: stretch; }
.onglets a {
  display: flex; align-items: center; padding: 0 14px;
  text-decoration: none; font-weight: 500; font-size: 15px; color: rgba(255, 255, 255, 0.72);
  border-bottom: 3px solid transparent; border-top: 3px solid transparent;
}
.onglets a:hover { color: #fff; }
.onglets .court { display: none; }
.onglets a[aria-current] { color: #fff; border-bottom-color: var(--cyan); }
.barre__utilisateur { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 14px; white-space: nowrap; }
.barre__utilisateur > span { display: grid; line-height: 1.2; }
.barre__utilisateur small { color: rgba(255, 255, 255, 0.65); font-size: 12px; }
.barre__utilisateur i {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--sable); color: var(--marine); font-style: normal; font-weight: 700; font-size: 12px;
}

/* Étapes du dossier : une vraie séquence, donc numérotée */
.etapes { background: var(--feuille); border-bottom: 1px solid var(--filet); overflow-x: auto; scrollbar-width: none; }
.etapes ol { list-style: none; margin: 0 auto; padding: 0 var(--marge); display: flex; gap: 4px; max-width: var(--largeur); }
.etapes a {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px 11px;
  text-decoration: none; border-bottom: 3px solid transparent;
  color: var(--encre-2); font-weight: 600; font-size: 15px; white-space: nowrap;
}
.etapes a span {
  display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid currentColor; font-size: 12px;
}
.etapes a:hover { color: var(--encre); }
.etapes a[aria-current] { color: var(--marine); border-bottom-color: var(--marine); }
.etapes a.faite span { background: var(--marine); border-color: var(--marine); color: #fff; }

/* Page */
main { outline: none; }
.page { max-width: var(--largeur); margin: 0 auto; padding: 30px var(--marge) 72px; }
.page.entree { animation: entree 0.32s ease-out both; }
@keyframes entree { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.entete { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 32px; margin-bottom: 24px; }
.entete h1 { font-size: clamp(26px, 3.2vw, 36px); max-width: 30ch; color: var(--marine); }
.entete p { color: var(--encre-2); max-width: 64ch; margin-top: 8px; }
.entete .surtitre { color: var(--encre-2); font-size: 15px; margin: 0 0 6px; }

.panneau { background: var(--feuille); border: 1px solid var(--filet); border-radius: var(--rayon); }
.panneau__titre { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 18px 20px 12px; }
.panneau__titre h2 { font-size: 20px; color: var(--marine); }
.panneau__titre span { color: var(--encre-2); font-size: 14px; }

/* Boutons */
.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: var(--rayon-petit);
  background: var(--marine); color: #fff; border: 1px solid var(--marine);
  font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer;
  transition: background 0.15s;
}
.bouton:hover { background: var(--marine-2); }
.bouton--discret { background: var(--feuille); color: var(--marine); border-color: var(--filet-fort); }
.bouton--discret:hover { background: var(--bleu-voile); }
.bouton[aria-disabled='true'] { opacity: 0.45; cursor: default; }
.bouton--fait { background: var(--mieux-voile); color: var(--mieux); border-color: transparent; cursor: default; }
.bouton--fait:hover { background: var(--mieux-voile); }

/* Ce que la machine a fait : filet cyan. Ce que l'équipe décide : filet sable. */
.machine { border-left: 3px solid var(--cyan); padding-left: 14px; }
.decision { border-left: 3px solid var(--sable); padding-left: 14px; }
.signe-machine { display: inline-flex; align-items: center; gap: 6px; color: var(--cyan-texte); font-size: 14px; font-weight: 600; }
.signe-machine::before { content: ''; width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--cyan); }
.signe-decision { display: inline-flex; align-items: center; gap: 6px; color: var(--sable-texte); font-size: 14px; font-weight: 600; }
.signe-decision::before { content: ''; width: 9px; height: 9px; transform: rotate(45deg); background: var(--sable); }

/* Pastilles d'étape et d'écart */
.pastille { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; background: var(--papier); color: var(--encre-2); }
.pastille--alerte { background: var(--moins-voile); color: var(--moins); }
.pastille--ok { background: var(--mieux-voile); color: var(--mieux); }
.pastille--machine { background: var(--cyan-voile); color: var(--cyan-texte); }

/* Tableaux */
.tableau { width: 100%; border-collapse: collapse; font-size: 15px; }
.tableau th { text-align: left; font-weight: 600; font-size: 13px; color: var(--encre-2); padding: 8px 14px; border-bottom: 1px solid var(--filet); white-space: nowrap; }
.tableau td { padding: 12px 14px; border-bottom: 1px solid var(--filet); vertical-align: top; }
.tableau tr:last-child td { border-bottom: 0; }
.tableau .nombre { text-align: right; white-space: nowrap; }

.chiffre { font-family: var(--police-titre); font-weight: 500; font-variant-numeric: lining-nums tabular-nums; }
.muet { color: var(--encre-2); }
.source { color: var(--encre-2); font-size: 13px; }

/* Message de confirmation */
.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%);
  background: var(--marine); color: #fff; padding: 12px 18px; border-radius: var(--rayon);
  box-shadow: var(--ombre); font-size: 15px; max-width: min(560px, calc(100vw - 32px)); z-index: 20;
  animation: toast 0.25s ease-out both;
}
@keyframes toast { from { opacity: 0; transform: translate(-50%, 6px); } to { opacity: 1; transform: translate(-50%, 0); } }

@media (max-width: 760px) {
  body { font-size: 15px; }
  .barre { gap: 14px; min-height: 54px; }
  .barre__marque { font-size: 21px; }
  .barre__utilisateur > span { display: none; }
  .onglets a { padding: 0 8px; font-size: 14px; white-space: nowrap; }
  .onglets .long { display: none; }
  .onglets .court { display: inline; }
  .page { padding-top: 22px; }
}
@media (max-width: 420px) {
  .barre__marque { display: none; }
  .barre { gap: 10px; }
  .barre__utilisateur { display: none; }
  .onglets a { padding: 0 7px; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
