/* web.labma.fr — feuille de style commune (aucune dépendance externe) */
:root {
  --bg: #f6f7f9; --surface: #ffffff; --surface-2: #eef1f5; --text: #1b1f24; --muted: #5b6573;
  --border: #dde2e8; --accent: #0b6bcb; --accent-2: #0a8f6a; --danger: #c0392b;
  --code-bg: #0f1720; --code-text: #e6edf3; --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.06);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117; --surface: #151b23; --surface-2: #1c2430; --text: #e6edf3; --muted: #9aa6b2;
    --border: #2a3441; --accent: #4aa3ff; --accent-2: #3ccf9b; --danger: #ff6b5e; --code-bg: #0a0e14;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--sans); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.wrap { width: min(1180px, 100% - 2rem); margin-inline: auto; }

/* ---------- Barre supérieure ---------- */
.topbar { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 60px; flex-wrap: wrap; }
.brand { font-weight: 800; font-size: 1.2rem; color: var(--text); letter-spacing: -.02em; }
.brand span { color: var(--accent); }
.nav { display: flex; align-items: center; gap: .25rem; flex-wrap: wrap; }
.nav a, .linkbtn { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .75rem; border-radius: 10px;
  color: var(--muted); font: inherit; font-size: .95rem; background: none; border: 0; cursor: pointer; }
.nav a:hover, .linkbtn:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav form { margin: 0; }
.nav img { width: 26px; height: 26px; border-radius: 50%; }

/* ---------- Accueil ---------- */
.hero { padding: clamp(3rem, 8vw, 6rem) 0 clamp(2rem, 5vw, 3.5rem); }
.eyebrow { display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent-2); background: color-mix(in srgb, var(--accent-2) 12%, transparent); padding: .3rem .7rem; border-radius: 999px; }
.hero h1 { font-size: clamp(2rem, 5.5vw, 3.6rem); line-height: 1.1; letter-spacing: -.03em; margin: 1rem 0; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p { font-size: clamp(1.05rem, 2.2vw, 1.25rem); color: var(--muted); max-width: 62ch; margin: 0 0 2rem; }
.btns { display: flex; gap: .75rem; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: .5rem; padding: .8rem 1.2rem; border-radius: 12px; font-weight: 650;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; font-size: 1rem; }
.btn:hover { text-decoration: none; border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn img { width: 28px; height: 28px; border-radius: 50%; margin: -.3rem 0; }

.section { padding: 2rem 0 3rem; }
.section h2 { font-size: 1.5rem; letter-spacing: -.02em; margin: 0 0 1.25rem; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: .5rem; }
.card h3 { margin: 0; font-size: 1.1rem; }
.card p { margin: 0; color: var(--muted); }
.card .icon { font-size: 1.6rem; line-height: 1; }
.card .logo { width: 72px; height: 72px; border-radius: 50%; box-shadow: var(--shadow); }
.card.link { color: inherit; transition: transform .15s ease, border-color .15s ease; }
.card.link:hover { transform: translateY(-2px); border-color: var(--accent); text-decoration: none; }
.tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: auto; padding-top: .5rem; }
.tag { font-size: .78rem; padding: .15rem .55rem; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.meta { font-size: .85rem; color: var(--muted); }

.footer { border-top: 1px solid var(--border); padding: 1.5rem 0 2rem; color: var(--muted); font-size: .9rem; }
.footer .wrap { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.footer a { display: inline-flex; align-items: center; gap: .4rem; color: var(--muted); }
.footer img { width: 22px; height: 22px; border-radius: 50%; }

/* ---------- Connexion ---------- */
.auth { min-height: calc(100vh - 61px); display: grid; place-items: center; padding: 2rem 1rem; }
.auth-box { width: min(420px, 100%); }
.auth-box h1 { font-size: 1.5rem; margin: 0 0 .25rem; }
.auth-box .card { gap: 1rem; }
label { font-weight: 600; font-size: .92rem; display: block; margin-bottom: .35rem; }
input[type=password], input[type=text] { width: 100%; padding: .75rem .9rem; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font: inherit; }
input.otp { font-family: var(--mono); font-size: 1.4rem; letter-spacing: .35em; text-align: center; }
.alert { padding: .75rem .9rem; border-radius: 10px; font-size: .92rem; }
.alert.err { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent); }
.alert.ok { background: color-mix(in srgb, var(--accent-2) 12%, transparent); color: var(--accent-2); border: 1px solid color-mix(in srgb, var(--accent-2) 35%, transparent); }
.secret { font-family: var(--mono); font-size: 1.1rem; word-break: break-all; background: var(--surface-2); padding: .75rem; border-radius: 10px; }

/* ---------- Page document ---------- */
.doc-layout { display: grid; gap: 2rem; padding: 2rem 0 3rem; }
@media (min-width: 1000px) { .doc-layout { grid-template-columns: 260px minmax(0, 1fr); } }
.toc { font-size: .9rem; }
@media (min-width: 1000px) { .toc { position: sticky; top: 80px; align-self: start; max-height: calc(100vh - 100px); overflow: auto; } }
.toc details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem 1rem; }
.toc summary { font-weight: 700; cursor: pointer; }
.toc ol { padding-left: 1.1rem; margin: .5rem 0 0; }
.toc li { margin: .3rem 0; }
.toc a { color: var(--muted); }
.toc a:hover { color: var(--accent); }

.prose { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: clamp(1.1rem, 4vw, 2.5rem); min-width: 0; overflow-wrap: anywhere; }
.prose > :first-child { margin-top: 0; }
.prose h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); letter-spacing: -.02em; line-height: 1.2; }
.prose h2 { font-size: 1.45rem; margin-top: 2.5rem; padding-top: .5rem; border-top: 1px solid var(--border); scroll-margin-top: 80px; }
.prose h3 { font-size: 1.15rem; margin-top: 1.8rem; scroll-margin-top: 80px; }
.prose h4 { scroll-margin-top: 80px; }
.prose :target { animation: flash 1.6s ease; }
@keyframes flash { 0%, 40% { background: color-mix(in srgb, var(--accent) 18%, transparent); } 100% { background: transparent; } }
.prose code { font-family: var(--mono); font-size: .88em; background: var(--surface-2); padding: .12em .4em; border-radius: 6px; }
.prose pre { background: var(--code-bg); color: var(--code-text); padding: 1rem 1.1rem; border-radius: 12px; overflow-x: auto; font-size: .88rem; line-height: 1.5; }
.prose pre code { background: none; padding: 0; color: inherit; font-size: inherit; overflow-wrap: normal; }
.prose blockquote { margin: 1rem 0; padding: .6rem 1rem; border-left: 4px solid var(--accent); background: var(--surface-2); border-radius: 0 10px 10px 0; }
.prose blockquote > :first-child { margin-top: 0; } .prose blockquote > :last-child { margin-bottom: 0; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }
.prose li > p:first-child { margin-top: 0; }
.prose li + li { margin-top: .25rem; }
.prose img { display: block; max-width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--border); box-shadow: var(--shadow); }
.prose a:has(> img) { display: block; cursor: zoom-in; }
.table-wrap { overflow-x: auto; margin: 1rem 0; border: 1px solid var(--border); border-radius: 10px; }
.prose table { border-collapse: collapse; width: 100%; font-size: .93rem; }
.prose th, .prose td { padding: .55rem .75rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.prose th { background: var(--surface-2); font-weight: 700; }
.prose tr:last-child td { border-bottom: 0; }
.prose .al-c { text-align: center; } .prose .al-r { text-align: right; }

.breadcrumb { font-size: .9rem; color: var(--muted); margin-top: 1.5rem; }

@media print {
  .topbar, .toc, .footer, .breadcrumb { display: none; }
  .prose { border: 0; box-shadow: none; padding: 0; }
  .doc-layout { display: block; }
}
