/*
 * Flo, feuille de style de base.
 * Les valeurs viennent toutes de tokens.css : aucune couleur ni mesure
 * n'est écrite en dur ici.
 */

@import "tokens-0Fcw6rf.css";

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--surface-app);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 22px;
  -webkit-font-smoothing: antialiased;
}

/* Le focus clavier doit rester franc et visible partout (CDC §5.1, RGAA). */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Réservé aux lecteurs d'écran : retiré de l'affichage, pas de l'arbre
   d'accessibilité, contrairement à display:none. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Lien d'évitement : premier élément focusable, masqué jusqu'au focus. */
.skip-link {
  position: absolute;
  left: var(--space-4);
  top: calc(-1 * var(--space-8) - var(--space-5));
  z-index: 100;
  padding: var(--space-3) var(--space-4);
  background: var(--brand);
  color: var(--on-brand);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  font-weight: 600;
  text-decoration: none;
  transition: top 120ms ease-out;
}

.skip-link:focus {
  top: 0;
}

a {
  color: var(--brand);
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* ------------------------------------------------------------ marque */

/* Le logotype est posé en image de fond plutôt qu'en balise img, pour une
   raison précise : le thème sombre se choisit par un attribut data-theme, que
   l'élément picture ne sait pas suivre puisqu'il ne réagit qu'aux media
   queries. En CSS, la bascule est immédiate, et le navigateur ne télécharge
   que la version affichée. Le nom accessible est porté par l'aria-label du
   lien qui l'entoure, ou par le rôle img de l'élément lui-même. */

.brandmark {
  display: block;
  width: 104px;
  height: 34px;
  background: url("../images/flo-logo-Ab3CMcq.webp") no-repeat left center;
  background-size: contain;
  text-decoration: none;
  flex: none;
}

/* Le bleu nuit du F descend à peine au-dessus du fond sombre. La variante
   éclaircie garde la teinte et le dégradé, et remonte la seule luminosité. */
:root[data-theme="dark"] .brandmark,
:root[data-theme="dark"] .auth__logo {
  background-image: url("../images/flo-logo-sombre-WgPlTaR.webp");
}

.auth__logo {
  display: block;
  width: 168px;
  height: 56px;
  margin: 0 auto var(--space-5);
  background: url("../images/flo-logo-Ab3CMcq.webp") no-repeat center;
  background-size: contain;
}

/* ------------------------------------------------------------ surfaces */

.panel {
  background: var(--surface-panel);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

/* ------------------------------------------------------------ contrôles */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: var(--space-4);
}

.field label {
  font-size: 13px;
  font-weight: 600;
}

.field .hint {
  font-size: 12px;
  color: var(--ink-subtle);
}

.control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-panel);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
}

.control--error {
  border-color: var(--danger);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.btn--primary {
  background: var(--brand);
  color: var(--on-brand);
}

.btn--secondary {
  background: var(--surface-panel);
  color: var(--brand);
  border-color: var(--border-strong);
}

.btn--ghost {
  background: transparent;
  color: var(--brand);
}

.btn--block {
  width: 100%;
}

/* ------------------------------------------------------------ messages */

.alert {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: 14px;
  margin-bottom: var(--space-4);
}

/* L'icône et le texte portent l'information : jamais la couleur seule. */
.alert--error {
  background: var(--danger-tint);
  color: var(--danger-ink);
}

.alert--success {
  background: var(--success-tint);
  color: var(--success-ink);
}

.alert--info {
  background: var(--brand-tint);
  color: var(--brand-strong);
}

.alert--warning {
  background: var(--warning-tint);
  color: var(--warning-ink);
}

.alert svg {
  flex: none;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

/* ------------------------------------------------------------ connexion */

.auth {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: var(--space-5);
}

.auth__card {
  width: 100%;
  max-width: 420px;
  padding: var(--space-6);
  background: var(--surface-panel);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.auth__title {
  font-size: 22px;
  text-align: center;
  margin-bottom: var(--space-2);
}

.auth__lead {
  margin: 0 0 var(--space-5);
  text-align: center;
  color: var(--ink-muted);
  font-size: 14px;
}

.auth__footer {
  margin-top: var(--space-4);
  text-align: center;
  font-size: 13px;
}

.auth__service {
  margin-top: var(--space-5);
  text-align: center;
  font-size: 12px;
  color: var(--ink-subtle);
}

/* Le code à usage unique se lit chiffre par chiffre : chasse fixe, espacé. */
.otp {
  font-family: var(--font-mono);
  font-size: 26px;
  letter-spacing: 0.4em;
  text-align: center;
}

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

/* ==========================================================================
   Enveloppes d'écran
   ========================================================================== */

/* ------------------------------------------------- portail usager */

.topbar {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: 14px var(--space-6);
  background: var(--surface-panel);
  border-bottom: 1px solid var(--border-hairline);
  flex-wrap: wrap;
}

.topbar__service {
  font-size: 13px;
  color: var(--ink-subtle);
  border-left: 1px solid var(--border-hairline);
  padding-left: var(--space-4);
}

.topbar__nav {
  display: flex;
  gap: var(--space-4);
  margin-left: var(--space-5);
}

.topbar__nav a {
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink-muted);
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}

.topbar__nav a[aria-current="page"] {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

.topbar__account {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: 14px;
}

.topbar__name {
  color: var(--ink-muted);
}

.topbar__logout {
  font-size: 13px;
}

.avatar {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: var(--radius-pill);
  background: var(--brand-tint);
  color: var(--brand-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
}

.portail {
  max-width: 1040px;
  margin: 0 auto;
  padding: var(--space-6) var(--space-5) var(--space-8);
}

/* Lecture confortable côté usager : le texte courant y est plus grand. */
.portail p {
  font-size: 17px;
  line-height: 26px;
}

/* ------------------------------------------- back-office exploitant */

.back {
  display: grid;
  grid-template-columns: 232px 1fr;
  min-height: 100vh;
}

.back__nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-5) var(--space-4);
  background: var(--surface-panel);
  border-right: 1px solid var(--border-hairline);
}

.back__brand {
  width: 112px;
  height: 38px;
  margin-bottom: var(--space-5);
  margin-left: var(--space-2);
}

.back__link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 9px var(--space-3);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-muted);
  text-decoration: none;
}

.back__link svg {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}

.back__link:hover {
  background: var(--surface-hover);
}

.back__link.is-active {
  background: var(--brand-tint);
  color: var(--brand-strong);
}

.back__section {
  margin: var(--space-4) 0 var(--space-1);
  padding-left: var(--space-3);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-subtle);
}

.back__account {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-hairline);
  font-size: 13px;
}

.back__account b {
  display: block;
  font-weight: 600;
}

.back__account a {
  font-size: 12px;
}

.back__main {
  padding: var(--space-5) var(--space-6) var(--space-8);
  min-width: 0;
}

@media (max-width: 860px) {
  .back {
    grid-template-columns: 1fr;
  }

  .back__nav {
    border-right: 0;
    border-bottom: 1px solid var(--border-hairline);
  }

  .back__account {
    margin-top: var(--space-4);
  }
}

/* ==========================================================================
   Composants métier
   ========================================================================== */

.page-head {
  display: flex;
  align-items: baseline;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-5);
}

.page-head h1 {
  font-size: 26px;
}

.page-head .lead {
  color: var(--ink-muted);
  font-size: 15px;
  margin: 0;
}

.page-head .actions {
  margin-left: auto;
  display: flex;
  gap: var(--space-3);
}

/* ------------------------------------------------------------- badges */

/* La pastille et le libellé vont toujours ensemble : la couleur ne porte
   jamais seule l'information (CDC §5.1). */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--radius-pill);
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.badge .dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-pill);
  background: currentColor;
  flex: none;
}

.badge--brand   { background: var(--brand-tint);   color: var(--brand-strong); }
.badge--assai   { background: var(--assai-tint);   color: var(--assai-ink); }
.badge--success { background: var(--success-tint); color: var(--success-ink); }
.badge--warning { background: var(--warning-tint); color: var(--warning-ink); }
.badge--danger  { background: var(--danger-tint);  color: var(--danger-ink); }
.badge--neutral { background: var(--surface-sunken); color: var(--ink-muted); }

/* ------------------------------------------------------------ tableaux */

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface-panel);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.table th {
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-subtle);
  padding: 12px var(--space-4);
  background: var(--surface-sunken);
  border-bottom: 1px solid var(--border-hairline);
}

.table td {
  padding: 14px var(--space-4);
  border-bottom: 1px solid var(--border-hairline);
  font-size: 14px;
  vertical-align: middle;
}

.table tr:last-child td {
  border-bottom: 0;
}

.table tbody tr:hover {
  background: var(--surface-hover);
}

.table .ref {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-strong);
  white-space: nowrap;
}

.table .muted {
  display: block;
  font-size: 12px;
  color: var(--ink-subtle);
}

.table-wrap {
  overflow-x: auto;
}

.empty {
  padding: var(--space-8) var(--space-5);
  text-align: center;
  color: var(--ink-muted);
  background: var(--surface-panel);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
}

/* --------------------------------------------------- fil d'avancement */

.timeline {
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  position: relative;
  padding: 0 0 var(--space-5) var(--space-5);
  border-left: 2px solid var(--border-hairline);
}

.timeline li:last-child {
  border-left-color: transparent;
  padding-bottom: 0;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 2px;
  width: 12px;
  height: 12px;
  border-radius: var(--radius-pill);
  background: var(--surface-panel);
  border: 2px solid var(--border-strong);
}

.timeline li.is-done::before {
  background: var(--brand);
  border-color: var(--brand);
}

.timeline li.is-current::before {
  background: var(--surface-panel);
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-tint);
}

.timeline b {
  font-size: 14px;
  font-weight: 600;
  display: block;
}

.timeline li.is-todo b {
  color: var(--ink-subtle);
  font-weight: 500;
}

.timeline span {
  display: block;
  font-size: 12px;
  color: var(--ink-subtle);
}

/* --------------------------------------------------- barre d'étapes */

.steps {
  display: flex;
  gap: 6px;
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
}

.steps .step {
  flex: 1;
  min-width: 96px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
  color: var(--ink-subtle);
}

.steps .step.is-done {
  background: var(--brand-tint);
  color: var(--brand-strong);
}

.steps .step.is-current {
  background: var(--brand);
  color: var(--on-brand);
}

/* ------------------------------------------------------------ colonnes */

.cols {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-5);
  align-items: start;
}

@media (max-width: 900px) {
  .cols {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--surface-panel);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-5);
}

.card > h2 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ink-subtle);
  margin-bottom: var(--space-4);
}

.datalist {
  margin: 0;
}

.datalist dt {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ink-subtle);
  margin-bottom: 2px;
}

.datalist dd {
  margin: 0 0 var(--space-4);
  font-size: 14px;
}

.datalist dd:last-child {
  margin-bottom: 0;
}

/* --------------------------------------------------------- pièces */

.piece {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px 0;
  border-bottom: 1px solid var(--border-hairline);
  font-size: 14px;
}

.piece:last-child {
  border-bottom: 0;
}

.piece svg {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: var(--assai);
  stroke-width: 1.6;
}

.piece .nom {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.piece .meta {
  display: block;
  font-size: 12px;
  color: var(--ink-subtle);
}

/* ---------------------------------------------------------- filtres */

.filters {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  align-items: flex-end;
  padding: var(--space-4);
  background: var(--surface-panel);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-5);
}

.filters .field {
  margin-bottom: 0;
  min-width: 150px;
}

.filters .control {
  padding: 7px 10px;
  font-size: 14px;
}

/* -------------------------------------------------------- indicateurs */

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.kpi {
  background: var(--surface-panel);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}

.kpi .k {
  font-size: 12px;
  color: var(--ink-subtle);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.kpi .v {
  font-family: var(--font-mono);
  font-size: 26px;
  line-height: 30px;
  font-weight: 600;
  margin: 4px 0 2px;
}

.kpi .t {
  font-size: 12px;
  color: var(--ink-muted);
}

/* ------------------------------------------------------ tuiles usager */

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.tile {
  display: block;
  background: var(--surface-panel);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
}

.tile:hover {
  border-color: var(--brand);
}

.tile .ic {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-3);
  background: var(--brand-tint);
}

.tile .ic svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--brand-strong);
  stroke-width: 1.6;
}

.tile--assai .ic {
  background: var(--assai-tint);
}

.tile--assai .ic svg {
  stroke: var(--assai);
}

.tile h3 {
  font-size: 16px;
  margin-bottom: 4px;
}

.tile p {
  margin: 0;
  font-size: 13px;
  line-height: 18px;
  color: var(--ink-subtle);
}

/* ---------------------------------------------------- dépôt de pièce */

.dropzone {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  text-align: center;
  color: var(--ink-muted);
  background: var(--surface-app);
  font-size: 14px;
}

.dropzone b {
  color: var(--brand);
}

/* ==========================================================================
   Interventions (CDC §2.2)
   ========================================================================== */

/* -------------------------------------------------- bascule de vue */

.seg {
  display: inline-flex;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
  font-size: 13px;
}

.seg > * {
  padding: 7px 14px;
  color: var(--ink-muted);
  text-decoration: none;
}

.seg .is-on {
  background: var(--brand-tint);
  color: var(--brand-strong);
  font-weight: 600;
}

/* ------------------------------------------------- tableau de suivi */

.board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: var(--space-4);
  align-items: start;
}

.board__col {
  background: var(--surface-sunken);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  min-width: 0;
}

.board__head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 8px 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-muted);
}

.board__count {
  margin-left: auto;
  background: var(--surface-panel);
  border-radius: var(--radius-pill);
  padding: 1px 8px;
  font-size: 11px;
  color: var(--ink-subtle);
}

.board__vide {
  margin: 0;
  padding: var(--space-4) 8px;
  font-size: 13px;
  color: var(--ink-subtle);
  text-align: center;
}

/* ------------------------------------------------------------ ticket */

.ticket {
  display: block;
  background: var(--surface-panel);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
}

.ticket:hover {
  border-color: var(--brand);
}

/* Une intervention close reste lisible, simplement en retrait. */
.ticket.is-done {
  opacity: 0.72;
}

.ticket__ref {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-strong);
}

.ticket__titre {
  display: block;
  font-size: 14px;
  font-weight: 600;
  line-height: 18px;
  margin: 3px 0 8px;
}

.ticket__meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ticket__dates {
  display: block;
  font-size: 11px;
  color: var(--ink-subtle);
  margin-top: 8px;
}

.ticket__retard {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--warning-ink);
}

/* Priorité : trois barres, toujours doublées d'un libellé. */
.prio {
  display: inline-flex;
  gap: 2px;
  vertical-align: middle;
}

.prio i {
  display: inline-block;
  width: 3px;
  height: 13px;
  border-radius: 2px;
}

/* ---------------------------------------------------------- planning */

.planning {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border-hairline);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.planning__jour {
  background: var(--surface-panel);
  padding: var(--space-3);
  min-height: 116px;
}

.planning__jour.is-weekend {
  background: var(--surface-sunken);
}

.planning__jour.is-today {
  box-shadow: inset 0 3px 0 var(--brand);
}

.planning__date {
  font-size: 12px;
  margin-bottom: var(--space-2);
}

.planning__date b {
  text-transform: capitalize;
}

.planning__date span {
  color: var(--ink-subtle);
}

.planning__item {
  display: block;
  background: var(--brand-tint);
  color: var(--brand-strong);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  margin-bottom: 5px;
  font-size: 12px;
  line-height: 16px;
  text-decoration: none;
}

.planning__item b {
  font-family: var(--font-mono);
  display: block;
}

.planning__item span {
  display: block;
  color: var(--ink-subtle);
  font-size: 11px;
}

.planning__vide {
  font-size: 12px;
  color: var(--ink-subtle);
}

@media (max-width: 900px) {
  .planning {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==========================================================================
   Pages publiques
   ========================================================================== */

.hero {
  padding: var(--space-8) 0 var(--space-6);
  max-width: 660px;
}

.hero h1 {
  font-size: 38px;
  line-height: 44px;
  margin-bottom: var(--space-4);
}

.hero__lead {
  font-size: 19px;
  line-height: 28px;
  color: var(--ink-muted);
  margin: 0 0 var(--space-5);
}

.hero__actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin: 0;
}

.section-titre {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-subtle);
  margin: var(--space-6) 0 var(--space-4);
}

/* Les étapes du parcours, numérotées : la séquence se lit sans dépendre
   d'un ordre visuel implicite. */
.etapes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: var(--space-4);
}

.etapes li {
  background: var(--surface-panel);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}

.etapes__num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-pill);
  background: var(--brand);
  color: var(--on-brand);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 14px;
  margin-bottom: var(--space-3);
}

.etapes b {
  display: block;
  font-size: 16px;
  margin-bottom: 4px;
}

.etapes span:not(.etapes__num) {
  display: block;
  font-size: 14px;
  line-height: 20px;
  color: var(--ink-subtle);
}

.encart {
  background: var(--brand-tint);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-top: var(--space-6);
}

.encart p {
  font-size: 15px;
  line-height: 23px;
  margin: 0 0 var(--space-3);
}

.encart p:last-child {
  margin-bottom: 0;
}

.liste {
  padding-left: 1.2em;
  margin: 0 0 var(--space-4);
}

.liste li {
  margin-bottom: var(--space-2);
  line-height: 22px;
}

.pied {
  border-top: 1px solid var(--border-hairline);
  padding: var(--space-5) var(--space-6);
  text-align: center;
  font-size: 13px;
  color: var(--ink-muted);
  background: var(--surface-panel);
}

.pied p {
  margin: 0 0 4px;
}

.pied__note {
  color: var(--ink-subtle);
  font-size: 12px;
}

@media (max-width: 640px) {
  .hero h1 {
    font-size: 30px;
    line-height: 36px;
  }
}

/* ------------------------------------------------- bascule de thème */

.theme-bascule {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--surface-panel);
  color: var(--ink-muted);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.theme-bascule:hover {
  background: var(--surface-hover);
}

.theme-bascule svg {
  flex: none;
}

/* Dans la barre latérale de l'exploitant, il occupe toute la largeur. */
.back__nav .theme-bascule {
  width: 100%;
  justify-content: center;
  margin-top: auto;
}

.back__nav + .back__account,
.back__nav .theme-bascule + .back__account {
  margin-top: var(--space-4);
}

/* -------------------------------------------- appel à l'action des tuiles */

.tile__cta {
  display: inline-block;
  margin-top: var(--space-3);
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
}

.tile:hover .tile__cta {
  text-decoration: underline;
}

/* ------------------------------------------- choix d'un profil */

.profils {
  display: grid;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.profil {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  padding: var(--space-3);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 14px;
}

.profil:hover {
  background: var(--surface-hover);
}

.profil:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-tint);
}

.profil input {
  margin-top: 3px;
  flex: none;
}

.profil b {
  display: block;
  font-weight: 600;
}

.profil span {
  color: var(--ink-subtle);
  line-height: 19px;
}

.profil b + br,
.profil span b {
  color: var(--ink);
}

/* --------------------------------------------------- graphiques */

/* La couleur ne porte jamais seule l'information : chaque marque est
   accompagnée de sa valeur chiffrée et de son libellé (CDC §5.1, RGAA). */

.graph {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 180px;
  padding-top: 22px;
  border-bottom: 1px solid var(--border-hairline);
}

.graph__col {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  height: 100%;
  min-width: 0;
}

.graph__val {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-muted);
  margin-bottom: 3px;
}

.graph__bar {
  width: 100%;
  max-width: 34px;
  min-height: 2px;
  background: var(--data-eau);
  border-radius: 4px 4px 0 0;
}

.graph__axis {
  display: flex;
  gap: 2px;
  margin-top: 6px;
}

.graph__axis span {
  flex: 1 1 0;
  text-align: center;
  font-size: 11px;
  color: var(--ink-subtle);
  min-width: 0;
  overflow: hidden;
}

.bars {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.bars__row .bars__head {
  display: flex;
  gap: var(--space-2);
  font-size: 13px;
  margin-bottom: 4px;
}

.bars__head b {
  font-weight: 600;
}

.bars__head span {
  margin-left: auto;
  font-family: var(--font-mono);
  color: var(--ink-muted);
}

.bars__track {
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--surface-sunken);
  overflow: hidden;
}

.bars__fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--data-eau);
}

.bars__fill--assainissement {
  background: var(--data-assai);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
  font-size: 13px;
  color: var(--ink-muted);
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--data-eau);
}

.legend i.assainissement {
  background: var(--data-assai);
}

.vide {
  margin: 0;
  font-size: 14px;
  color: var(--ink-subtle);
}

/* Marque hors seuil sur une courbe de qualité. La couleur ne suffit pas :
   la valeur est écrite au-dessus de chaque barre, et le motif de l'écart
   figure en clair dans le tableau des mesures (CDC §5.1). */
.graph__bar--alerte {
  background: var(--danger);
}
