/* ============================================================
   Menu — ESPACE DÉVELOPPEURS (documentation, candidature, portail)
   Thème partagé avec l'accueil : même clé localStorage « menu-theme ».
   ============================================================ */

:root, :root[data-theme="dark"] {
  --accent: #E8591C; --accent-d: #C94A14; --accent-soft: rgba(232,89,28,.12); --accent-line: rgba(232,89,28,.35);
  --success: #38A169; --success-soft: rgba(56,161,105,.13);
  --danger: #EF4444; --danger-soft: rgba(239,68,68,.12);
  --amber: #F5A623; --amber-soft: rgba(245,166,35,.12);
  --blue: #3B82F6; --blue-soft: rgba(59,130,246,.13);
  --purple: #8B5CF6; --purple-soft: rgba(139,92,246,.13);
  --bg: #08080E; --bg2: #0E0E17; --bg3: #14141F; --bg-code: #0B0B13;
  --border: rgba(255,255,255,.08); --border2: rgba(255,255,255,.14);
  --txt1: #F9FAFB; --txt2: #A1A1AA; --txt3: #6B7280;
  --code-txt: #E4E4E7; --code-str: #FDBA74; --code-key: #93C5FD; --code-com: #6B7280; --code-num: #86EFAC;
  --nav-bg: rgba(8,8,14,.78);
  --shadow: 0 10px 40px rgba(0,0,0,.35);
  --r: 14px; --r2: 20px;
  --ease: cubic-bezier(.22,1,.36,1);
}
:root[data-theme="light"] {
  --accent-soft: rgba(232,89,28,.09);
  --success-soft: rgba(56,161,105,.1); --danger-soft: rgba(239,68,68,.08);
  --amber-soft: rgba(245,166,35,.12); --blue-soft: rgba(59,130,246,.09); --purple-soft: rgba(139,92,246,.09);
  --bg: #F8F5F0; --bg2: #FFFFFF; --bg3: #F1ECE4; --bg-code: #16161F;
  --border: rgba(0,0,0,.08); --border2: rgba(0,0,0,.14);
  --txt1: #18181B; --txt2: #52525B; --txt3: #8A8A93;
  --nav-bg: rgba(248,245,240,.85);
  --shadow: 0 10px 30px rgba(24,24,27,.08);
}

*,*::before,*::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0; font-family: 'Inter', system-ui, sans-serif; background: var(--bg); color: var(--txt1);
  line-height: 1.6; -webkit-font-smoothing: antialiased; transition: background .3s, color .3s;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, kbd, .mono { font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace; }
img { max-width: 100%; }
::selection { background: var(--accent); color: #fff; }

/* ---------- Animations ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { 0% { transform: scale(.96); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes gradFlow { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(232,89,28,.5); } 70% { box-shadow: 0 0 0 10px rgba(232,89,28,0); } 100% { box-shadow: 0 0 0 0 rgba(232,89,28,0); } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes grow { from { width: 0; } }

.anim-up { animation: fadeUp .7s var(--ease) both; }
.d1 { animation-delay: .06s; } .d2 { animation-delay: .14s; } .d3 { animation-delay: .22s; } .d4 { animation-delay: .3s; } .d5 { animation-delay: .38s; }
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Topbar ---------- */
.dev-nav {
  position: sticky; top: 0; z-index: 50; height: 64px; display: flex; align-items: center; gap: 16px;
  padding: 0 24px; background: var(--nav-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.dev-brand { display: flex; align-items: center; gap: 10px; color: var(--txt1); font-weight: 800; letter-spacing: -.02em; white-space: nowrap; }
.dev-brand:hover { text-decoration: none; }
.dev-brand img { width: 30px; height: 30px; border-radius: 8px; object-fit: cover; border: 1px solid var(--border2); }
.dev-brand small { font-weight: 600; color: var(--accent); font-size: .72rem; padding: 2px 8px; border-radius: 99px; background: var(--accent-soft); border: 1px solid var(--accent-line); }
.dev-nav-links { display: flex; gap: 2px; margin-left: 12px; }
.dev-nav-links a { color: var(--txt2); font-size: .85rem; font-weight: 500; padding: 8px 12px; border-radius: 9px; transition: .2s; }
.dev-nav-links a:hover { color: var(--txt1); background: var(--accent-soft); text-decoration: none; }
.dev-nav-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px;
  border: 1px solid var(--border2); background: transparent; color: var(--txt2); cursor: pointer; transition: .2s;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.icon-btn svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 2; }
.theme-sun { display: none; } :root[data-theme="light"] .theme-sun { display: block; } :root[data-theme="light"] .theme-moon { display: none; }
@media (max-width: 900px) { .dev-nav-links { display: none; } }
@media (max-width: 560px) { .dev-nav { padding: 0 16px; } .dev-brand small, .hide-sm { display: none !important; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 11px;
  font: 600 .88rem 'Inter', sans-serif; border: 1px solid transparent; cursor: pointer; transition: transform .2s var(--ease), box-shadow .2s, background .2s, border-color .2s, color .2s;
  text-decoration: none !important; white-space: nowrap; color: var(--txt1); background: transparent;
}
.btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 22px rgba(232,89,28,.3); }
.btn-primary:hover { background: var(--accent-d); transform: translateY(-1px); box-shadow: 0 10px 30px rgba(232,89,28,.42); }
.btn-ghost { border-color: var(--border2); background: var(--bg2); }
.btn-ghost:hover { border-color: var(--accent-line); color: var(--accent); }
.btn-danger { background: var(--danger-soft); color: #F87171; border-color: rgba(239,68,68,.3); }
.btn-danger:hover { background: rgba(239,68,68,.2); }
.btn-sm { padding: 7px 12px; font-size: .8rem; border-radius: 9px; }
.btn-lg { padding: 14px 24px; font-size: .95rem; border-radius: 13px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }
.spinner { width: 15px; height: 15px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }

/* ---------- Cards / badges ---------- */
.card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--r2); padding: 24px; box-shadow: var(--shadow); }
.card-title { margin: 0 0 6px; font-size: 1.02rem; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.card-sub { margin: 0 0 18px; color: var(--txt2); font-size: .86rem; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: .72rem; font-weight: 700; letter-spacing: .01em; border: 1px solid transparent; white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.no-dot::before { display: none; }
.badge-green { color: #4ADE80; background: var(--success-soft); border-color: rgba(56,161,105,.28); }
.badge-gray { color: var(--txt2); background: var(--bg3); border-color: var(--border2); }
.badge-orange { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-line); }
.badge-blue { color: #60A5FA; background: var(--blue-soft); border-color: rgba(59,130,246,.28); }
.badge-amber { color: var(--amber); background: var(--amber-soft); border-color: rgba(245,166,35,.3); }
.badge-red { color: #F87171; background: var(--danger-soft); border-color: rgba(239,68,68,.3); }
:root[data-theme="light"] .badge-green { color: #15803D; } :root[data-theme="light"] .badge-blue { color: #1D4ED8; } :root[data-theme="light"] .badge-red { color: #B91C1C; } :root[data-theme="light"] .badge-amber { color: #B45309; }
.method { display: inline-block; min-width: 50px; text-align: center; padding: 3px 8px; border-radius: 7px; font: 700 .7rem 'JetBrains Mono', monospace; letter-spacing: .03em; }
.method.get { color: #60A5FA; background: var(--blue-soft); }
.method.post { color: #4ADE80; background: var(--success-soft); }
:root[data-theme="light"] .method.get { color: #1D4ED8; } :root[data-theme="light"] .method.post { color: #15803D; }
.pill-env { font: 600 .7rem 'JetBrains Mono', monospace; padding: 2px 8px; border-radius: 6px; }
.pill-env.sandbox { color: var(--amber); background: var(--amber-soft); }
.pill-env.live { color: #4ADE80; background: var(--success-soft); }

/* ---------- Callouts / messages ---------- */
.callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: 13px; border: 1px solid; font-size: .88rem; margin: 18px 0; line-height: 1.55; }
.callout svg { flex: 0 0 18px; width: 18px; height: 18px; margin-top: 2px; stroke: currentColor; fill: none; stroke-width: 2; }
.callout p { margin: 0; color: inherit; }
.callout-info { background: var(--blue-soft); border-color: rgba(59,130,246,.28); color: var(--txt1); }
.callout-info svg { color: var(--blue); }
.callout-warn { background: var(--amber-soft); border-color: rgba(245,166,35,.3); color: var(--txt1); }
.callout-warn svg { color: var(--amber); }
.callout-danger { background: var(--danger-soft); border-color: rgba(239,68,68,.3); color: var(--txt1); }
.callout-danger svg { color: var(--danger); }
.callout-success { background: var(--success-soft); border-color: rgba(56,161,105,.3); color: var(--txt1); }
.callout-success svg { color: var(--success); }

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; }
.field label, .label { display: block; font-size: .8rem; font-weight: 600; color: var(--txt2); margin-bottom: 7px; }
.field .hint { font-size: .75rem; color: var(--txt3); margin-top: 6px; }
.req { color: var(--accent); }
.input, .field input:not([type=radio]):not([type=checkbox]):not([type=file]), .field select, .field textarea {
  width: 100%; padding: 11px 14px; border-radius: 11px; border: 1px solid var(--border2); background: var(--bg);
  color: var(--txt1); font: 400 .92rem 'Inter', sans-serif; transition: border-color .2s, box-shadow .2s;
}
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.field textarea { resize: vertical; min-height: 110px; }
.field.has-error input, .field.has-error textarea { border-color: var(--danger); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r); }
table.tbl { width: 100%; border-collapse: collapse; font-size: .86rem; }
.tbl th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--txt3); font-weight: 700; padding: 11px 14px; background: var(--bg3); border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--txt2); vertical-align: top; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background .15s; }
.tbl tbody tr:hover { background: var(--accent-soft); }
.tbl td strong, .tbl td .strong { color: var(--txt1); }

/* ---------- Code ---------- */
code.inline, .prose code:not(pre code) {
  font-size: .84em; padding: 2px 7px; border-radius: 6px; background: var(--bg3); border: 1px solid var(--border); color: var(--accent);
}
.code {
  position: relative; background: var(--bg-code); border: 1px solid rgba(255,255,255,.08); border-radius: var(--r); overflow: hidden; margin: 14px 0;
}
.code-head { display: flex; align-items: center; gap: 4px; padding: 6px 8px 6px 14px; border-bottom: 1px solid rgba(255,255,255,.07); background: rgba(255,255,255,.02); min-height: 42px; }
.code-head .dots { display: flex; gap: 6px; margin-right: 10px; }
.code-head .dots i { width: 10px; height: 10px; border-radius: 50%; background: #3F3F46; }
.code-head .dots i:nth-child(1) { background: #EF4444aa; } .code-head .dots i:nth-child(2) { background: #F5A623aa; } .code-head .dots i:nth-child(3) { background: #38A169aa; }
.code-title { font: 500 .75rem 'JetBrains Mono', monospace; color: #A1A1AA; }
.code-tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.code-tabs::-webkit-scrollbar { display: none; }
.code-tab { background: none; border: none; color: #8A8A93; font: 600 .75rem 'Inter', sans-serif; padding: 7px 11px; border-radius: 8px; cursor: pointer; transition: .2s; white-space: nowrap; }
.code-tab:hover { color: #E4E4E7; }
.code-tab.active { color: #fff; background: rgba(232,89,28,.22); }
.copy-btn {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1);
  color: #D4D4D8; font: 600 .72rem 'Inter', sans-serif; padding: 6px 10px; border-radius: 8px; cursor: pointer; transition: .2s; flex-shrink: 0;
}
.copy-btn:hover { background: rgba(232,89,28,.2); border-color: rgba(232,89,28,.4); color: #fff; }
.copy-btn.copied { background: rgba(56,161,105,.25); border-color: rgba(56,161,105,.5); color: #BBF7D0; }
.copy-btn svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2; }
.code pre { margin: 0; padding: 16px 18px; overflow-x: auto; font-size: .8rem; line-height: 1.7; color: var(--code-txt); tab-size: 2; }
.code-panel { display: none; }
.code-panel.active { display: block; animation: fadeIn .25s ease; }
.tok-s { color: var(--code-str); } .tok-k { color: var(--code-key); } .tok-c { color: var(--code-com); font-style: italic; } .tok-n { color: var(--code-num); }

/* ---------- Secret affiché une seule fois ---------- */
.secret-once {
  border: 1px solid var(--accent-line); background: linear-gradient(135deg, var(--accent-soft), transparent 70%), var(--bg2);
  border-radius: var(--r2); padding: 22px; margin-bottom: 22px; animation: pop .45s var(--ease) both; box-shadow: 0 0 0 6px var(--accent-soft);
}
.secret-once h3 { margin: 0 0 4px; display: flex; align-items: center; gap: 10px; font-size: 1rem; }
.secret-once h3 svg { width: 20px; height: 20px; stroke: var(--accent); fill: none; stroke-width: 2; }
.secret-once > p { margin: 0 0 14px; color: var(--txt2); font-size: .85rem; }
.secret-row { display: flex; align-items: center; gap: 10px; background: var(--bg-code); border: 1px solid rgba(255,255,255,.08); border-radius: 11px; padding: 8px 8px 8px 14px; margin-bottom: 8px; }
.secret-row .k { font-size: .7rem; color: #8A8A93; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; min-width: 140px; }
.secret-row code { flex: 1; color: #FDBA74; font-size: .82rem; word-break: break-all; }
@media (max-width: 640px) { .secret-row { flex-wrap: wrap; } .secret-row .k { min-width: 100%; } }

/* ---------- Progress ---------- */
.progress { height: 8px; border-radius: 99px; background: var(--bg3); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), #F5A623); animation: grow 1.1s var(--ease) both; }
.progress.warn > span { background: linear-gradient(90deg, #F5A623, #EF4444); }

/* ---------- Toast ---------- */
.toast-zone { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--bg2); border: 1px solid var(--border2); border-left: 3px solid var(--success); color: var(--txt1); padding: 11px 16px; border-radius: 11px; font-size: .85rem; box-shadow: var(--shadow); animation: fadeUp .35s var(--ease); }

/* ---------- Divers ---------- */
.muted { color: var(--txt2); } .small { font-size: .8rem; } .xs { font-size: .74rem; }
.empty { text-align: center; padding: 38px 18px; color: var(--txt2); }
.empty svg { width: 42px; height: 42px; stroke: var(--txt3); fill: none; stroke-width: 1.5; margin-bottom: 10px; }
.grad-text { background: linear-gradient(100deg, #E8591C, #F5A623 50%, #E8591C); background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent; animation: gradFlow 6s ease infinite; }
.kbd, kbd { font-size: .72rem; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--border2); background: var(--bg3); color: var(--txt2); }
