/* ==========================================================================
   Tirage au sort du solde de la taxe d'apprentissage — page publique, inscription,
   retrait et vérification. Chargée après pages.css, dont ces pages reprennent
   .page-entete, .page-intro et .texte-legal.

   Ton : sobre et documentaire. Ces pages sont lues par des directions qui devront
   justifier une recette devant un conseil d'administration ; rien n'y est vendu,
   rien n'y clignote. Mobile d'abord, aucune couleur en dur (jetons de base.css).
   ========================================================================== */

/* ---------- Encarts ---------- */
.taxe-encart {
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid var(--ligne-2);
  border-left: 4px solid var(--sable);
  border-radius: var(--rayon);
  background: var(--surface);
}
.taxe-encart h2 { font-size: 1.25rem; margin-bottom: 0.75rem; }
.taxe-encart p { color: var(--encre-2); }
.taxe-encart p:last-child { margin-bottom: 0; }

/* L'encart qui porte les règles absolues : c'est la première chose que la page doit faire lire. */
.taxe-encart--ouvert { border-left-color: var(--succes); background: var(--surface-2); }
.taxe-encart--ferme { border-left-color: var(--alerte); }
.taxe-encart--retrait { margin-block: 1.5rem; border-left-color: var(--info); }

.taxe-regles { margin: 0; padding-left: 1.2rem; display: flex; flex-direction: column; gap: 0.7rem; color: var(--encre-2); }
.taxe-regles li::marker { color: var(--sable-fonce); }
.taxe-regles strong { color: var(--encre); }

.taxe-texte { color: var(--encre-2); line-height: 1.7; }
.taxe-texte p { margin-bottom: 1.1em; }
.taxe-texte p:first-child { color: var(--encre); font-size: 1.05rem; }
.taxe-texte p:last-child { margin-bottom: 0; }

.taxe-sous-titre { font-size: 1.2rem; margin: 2rem 0 0.75rem; }
.taxe-liste-simple { margin: 0 0 1.25rem; padding-left: 1.2rem; display: flex; flex-direction: column; gap: 0.5rem; color: var(--encre-2); }
.taxe-liste-simple li::marker { color: var(--ligne-2); }

.taxe-mention {
  margin: 1.25rem 0 0;
  padding: 0.85rem 1.1rem;
  border: 1px solid var(--ligne-2);
  border-radius: var(--rayon-s);
  background: var(--surface-2);
  color: var(--encre-2);
  font-size: var(--texte-s);
}
.taxe-contact { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--ligne); color: var(--encre-2); font-size: var(--texte-s); }

/* ---------- Calendrier ---------- */
.taxe-calendrier { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.taxe-calendrier-ligne {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.2rem 1.25rem;
  padding: 1rem 0;
  border-top: 1px solid var(--ligne);
}
.taxe-calendrier-ligne:first-child { border-top: 0; padding-top: 0; }
.taxe-calendrier-date {
  margin: 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--encre);
  white-space: nowrap;
}
.taxe-calendrier-libelle { margin: 0 0 0.15rem; font-weight: 600; color: var(--encre); }
.taxe-calendrier-note { margin: 0; color: var(--encre-2); font-size: var(--texte-s); }
/* Une étape passée reste lisible : elle s'efface d'un ton, elle ne disparaît pas. */
.taxe-calendrier-ligne.est-passee .taxe-calendrier-date { color: var(--encre-3); font-weight: 500; }
@media (min-width: 40rem) {
  .taxe-calendrier-ligne { grid-template-columns: 9rem minmax(0, 1fr); align-items: baseline; }
}

.taxe-appel {
  margin-top: 1.75rem;
  padding: clamp(1.25rem, 3vw, 1.75rem);
  border: 1px solid var(--ligne-2);
  border-radius: var(--rayon);
  background: var(--surface);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  justify-content: space-between;
}
.taxe-appel-texte { margin: 0; color: var(--encre-2); flex: 1 1 18rem; }
@media (max-width: 40rem) { .taxe-appel .bouton { width: 100%; } }

/* ---------- Le procédé, en quatre étapes ---------- */
.taxe-etapes { list-style: none; margin: 0 0 1.5rem; padding: 0; display: grid; gap: 1rem; }
.taxe-etape {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr);
  gap: 1rem;
  padding: 1.1rem;
  border: 1px solid var(--ligne);
  border-radius: var(--rayon);
  background: var(--surface);
}
.taxe-etape-numero {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.5rem; height: 2.5rem; border-radius: 50%;
  background: var(--sable-clair); color: var(--sable-fonce);
  font-weight: 700; font-size: 1rem;
}
.taxe-etape h3 { font-size: 1.05rem; margin-bottom: 0.35rem; }
.taxe-etape p { margin: 0; color: var(--encre-2); font-size: 0.95rem; }
@media (min-width: 52rem) { .taxe-etapes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Résultats publiés ---------- */
.taxe-resultat { margin-bottom: 1.25rem; }
.taxe-resultat:last-child { margin-bottom: 0; }
.taxe-resultat-entete { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin-bottom: 0.9rem; }
.taxe-resultat-entete h3 { font-size: 1.2rem; margin: 0; }
.taxe-resultat-entete p { margin: 0; }
.taxe-resultat-gagnant { display: flex; flex-direction: column; gap: 0.15rem; margin-bottom: 1rem; }
.taxe-resultat-etiquette { font-size: var(--texte-xs); text-transform: uppercase; letter-spacing: 0.08em; color: var(--encre-3); font-weight: 600; }
.taxe-resultat-gagnant strong { font-size: 1.05rem; }

/* Graine et empreinte : deux valeurs de 64 caractères, à donner en entier et à pouvoir recopier. */
.taxe-valeurs { margin: 0 0 1rem; display: grid; gap: 0.35rem 1.25rem; }
.taxe-valeurs dt { font-size: var(--texte-xs); text-transform: uppercase; letter-spacing: 0.08em; color: var(--encre-3); font-weight: 600; }
.taxe-valeurs dd { margin: 0 0 0.6rem; min-width: 0; }
.taxe-valeurs dd:last-child { margin-bottom: 0; }
@media (min-width: 44rem) {
  .taxe-valeurs--large { grid-template-columns: 14rem minmax(0, 1fr); align-items: baseline; }
  .taxe-valeurs--large dd { margin-bottom: 0.35rem; }
}
.taxe-code {
  display: inline-block;
  max-width: 100%;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: var(--texte-s);
  line-height: 1.5;
  word-break: break-all;
  overflow-wrap: anywhere;
  color: var(--encre);
  background: var(--surface-2);
  border: 1px solid var(--ligne);
  border-radius: var(--rayon-s);
  padding: 0.25rem 0.5rem;
}
.taxe-code--lien { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Règlement rendu dans la page (h3, la page portant déjà ses h2) ---------- */
.taxe-reglement h3 {
  font-family: var(--police-titre);
  font-size: 1.125rem;
  line-height: 1.35;
  color: var(--encre);
  margin: 2.25rem 0 0.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--ligne);
  scroll-margin-top: 1.5rem;
}
.taxe-reglement > h3:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

/* ---------- Formulaires ---------- */
.taxe-form fieldset { border: 0; padding: 0; margin: 0 0 1.75rem; }
.taxe-form fieldset:last-of-type { margin-bottom: 0; }
.taxe-form legend {
  padding: 0 0 0.75rem;
  font-family: var(--police-titre);
  font-size: 1.1rem;
  color: var(--encre);
}
.taxe-form-obligatoire { margin-bottom: 1.25rem; }
.taxe-form-note { color: var(--encre-2); font-size: var(--texte-s); margin: 0 0 0.75rem; }
.taxe-consentement { align-items: flex-start; gap: 0.65rem; }
.taxe-consentement input { margin-top: 0.2rem; flex: none; }
.taxe-consentement a { color: var(--encre-2); text-decoration: underline; text-underline-offset: 2px; }
.taxe-entree-code { font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace; font-size: var(--texte-s); }
.taxe-liens { margin-top: 1.5rem; gap: 1.25rem; font-size: var(--texte-s); }
.taxe-choix { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1rem; margin-bottom: 1.5rem; }
.taxe-choix .champ { flex: 1 1 14rem; }
@media (max-width: 40rem) {
  .taxe-form .formulaire-actions .bouton { width: 100%; }
  .taxe-choix .bouton { width: 100%; }
}

/* ---------- Confirmation et retrait ---------- */
.taxe-confirmation { padding: clamp(1.5rem, 4vw, 2.5rem); }
.taxe-confirmation h1 { font-size: clamp(1.4rem, 3vw, 1.8rem); margin-bottom: 0.75rem; }
.taxe-confirmation h2 { font-size: 1.15rem; margin-bottom: 0.5rem; }
.taxe-confirmation-icone { width: 3rem; height: 3rem; margin-bottom: 0.75rem; color: var(--succes); }
.taxe-retrait-form { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin: 1.5rem 0; }
@media (max-width: 40rem) { .taxe-retrait-form .bouton { width: 100%; } }

/* ---------- Vérification ---------- */
.taxe-details { margin-top: 1.5rem; border: 1px solid var(--ligne); border-radius: var(--rayon); background: var(--surface); }
.taxe-details summary { padding: 0.9rem 1.1rem; cursor: pointer; font-weight: 600; color: var(--encre); }
.taxe-details summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: var(--rayon); }
.taxe-details > :not(summary) { padding-inline: 1.1rem; }
.taxe-details > p { color: var(--encre-2); font-size: 0.95rem; }
.taxe-pre {
  margin: 0 1.1rem 1.1rem;
  padding: 0.9rem;
  overflow-x: auto;
  background: var(--surface-2);
  border: 1px solid var(--ligne);
  border-radius: var(--rayon-s);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: var(--texte-xs);
  line-height: 1.6;
  color: var(--encre);
}
.taxe-pre:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* La ligne du gagnant dans la liste figée : repérée au ton ET au trait, jamais par la seule couleur. */
.table tbody tr.est-gagnant td { background: var(--sable-clair); font-weight: 600; }
.table tbody tr.est-gagnant:hover td { background: var(--sable-clair); }
.table tbody tr.est-gagnant td:first-child { box-shadow: inset 3px 0 0 var(--sable-fonce); }

.taxe-verdict {
  margin-top: 1.5rem;
  padding: clamp(1.1rem, 3vw, 1.5rem);
  border: 1px solid var(--ligne-2);
  border-radius: var(--rayon);
  background: var(--surface);
}
.taxe-verdict h3 { font-size: 1.15rem; margin-bottom: 0.75rem; }
.taxe-verdict--ok { border-color: var(--succes-bord); background: var(--succes-clair); }
.taxe-verdict--ok h3 { color: var(--succes-texte); }
.taxe-verdict--ko { border-color: var(--erreur-bord); background: var(--erreur-clair); }
.taxe-verdict--ko h3 { color: var(--erreur-texte); }
.taxe-verdict-detail { margin: 0.75rem 0 0; font-size: var(--texte-s); color: var(--encre-2); }

.taxe-controles { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.taxe-controles li { position: relative; padding-left: 1.75rem; color: var(--encre-2); font-size: 0.95rem; }
/* Le symbole double la couleur : un daltonien lit le résultat aussi bien qu'un autre. */
.taxe-controles li::before { position: absolute; left: 0; top: 0; font-weight: 700; }
.taxe-controles li.est-ok::before { content: "\2713"; color: var(--succes-texte); }
.taxe-controles li.est-ko::before { content: "\2715"; color: var(--erreur-texte); }

.taxe-calcul { margin: 1.5rem 0 0; padding-left: 1.4rem; display: flex; flex-direction: column; gap: 1rem; }
.taxe-calcul li { color: var(--encre-2); }
.taxe-calcul li::marker { color: var(--sable-fonce); font-weight: 700; }
.taxe-calcul-titre { margin: 0 0 0.4rem; color: var(--encre); font-weight: 600; font-size: 0.95rem; }
.taxe-calcul-resultat { margin: 0; }

.taxe-recette { margin: 0 0 1.5rem; padding-left: 1.4rem; display: flex; flex-direction: column; gap: 0.85rem; color: var(--encre-2); line-height: 1.65; }
.taxe-recette li::marker { color: var(--sable-fonce); font-weight: 700; }
.taxe-recette strong { color: var(--encre); }
.taxe-recette code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--surface-2);
  border-radius: var(--rayon-s);
  padding: 0.05rem 0.3rem;
}
.taxe-recette abbr { text-decoration: none; border-bottom: 1px dotted var(--ligne-2); }

/* >>> Corrections de la revue d'équité (17/09/2026) ------------------------------------------------- */

/* Ligne obtenue avec des valeurs SAISIES, et non avec celles publiées : elle ne doit en aucun cas se
   présenter comme le gagnant. Une capture d'écran de ce tableau circulerait sans le verdict affiché
   au-dessus — le marquage, lui, voyage avec le tableau. */
.table tbody tr.est-recalcule td { background: var(--alerte-clair); font-style: italic; }
.table tbody tr.est-recalcule:hover td { background: var(--alerte-clair); }
.table tbody tr.est-recalcule td:first-child { box-shadow: inset 3px 0 0 var(--alerte); }
.taxe-calcul-resultat.est-recalcule { color: var(--alerte-texte); font-style: italic; }

/* Engagement publié à la clôture : la valeur qui fait la différence entre « la graine est tirée au sort »
   et « la graine était arrêtée avant qu'on connaisse le résultat ». */
.taxe-encart--engagement { margin-top: 1.5rem; border-left: 3px solid var(--sable-fonce); }
.taxe-encart--engagement dl { margin-bottom: 0; }

/* Tirages annulés et inscriptions non retenues : ce qui comblait les trous du document publié. */
.taxe-annules { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--ligne); }
.taxe-annule {
  margin-top: 0.85rem;
  padding: 0.85rem 1.1rem;
  background: var(--surface-2);
  border-radius: var(--rayon);
  border-left: 3px solid var(--alerte);
}
.taxe-annule p { margin: 0 0 0.35rem; color: var(--encre-2); }
.taxe-annule p:last-child { margin-bottom: 0; }
.taxe-non-retenus { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px dashed var(--ligne); }
.taxe-non-retenus p:first-child { margin-top: 0; }
.taxe-code--court { font-size: 0.8em; word-break: break-all; }
/* <<< fin du bloc « corrections de la revue d'équité » */
