/* Pages légales — feuille de style
   Même système que optimiser-image.fr : fond blanc, texte ardoise, bordures fines,
   magenta Palmsquare en petite touche. Polices système uniquement :
   un outil de conformité ne charge rien chez un tiers. */

:root {
  --encre: #0f172a;
  --encre-douce: #64748b;
  --fond: #fcfcfc;
  --papier: #ffffff;
  --voile: #f8fafc;
  --voile-fort: #f1f5f9;
  --trait: #e2e8f0;
  --magenta: #ff00a6;
  --magenta-texte: #d6008b;
  --magenta-trace: rgba(255, 0, 166, 0.16);
  --jaune: #ffe14d;
  --jaune-trace: rgba(255, 213, 0, 0.5);
  --alerte: #b4123f;

  --texte: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;

  --rayon: 0.5rem;
  --rayon-grand: 0.75rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fond);
  color: var(--encre);
  font: 1rem/1.5 var(--texte);
}
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, select { font: inherit; color: inherit; }
a { color: inherit; text-underline-offset: 0.18em; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--magenta); outline-offset: 2px; border-radius: 4px; }

.masque-visuel {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
.accent { color: var(--magenta-texte); font-weight: 500; white-space: nowrap; }

/* ───────── En-tête et pied ───────── */

.entete {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  max-width: 72rem; margin: 0 auto; padding: 1rem 1.5rem;
}
.marque {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-weight: 800; font-size: 0.9375rem; line-height: 1; letter-spacing: 0.01em;
  text-transform: uppercase; text-decoration: none;
}
.marque:hover { opacity: 0.8; }
/* Le signe : une ligne de texte et un trait de surligneur. */
.marque__signe {
  width: 1.375rem; height: 1.375rem; border-radius: 0.35rem; background: var(--encre);
  background-image:
    linear-gradient(#fff, #fff),
    linear-gradient(var(--magenta), var(--magenta));
  background-size: 0.55rem 0.13rem, 0.82rem 0.33rem;
  background-position: 0.28rem 0.38rem, 0.28rem 0.7rem;
  background-repeat: no-repeat;
}
.entete__par { font-size: 0.75rem; font-weight: 500; color: var(--encre-douce); text-decoration: none; }
.entete__par:hover { color: var(--encre); }

.pied {
  max-width: 72rem; margin: 0 auto; padding: 3rem 1.5rem 2.5rem;
  font-size: 0.75rem; color: var(--encre-douce); display: grid; gap: 0.2rem; text-align: center;
}

/* ───────── Scène ───────── */

.scene {
  display: grid; grid-template-columns: minmax(0, 26rem) minmax(0, 1fr); column-gap: 3rem;
  align-items: start;
  max-width: 72rem; margin: 0 auto; padding: 1rem 1.5rem 0;
}
.parcours-haut { grid-column: 1 / -1; }
.parcours-haut:empty { display: none; }

/* Avant l'analyse : une seule colonne centrée, sans document à côté. */
.scene:not([data-phase="verif"]) {
  grid-template-columns: minmax(0, 40rem); justify-content: center;
  padding-top: clamp(1rem, 5vh, 3rem);
}
.scene:not([data-phase="verif"]) .bureau { display: none; }
.scene:not([data-phase="verif"]) .pupitre h1,
.scene:not([data-phase="verif"]) .chapo { text-align: center; }
.scene:not([data-phase="verif"]) .chapo { max-width: 56ch; margin-inline: auto; }

.pupitre h1 { font-size: 1.5rem; line-height: 1.3; font-weight: 600; letter-spacing: -0.025em; text-wrap: balance; }
.pupitre .h1--verif { font-size: 1.25rem; outline: none; }
.hote { background: linear-gradient(to top, var(--magenta-trace) 0 40%, transparent 40%); overflow-wrap: anywhere; }
.chapo { margin-top: 0.5rem; color: var(--encre-douce); font-size: 0.875rem; line-height: 1.5; text-wrap: pretty; }
.chapo strong { color: var(--encre); font-weight: 600; }
.retour { margin-bottom: 0.75rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 1rem; }

/* Fil d'étapes */
.parcours { display: flex; justify-content: center; margin: 1.5rem 0; }
.parcours li {
  position: relative; width: 6.5rem; display: grid; justify-items: center; gap: 0.4rem;
  font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: #94a3b8;
}
.parcours li + li::before {
  content: ""; position: absolute; top: 1rem; right: calc(50% + 1.4rem);
  width: calc(100% - 2.8rem); height: 1px; background: var(--trait);
}
.parcours__rond {
  width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--papier); border: 1px solid var(--trait);
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0; color: var(--encre-douce);
}
.parcours .actif { color: var(--magenta-texte); }
.parcours .actif .parcours__rond { border: 2px solid var(--magenta); color: var(--magenta-texte); background: rgba(255, 0, 166, 0.06); }
.parcours .fait { color: var(--encre-douce); }
.parcours .fait .parcours__rond { border-color: var(--encre); color: var(--encre); }

/* La fiche : le cadre principal de l'accueil et de l'analyse. */
.fiche {
  padding: 1.5rem; background: var(--papier);
  border: 1px solid var(--trait); border-radius: var(--rayon-grand);
}
.depart { display: grid; gap: 1rem; }
.rangee { display: flex; gap: 0.5rem; }
.rangee input { flex: 1; min-width: 0; }
.rangee .bouton { flex: none; }
.rangee input, .rangee .bouton { min-height: 3rem; }
.sans-site { margin-top: 0.75rem; text-align: center; }

.encart {
  margin-top: 1rem; padding: 1rem 1.25rem; border-radius: var(--rayon-grand);
  background: var(--voile); font-size: 0.8125rem; color: var(--encre-douce);
  display: grid; gap: 0.6rem; justify-items: center;
}
.encart__titre { font-size: 0.875rem; font-weight: 500; color: var(--encre); }
.encart ul { display: grid; gap: 0.3rem; }
.encart li { padding-left: 0.9rem; position: relative; }
.encart li::before { content: "•"; position: absolute; left: 0; color: var(--magenta); }
.encart__note { font-size: 0.75rem; font-weight: 500; color: var(--magenta-texte); text-align: center; }

/* ───────── Champs de saisie ───────── */

.champ-saisie { display: grid; gap: 0.375rem; min-width: 0; }
.champ-saisie > label { font-weight: 500; font-size: 0.875rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0.5rem; }
.option { font-weight: 400; font-size: 0.75rem; color: var(--encre-douce); }
.champ-saisie input, .champ-saisie select {
  width: 100%; min-height: 2.75rem; padding: 0.5rem 0.75rem;
  background: var(--papier); border: 1px solid var(--trait); border-radius: var(--rayon);
}
.champ-saisie input::placeholder { color: #94a3b8; }
.champ-saisie input:hover, .champ-saisie select:hover { border-color: #cbd5e1; }
.champ-saisie input:focus-visible, .champ-saisie select:focus-visible { outline-offset: 0; border-color: var(--magenta); }
.champ-saisie input[type="search"]::-webkit-search-cancel-button { display: none; }
.aide { font-size: 0.75rem; color: var(--encre-douce); }
.grille { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem 0.75rem; }
.grille .champ-saisie:has([data-saisie="dirpub"]), .grille .champ-saisie:has([data-saisie="mediateur"]) { grid-column: 1 / -1; }
.coche { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.75rem; font-size: 0.875rem; cursor: pointer; }
.coche input { width: 1rem; height: 1rem; margin: 0; accent-color: var(--magenta); }

.erreur {
  padding: 0.6rem 0.75rem; border-radius: var(--rayon);
  background: #fdecef; color: var(--alerte); font-size: 0.875rem; font-weight: 500;
}

/* ───────── Boutons ───────── */

.bouton {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 2.75rem; padding: 0.5rem 1.1rem;
  border: 0; border-radius: var(--rayon); cursor: pointer;
  font-weight: 600; font-size: 0.875rem; white-space: nowrap;
  transition: background-color 0.15s ease, opacity 0.15s ease;
}
.bouton--action { background: var(--magenta); color: #fff; }
.bouton--action:hover { opacity: 0.9; }
.bouton--encre { background: var(--encre); color: #fff; }
.bouton--encre:hover { background: #1e293b; }
.bouton--contour { background: var(--papier); color: var(--encre); border: 1px solid var(--trait); }
.bouton--contour:hover { background: var(--voile-fort); }

.lien {
  padding: 0; border: 0; background: none; cursor: pointer;
  font-weight: 500; font-size: 0.8125rem; color: var(--encre-douce);
  text-decoration: underline; text-underline-offset: 0.18em;
}
.lien:hover { color: var(--magenta-texte); }

/* ───────── Recherche d'entreprise ───────── */

.recherche { position: relative; }
.propositions {
  position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 0.25rem);
  background: var(--papier); border: 1px solid var(--trait); border-radius: var(--rayon);
  box-shadow: 0 10px 24px -10px rgba(15, 23, 42, 0.25);
  max-height: 20rem; overflow: auto; padding: 0.25rem;
}
.propositions li { padding: 0.5rem 0.6rem; border-radius: 0.375rem; display: grid; gap: 0.1rem; cursor: pointer; }
.propositions li strong { font-size: 0.875rem; font-weight: 600; line-height: 1.3; }
.propositions li span { font-size: 0.75rem; color: var(--encre-douce); }
.propositions li[aria-selected="true"], .propositions li[data-i]:hover { background: var(--voile-fort); }
.propositions .propositions__vide { cursor: default; font-size: 0.8125rem; color: var(--encre-douce); }

.carte {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
  padding: 0.75rem 0.85rem; background: var(--papier);
  border: 1px solid var(--trait); border-radius: var(--rayon);
}
.carte__texte { display: grid; gap: 0.1rem; min-width: 0; }
.carte__texte strong { font-size: 0.9375rem; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.carte__texte span { font-size: 0.75rem; color: var(--encre-douce); overflow-wrap: anywhere; }

/* ───────── Étapes d'analyse ───────── */

.etapes { display: grid; gap: 0.7rem; font-size: 0.875rem; }
.etapes li { display: flex; align-items: center; gap: 0.7rem; color: #94a3b8; font-weight: 500; }
.etapes li::before {
  content: ""; flex: none; width: 1rem; height: 1rem; border-radius: 50%;
  border: 2px solid currentColor;
}
.etapes .encours { color: var(--encre); }
.etapes .encours::before { border-color: var(--magenta); border-top-color: transparent; animation: tourne 0.7s linear infinite; }
.etapes .fait { color: var(--encre-douce); }
.etapes .fait::before { background: var(--encre); border-color: var(--encre); box-shadow: inset 0 0 0 3px var(--papier); }
@keyframes tourne { to { transform: rotate(360deg); } }

/* ───────── Blocs de vérification ───────── */

.bloc { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--trait); display: grid; gap: 0.75rem; }
.bloc > h2 { font-size: 1rem; font-weight: 600; line-height: 1.3; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.bloc > h3 { font-size: 0.75rem; font-weight: 500; color: var(--encre-douce); margin-top: 0.25rem; }
.note { font-size: 0.8125rem; color: var(--encre-douce); }
.pastille {
  font-size: 0.6875rem; font-weight: 600; line-height: 1;
  padding: 0.25rem 0.4rem; border-radius: 0.375rem; white-space: nowrap;
}
.pastille--auto { background: var(--magenta-trace); color: #8a0059; }
.pastille--verif { background: var(--jaune); color: #4a3c00; }

.puces { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.puce {
  min-height: 2.25rem; padding: 0.3rem 0.75rem; cursor: pointer;
  background: var(--papier); border: 1px solid var(--trait); border-radius: 99px;
  font-size: 0.8125rem; font-weight: 500; color: var(--encre-douce);
}
.puce:hover { border-color: #94a3b8; color: var(--encre); }
.puce[aria-pressed="true"] { background: var(--encre); border-color: var(--encre); color: #fff; }
.puce[aria-pressed="true"]::before { content: "✓"; margin-right: 0.35rem; color: #ff7dd1; font-weight: 700; }

/* ───────── Bureau : onglets, document, actions ───────── */

.bureau { position: sticky; top: 1rem; min-width: 0; }
.bureau__barre { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.onglets-zone { display: flex; align-items: center; flex-wrap: wrap; gap: 0.25rem 0.5rem; }
.onglets { display: inline-flex; gap: 0.125rem; padding: 0.25rem; border-radius: var(--rayon); background: var(--voile-fort); }
.onglet {
  padding: 0.375rem 0.75rem; border: 0; cursor: pointer; white-space: nowrap;
  background: transparent; border-radius: 0.375rem;
  font-weight: 500; font-size: 0.875rem; color: var(--encre-douce);
}
.onglet:hover { color: var(--encre); }
.onglet[aria-selected="true"] { background: var(--papier); color: var(--encre); box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08); }

.etat-doc { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; font-size: 0.75rem; color: var(--encre-douce); }
.legende { font-weight: 500; padding: 0.25rem 0.5rem; border-radius: 0.375rem; border: 0; color: var(--encre); font-size: 0.75rem; }
.legende--auto { background: var(--magenta-trace); }
.legende--vide { background: var(--jaune); cursor: pointer; text-decoration: underline; text-underline-offset: 0.15em; }
.legende--ok { background: var(--voile-fort); }

.feuille {
  background: var(--papier); border: 1px solid var(--trait); border-radius: var(--rayon-grand);
  padding: clamp(1.25rem, 3.5vw, 2.5rem) clamp(1.25rem, 4vw, 3rem);
  max-height: calc(100vh - 17.5rem); min-height: 20rem; overflow: auto;
  font-size: 0.9375rem; line-height: 1.7;
  overflow-wrap: break-word;
}
.feuille h1 { font-size: 1.375rem; font-weight: 600; line-height: 1.25; letter-spacing: -0.02em; margin-bottom: 0.25rem; }
.feuille h1 + p { color: var(--encre-douce); font-size: 0.8125rem; margin-bottom: 1rem; }
.feuille h2 {
  font-size: 0.6875rem; font-weight: 600; line-height: 1.3; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--encre-douce);
  margin: 1.6rem 0 0.5rem; padding-top: 0.9rem; border-top: 1px solid var(--trait);
}
.feuille p + p { margin-top: 0.7rem; }
.feuille ul { margin: 0.5rem 0; display: grid; gap: 0.3rem; }
.feuille li { padding-left: 1rem; position: relative; }
.feuille li::before { content: "–"; position: absolute; left: 0; color: var(--encre-douce); }

/* Les champs : surligneur magenta = trouvé, jaune = à vérifier ou à compléter. */
.champ { cursor: pointer; border-radius: 2px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.champ.auto { background: linear-gradient(to top, var(--magenta-trace) 0 100%); background-repeat: no-repeat; }
.champ.verifier { background: linear-gradient(to top, var(--jaune-trace) 0 100%); background-repeat: no-repeat; }
.champ.saisi:hover, .champ.auto:hover, .champ.verifier:hover { outline: 1px dashed #94a3b8; outline-offset: 2px; }
.champ.vide {
  display: inline; padding: 0.05em 0.4em; border: 0;
  background: var(--jaune); color: var(--encre);
  font: inherit; font-style: italic; font-size: 0.9375em;
}
.champ.vide::before { content: "à compléter : "; font-style: normal; font-weight: 600; font-size: 0.85em; }
.champ.vide:hover { background: #ffd000; }

/* Remplissage : chaque valeur trouvée reçoit son trait de surligneur, l'une après l'autre. */
@keyframes surligne {
  0% { background-size: 0% 100%; }
  100% { background-size: 100% 100%; }
}
.feuille--remplissage .champ.auto, .feuille--remplissage .champ.verifier {
  background-size: 0% 100%;
  animation: surligne 0.5s ease-out both;
  animation-delay: calc(var(--i, 0) * 60ms + 200ms);
}

.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }

/* ───────── Message de confirmation ───────── */

.toast {
  position: fixed; left: 50%; bottom: 1.5rem; z-index: 20;
  transform: translate(-50%, 0.75rem); opacity: 0; pointer-events: none;
  max-width: min(32rem, calc(100vw - 2rem));
  padding: 0.7rem 1rem; border-radius: var(--rayon);
  background: var(--encre); color: #fff; font-weight: 500; font-size: 0.875rem;
  box-shadow: 0 10px 24px -10px rgba(15, 23, 42, 0.5);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast--visible { opacity: 1; transform: translate(-50%, 0); }

/* ───────── Accord pour la mesure d'audience ───────── */

.pied__lien { font-size: inherit; }
.accord {
  position: fixed; left: 50%; bottom: 1rem; z-index: 15; transform: translateX(-50%);
  width: min(40rem, calc(100vw - 2rem));
  display: flex; align-items: center; gap: 1rem;
  padding: 0.875rem 1rem; background: var(--papier);
  border: 1px solid var(--trait); border-radius: var(--rayon-grand);
  box-shadow: 0 12px 32px -12px rgba(15, 23, 42, 0.25);
  font-size: 0.8125rem; color: var(--encre-douce);
}
.accord p { flex: 1; }
.accord__choix { display: flex; gap: 0.5rem; flex: none; }
.accord .bouton { min-height: 2.5rem; }
@media (max-width: 36rem) {
  .accord { flex-direction: column; align-items: stretch; }
  .accord__choix .bouton { flex: 1; }
}

/* ───────── Écrans étroits ───────── */

@media (max-width: 60rem) {
  .scene { grid-template-columns: minmax(0, 1fr); padding: 0.5rem 1rem 0; }
  .entete, .pied { padding-left: 1rem; padding-right: 1rem; }
  .bureau { position: static; margin-top: 2.5rem; }
  .feuille { max-height: none; }
}
@media (max-width: 30rem) {
  .rangee { flex-direction: column; }
  .fiche { padding: 1rem; }
  .parcours li { width: 5.5rem; }
  .grille { grid-template-columns: 1fr; }
  .actions .bouton { width: 100%; }
  .onglet { padding-inline: 0.55rem; font-size: 0.8125rem; }
}

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

/* ───────── Page de mentions légales ───────── */
.legal { max-width: 44rem; margin: 0 auto; padding: clamp(1rem, 4vh, 2.5rem) 1.5rem 0; }
.legal h1 { font-size: 1.75rem; font-weight: 600; letter-spacing: -0.015em; line-height: 1.2; }
.legal__chapo { margin-top: 0.5rem; color: var(--encre-douce); font-size: 0.9375rem; }
.legal section { margin-top: 2.25rem; padding-top: 1.5rem; border-top: 1px solid var(--trait); }
.legal h2 { font-size: 1.0625rem; font-weight: 600; margin-bottom: 0.6rem; }
.legal p + p { margin-top: 0.7rem; }
.legal a { color: var(--magenta-texte); font-weight: 500; }
.legal__fiche { margin: 0.9rem 0 0; display: grid; gap: 0; border: 1px solid var(--trait); border-radius: var(--rayon-grand); background: var(--papier); }
.legal__fiche div { display: grid; grid-template-columns: 12rem minmax(0, 1fr); gap: 1rem; padding: 0.65rem 1rem; }
.legal__fiche div + div { border-top: 1px solid var(--trait); }
.legal__fiche dt { color: var(--encre-douce); font-size: 0.875rem; }
.legal__fiche dd { margin: 0; font-size: 0.9375rem; overflow-wrap: anywhere; }
.legal__liste { margin: 0.9rem 0; display: grid; gap: 0.7rem; }
.legal__liste li { padding-left: 1rem; border-left: 2px solid var(--trait); }
.legal .lien { font-size: inherit; }
.legal__retour { margin-top: 2.5rem; }
@media (max-width: 34rem) {
  .legal { padding-left: 1rem; padding-right: 1rem; }
  .legal__fiche div { grid-template-columns: 1fr; gap: 0.1rem; }
}
