/* ══════════════════════════════════════════════════════════
   Veilforge — page documentation
   Reprend les tokens et composants de styles.css (thème sombre)
   ══════════════════════════════════════════════════════════ */

/* ── Tête de page ──────────────────────────────────────── */
.doc-hero {
  padding: 72px 0 46px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(720px 300px at 12% -10%, rgba(145,229,190,.10), transparent 68%),
    linear-gradient(180deg, rgba(22,26,25,.55), transparent);
}
.doc-hero-inner { max-width: 1160px; margin: 0 auto; padding: 0 32px; }
.doc-hero h1 {
  margin: 14px 0 0;
  font-size: clamp(32px, 4.4vw, 48px);
  letter-spacing: -1.6px; line-height: 1.1;
}
.doc-lead {
  margin: 18px 0 0; max-width: 760px;
  color: var(--muted); font-size: 15.5px; line-height: 1.75;
}
.doc-lead a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--accent-line); }
.doc-lead a:hover { border-bottom-color: var(--accent); }

.doc-cards {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px; margin-top: 30px; max-width: 720px;
}
.doc-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 11px; padding: 14px 16px;
}
.doc-card span { display: block; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.doc-card strong { display: block; margin-top: 6px; font-size: 17px; font-weight: 650; color: var(--ink); }

.doc-jumps { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }

/* ── Mise en page ──────────────────────────────────────── */
.docs-layout {
  display: grid; grid-template-columns: 232px minmax(0, 1fr);
  gap: 44px; max-width: 1160px; margin: 0 auto; padding: 0 32px;
}

/* ── Sommaire ──────────────────────────────────────────── */
.toc {
  position: sticky; top: 84px; align-self: start;
  display: flex; flex-direction: column; gap: 2px;
  padding: 26px 0 40px;
}
.toc-title {
  margin: 0 0 10px; font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--faint);
}
.toc a {
  padding: 7px 12px; border-left: 2px solid transparent;
  border-radius: 0 8px 8px 0;
  font-size: 13px; color: var(--muted); text-decoration: none;
  transition: color .15s, background .15s, border-color .15s;
}
.toc a:hover { color: var(--ink); background: rgba(255,255,255,.035); }
.toc a.is-active { color: var(--accent); border-left-color: var(--accent); background: rgba(145,229,190,.07); }
.toc-swagger {
  margin-top: 16px; padding: 9px 12px !important;
  border: 1px solid var(--line); border-left-width: 1px !important;
  border-radius: 9px !important; font-size: 12.5px !important;
}
.toc-swagger:hover { border-color: var(--accent-line) !important; }

/* ── Contenu ───────────────────────────────────────────── */
.doc-content { padding-bottom: 40px; min-width: 0; }
.doc-section { padding: 42px 0; border-top: 1px solid var(--line); scroll-margin-top: 90px; }
.doc-section:first-child { border-top: 0; padding-top: 38px; }
.doc-num {
  margin: 0; font-size: 12px; font-weight: 700;
  letter-spacing: .16em; color: var(--accent);
}
.doc-section h2 {
  margin: 6px 0 0; font-size: clamp(23px, 2.6vw, 29px);
  letter-spacing: -.7px; line-height: 1.2;
}
.doc-section h3.doc-sub {
  margin: 30px 0 12px; font-size: 16px; font-weight: 650;
  letter-spacing: -.2px; color: var(--ink);
}
.doc-section h3.doc-sub code { font-size: 14px; }
.doc-p { margin: 14px 0 0; color: var(--muted); font-size: 14.5px; line-height: 1.8; }
.doc-p a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--accent-line); }

/* code en ligne */
.doc-content code {
  background: var(--field); border: 1px solid var(--line);
  border-radius: 5px; padding: 1px 6px;
  font-size: .9em; color: var(--accent);
}
.doc-content pre code {
  background: none; border: 0; padding: 0;
  color: var(--code-ink, var(--ink)); font-size: 12.5px;
}

/* ── Étapes ────────────────────────────────────────────── */
.step-list { display: flex; flex-direction: column; gap: 14px; margin-top: 24px; }
.step-item {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 16px 18px;
}
.step-item > span {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(145,229,190,.12); border: 1px solid var(--accent-line);
  color: var(--accent); font-size: 13px; font-weight: 700;
}
.step-item strong { display: block; font-size: 14.5px; color: var(--ink); }
.step-item p { margin: 5px 0 0; font-size: 13.5px; color: var(--muted); line-height: 1.65; }

/* ── Listes ────────────────────────────────────────────── */
.doc-ul { margin: 18px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 11px; }
.doc-ul li {
  position: relative; padding-left: 22px;
  color: var(--muted); font-size: 14.5px; line-height: 1.72;
}
.doc-ul li::before {
  content: ""; position: absolute; left: 4px; top: .68em;
  width: 7px; height: 7px; border-radius: 2px;
  background: var(--accent); opacity: .8;
}
.doc-ul li strong { color: var(--ink); font-weight: 600; }

.flow-list { margin: 22px 0 0; padding: 0; list-style: none; counter-reset: fl; display: flex; flex-direction: column; gap: 12px; }
.flow-list li {
  counter-increment: fl; position: relative;
  padding: 15px 18px 15px 56px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  color: var(--muted); font-size: 14.5px; line-height: 1.7;
}
.flow-list li::before {
  content: counter(fl); position: absolute; left: 17px; top: 15px;
  width: 24px; height: 24px; border-radius: 7px;
  display: grid; place-items: center;
  background: var(--field); border: 1px solid var(--line);
  color: var(--accent); font-size: 12.5px; font-weight: 700;
}
.flow-list li strong { color: var(--ink); }

.check-list { margin: 16px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; counter-reset: ck; }
.check-list li {
  counter-increment: ck; position: relative;
  padding: 13px 16px 13px 48px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 11px;
  color: var(--muted); font-size: 14px; line-height: 1.65;
}
.check-list li::before {
  content: counter(ck); position: absolute; left: 15px; top: 13px;
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(145,229,190,.12); color: var(--accent);
  font-size: 12px; font-weight: 700;
}

/* ── Boîtes d'information ──────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 22px; }
.info-box {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 17px 19px;
}
.info-box h3 { margin: 0; font-size: 14.5px; font-weight: 650; color: var(--ink); }
.info-box p { margin: 8px 0 0; font-size: 13.5px; color: var(--muted); line-height: 1.7; }

/* ── Encadrés ──────────────────────────────────────────── */
.callout {
  margin-top: 20px; padding: 15px 18px;
  background: var(--field); border: 1px solid var(--line);
  border-left: 3px solid var(--muted);
  border-radius: 10px; color: var(--muted);
  font-size: 14px; line-height: 1.7;
}
.callout strong { color: var(--ink); }
.callout.ok { border-left-color: var(--accent); }
.callout.warn { border-left-color: #e5b567; background: rgba(229,181,103,.05); }
.callout ul { margin: 10px 0 0; padding-left: 19px; }
.callout li { margin-top: 5px; }

/* ── Tableaux ──────────────────────────────────────────── */
.table-wrap {
  margin-top: 20px; overflow-x: auto;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--panel);
}
.api-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.api-table th {
  text-align: left; padding: 12px 16px;
  background: rgba(255,255,255,.028);
  border-bottom: 1px solid var(--line);
  font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); font-weight: 650; white-space: nowrap;
}
.api-table td {
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  color: var(--muted); line-height: 1.6; vertical-align: top;
}
.api-table tr:last-child td { border-bottom: 0; }
.api-table td strong { color: var(--ink); font-weight: 600; }
.api-table td code { white-space: nowrap; }
.method {
  display: inline-block; min-width: 46px; text-align: center;
  padding: 3px 7px; border-radius: 6px;
  font-size: 11px; font-weight: 750; letter-spacing: .06em;
}
.method.get { background: rgba(122,179,255,.13); color: #8fc0ff; border: 1px solid rgba(122,179,255,.3); }
.method.post { background: rgba(145,229,190,.13); color: var(--accent); border: 1px solid var(--accent-line); }

/* ── Blocs de code ─────────────────────────────────────── */
.doc-section .code-card { margin-top: 18px; }

/* ── Figure ────────────────────────────────────────────── */
.doc-figure {
  margin: 24px 0 0; padding: 22px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
}
.doc-figure img { display: block; width: 100%; height: auto; }
.doc-figure figcaption { margin-top: 14px; font-size: 12.5px; color: var(--faint); text-align: center; }

/* ── FAQ ───────────────────────────────────────────────── */
.faq {
  margin-top: 12px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 11px;
  overflow: hidden;
}
.faq summary {
  cursor: pointer; padding: 15px 18px;
  font-size: 14.5px; font-weight: 600; color: var(--ink);
  list-style: none; position: relative; padding-right: 42px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 18px; top: 50%;
  transform: translateY(-50%); color: var(--accent);
  font-size: 18px; font-weight: 500;
}
.faq[open] summary::after { content: "–"; }
.faq[open] summary { border-bottom: 1px solid var(--line); }
.faq p { margin: 0; padding: 15px 18px; font-size: 14px; color: var(--muted); line-height: 1.75; }
.faq a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--accent-line); }

/* ── Bloc final ────────────────────────────────────────── */
.doc-end {
  margin-top: 34px; padding: 30px 32px;
  background: linear-gradient(145deg, rgba(145,229,190,.10), rgba(22,26,25,.2) 62%);
  border: 1px solid var(--line); border-radius: 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.doc-end h2 { margin: 0; font-size: 23px; letter-spacing: -.6px; }
.doc-end .doc-p { margin-top: 7px; }
.doc-end-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 980px) {
  .docs-layout { grid-template-columns: 1fr; gap: 0; }
  .toc {
    position: sticky; top: 61px; z-index: 30;
    flex-direction: row; align-items: center; gap: 8px;
    margin: 0 -32px; padding: 11px 32px;
    background: rgba(13,15,15,.94); backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
    overflow-x: auto; scrollbar-width: none;
  }
  .toc::-webkit-scrollbar { display: none; }
  .toc-title { display: none; }
  .toc a {
    flex-shrink: 0; border-left: 0; border-radius: 999px;
    padding: 7px 13px; background: var(--panel);
    border: 1px solid var(--line); font-size: 12.5px; white-space: nowrap;
  }
  .toc a.is-active { border-color: var(--accent-line); background: rgba(145,229,190,.1); }
  .toc-swagger { margin-top: 0 !important; border-radius: 999px !important; }
  .doc-hero { padding: 54px 0 38px; }
  .doc-hero-inner { padding: 0 20px; }
  .doc-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .doc-section { scroll-margin-top: 120px; }
}

@media (max-width: 720px) {
  .docs-layout { padding: 0 20px; }
  .toc { margin: 0 -20px; padding: 11px 20px; }
  .grid-2 { grid-template-columns: 1fr; }
  .doc-end { padding: 24px 22px; }
  .doc-end-actions { width: 100%; }
  .doc-end-actions .button { flex: 1; justify-content: center; }
  .step-item { padding: 14px 15px; }
}

@media (max-width: 460px) {
  .doc-cards { grid-template-columns: 1fr 1fr; gap: 10px; }
  .doc-jumps .button { width: 100%; justify-content: center; }
  .api-table td, .api-table th { padding: 11px 13px; }
}
