/* =====================================================================
   Aide (2026-10-30)
   ---------------------------------------------------------------------
   1. Bouton « ? » et menu d'aide de l'accueil (index.html) :
      - ordinateur : bouton rond dans l'en-tete, menu deroulant sous lui ;
      - telephone (820 px et moins) : la premiere ligne de l'en-tete est
        deja pleine (logo, langue, « Creer ma page »), le bouton devient
        une pastille flottante en bas a droite, a portee de pouce, et le
        menu un panneau qui monte du bas de l'ecran.
      Le menu est un <dialog> natif : Echap, piege du focus et retour du
      focus au bouton sont assures par le navigateur. Sans JavaScript, le
      bouton est un simple lien vers la page d'aide.
   2. Page d'aide (aide.html) : guide illustre pas a pas (captures
      ordinateur ou telephone selon l'ecran), recherche instantanee,
      questions frequentes, agrandissement des captures.
   Script : aide.js, dans le meme dossier.
   ===================================================================== */

/* ---------------------------------------------------------------- 1. Menu */
.rz-help-toggle {
  flex: none; width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid rgba(1, 56, 71, .16); border-radius: 50%;
  background: rgba(255, 255, 255, .75); color: var(--rz-ink, #161b28);
  font: 700 18px/1 var(--rz-display, system-ui, sans-serif);
  text-decoration: none; cursor: pointer;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}
.rz-help-toggle:hover { background: #fff; border-color: rgba(1, 56, 71, .32); }
.rz-help-toggle:focus-visible { outline: 3px solid var(--rz-olive, #596400); outline-offset: 2px; }
.rz-help-toggle[aria-expanded="true"] { background: var(--rz-ink, #161b28); border-color: var(--rz-ink, #161b28); color: #fff; }

/* Pastille flottante du telephone : un element a part, pose dans <body>.
   Le bouton de l'en-tete ne peut pas servir : l'en-tete porte un
   `backdrop-filter`, qui retient tout `position: fixed` a l'interieur de
   lui (la pastille restait collee sous le menu). */
.rz-help-fab { display: none; }
@media (max-width: 820px) {
  .site-header .header-actions > .rz-help-toggle { display: none; }
  .rz-help-fab {
    position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 250;
    width: 52px; height: 52px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--rz-ink, #161b28); color: #fff; text-decoration: none;
    font: 700 22px/1 var(--rz-display, system-ui, sans-serif);
    box-shadow: 0 10px 28px rgba(22, 27, 40, .28), 0 2px 6px rgba(22, 27, 40, .18);
  }
  .rz-help-fab:hover { background: #2a3142; }
  .rz-help-fab:focus-visible { outline: 3px solid var(--rz-olive, #596400); outline-offset: 3px; }
  .rz-help-fab[aria-expanded="true"] { background: var(--rz-lime, #d2e823); color: var(--rz-lime-ink, #4a5300); }
}

/* Reserve aux visiteurs connectes (2026-11-04) : le « ? » et la pastille
   restent caches tant que site.js n’a pas reconnu la session (api/me.php)
   et pose `rz-connecte` sur <html>. Le lien « Aide » du pied de page reste
   pour tout le monde. */
html:not(.rz-connecte) .rz-help-toggle,
html:not(.rz-connecte) .rz-help-fab { display: none !important; }

.rz-help-menu {
  /* Ordinateur : panneau deroulant cale sous le bouton (top/right poses par
     le script ; valeurs par defaut si le calcul n'a pas eu lieu). */
  position: fixed; top: 76px; right: 24px; left: auto; bottom: auto;
  width: min(420px, calc(100vw - 32px)); max-height: min(78vh, 680px);
  margin: 0; padding: 0; border: 0; border-radius: 18px;
  background: #fff; color: var(--rz-ink, #161b28);
  box-shadow: 0 24px 70px rgba(22, 27, 40, .22), 0 2px 8px rgba(22, 27, 40, .08);
  overflow: hidden;
}
.rz-help-menu[open] { display: flex; animation: rz-help-in .18s ease-out; }
.rz-help-menu::backdrop { background: rgba(22, 27, 40, .18); }
@keyframes rz-help-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.rz-help-panel { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain; }
.rz-help-head { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 20px 20px 12px; }
.rz-help-head > div { flex: 1; min-width: 0; }
.rz-help-grip { display: none; }
.rz-help-title { margin: 0 0 4px; font: 700 20px/1.2 var(--rz-display, system-ui, sans-serif); letter-spacing: -.02em; }
.rz-help-text { margin: 0; color: #5d5f4c; font-size: 14px; line-height: 1.5; }
.rz-help-close {
  flex: none; width: 44px; height: 44px; margin: -8px -8px 0 0;
  border: 0; border-radius: 50%; background: transparent; color: inherit;
  font-size: 26px; line-height: 1; cursor: pointer;
}
.rz-help-close:hover, .rz-help-close:focus-visible { background: #f2f3ff; outline: none; }

.rz-help-search { display: flex; gap: 8px; margin: 0 20px 6px; }
.rz-help-search input {
  flex: 1; min-width: 0; min-height: 44px; padding: 0 14px;
  border: 1px solid #d9dbe8; border-radius: 12px; background: #f7f8ff;
  font: 400 16px/1.2 var(--rz-body, system-ui, sans-serif); color: inherit;
}
.rz-help-search input:focus { outline: 2px solid var(--rz-olive, #596400); outline-offset: 1px; background: #fff; }
.rz-help-search button {
  flex: none; min-height: 44px; padding: 0 16px; border: 0; border-radius: 12px;
  background: var(--rz-ink, #161b28); color: #fff; cursor: pointer;
  font: 700 14px/1 var(--rz-display, system-ui, sans-serif);
}

.rz-help-section { margin: 14px 20px 6px; color: #6b6d5a; font: 700 11px/1 var(--rz-display, system-ui, sans-serif); letter-spacing: .08em; text-transform: uppercase; }
.rz-help-list { margin: 0; padding: 0 10px; list-style: none; }
.rz-help-item {
  display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 8px 10px;
  border-radius: 12px; color: inherit; text-decoration: none;
}
.rz-help-item:hover, .rz-help-item:focus-visible { background: #f2f3ff; outline: none; }
.rz-help-item img {
  flex: none; width: 48px; height: 48px; object-fit: cover; object-position: top;
  border-radius: 10px; border: 1px solid #e3e5f0; background: #f2f3ff;
}
.rz-help-item span { min-width: 0; display: grid; gap: 2px; }
.rz-help-item strong { font: 700 14px/1.3 var(--rz-display, system-ui, sans-serif); }
.rz-help-item small { color: #6b6d5a; font-size: 12.5px; line-height: 1.35; }

.rz-help-foot {
  position: sticky; bottom: 0; margin-top: 8px; padding: 10px 14px 14px;
  display: flex; flex-wrap: wrap; gap: 6px;
  border-top: 1px solid #eceef6; background: #fff;
}
.rz-help-foot a {
  flex: 1 1 auto; min-height: 44px; padding: 0 12px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; background: #f2f3ff; color: var(--rz-ink, #161b28);
  font: 600 13px/1.2 var(--rz-display, system-ui, sans-serif); text-align: center; text-decoration: none;
}
.rz-help-foot a:hover, .rz-help-foot a:focus-visible { background: var(--rz-lime, #d2e823); color: var(--rz-lime-ink, #4a5300); outline: none; }

/* Telephone : panneau qui monte du bas de l'ecran. */
@media (max-width: 820px) {
  .rz-help-menu {
    top: auto; right: 0; left: 0; bottom: 0;
    width: 100%; max-width: none; max-height: 88vh; max-height: 88dvh;
    border-radius: 22px 22px 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .rz-help-menu[open] { animation: rz-help-up .24s cubic-bezier(.2, .8, .2, 1); }
  .rz-help-menu::backdrop { background: rgba(22, 27, 40, .45); }
  .rz-help-grip { display: block; position: absolute; top: 8px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: #d9dbe8; }
  .rz-help-head { padding-top: 24px; }
}
@keyframes rz-help-up { from { transform: translateY(100%); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .rz-help-menu[open] { animation: none; }
}
@media print { .rz-help-toggle, .rz-help-fab, .rz-help-menu { display: none !important; } }

/* --------------------------------------------------------- 2. Page d'aide */
.help-page [hidden] { display: none !important; }

/* Recherche */
.help-search { position: relative; margin-top: 22px; }
.help-search svg { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; margin-top: -9px; fill: none; stroke: #6b6d5a; stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.help-search input {
  width: 100%; min-height: 48px; padding: 0 46px 0 42px; box-sizing: border-box;
  border: 1px solid var(--line, #e6e1dc); border-radius: 14px; background: #fff;
  font: 400 16px/1.2 var(--rz-body, system-ui, sans-serif); color: inherit;
  box-shadow: 0 6px 18px rgba(25, 20, 17, .04);
}
.help-search input:focus { outline: 2px solid var(--rz-olive, #596400); outline-offset: 1px; }
.help-search input::-webkit-search-cancel-button { display: none; }
.help-search-clear {
  position: absolute; right: 2px; top: 50%; width: 44px; height: 44px; margin-top: -22px;
  border: 0; border-radius: 50%; background: transparent; color: #6b6d5a; font-size: 22px; cursor: pointer;
}
.help-empty { margin: 0 0 24px; padding: 16px 18px; border-radius: 12px; background: #f2f3ff; }

/* Sommaire : titres des deux groupes */
.legal-summary nav .help-nav-title {
  margin: 0; padding: 18px 0 8px; border-bottom: 1px solid var(--line);
  color: var(--rz-ink, #161b28); font: 700 11px/1 var(--rz-display, system-ui, sans-serif);
  letter-spacing: .08em; text-transform: uppercase;
}
.legal-summary nav .help-nav-title:first-child { padding-top: 0; }
@media (max-width: 1100px) {
  .legal-summary nav .help-nav-title { grid-column: 1 / -1; }
}
/* Telephone : le guide a ses cartes illustrees juste en dessous, le
   sommaire ne garde que les questions. */
@media (max-width: 820px) {
  .legal-summary nav .help-nav-guide { display: none; }
}

/* Cartes du guide (sommaire illustre) */
.help-cards { margin: 20px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.legal-content .help-cards li + li { margin-top: 0; }
.help-card {
  position: relative; height: 100%; min-height: 72px; box-sizing: border-box;
  display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 10px;
  border: 1px solid var(--line, #e6e1dc); border-radius: 14px; background: #fff;
  color: inherit; text-decoration: none;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.legal-content a.help-card { color: inherit; text-decoration: none; }
.help-card:hover, .help-card:focus-visible { border-color: var(--rz-olive, #596400); box-shadow: 0 8px 22px rgba(25, 20, 17, .08); outline: none; }
.help-card img { flex: none; width: 52px; height: 52px; object-fit: cover; object-position: top; border-radius: 10px; border: 1px solid #e3e5f0; }
.help-card-num {
  position: absolute; left: 4px; top: 4px; min-width: 20px; height: 20px; padding: 0 5px; box-sizing: border-box;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; background: var(--rz-lime, #d2e823); color: var(--rz-lime-ink, #4a5300);
  font: 700 11px/1 var(--rz-display, system-ui, sans-serif);
}
.help-card-text { min-width: 0; display: grid; gap: 2px; }
.help-card-text strong { font: 700 14px/1.3 var(--rz-display, system-ui, sans-serif); color: var(--rz-ink, #161b28); }
.legal-content .help-card-text small { color: #6b6d5a; font-size: 12.5px; line-height: 1.35; }
.legal-content .help-note { margin-top: 14px; color: #8a857f; font-size: 13px; }
@media (max-width: 560px) {
  .help-cards { grid-template-columns: 1fr; }
}

/* Etapes du guide */
.legal-content .help-guide h2 { display: flex; align-items: center; gap: 12px; }
.help-guide-num {
  flex: none; width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--rz-lime, #d2e823); color: var(--rz-lime-ink, #4a5300);
  font: 700 16px/1 var(--rz-display, system-ui, sans-serif); letter-spacing: 0;
}
.help-shot { margin: 18px 0 0; }
.help-shot-link {
  display: block; overflow: hidden; border: 1px solid #e3e5f0; border-radius: 12px;
  background: #f2f3ff; box-shadow: 0 14px 34px rgba(22, 27, 40, .10);
  cursor: zoom-in;
}
/* Ordinateur : barre de fenetre au-dessus de la capture. */
.help-shot-link::before {
  content: ""; display: block; height: 22px;
  background:
    radial-gradient(circle at 14px 11px, #ff6159 4px, transparent 4.5px),
    radial-gradient(circle at 30px 11px, #ffbd2e 4px, transparent 4.5px),
    radial-gradient(circle at 46px 11px, #28c941 4px, transparent 4.5px),
    #eceef6;
}
.help-shot img { display: block; width: 100%; height: auto; }
.help-shot figcaption { margin-top: 8px; color: #8a857f; font-size: 12.5px; text-align: center; }
.help-shot-m { display: none; }
/* Telephone : capture du telephone, dans un cadre d'ecran. */
@media (max-width: 767px) {
  .help-shot-link {
    width: min(270px, 78%); margin: 0 auto;
    border: 8px solid var(--rz-ink, #161b28); border-radius: 30px;
    box-shadow: 0 18px 40px rgba(22, 27, 40, .22);
  }
  .help-shot-link::before { display: none; }
  .help-shot-d { display: none; }
  .help-shot-m { display: inline; }
}

.legal-content .help-steps { margin: 20px 0 0; padding: 0; list-style: none; counter-reset: help-step; }
.legal-content .help-steps li { position: relative; padding-left: 40px; counter-increment: help-step; }
.legal-content .help-steps li + li { margin-top: 12px; }
.legal-content .help-steps li::before {
  content: counter(help-step); position: absolute; left: 0; top: 1px;
  width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; background: #f2f3ff; color: var(--rz-ink, #161b28);
  font: 700 13px/1 var(--rz-display, system-ui, sans-serif);
}
.legal-content .help-tip { margin-top: 18px; padding: 14px 16px; border-left: 3px solid var(--rz-lime, #d2e823); border-radius: 0 10px 10px 0; background: #fbfcef; }
.legal-content .help-go-wrap { margin-top: 16px; }
.legal-content a.help-go {
  min-height: 44px; padding: 0 18px; display: inline-flex; align-items: center; gap: 8px;
  border-radius: 999px; background: var(--rz-ink, #161b28); color: #fff;
  font: 700 14px/1.2 var(--rz-display, system-ui, sans-serif); text-decoration: none;
}
.legal-content a.help-go:hover { background: #2a3142; }
.help-go svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.legal-content .help-questions-intro h2 { font-size: 30px; }

/* Agrandissement d'une capture */
.help-zoom {
  max-width: calc(100vw - 24px); max-height: calc(100vh - 24px);
  padding: 0; border: 0; border-radius: 14px; background: #fff; overflow: auto;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
}
.help-zoom::backdrop { background: rgba(22, 27, 40, .7); }
.help-zoom img { display: block; max-width: 100%; height: auto; cursor: zoom-out; }
.help-zoom-close {
  position: sticky; top: 8px; float: right; z-index: 1; width: 44px; height: 44px; margin: 8px 8px -52px 0;
  border: 0; border-radius: 50%; background: rgba(22, 27, 40, .8); color: #fff; font-size: 24px; cursor: pointer;
}
@media print { .help-search, .help-zoom, .help-go-wrap { display: none !important; } }
