*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --cream: #FAF7F2; --green: #1A4530; --green-2: #2D6A47;
  --caramel: #B8742A; --caramel-bg: #FBF0E2;
  --text: #1C1208; --muted: #8C7060; --border: #DDD0BE; --white: #FFFFFF;
  --dark: #0E1A10;
  --blue: #1D4ED8; --blue-bg: #EFF6FF;
  --amber: #92400E; --amber-bg: #FFFBEB;
}
html { scroll-behavior: smooth; }
body { font-family: 'Inter', sans-serif; background: var(--cream); color: var(--text); line-height: 1.65; font-size: 15px; }
h1,h2,h3,h4 { font-family: 'Plus Jakarta Sans', sans-serif; line-height: 1.25; }
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; max-width: 100%; }
code { font-family: 'Menlo', 'Consolas', monospace; font-size: .875em; background: #EDE8E0; padding: 2px 6px; border-radius: 4px; }

/* ── NAV ── */
.aide-nav {
  background: var(--dark); height: 56px;
  padding: 0 24px; display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
  border-bottom: 1px solid rgba(250,247,242,.07);
}
.aide-nav-logo { color: var(--cream); font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 900; font-size: 17px; text-decoration: none; display: flex; align-items: center; gap: 10px; }
.aide-nav-logo span { font-size: 11px; font-weight: 500; color: rgba(250,247,242,.45); font-family: 'Inter', sans-serif; border-left: 1px solid rgba(250,247,242,.15); padding-left: 10px; margin-left: 2px; }
.aide-nav-right { display: flex; align-items: center; gap: 16px; }
.aide-nav-link { font-size: 13px; color: rgba(250,247,242,.6); text-decoration: none; transition: color .15s; }
.aide-nav-link:hover { color: var(--cream); text-decoration: none; }
.aide-nav-cta { background: var(--caramel); color: var(--white); padding: 7px 16px; border-radius: 999px; font-size: 12px; font-weight: 700; text-decoration: none; transition: opacity .15s; }
.aide-nav-cta:hover { opacity: .88; text-decoration: none; }

/* ── ARTICLE LAYOUT ── */
.aide-wrap { display: grid; grid-template-columns: 240px 1fr; gap: 0; min-height: calc(100vh - 56px); max-width: 1100px; margin: 0 auto; }
.aide-sidebar {
  padding: 32px 20px; border-right: 1px solid var(--border);
  position: sticky; top: 56px; height: calc(100vh - 56px); overflow-y: auto;
}
.aide-sidebar-title { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 12px; padding: 0 8px; }
.aide-sidebar-section { margin-bottom: 24px; }
.aide-sidebar-section-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--caramel); margin-bottom: 6px; padding: 0 8px; }
.aide-sidebar-link {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 8px; border-radius: 8px;
  font-size: 13px; color: var(--muted); text-decoration: none;
  transition: background .12s, color .12s;
  margin-bottom: 2px;
}
.aide-sidebar-link:hover { background: var(--border); color: var(--text); text-decoration: none; }
.aide-sidebar-link.active { background: var(--green); color: var(--cream); font-weight: 600; }
.aide-sidebar-link.active:hover { background: var(--green-2); }

/* ── ARTICLE CONTENT ── */
.aide-content { padding: 40px 48px 80px; max-width: 760px; }
.aide-breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); margin-bottom: 24px; }
.aide-breadcrumb a { color: var(--muted); text-decoration: none; }
.aide-breadcrumb a:hover { color: var(--text); }
.aide-breadcrumb span { opacity: .5; }

.aide-article-header { margin-bottom: 36px; padding-bottom: 28px; border-bottom: 1px solid var(--border); }
.aide-article-eyebrow { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--caramel); margin-bottom: 10px; }
.aide-article-header h1 { font-size: clamp(24px, 3vw, 34px); margin-bottom: 12px; }
.aide-article-meta { display: flex; align-items: center; gap: 16px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }

/* ── PLATFORM BADGES ── */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.badge-web { background: var(--blue-bg); color: var(--blue); }
.badge-app { background: #F0FDF4; color: #166534; }
.badge-both { background: var(--caramel-bg); color: var(--caramel); }

/* ── CONTENT ELEMENTS ── */
.aide-content h2 { font-size: 22px; margin: 40px 0 14px; padding-top: 8px; }
.aide-content h2:first-of-type { margin-top: 0; }
.aide-content h3 { font-size: 17px; margin: 28px 0 10px; }
.aide-content p { margin-bottom: 16px; color: var(--text); line-height: 1.7; }
.aide-content ul, .aide-content ol { padding-left: 22px; margin-bottom: 16px; }
.aide-content li { margin-bottom: 6px; line-height: 1.65; }
.aide-content strong { font-weight: 700; }

.platform-section {
  border-left: 3px solid var(--border);
  padding: 20px 24px;
  margin: 24px 0;
  border-radius: 0 12px 12px 0;
  background: var(--white);
}
.platform-section.web { border-left-color: var(--blue); background: var(--blue-bg); }
.platform-section.app { border-left-color: #16A34A; background: #F0FDF4; }
.platform-section-header { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-weight: 700; font-size: 14px; }

.step-list { display: grid; gap: 12px; margin: 20px 0; }
.step { display: flex; gap: 14px; align-items: flex-start; }
.step-num { width: 26px; height: 26px; flex-shrink: 0; background: var(--green); color: var(--cream); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; margin-top: 1px; }
.step-body strong { display: block; font-size: 14px; margin-bottom: 3px; }
.step-body span { font-size: 13px; color: var(--muted); }

.tip {
  background: var(--caramel-bg); border: 1px solid rgba(184,116,42,.25);
  border-radius: 12px; padding: 16px 20px; margin: 20px 0;
  font-size: 13.5px; line-height: 1.6;
}
.tip::before { content: '💡 '; font-style: normal; }

.warning {
  background: var(--amber-bg); border: 1px solid rgba(146,64,14,.2);
  border-radius: 12px; padding: 16px 20px; margin: 20px 0;
  font-size: 13.5px; line-height: 1.6; color: var(--amber);
}
.warning::before { content: '⚠️ '; }

.info {
  background: var(--blue-bg); border: 1px solid rgba(29,78,216,.15);
  border-radius: 12px; padding: 16px 20px; margin: 20px 0;
  font-size: 13.5px; line-height: 1.6; color: var(--blue);
}
.info::before { content: 'ℹ️ '; }

.related { background: var(--white); border: 1px solid var(--border); border-radius: 14px; padding: 24px; margin-top: 48px; }
.related h4 { font-size: 14px; margin-bottom: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-family: 'Inter', sans-serif; font-weight: 700; }
.related-links { display: grid; gap: 8px; }
.related-link { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--green); padding: 10px 14px; border-radius: 8px; background: var(--cream); border: 1px solid var(--border); text-decoration: none; transition: border-color .15s; }
.related-link:hover { border-color: var(--green); text-decoration: none; }

/* ── INDEX PAGE ── */
.aide-index-header { background: var(--dark); padding: 56px 24px 48px; }
.aide-index-header-inner { max-width: 760px; margin: 0 auto; }
.aide-index-eyebrow { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--caramel); margin-bottom: 12px; }
.aide-index-header h1 { font-size: clamp(28px, 4vw, 44px); color: var(--cream); margin-bottom: 12px; }
.aide-index-header p { font-size: 16px; color: rgba(250,247,242,.55); max-width: 440px; }

.aide-search-wrap { max-width: 760px; margin: 0 auto; padding: 32px 24px 0; }
.aide-search {
  display: flex; align-items: center; gap: 12px;
  background: var(--white); border: 1.5px solid var(--border);
  border-radius: 14px; padding: 12px 18px;
  transition: border-color .15s;
}
.aide-search:focus-within { border-color: var(--green); }
.aide-search svg { flex-shrink: 0; color: var(--muted); }
.aide-search input { flex: 1; border: none; background: none; font-size: 15px; color: var(--text); font-family: 'Inter', sans-serif; outline: none; }
.aide-search input::placeholder { color: var(--muted); }

.aide-index-body { max-width: 760px; margin: 0 auto; padding: 32px 24px 80px; }
.aide-categories { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 40px; }
.aide-cat {
  background: var(--white); border: 1px solid var(--border);
  border-radius: 16px; padding: 22px 24px;
  text-decoration: none; color: var(--text);
  transition: box-shadow .15s, transform .15s, border-color .15s;
  display: block;
}
.aide-cat:hover { box-shadow: 0 8px 32px rgba(28,18,8,.08); transform: translateY(-2px); border-color: var(--green); text-decoration: none; }
.aide-cat-icon { font-size: 26px; margin-bottom: 12px; }
.aide-cat h3 { font-size: 16px; margin-bottom: 6px; }
.aide-cat p { font-size: 13px; color: var(--muted); line-height: 1.5; margin-bottom: 12px; }
.aide-cat-count { font-size: 11px; font-weight: 700; color: var(--caramel); }
.aide-cat-links { display: grid; gap: 4px; margin-top: 8px; }
.aide-cat-link { font-size: 13px; color: var(--green); padding: 3px 0; border-top: 1px solid var(--border); }
.aide-cat-link:first-child { border-top: none; }

#search-results { display: none; }
#search-results.visible { display: block; }
.search-result-item { background: var(--white); border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px; margin-bottom: 10px; text-decoration: none; display: block; transition: border-color .15s; }
.search-result-item:hover { border-color: var(--green); text-decoration: none; }
.search-result-item strong { font-size: 15px; color: var(--text); display: block; margin-bottom: 4px; }
.search-result-item span { font-size: 13px; color: var(--muted); }

/* ── FOOTER ── */
.aide-footer { background: #080F09; padding: 28px 24px; text-align: center; border-top: 1px solid rgba(250,247,242,.06); }
.aide-footer p { font-size: 12px; color: rgba(250,247,242,.32); }
.aide-footer a { color: var(--caramel-bg); }

/* ── RESPONSIVE ── */
/* ── Mobile nav back link (shown only on mobile articles) ── */
.aide-mobile-back {
  display: none;
  align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--green);
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--white);
  text-decoration: none;
}
.aide-mobile-back:hover { text-decoration: none; background: var(--cream); }

@media (max-width: 760px) {
  .aide-wrap { grid-template-columns: 1fr; }
  .aide-sidebar { display: none; }
  .aide-content { padding: 20px 16px 60px; max-width: 100%; }
  .aide-categories { grid-template-columns: 1fr; }
  .aide-mobile-back { display: flex; }
  .platform-section { padding: 14px 16px; }
  .aide-article-header h1 { font-size: 24px; }
  .step-list { gap: 10px; }
  .aide-nav-right .aide-nav-link { display: none; }
}

/* ── Neutralise l'ancien système section-lock ── */
.aide-lock-wrap { position: static; margin: 0; }
.aide-lock-content { filter: none !important; max-height: none !important; overflow: visible !important; pointer-events: auto !important; user-select: auto !important; }
.aide-lock-fade, .aide-lock-card { display: none !important; }

/* ── Popup Gate ── */

/* Voile progressif sur le bas de la page */
.aide-gate-veil {
  position: fixed;
  inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    transparent 35%,
    rgba(250,247,242,.25) 50%,
    rgba(250,247,242,.75) 65%,
    rgba(250,247,242,.97) 80%,
    var(--cream) 100%
  );
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity .9s ease;
}
body.is-gated .aide-gate-veil { opacity: 1; }

/* Popup card remontant depuis le bas */
.aide-gate-popup {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  display: flex; justify-content: center;
  padding: 0 20px 36px;
  z-index: 50;
  opacity: 0;
  transform: translateY(32px);
  pointer-events: none;
  transition: opacity .5s ease .6s, transform .5s ease .6s;
}
body.is-gated .aide-gate-popup {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.aide-gate-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 20px 20px 16px 16px;
  padding: 28px 36px 28px;
  text-align: center;
  box-shadow: 0 -4px 32px rgba(28,18,8,.08), 0 24px 64px rgba(28,18,8,.16);
  width: min(460px, 100%);
  display: grid;
  gap: 6px;
}
.aide-gate-card-icon {
  font-size: 28px; margin-bottom: 4px;
}
.aide-gate-card h3 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 20px; color: var(--text);
  margin-bottom: 6px;
}
.aide-gate-card p {
  font-size: 14px; color: var(--muted);
  line-height: 1.5; margin-bottom: 16px;
}
.aide-gate-btn {
  display: block;
  background: var(--green); color: var(--cream) !important;
  padding: 13px 28px; border-radius: 999px;
  font-size: 15px; font-weight: 700;
  text-decoration: none !important;
  transition: opacity .15s;
  margin-bottom: 10px;
}
.aide-gate-btn:hover { opacity: .88; }
.aide-gate-login {
  font-size: 12px; color: var(--muted);
}
.aide-gate-login a { color: var(--green); font-weight: 600; }
