/* ==========================================================================
   FlexiCash — Guide complet (help.html)
   --------------------------------------------------------------------------
   Recherche, table des matières, filtres, accordéons et retour en haut.
   Mobile d'abord : cibles tactiles larges, aucun débordement horizontal.
   ========================================================================== */

.help-shell {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  align-items: start;
}

/* --- Barre de recherche --------------------------------------------------- */

.help-search-wrap {
  position: relative;
  max-width: 560px;
}

.help-search-wrap .input {
  width: 100%;
  min-height: 50px;
  padding-inline-start: 42px;
  font-size: 1rem;
}

.help-search-icon {
  position: absolute;
  inset-inline-start: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #6b7a72;
  pointer-events: none;
  display: grid;
  place-items: center;
}

.help-count {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.85rem;
  color: #6b7a72;
}

/* --- Catégories cliquables ------------------------------------------------ */

.help-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.help-chip {
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid #d9e5df;
  border-radius: 999px;
  background: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  color: #3d4c45;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.help-chip:hover { border-color: #0d9250; color: #0b2b1d; }
.help-chip:focus-visible { outline: 2px solid #0d9250; outline-offset: 2px; }

.help-chip.is-active {
  background: #0d9250;
  border-color: #0d9250;
  color: #fff;
}

/* --- Table des matières --------------------------------------------------- */

.help-toc {
  border: 1px solid #e6eee9;
  border-radius: 16px;
  background: #fbfdfc;
  padding: 18px 20px;
}

.help-toc-title {
  margin: 0 0 12px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #0d9250;
}

.help-toc-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 2px;
}

.help-toc-list a {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 9px 8px;
  border-radius: 9px;
  font-size: 0.92rem;
  line-height: 1.4;
  color: #3d4c45;
  text-decoration: none;
}

.help-toc-list a:hover { background: #eef6f2; color: #0b2b1d; }
.help-toc-list a:focus-visible { outline: 2px solid #0d9250; outline-offset: -2px; }

.help-toc-num {
  flex: none;
  min-width: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #9aa8a1;
}

/* --- Sections en accordéon ------------------------------------------------ */

.help-section {
  border: 1px solid #e6eee9;
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
}

.help-section + .help-section { margin-top: 12px; }

.help-section-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  /* Cible tactile confortable : 60 px de haut au minimum. */
  min-height: 60px;
  padding: 14px 18px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.help-section-summary::-webkit-details-marker { display: none; }
.help-section-summary:hover { background: #f7fbf9; }
.help-section-summary:focus-visible { outline: 2px solid #0d9250; outline-offset: -2px; }

.help-section-icon {
  flex: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: #e7f6ee;
  color: #0d9250;
}

.help-section-title {
  flex: 1;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #0b2b1d;
}

.help-section-chevron {
  flex: none;
  color: #8a9992;
  transition: transform 0.2s ease;
  display: grid;
  place-items: center;
}

.help-section[open] .help-section-chevron { transform: rotate(180deg); }

.help-section-body {
  padding: 4px 18px 22px;
  border-top: 1px solid #f0f5f2;
}

/* --- Contenu -------------------------------------------------------------- */

.help-text {
  margin: 14px 0 0;
  font-size: 0.97rem;
  line-height: 1.65;
  color: #3d4c45;
}

.help-list,
.help-steps {
  margin: 14px 0 0;
  padding-inline-start: 22px;
  display: grid;
  gap: 8px;
  font-size: 0.97rem;
  line-height: 1.6;
  color: #3d4c45;
}

.help-steps li::marker { font-weight: 700; color: #0d9250; }
.help-list li::marker { color: #0d9250; }

.help-callout {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 12px;
  border-inline-start: 3px solid;
}

.help-callout p {
  margin: 6px 0 0;
  font-size: 0.93rem;
  line-height: 1.6;
}

.help-callout-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.help-note {
  background: #eef6f2;
  border-color: #0d9250;
}
.help-note .help-callout-label { color: #0a7a43; }
.help-note p { color: #29473a; }

.help-warn {
  background: #fdf6e7;
  border-color: #d99b13;
}
.help-warn .help-callout-label { color: #a8730a; }
.help-warn p { color: #4a3a17; }

/* --- Questions / réponses -------------------------------------------------- */

.help-qa { margin-top: 14px; display: grid; gap: 8px; }

.help-qa-item {
  border: 1px solid #e6eee9;
  border-radius: 11px;
  background: #fbfdfc;
  overflow: hidden;
}

.help-qa-item summary {
  min-height: 50px;
  display: flex;
  align-items: center;
  padding: 12px 15px;
  font-size: 0.94rem;
  font-weight: 600;
  color: #0b2b1d;
  cursor: pointer;
  list-style: none;
}

.help-qa-item summary::-webkit-details-marker { display: none; }
.help-qa-item summary::after {
  content: "+";
  margin-inline-start: auto;
  padding-inline-start: 12px;
  font-size: 1.15rem;
  font-weight: 400;
  color: #8a9992;
}
.help-qa-item[open] summary::after { content: "−"; }
.help-qa-item summary:focus-visible { outline: 2px solid #0d9250; outline-offset: -2px; }

.help-qa-item p {
  margin: 0;
  padding: 0 15px 14px;
  font-size: 0.93rem;
  line-height: 1.6;
  color: #3d4c45;
}

/* --- Recherche sans résultat ---------------------------------------------- */

.help-empty {
  border: 1px dashed #d9e5df;
  border-radius: 16px;
  padding: 30px 22px;
  text-align: center;
  color: #4b5c54;
}

.help-empty p { margin: 0 0 8px; line-height: 1.6; }

/* --- Bloc « Vous ne trouvez pas votre réponse ? » -------------------------- */

.help-fallback {
  margin-top: 32px;
  padding: 26px 22px;
  border-radius: 18px;
  background: #eef6f2;
  border: 1px solid #d6ebe0;
}

.help-fallback h2 {
  margin: 0 0 8px;
  font-size: 1.18rem;
  letter-spacing: -0.02em;
  color: #0b2b1d;
}

.help-fallback p {
  margin: 0 0 18px;
  font-size: 0.96rem;
  line-height: 1.6;
  color: #3d4c45;
}

.help-fallback-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* --- Retour en haut ------------------------------------------------------- */

.help-top-button {
  position: fixed;
  inset-inline-end: 18px;
  bottom: 18px;
  z-index: 60;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid #d9e5df;
  border-radius: 50%;
  background: #fff;
  color: #0b2b1d;
  box-shadow: 0 6px 18px rgba(6, 32, 21, 0.14);
  cursor: pointer;
}

.help-top-button:hover { background: #f2f8f5; }
.help-top-button:focus-visible { outline: 2px solid #0d9250; outline-offset: 2px; }
.help-top-button[hidden] { display: none; }

/* --------------------------------------------------------------------------
   Tablette et ordinateur : la table des matières passe en colonne collante.
   -------------------------------------------------------------------------- */
@media (min-width: 960px) {
  .help-shell {
    grid-template-columns: 264px minmax(0, 1fr);
    gap: 36px;
  }

  .help-toc {
    position: sticky;
    top: 24px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
  }
}

/* --------------------------------------------------------------------------
   Téléphone : rien ne déborde, le texte reste lisible.
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
  .help-section-summary { padding: 12px 14px; gap: 11px; }
  .help-section-body { padding: 4px 14px 18px; }
  .help-section-title { font-size: 0.97rem; }
  .help-toc { padding: 14px 15px; }
  .help-text,
  .help-list,
  .help-steps { font-size: 0.95rem; }
  .help-fallback { padding: 20px 16px; }
  .help-fallback-actions .btn { width: 100%; }
  .help-top-button { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
}

@media (prefers-reduced-motion: reduce) {
  .help-section-chevron { transition: none; }
}
