/* ===================================================================
   L'ATELIER : ce qui sépare « ça marche » de « c'est beau ».
   -------------------------------------------------------------------
   Demandé par Joris le 23 octobre 2026 : « fais moi un truc vraiment
   comme si je payais 5000 euros le site », carte blanche. Ce fichier se
   charge APRÈS annuaire.css et annuaire-1parrainage.css, et il ne touche
   qu'à ce qui manquait à un site de ce prix :

   1. UNE OUVERTURE QUI RACONTE. Un titre seul sur de l'encre, c'est une
      page d'erreur bien habillée. L'accueil reçoit une scène dessinée
      (deux personnes qui se passent une carte cadeau, dans notre vert)
      et trois chiffres vrais : les offres relues, les parrains inscrits,
      les annonces en ligne. Aucun chiffre inventé, ils viennent du
      catalogue et du journal.

   2. UNE RECHERCHE ET DES FAMILLES. Vingt huit tuiles sans filtre, c'est
      vingt huit lectures. Un champ et une rangée de familles, en
      JavaScript, et sans lui la liste reste entière.

   3. DES TUILES QUI SE LISENT. Le nom sans « Parrainage » répété, le gain
      en sève, le nombre de parrains en pastille, et « soyez le premier »
      qui ne crie plus vingt fois.

   4. LES TROIS PAS SUR L'ENCRE, ILLUSTRÉS. Les dessins ont un fond encre
      uni, et un masque fond leurs bords : aucune incrustation visible, la
      peur de Joris.

   5. LA CONFIANCE ET LES QUESTIONS. Trois promesses tenues, quatre
      questions dépliables.

   6. LE TABLEAU DE BORD DU PARRAIN. Quatre chiffres en tête de son
      espace, et la route des cinq niveaux dans l'ouverture.

   7. LE MOUVEMENT. Ce qui est sous le pli apparaît en montant, les
      chiffres comptent. Tout s'arrête avec prefers-reduced-motion.

   AUCUNE COULEUR NOUVELLE : les jetons de tokens.css, et sur l'encre, les
   mêmes clairs que annuaire.css.
   =================================================================== */

/* ---------- 1. L'ouverture de l'accueil ---------- */

.an-ouverture--accueil .an-dedans { display: grid; gap: 26px; align-items: center; }
.an-ouverture-illu { display: none; }
.an-ouverture-illu img {
  display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover;
  -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 58%, transparent 100%);
  mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 58%, transparent 100%);
}
/* Le fil d'Ariane prend toute la largeur, le texte la colonne de gauche,
   la scène la colonne de droite : sans ces trois placements, la grille
   rangeait le fil à gauche, le titre à droite et la scène en dessous,
   vu à la première photo du 23 octobre 2026. */
@media (min-width: 900px) {
  .an-ouverture--accueil .an-dedans { grid-template-columns: minmax(0, 1fr) minmax(300px, 420px); column-gap: 48px; row-gap: 8px; }
  .an-ouverture--accueil .an-fil { grid-column: 1 / -1; }
  .an-ouverture--accueil .an-titre-ligne { grid-column: 1; grid-row: 2; }
  .an-ouverture-illu { display: block; min-width: 0; grid-column: 2; grid-row: 2; align-self: center; }
}

.an-preuves { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 0; padding: 0; list-style: none; max-width: 580px; }
.an-preuves li { flex: 1 1 140px; min-width: 0; padding: 12px 14px; border-radius: var(--angle); background: rgba(255, 255, 255, .06); border: 1px solid rgba(190, 211, 201, .22); }
/* Sur téléphone, l'ouverture est centrée comme partout sur le site : les
   boutons et les chiffres suivent le texte, au lieu de rester collés à
   gauche sous un titre centré. */
@media (max-width: 759px) {
  .an-ouverture-boutons { justify-content: center; }
  .an-preuves, .an-ligne-preuves { justify-content: center; margin-inline: auto; }
  .an-preuves li { flex: 1 1 100px; text-align: center; }
}
.an-preuves b { display: block; font: 800 clamp(1.45rem, 2.6vw, 1.95rem)/1 var(--ff-titre); letter-spacing: var(--ls-titre); color: #f5f7f6; font-variant-numeric: tabular-nums; }
.an-preuves span { display: block; margin-top: 5px; color: #b6c1bc; font-size: 14px; line-height: 1.3; }

/* ---------- 2. La recherche et les familles ---------- */

.an-filtre { display: grid; gap: 12px; margin: 0 0 18px; }
.an-recherche { position: relative; }
/* Le rembourrage gauche est marqué !important, comme celui du champ de
   mot de passe dans annuaire.css : la règle commune des champs du site
   passait devant et posait le texte sous la loupe. */
.an-recherche input {
  width: 100%; min-height: 50px; padding: 0 14px 0 46px !important; border-radius: var(--angle);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: 500 1rem var(--ff-texte);
  box-shadow: var(--shadow-sm);
}
.an-recherche input:focus-visible { outline: 3px solid var(--accent-fonce); outline-offset: 1px; border-color: var(--accent-fonce); }
.an-recherche input::placeholder { color: var(--faint); }
.an-recherche svg { position: absolute; left: 14px; top: 50%; translate: 0 -50%; width: 20px; height: 20px; color: var(--muted); pointer-events: none; }
/* AUCUNE MARGE NÉGATIVE SUR LA RANGÉE QUI DÉFILE : avec « margin: 0 -16px »
   elle dépassait sa colonne de seize pixels à droite, et toute la page
   glissait de côté sur téléphone. Vu en production le 23 octobre 2026 au
   soir, signalé par Joris. */
.an-familles { display: flex; gap: 8px; margin: 0; padding: 2px 0; max-width: 100%; list-style: none; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
.an-familles::-webkit-scrollbar { display: none; }
.an-familles li { flex: 0 0 auto; scroll-snap-align: start; }
@media (min-width: 760px) { .an-familles { flex-wrap: wrap; overflow: visible; } }
.an-famille {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: var(--angle-pilule);
  border: 1px solid var(--line); background: var(--surface); color: var(--muted); font: 700 14px var(--ff-texte); cursor: pointer;
  transition: background-color var(--mv-court) var(--mv-courbe), color var(--mv-court) var(--mv-courbe), border-color var(--mv-court) var(--mv-courbe);
}
.an-famille:hover { border-color: var(--accent-line); color: var(--text); }
.an-famille:focus-visible { outline: 3px solid var(--accent-fonce); outline-offset: 2px; }
.an-famille[aria-pressed="true"] { background: var(--accent-fonce); color: var(--on-accent-fonce); border-color: var(--accent-fonce); }
.an-filtre-vide { margin: 0; padding: var(--pas-3); border-radius: var(--angle); border: 1px dashed var(--line-strong); color: var(--muted); text-align: center; }

/* ---------- 3. Les tuiles ---------- */

.an-tuiles { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.an-tuile { position: relative; gap: 8px; padding: 20px 12px 16px; }
.an-tuile-logo { width: 64px; height: 64px; padding: 8px; }
.an-tuile-nom { font-size: 1rem; }
.an-tuile-gain { font-size: 1.15rem; }
.an-tuile-gain--vide { font-size: .9rem; }
.an-tuile-parrains {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 2px; padding: 4px 10px; border-radius: var(--angle-pilule);
  border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); font-size: 14px; font-weight: 700; line-height: 1.2;
}
.an-tuile-parrains svg { width: 14px; height: 14px; }
.an-tuile-parrains--oui { border-color: var(--accent-line); background: var(--accent-wash); color: var(--accent-ink); }

/* ---------- 4. Les trois pas, sur l'encre ---------- */

.an-comment--encre {
  color: #f5f7f6; border-color: rgba(255, 255, 255, .09);
  background: radial-gradient(90% 70% at 18% 0%, rgba(255, 255, 255, .08) 0%, transparent 60%), linear-gradient(180deg, #0d1a15 0%, #08100e 70%), #08100e;
  padding: clamp(26px, 3.4vw, 44px) clamp(18px, 2.6vw, 34px);
}
.an-comment--encre h2 { margin: 0 0 6px; text-align: center; color: #f5f7f6; font-size: clamp(1.35rem, 2.6vw, 1.85rem); letter-spacing: var(--ls-titre); }
.an-comment-sous { margin: 0 0 22px; text-align: center; color: #b6c1bc; line-height: 1.55; }
.an-comment--encre .an-pas li { color: #c6cfcb; justify-items: center; text-align: center; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.an-comment--encre .an-pas strong { color: #f5f7f6; }
.an-pas-illu {
  display: block; width: min(200px, 62%); height: auto; aspect-ratio: 1; object-fit: cover;
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 56%, transparent 72%);
  mask-image: radial-gradient(circle at 50% 50%, #000 56%, transparent 72%);
}
.an-comment--encre .an-pas li i { margin-top: -22px; box-shadow: 0 8px 18px -10px rgba(4, 22, 11, .8); }
.an-comment--encre .an-gain-date { margin-top: 18px; text-align: center; color: #b6c1bc; }
.an-comment--encre .an-gain-date a { color: #f5f7f6; }
@media (min-width: 760px) { .an-comment--encre .an-pas { gap: 26px; } }

/* ---------- 5. La confiance et les questions ---------- */

.an-confiance { display: grid; gap: 18px; }
.an-promesses { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.an-promesse {
  display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; align-items: start; min-width: 0;
  padding: 16px; border-radius: var(--angle); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-sm);
}
.an-promesse i { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--angle-objet); background: var(--accent-wash); border: 1px solid var(--accent-line); color: var(--accent-ink); font-style: normal; }
.an-promesse i svg { width: 22px; height: 22px; }
.an-promesse b { display: block; margin-bottom: 3px; color: var(--text); font: 800 1rem/1.3 var(--ff-titre); }
.an-promesse span { display: block; color: var(--muted); font-size: .95rem; line-height: 1.5; overflow-wrap: anywhere; }
.an-faq { display: grid; }
.an-faq details { border-top: 1px solid var(--line); }
.an-faq details:last-child { border-bottom: 1px solid var(--line); }
.an-faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 52px; padding: 8px 0; cursor: pointer; list-style: none;
  color: var(--text); font: 700 1rem/1.35 var(--ff-titre);
}
.an-faq summary::-webkit-details-marker { display: none; }
.an-faq summary::after { content: ""; flex: 0 0 auto; width: 10px; height: 10px; border-right: 2px solid var(--accent-ink); border-bottom: 2px solid var(--accent-ink); transform: rotate(45deg); transition: transform var(--mv-court) var(--mv-courbe); margin-right: 4px; }
.an-faq details[open] summary::after { transform: rotate(-135deg); }
.an-faq summary:hover { color: var(--accent-ink); }
.an-faq summary:focus-visible { outline: 3px solid var(--accent-fonce); outline-offset: 2px; border-radius: 4px; }
.an-faq p { margin: 0 0 18px; max-width: 70ch; color: var(--muted); line-height: 1.6; }

/* ---------- 6. Le tableau de bord du parrain ---------- */

.an-tableau { grid-column: 1 / -1; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 760px) { .an-tableau { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; } }
.an-tableau li {
  display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; align-items: center; min-width: 0;
  padding: 14px; border-radius: var(--angle); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-sm);
}
.an-tableau i { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--angle-objet); background: var(--accent-wash); border: 1px solid var(--accent-line); color: var(--accent-ink); font-style: normal; }
.an-tableau i svg { width: 20px; height: 20px; }
.an-tableau b { display: block; font: 800 1.45rem/1.1 var(--ff-titre); letter-spacing: var(--ls-titre); color: var(--text); font-variant-numeric: tabular-nums; }
.an-tableau span { display: block; margin-top: 2px; color: var(--muted); font-size: 14px; line-height: 1.3; }
.an-tableau a { color: inherit; text-decoration: none; }

.an-route { display: flex; justify-content: space-between; align-items: end; gap: 6px; max-width: 420px; margin: 12px 0 0; padding: 0; list-style: none; }
.an-route li { display: grid; justify-items: center; opacity: .38; filter: grayscale(.6); transition: opacity var(--mv-moyen) var(--mv-courbe); }
.an-route li.fait { opacity: .85; filter: none; }
.an-route li.actuel { opacity: 1; filter: none; }
.an-route img { width: 34px; height: 34px; }
.an-route li.actuel img { width: 46px; height: 46px; filter: drop-shadow(0 6px 12px rgba(85, 230, 149, .45)); }
.an-route li + li { position: relative; }

/* ---------- 8. La page de marque, le profil et le classement ---------- */

.an-ligne-preuves { display: flex; flex-wrap: wrap; gap: 8px 10px; margin: 16px 0 0; padding: 0; list-style: none; }
.an-ligne-preuves li { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 0 13px; border-radius: var(--angle-pilule); background: rgba(255, 255, 255, .07); border: 1px solid rgba(190, 211, 201, .25); color: #c6cfcb; font-size: 14px; }
.an-ligne-preuves svg { width: 16px; height: 16px; color: #8ff2bc; }
.an-ligne-preuves b { color: #f5f7f6; }

.an-chiffres--deux { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.an-code--lien code { font-size: 14px; letter-spacing: 0; font-weight: 600; }
.an-profil-tete-ouverture .an-route { margin-top: 14px; }

.an-podium { gap: 12px; }
.an-podium li { position: relative; gap: 4px; padding: 22px 10px 18px; box-shadow: var(--shadow-sm); }
.an-podium li:nth-child(1) { padding-top: 30px; background: linear-gradient(180deg, var(--accent-wash), transparent 45%), var(--surface); }
.an-podium .an-rang { position: absolute; top: -14px; left: 50%; translate: -50% 0; min-width: 40px; height: 28px; font-size: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.an-podium li:nth-child(1) .an-rang { background-color: var(--accent); background-image: var(--matiere-fond); color: var(--on-accent); border-color: var(--matiere-line); }
.an-podium .an-avatar--grand { width: 72px; height: 72px; font-size: 1.6rem; margin-bottom: 6px; }
.an-podium li:nth-child(1) .an-avatar--grand { width: 88px; height: 88px; font-size: 1.9rem; }
/* La médaille ne couvre pas les initiales : plus petite sur les deuxième
   et troisième, vu à la photo du 23 octobre 2026 au soir. */
.an-podium .an-avatar--grand img { width: 34px; height: 34px; right: -8px; bottom: -8px; }
.an-podium li:nth-child(1) .an-avatar--grand img { width: 42px; height: 42px; right: -10px; bottom: -10px; }
.an-podium small { color: var(--accent-ink); font-size: 14px; font-weight: 700; }
.an-classement li { box-shadow: var(--shadow-sm); }

/* ---------- 9. La barre fixe de la page de marque, sur téléphone ---------- */

/* Deux gestes sous le pouce pendant toute la page : profiter de l'offre
   par le premier parrain de la liste, ou déposer son annonce. Sur grand
   écran, la barre n'existe pas : les boutons sont déjà sous les yeux. */
.an-barre-fixe { display: none; }
@media (max-width: 759px) {
  .an-barre-fixe {
    position: fixed; inset: auto 0 0 0; z-index: 40; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px;
    padding: 10px max(12px, env(safe-area-inset-right, 0px)) max(10px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
    background: color-mix(in srgb, var(--surface) 92%, transparent); border-top: 1px solid var(--line);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: 0 -8px 24px -16px rgba(4, 22, 11, .4);
  }
  .an-barre-fixe .an-bouton { min-height: 48px; padding-inline: 16px; }
  .an-barre-fixe .an-bouton--plein { justify-content: center; }
  /* La page garde de la place sous elle, sinon le pied de page vit sous la barre. */
  .an--avec-barre .an-page-corps { padding-bottom: 96px; }
}

/* ---------- 10. Un formulaire seul sur sa page ---------- */

/* Les retours et la marque proposée n'ont pas de colonne d'atouts : la
   carte prend toute la largeur de la grille et se centre, un peu plus
   large qu'une carte de connexion pour laisser respirer le texte. */
.an-acces-carte--seule, .an-acces .an-acces-carte--seule { grid-column: 1 / -1; justify-self: center; width: min(100%, 620px); }

/* ---------- 7. Le mouvement ---------- */

@media (prefers-reduced-motion: no-preference) {
  .an-cache { opacity: 0; transform: translateY(16px); }
  .an-apparait.est-la { opacity: 1; transform: none; transition: opacity var(--mv-long) var(--mv-courbe), transform var(--mv-long) var(--mv-courbe); }
  .an-tuile img { transition: transform var(--mv-moyen) var(--mv-courbe); }
  .an-tuile:hover img { transform: scale(1.08); }
  .an-ouverture-illu img { animation: an-flotte 6s ease-in-out infinite; }
  @keyframes an-flotte { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
}
@media (forced-colors: active) {
  .an-famille[aria-pressed="true"] { background: Highlight; color: HighlightText; }
  .an-ouverture-illu img, .an-pas-illu { -webkit-mask-image: none; mask-image: none; }
}
