/* SoukPilot — Centre d'aide (LOT G) — indépendant du dashboard, réutilise les tokens de marque */

*, *::before, *::after { box-sizing: border-box; }

html { font-family: var(--font-latin, 'Poppins', 'Segoe UI', system-ui, sans-serif); scroll-behavior: smooth; }
html[lang="ar"], html[dir="rtl"] { font-family: var(--font-arabic, 'Cairo', 'Tajawal', system-ui, sans-serif); }

body.aide-body {
  margin: 0;
  background: var(--brand-background, #F7F7F5);
  color: var(--brand-text, #111827);
  line-height: var(--lh-normal, 1.5);
  min-height: 100vh;
}

.aide-skip-link {
  position: absolute;
  inset-inline-start: -999px;
  top: 0;
  background: var(--brand-primary, #1B2A4A);
  color: #fff;
  padding: 10px 16px;
  z-index: 100;
  border-radius: 0 0 8px 0;
}
.aide-skip-link:focus { inset-inline-start: 0; }

/* ---------- Header ---------- */
.aide-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--brand-surface, #fff);
  border-bottom: 1px solid var(--brand-border, #E2E5EA);
}
.aide-header-inner {
  max-width: var(--container-max, 1180px);
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.aide-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--brand-primary, #1B2A4A);
  font-weight: 700;
  font-size: 1.05rem;
  white-space: nowrap;
}
.aide-brand .aide-brand-badge {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--brand-primary, #1B2A4A);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800;
}
.aide-nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-inline-start: 8px;
  flex: 1 1 auto;
}
.aide-nav a {
  color: var(--brand-text-muted, #5B6472);
  text-decoration: none;
  font-size: 0.92rem;
  padding: 8px 10px;
  border-radius: var(--radius-sm, 6px);
  white-space: nowrap;
}
.aide-nav a:hover, .aide-nav a.is-active { background: var(--brand-background, #F7F7F5); color: var(--brand-primary, #1B2A4A); }

.aide-lang-switch { display: flex; gap: 4px; border: 1px solid var(--brand-border, #E2E5EA); border-radius: var(--radius-pill, 999px); padding: 3px; }
.aide-lang-switch button {
  border: 0; background: transparent; padding: 6px 12px; border-radius: var(--radius-pill, 999px);
  cursor: pointer; font-size: 0.85rem; color: var(--brand-text-muted, #5B6472);
}
.aide-lang-switch button.is-active { background: var(--brand-primary, #1B2A4A); color: #fff; font-weight: 600; }

.aide-nav-toggle {
  display: none;
  border: 1px solid var(--brand-border, #E2E5EA);
  background: var(--brand-surface, #fff);
  border-radius: var(--radius-sm, 6px);
  padding: 8px 10px;
  cursor: pointer;
}

/* ---------- Layout ---------- */
.aide-main { max-width: var(--container-max, 1180px); margin: 0 auto; padding: 28px 20px 80px; }

.aide-hero {
  background: linear-gradient(180deg, rgba(27,42,74,.04), transparent 70%);
  border: 1px solid var(--brand-border, #E2E5EA);
  border-radius: var(--radius-xl, 24px);
  padding: 36px 28px;
  margin-bottom: 28px;
}
.aide-hero h1 { margin: 0 0 8px; font-size: var(--fs-h1, 2rem); color: var(--brand-primary, #1B2A4A); letter-spacing: var(--tracking-tight, -.02em); }
.aide-hero p { margin: 0 0 20px; color: var(--brand-text-muted, #5B6472); max-width: 640px; }

.aide-search-form { display: flex; gap: 8px; max-width: 560px; }
.aide-search-form input[type="search"] {
  flex: 1; padding: 12px 14px; border-radius: var(--radius-md, 10px);
  border: 1px solid var(--brand-border-strong, #CBD1D9); font-size: 1rem; background: var(--brand-surface, #fff); color: inherit;
}
.aide-search-form input[type="search"]:focus { outline: none; box-shadow: var(--focus-ring, 0 0 0 3px rgba(46,204,155,.45)); }
.aide-search-form button {
  padding: 12px 18px; border: none; border-radius: var(--radius-md, 10px);
  background: var(--brand-primary, #1B2A4A); color: #fff; font-weight: 600; cursor: pointer;
}
.aide-search-form button:hover { background: var(--brand-primary-hover, #24365C); }

.aide-tour-btn {
  margin-top: 16px;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--brand-surface, #fff); border: 1px solid var(--brand-border-strong, #CBD1D9);
  padding: 8px 14px; border-radius: var(--radius-pill, 999px); cursor: pointer; font-size: 0.88rem; color: var(--brand-primary, #1B2A4A);
}
.aide-tour-btn:hover { border-color: var(--brand-primary, #1B2A4A); }

/* ---------- Category grid ---------- */
.aide-section-title { font-size: var(--fs-h3, 1.25rem); margin: 32px 0 14px; color: var(--brand-primary, #1B2A4A); }
.aide-cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.aide-cat-card {
  display: block; text-decoration: none; padding: 18px; border-radius: var(--radius-lg, 16px);
  border: 1px solid var(--brand-border, #E2E5EA); background: var(--brand-surface, #fff); color: inherit;
  transition: box-shadow var(--transition-base, 200ms ease), transform var(--transition-base, 200ms ease);
}
.aide-cat-card:hover { box-shadow: var(--shadow-md, 0 4px 12px rgba(17,24,39,.08)); transform: translateY(-1px); }
.aide-cat-card h3 { margin: 0 0 6px; font-size: 1rem; color: var(--brand-primary, #1B2A4A); }
.aide-cat-card span { font-size: 0.82rem; color: var(--brand-text-muted, #5B6472); }

/* ---------- Guide cards / lists ---------- */
.aide-guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.aide-guide-card {
  display: block; text-decoration: none; color: inherit; padding: 18px;
  border: 1px solid var(--brand-border, #E2E5EA); border-radius: var(--radius-lg, 16px); background: var(--brand-surface, #fff);
}
.aide-guide-card:hover { box-shadow: var(--shadow-sm, 0 1px 2px rgba(17,24,39,.06)); border-color: var(--brand-border-strong, #CBD1D9); }
.aide-guide-card h3 { margin: 0 0 6px; font-size: 1.02rem; color: var(--brand-primary, #1B2A4A); }
.aide-guide-card p { margin: 0 0 10px; font-size: 0.9rem; color: var(--brand-text-muted, #5B6472); }

.aide-badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 0.75rem; font-weight: 600;
  padding: 3px 10px; border-radius: var(--radius-pill, 999px);
}
.aide-badge.disponible { background: var(--brand-success-bg, #E7F6EF); color: var(--brand-success, #167A50); }
.aide-badge.partiel { background: var(--brand-warning-bg, #FFF1E6); color: var(--brand-warning, #8A4D20); }
.aide-badge.prevu { background: var(--brand-info-bg, #EAF3FA); color: var(--brand-info, #1F6FAE); }

/* ---------- Guide article ---------- */
.aide-breadcrumb { font-size: 0.85rem; color: var(--brand-text-muted, #5B6472); margin-bottom: 14px; }
.aide-breadcrumb a { color: var(--brand-primary, #1B2A4A); text-decoration: none; }
.aide-breadcrumb a:hover { text-decoration: underline; }

.aide-article-head h1 { margin: 4px 0 10px; font-size: var(--fs-h2, 1.75rem); color: var(--brand-primary, #1B2A4A); }
.aide-article-head p.aide-summary { color: var(--brand-text-muted, #5B6472); font-size: 1.02rem; margin: 0 0 14px; }

.aide-article-layout { display: grid; grid-template-columns: 1fr 240px; gap: 32px; align-items: start; margin-top: 24px; }
.aide-article-body section { margin-bottom: 26px; scroll-margin-top: 90px; }
.aide-article-body h2 { font-size: 1.15rem; color: var(--brand-primary, #1B2A4A); margin: 0 0 10px; }
.aide-article-body p { margin: 0 0 10px; }
.aide-article-body ul { margin: 0 0 10px; padding-inline-start: 22px; }
.aide-article-body li { margin-bottom: 6px; }

.aide-toc {
  position: sticky; top: 90px;
  border: 1px solid var(--brand-border, #E2E5EA); border-radius: var(--radius-lg, 16px);
  padding: 16px; background: var(--brand-surface, #fff);
}
.aide-toc h4 { margin: 0 0 10px; font-size: 0.8rem; text-transform: uppercase; letter-spacing: var(--tracking-wide, .04em); color: var(--brand-text-muted, #5B6472); }
.aide-toc ul { list-style: none; margin: 0 0 16px; padding: 0; }
.aide-toc a { display: block; padding: 5px 0; font-size: 0.88rem; color: var(--brand-text, #111827); text-decoration: none; border-inline-start: 2px solid transparent; padding-inline-start: 10px; }
.aide-toc a:hover { color: var(--brand-primary, #1B2A4A); border-inline-start-color: var(--brand-secondary, #2ECC9B); }

.aide-related { margin-top: 16px; }
.aide-related h4 { margin: 0 0 8px; font-size: 0.8rem; text-transform: uppercase; letter-spacing: var(--tracking-wide, .04em); color: var(--brand-text-muted, #5B6472); }
.aide-related a { display: block; font-size: 0.88rem; padding: 4px 0; color: var(--brand-primary, #1B2A4A); text-decoration: none; }
.aide-related a:hover { text-decoration: underline; }

.aide-copy-link { border: 1px solid var(--brand-border-strong, #CBD1D9); background: var(--brand-surface, #fff); border-radius: var(--radius-sm, 6px); padding: 6px 10px; font-size: 0.82rem; cursor: pointer; color: var(--brand-text, #111827); }

@media (max-width: 860px) {
  .aide-article-layout { grid-template-columns: 1fr; }
  .aide-toc { position: static; }
}

/* ---------- FAQ ---------- */
.aide-faq-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 20px; }
.aide-faq-filters button {
  border: 1px solid var(--brand-border-strong, #CBD1D9); background: var(--brand-surface, #fff);
  padding: 6px 14px; border-radius: var(--radius-pill, 999px); cursor: pointer; font-size: 0.85rem; color: var(--brand-text, #111827);
}
.aide-faq-filters button.is-active { background: var(--brand-primary, #1B2A4A); border-color: var(--brand-primary, #1B2A4A); color: #fff; }

.aide-faq-item { border: 1px solid var(--brand-border, #E2E5EA); border-radius: var(--radius-md, 10px); margin-bottom: 10px; overflow: hidden; background: var(--brand-surface, #fff); }
.aide-faq-item summary {
  cursor: pointer; padding: 14px 16px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 10px;
  color: var(--brand-text, #111827);
}
.aide-faq-item summary::-webkit-details-marker { display: none; }
.aide-faq-item summary::after { content: "+"; font-weight: 400; color: var(--brand-text-muted, #5B6472); }
.aide-faq-item[open] summary::after { content: "−"; }
.aide-faq-item .aide-faq-answer { padding: 0 16px 16px; color: var(--brand-text-muted, #5B6472); }

/* ---------- Glossary ---------- */
.aide-glossary-list { display: grid; gap: 10px; }
.aide-glossary-item { border: 1px solid var(--brand-border, #E2E5EA); border-radius: var(--radius-md, 10px); padding: 14px 16px; background: var(--brand-surface, #fff); }
.aide-glossary-item dt { font-weight: 700; color: var(--brand-primary, #1B2A4A); margin-bottom: 4px; }
.aide-glossary-item dd { margin: 0; color: var(--brand-text-muted, #5B6472); }
.aide-glossary-jump { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.aide-glossary-jump button { border: 1px solid var(--brand-border, #E2E5EA); background: var(--brand-surface, #fff); width: 30px; height: 30px; border-radius: var(--radius-sm, 6px); cursor: pointer; font-size: 0.82rem; }

/* ---------- Checklist ---------- */
.aide-checklist-progress { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.aide-progress-bar { flex: 1; height: 10px; border-radius: var(--radius-pill, 999px); background: var(--brand-border, #E2E5EA); overflow: hidden; }
.aide-progress-bar > span { display: block; height: 100%; background: var(--brand-secondary, #2ECC9B); transition: width var(--transition-slow, 320ms ease); }
.aide-checklist-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.aide-checklist-item {
  display: flex; align-items: flex-start; gap: 12px; border: 1px solid var(--brand-border, #E2E5EA);
  border-radius: var(--radius-md, 10px); padding: 12px 14px; background: var(--brand-surface, #fff);
}
.aide-checklist-item input[type="checkbox"] { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--brand-secondary, #2ECC9B); cursor: pointer; }
.aide-checklist-item label { flex: 1; cursor: pointer; }
.aide-checklist-item.is-done label { text-decoration: line-through; color: var(--brand-text-muted, #5B6472); }
.aide-checklist-item a.aide-checklist-link { font-size: 0.82rem; color: var(--brand-primary, #1B2A4A); text-decoration: none; white-space: nowrap; }
.aide-checklist-item a.aide-checklist-link:hover { text-decoration: underline; }
.aide-checklist-note { font-size: 0.82rem; color: var(--brand-text-muted, #5B6472); margin: 14px 0; }
.aide-reset-btn { border: 1px solid var(--brand-border-strong, #CBD1D9); background: var(--brand-surface, #fff); padding: 8px 14px; border-radius: var(--radius-sm, 6px); cursor: pointer; font-size: 0.85rem; margin-top: 10px; }

/* ---------- Search results ---------- */
.aide-search-results-list { display: grid; gap: 10px; margin-top: 16px; }
.aide-result-item { border: 1px solid var(--brand-border, #E2E5EA); border-radius: var(--radius-md, 10px); padding: 14px 16px; background: var(--brand-surface, #fff); }
.aide-result-item a { color: var(--brand-primary, #1B2A4A); font-weight: 600; text-decoration: none; }
.aide-result-item a:hover { text-decoration: underline; }
.aide-result-item .aide-result-type { font-size: 0.72rem; text-transform: uppercase; letter-spacing: var(--tracking-wide, .04em); color: var(--brand-text-muted, #5B6472); margin-bottom: 4px; display: block; }
.aide-result-item p { margin: 6px 0 0; font-size: 0.88rem; color: var(--brand-text-muted, #5B6472); }
mark { background: rgba(46,204,155,.35); color: inherit; border-radius: 3px; padding: 0 2px; }

/* ---------- CTA ---------- */
.aide-cta {
  margin-top: 40px; padding: 26px; border-radius: var(--radius-xl, 24px);
  background: var(--brand-primary, #1B2A4A); color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
}
.aide-cta h3 { margin: 0 0 6px; }
.aide-cta p { margin: 0; color: var(--brand-text-on-dark-muted, #B9C0CC); max-width: 520px; }
.aide-cta a.aide-cta-btn {
  background: var(--brand-secondary, #2ECC9B); color: var(--brand-on-secondary, #1B2A4A); text-decoration: none;
  font-weight: 700; padding: 12px 20px; border-radius: var(--radius-pill, 999px); white-space: nowrap;
}
.aide-cta a.aide-cta-btn:hover { background: var(--brand-secondary-hover, #29B78B); }

/* ---------- Diagnostic / contact page blocks ---------- */
.aide-callout { border-inline-start: 4px solid var(--brand-error, #C73838); background: var(--brand-error-bg, #FDECEC); padding: 14px 16px; border-radius: var(--radius-md, 10px); margin: 14px 0; }
.aide-callout.info { border-inline-start-color: var(--brand-info, #1F6FAE); background: var(--brand-info-bg, #EAF3FA); }
.aide-callout p { margin: 0; }

/* ---------- Footer ---------- */
.aide-footer { border-top: 1px solid var(--brand-border, #E2E5EA); padding: 24px 20px; text-align: center; font-size: 0.82rem; color: var(--brand-text-muted, #5B6472); }

/* ---------- Guided tour overlay ---------- */
.aide-tour-overlay { position: fixed; inset: 0; background: rgba(16,27,48,.55); display: none; align-items: center; justify-content: center; z-index: 200; padding: 20px; }
.aide-tour-overlay.is-open { display: flex; }
.aide-tour-box { background: var(--brand-surface, #fff); border-radius: var(--radius-lg, 16px); max-width: 420px; width: 100%; padding: 24px; box-shadow: var(--shadow-xl, 0 26px 60px -18px rgba(17,24,39,.20)); }
.aide-tour-box .aide-tour-step-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: var(--tracking-wide, .04em); color: var(--brand-text-muted, #5B6472); margin-bottom: 6px; }
.aide-tour-box h3 { margin: 0 0 10px; color: var(--brand-primary, #1B2A4A); }
.aide-tour-box p { margin: 0 0 20px; color: var(--brand-text-muted, #5B6472); }
.aide-tour-actions { display: flex; justify-content: space-between; gap: 10px; }
.aide-tour-actions button { border: none; border-radius: var(--radius-pill, 999px); padding: 9px 16px; cursor: pointer; font-size: 0.88rem; }
.aide-tour-actions .aide-tour-primary { background: var(--brand-primary, #1B2A4A); color: #fff; }
.aide-tour-actions .aide-tour-secondary { background: transparent; color: var(--brand-text-muted, #5B6472); }
.aide-tour-dots { display: flex; gap: 6px; margin-top: 16px; justify-content: center; }
.aide-tour-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--brand-border-strong, #CBD1D9); }
.aide-tour-dots span.is-active { background: var(--brand-secondary, #2ECC9B); }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .aide-nav { display: none; width: 100%; order: 3; flex-direction: column; gap: 2px; }
  .aide-nav.is-open { display: flex; }
  .aide-nav a { padding: 10px; }
  .aide-nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .aide-header-inner { flex-wrap: wrap; }
  .aide-hero { padding: 24px 18px; }
  .aide-search-form { max-width: none; flex-direction: column; }
  .aide-search-form button { align-self: flex-start; }
  .aide-cta { flex-direction: column; align-items: flex-start; }
}

[dir="rtl"] .aide-checklist-item a.aide-checklist-link { text-align: right; }

.aide-visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Lot AE — feedback et checklist vérifiée côté serveur */
.aide-feedback{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:22px;padding:14px;border:1px solid var(--brand-border,#E2E5EA);border-radius:var(--radius-md,10px);background:var(--brand-background,#F7F7F5)}
.aide-feedback button{border:1px solid var(--brand-border-strong,#CBD1D9);background:#fff;border-radius:999px;padding:7px 12px;cursor:pointer}.aide-feedback button:disabled{opacity:.55}
.aide-feedback span{font-size:.82rem;color:var(--brand-text-muted,#5B6472)}
.aide-server-store{display:grid;gap:6px;max-width:360px;margin:12px 0}.aide-server-store select{min-height:42px;border:1px solid var(--brand-border-strong,#CBD1D9);border-radius:8px;background:#fff;padding:8px}
.aide-server-mark{display:grid;place-items:center;width:22px;height:22px;border-radius:50%;font-weight:800;color:var(--brand-error,#C73838)}.aide-checklist-item.is-done .aide-server-mark{color:var(--brand-success,#1C8A4C)}
.aide-checklist-item small{display:block;color:var(--brand-text-muted,#5B6472);font-size:.76rem;margin-top:3px}.aide-open-onboarding{display:inline-flex;margin-top:16px}
