/* ══════════════════════════════════════════════════════════════
   Carboneum — help.css
   Panneau d'aide contextuelle
   ══════════════════════════════════════════════════════════════ */

/* ─── Bouton déclencheur ─────────────────────────────────── */
#help-fab {
  position: fixed;
  bottom: 1.4rem;
  right: 1.4rem;
  z-index: 200;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c-400), var(--c-500));
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(15, 143, 90, 0.38);
  transition: transform .18s ease, box-shadow .18s ease;
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1;
  font-family: Georgia, serif;
  letter-spacing: -.5px;
  user-select: none;
}
#help-fab:hover {
  transform: translateY(-2px) scale(1.07);
  box-shadow: 0 8px 24px rgba(15, 143, 90, 0.42);
}
#help-fab.active {
  background: linear-gradient(135deg, var(--c-500), var(--c-600));
}

/* ─── Overlay de fond (mobile) ───────────────────────────── */
#help-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 210;
  background: rgba(0,0,0,.28);
  opacity: 0;
  transition: opacity .22s ease;
}
#help-overlay.visible {
  display: block;
  opacity: 1;
}

/* ─── Panneau principal ──────────────────────────────────── */
#help-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 220;
  width: 360px;
  max-width: 92vw;
  background: var(--bg-1, #fff);
  border-left: 1.5px solid var(--border, #86EFBB);
  box-shadow: -8px 0 32px rgba(0,0,0,.1);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}
#help-panel.open {
  transform: translateX(0);
}

/* ─── En-tête du panneau ─────────────────────────────────── */
.help-header {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .9rem 1rem .85rem;
  background: linear-gradient(135deg, var(--c-600), var(--c-500));
  color: #fff;
  flex-shrink: 0;
}
.help-header-ico {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  font-family: Georgia, serif;
  flex-shrink: 0;
}
.help-header-text {
  flex: 1;
  min-width: 0;
}
.help-header-title {
  font-size: .9rem;
  font-weight: 700;
  line-height: 1.2;
}
.help-header-page {
  font-size: .74rem;
  opacity: .8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#help-close {
  background: rgba(255,255,255,.15);
  border: none;
  color: #fff;
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.1rem;
  transition: background .15s;
}
#help-close:hover { background: rgba(255,255,255,.28); }

/* ─── Recherche ──────────────────────────────────────────── */
.help-search-wrap {
  padding: .7rem 1rem .5rem;
  border-bottom: 1px solid var(--border, #ddd);
  flex-shrink: 0;
  background: var(--bg-1, #fff);
}
.help-search {
  width: 100%;
  box-sizing: border-box;
  padding: .42rem .75rem .42rem 2rem;
  border: 1.5px solid var(--border, #ddd);
  border-radius: 20px;
  font-size: .82rem;
  background: var(--bg, #f9fafb) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%231DB97A' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") no-repeat .65rem center;
  color: var(--txt, #111);
  outline: none;
  transition: border-color .15s;
}
.help-search:focus { border-color: var(--primary, #1DB97A); }
.help-search::placeholder { color: var(--txt-3, #9ca3af); }

/* ─── Corps scrollable ───────────────────────────────────── */
.help-body {
  flex: 1;
  overflow-y: auto;
  padding: .8rem 1rem 2rem;
  overscroll-behavior: contain;
}
.help-body::-webkit-scrollbar { width: 4px; }
.help-body::-webkit-scrollbar-thumb { background: var(--border, #ddd); border-radius: 2px; }

/* ─── Section de contenu ─────────────────────────────────── */
.help-section {
  margin-bottom: 1.1rem;
}
.help-section-title {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--primary, #1DB97A);
  margin-bottom: .45rem;
  padding-bottom: .3rem;
  border-bottom: 1.5px solid var(--c-100, #BBFADE);
}

/* ─── Description rapide ─────────────────────────────────── */
.help-desc {
  font-size: .84rem;
  color: var(--txt-2, #374151);
  line-height: 1.55;
  margin-bottom: .8rem;
  background: var(--c-50, #F0FDF8);
  border-left: 3px solid var(--primary, #1DB97A);
  border-radius: 0 var(--r-sm, 6px) var(--r-sm, 6px) 0;
  padding: .55rem .75rem;
}

/* ─── Étapes ─────────────────────────────────────────────── */
.help-steps { list-style: none; padding: 0; margin: 0 0 .6rem; }
.help-steps li {
  display: flex;
  gap: .6rem;
  align-items: flex-start;
  margin-bottom: .5rem;
  font-size: .83rem;
  color: var(--txt-2, #374151);
  line-height: 1.5;
}
.help-step-num {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary, #1DB97A);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: .12rem;
}

/* ─── Tips / Remarques ───────────────────────────────────── */
.help-tip {
  display: flex;
  gap: .5rem;
  align-items: flex-start;
  background: rgba(245,158,11,.09);
  border: 1px solid rgba(217,119,6,.22);
  border-radius: var(--r-sm, 6px);
  padding: .5rem .7rem;
  margin-bottom: .5rem;
  font-size: .8rem;
  color: #92400e;
  line-height: 1.5;
}
.help-tip-ico { flex-shrink: 0; font-size: .9rem; }

.help-note {
  display: flex;
  gap: .5rem;
  align-items: flex-start;
  background: var(--c-50, #F0FDF8);
  border: 1px solid var(--c-200, #86EFBB);
  border-radius: var(--r-sm, 6px);
  padding: .5rem .7rem;
  margin-bottom: .5rem;
  font-size: .8rem;
  color: var(--txt-2, #374151);
  line-height: 1.5;
}
.help-note-ico { flex-shrink: 0; font-size: .9rem; color: var(--primary, #1DB97A); }

/* ─── Tableau champs ─────────────────────────────────────── */
.help-fields {
  width: 100%;
  border-collapse: collapse;
  font-size: .78rem;
  margin-bottom: .6rem;
}
.help-fields th {
  text-align: left;
  font-weight: 700;
  color: var(--txt-3, #6b7280);
  padding: .25rem .4rem;
  border-bottom: 1.5px solid var(--border, #ddd);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.help-fields td {
  padding: .3rem .4rem;
  vertical-align: top;
  color: var(--txt-2, #374151);
  border-bottom: 1px solid var(--border-2, #f3f4f6);
  line-height: 1.45;
}
.help-fields td:first-child {
  font-weight: 600;
  color: var(--txt, #111);
  white-space: nowrap;
  padding-right: .6rem;
}
.help-fields tr:last-child td { border-bottom: none; }

/* ─── Norme badge ────────────────────────────────────────── */
.help-norm {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  background: rgba(124,58,237,.1);
  color: var(--violet, #7C3AED);
  font-size: .7rem;
  font-weight: 700;
  border-radius: 4px;
  padding: .1rem .4rem;
  margin: 0 .2rem .3rem 0;
}

/* ─── Lien vers autre page ───────────────────────────────── */
.help-nav-link {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  color: var(--primary, #1DB97A);
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: text-decoration-color .15s;
}
.help-nav-link:hover { text-decoration-color: var(--primary, #1DB97A); }

/* ─── Résultats de recherche ─────────────────────────────── */
.help-search-result {
  border: 1px solid var(--border, #ddd);
  border-radius: var(--r-sm, 6px);
  padding: .55rem .75rem;
  margin-bottom: .45rem;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.help-search-result:hover {
  background: var(--c-50, #F0FDF8);
  border-color: var(--primary, #1DB97A);
}
.help-search-result-page {
  font-size: .7rem;
  color: var(--primary, #1DB97A);
  font-weight: 600;
  margin-bottom: .1rem;
}
.help-search-result-text {
  font-size: .8rem;
  color: var(--txt-2, #374151);
  line-height: 1.4;
}
.help-search-result-text mark {
  background: var(--c-100, #BBFADE);
  color: var(--c-600, #065C39);
  border-radius: 2px;
  padding: 0 .15rem;
}
.help-no-results {
  text-align: center;
  color: var(--txt-3, #9ca3af);
  font-size: .84rem;
  padding: 1.5rem 0;
}

/* ─── Responsive mobile ──────────────────────────────────── */
@media (max-width: 600px) {
  #help-panel { width: 100vw; max-width: 100vw; }
  #help-fab { bottom: 1rem; right: 1rem; }
}
