/* =========================================================
   Macro-Suite — feuille de style moderne (2026)
   Palette d'origine : ardoise #20313d, sarcelle #2e9692,
   bleu #3aa4ca, rouge #b84d50. Thèmes clair + sombre.
   ========================================================= */

:root {
  font-size: 18px;
  --bg: #eef2f3;
  --surface: #ffffff;
  --surface-2: #e4eaeb;
  --fg: #1b2a34;
  --muted: #5a6a75;
  --line: #d3dadd;
  --ink: #20313d;
  --ink-fg: #ffffff;
  --ink-muted: rgba(255,255,255,.62);
  --ink-line: rgba(255,255,255,.14);
  --accent: #2e9692;
  --accent-alt: #226f6c;
  --accent-fg: #ffffff;
  --blue: #3aa4ca;
  --red: #b84d50;
  --term: #4fd1c0;
  --shadow: 0 1px 2px rgba(27,42,52,.06), 0 10px 26px rgba(27,42,52,.08);
  --radius: 14px;
  --maxw: 1120px;
  --f-display: "Archivo", system-ui, Arial, sans-serif;
  --f-body: "Figtree", system-ui, Arial, sans-serif;
  --f-mono: "JetBrains Mono", "Courier New", ui-monospace, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101b22; --surface: #182631; --surface-2: #203340;
    --fg: #e6edf0; --muted: #9fb0ba; --line: #2a3e4c;
    --ink: #0c151b; --ink-fg: #e6edf0; --ink-muted: rgba(230,237,240,.6); --ink-line: rgba(255,255,255,.1);
    --accent: #37b0ab; --accent-alt: #2a8c88; --accent-fg: #06201f;
    --blue: #4fb6da; --red: #cf6a6d;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 12px 32px rgba(0,0,0,.45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #101b22; --surface: #182631; --surface-2: #203340;
  --fg: #e6edf0; --muted: #9fb0ba; --line: #2a3e4c;
  --ink: #0c151b; --ink-fg: #e6edf0; --ink-muted: rgba(230,237,240,.6); --ink-line: rgba(255,255,255,.1);
  --accent: #37b0ab; --accent-alt: #2a8c88; --accent-fg: #06201f;
  --blue: #4fb6da; --red: #cf6a6d;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 12px 32px rgba(0,0,0,.45);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--fg); font-family: var(--f-body); line-height: 1.6; font-size: 1rem; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--f-display); text-wrap: balance; line-height: 1.14; margin: 0; letter-spacing: -.01em; }
p { margin: 0; }
a { color: var(--accent); }
img { max-width: 100%; height: auto; }
.mono { font-family: var(--f-mono); }

.band { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.inner { max-width: var(--maxw); margin: 0 auto; width: 100%; }

/* ---------- Header ---------- */
header.site { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(140%) blur(10px); border-bottom: 1px solid var(--line); }
.nav { display: flex; align-items: center; gap: 20px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--f-display); font-weight: 700; font-size: 1.1rem; letter-spacing: -.02em; cursor: pointer; background: none; border: 0; color: var(--fg); text-decoration: none; }
.brand .glyph { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: var(--accent-fg); display: grid; place-items: center; font-family: var(--f-display); font-weight: 700; font-size: 1rem; flex: none; }
.nav .links { display: flex; gap: 22px; margin-left: auto; align-items: center; }
.nav .links a { color: var(--muted); text-decoration: none; font-size: .93rem; font-weight: 500; }
.nav .links a:hover { color: var(--fg); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-family: var(--f-body); font-weight: 600; font-size: .92rem; padding: 10px 16px; border-radius: 10px; border: 1px solid transparent; cursor: pointer; text-decoration: none; transition: transform .12s ease, background .12s ease; }
.btn:active { transform: translateY(1px); }
.btn-accent { background: var(--accent); color: var(--accent-fg); }
.btn-accent:hover { background: var(--accent-alt); color: var(--accent-fg); }
.btn-ghost { border-color: var(--line); color: var(--fg); background: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { padding: 7px 12px; font-size: .84rem; border-radius: 8px; }
.theme-toggle { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: var(--fg); cursor: pointer; display: grid; place-items: center; flex: none; }

/* ---------- Hero (index) ---------- */
.hero { background: var(--ink); color: var(--ink-fg); overflow: hidden; }
.hero .inner { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; padding-block: 72px; }
.eyebrow { font-family: var(--f-mono); font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: 18px; }
.hero .eyebrow { color: var(--term); }
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.3rem); font-weight: 700; color: var(--ink-fg); }
.hero h1 em { color: var(--term); font-style: normal; }
.hero .lede { color: var(--ink-muted); font-size: 1.1rem; margin-top: 20px; max-width: 48ch; }
.hero .cta-row { display: flex; gap: 12px; margin-top: 30px; flex-wrap: wrap; }
.hero .btn-ghost { border-color: var(--ink-line); color: var(--ink-fg); }
.hero .btn-ghost:hover { background: rgba(255,255,255,.06); }
.hero .meta { margin-top: 34px; display: flex; gap: 26px; flex-wrap: wrap; color: var(--ink-muted); font-size: .85rem; }
.hero .meta b { color: var(--ink-fg); font-family: var(--f-display); font-weight: 600; display: block; font-size: 1.25rem; }

.term-box { background: #0b141a; border: 1px solid #20323e; border-radius: var(--radius); box-shadow: 0 20px 50px rgba(0,0,0,.45); font-family: var(--f-mono); font-size: .83rem; overflow: hidden; min-width: 0; }
.term-box .bar { display: flex; align-items: center; gap: 7px; padding: 11px 14px; border-bottom: 1px solid #182732; color: #5d7484; font-size: .74rem; }
.term-box .bar i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.term-box .bar .t { margin-left: 8px; letter-spacing: .04em; }
.term-box .body { padding: 16px 16px 18px; display: grid; gap: 3px; color: #c6d3de; overflow-x: auto; }
.term-box .ln { white-space: pre; }
.term-box .k { color: var(--term); }
.term-box .s { color: #7fd1ea; }
.term-box .c { color: #5d7484; }
.term-box .scr { margin-top: 12px; padding: 10px 12px; border: 1px dashed #273a47; border-radius: 8px; color: #8aa0b2; }
.term-box .scr .hl { color: var(--term); }
.cursor { display: inline-block; width: 8px; height: 1.05em; background: var(--term); transform: translateY(2px); animation: blink 1.1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cursor { animation: none; } }

/* ---------- Sections (index) ---------- */
section.blk { padding-block: 72px; }
.sec-head { max-width: 62ch; margin-bottom: 40px; }
.sec-head h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); font-weight: 700; }
.sec-head p { color: var(--muted); margin-top: 14px; font-size: 1.05rem; }

.modules { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.mod { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow); min-width: 0; }
.mod .tag { font-family: var(--f-mono); font-size: .8rem; color: var(--accent); letter-spacing: .04em; }
.mod h3 { font-size: 1.35rem; font-weight: 600; }
.mod p { color: var(--muted); font-size: 1.05rem; }
.mod .more { margin-top: auto; font-size: .98rem; font-weight: 600; color: var(--fg); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.mod .more::after { content: "→"; color: var(--accent); transition: transform .12s ease; }
.mod:hover .more::after { transform: translateX(3px); }
.mod.span-full { grid-column: 1 / -1; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 6px 28px; }
.mod.span-full .tag { width: 100%; }
.mod.span-full h3 { font-size: 1.7rem; }
.mod.span-full p { flex: 1; min-width: 240px; margin: 0; }
.mod.span-full .more { margin: 0; }

.feats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 28px; }
.feat { display: flex; gap: 14px; padding-block: 8px; }
.feat .dot { flex: none; width: 34px; height: 34px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; color: var(--accent); }
.feat .dot svg { width: 17px; height: 17px; }
.feat h3 { font-size: .98rem; font-weight: 600; margin-bottom: 2px; }
.feat p { color: var(--muted); font-size: .86rem; line-height: 1.5; }

/* ---------- Contact (index) ---------- */
.contact { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.contact .grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: .82rem; font-weight: 600; color: var(--fg); }
.field input, .field textarea, .field select { font-family: var(--f-body); font-size: .95rem; padding: 11px 13px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); width: 100%; }
.field input:focus, .field textarea:focus, .field select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.note { font-size: .82rem; color: var(--muted); margin-top: 6px; }
.coord { display: grid; gap: 22px; align-content: start; }
.coord .item h3 { font-family: var(--f-display); font-size: .76rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.coord .item p, .coord .item a { font-size: .98rem; color: var(--fg); text-decoration: none; display: block; }
.coord .item a:hover { color: var(--accent); }
.copy { font-family: var(--f-mono); font-size: .78rem; color: var(--accent); background: none; border: 1px solid var(--line); border-radius: 7px; padding: 3px 8px; cursor: pointer; margin-left: 8px; }
.captcha-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.captcha-img { border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.captcha-reload { width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--accent); cursor: pointer; font-size: 1.2rem; line-height: 1; }
.captcha-reload:hover { border-color: var(--accent); }
.msg-error { color: var(--red); font-size: .9rem; margin: 6px 0; }
.msg-ok { color: var(--accent); font-size: .9rem; margin: 6px 0; }

/* ---------- Footer ---------- */
footer.site { background: var(--ink); color: var(--ink-muted); }
footer.site .inner { padding-block: 40px; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: center; font-size: .85rem; }
footer.site .brand { color: var(--ink-fg); cursor: default; }
footer.site a { color: var(--ink-fg); }

/* ---------- Espace clients ---------- */
.portal { padding-block: 56px; min-height: 60vh; }
.demo-flag { display: inline-flex; align-items: center; gap: 8px; font-family: var(--f-mono); font-size: .76rem; letter-spacing: .04em; color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); padding: 5px 11px; border-radius: 999px; margin-bottom: 26px; }
.login-card { max-width: 440px; margin: 10px auto 0; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 32px; }
.login-card h1 { font-size: 1.6rem; font-weight: 700; margin-bottom: 4px; }
.login-card .sub { color: var(--muted); font-size: .95rem; margin-bottom: 24px; }
.login-card .forgot { font-size: .85rem; color: var(--accent); text-decoration: none; }
.login-card .forgot:hover { text-decoration: underline; }
.login-actions { display: flex; gap: 10px; margin-top: 8px; }
.login-err { align-items: center; gap: 8px; color: var(--red); font-size: .88rem; background: color-mix(in srgb, var(--red) 12%, transparent); border: 1px solid color-mix(in srgb, var(--red) 35%, transparent); padding: 9px 12px; border-radius: 10px; margin-bottom: 16px; }

.dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.dash-head h1 { font-size: clamp(1.6rem, 4vw, 2.1rem); font-weight: 700; }
.dash-head .who { color: var(--muted); font-size: .92rem; margin-top: 4px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-top: 22px; }
.card > .card-h { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.card > .card-h h2 { font-size: 1.05rem; font-weight: 600; }
.card > .card-h .hint { color: var(--muted); font-size: .85rem; }
.card-body { padding: 6px 4px 8px; }
.tbl-scroll { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 560px; }
table.data th { text-align: left; font-family: var(--f-display); font-weight: 600; font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--surface-2); }
.mono-cell { font-family: var(--f-mono); font-size: .85rem; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.pill.teal { color: var(--accent); background: color-mix(in srgb, var(--accent) 15%, transparent); }
.pill.blue { color: var(--blue); background: color-mix(in srgb, var(--blue) 15%, transparent); }
.pill.red  { color: var(--red);  background: color-mix(in srgb, var(--red) 15%, transparent); }
.ver-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 16px 20px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.ver-row label { font-weight: 600; font-size: .9rem; }
.ver-row select { max-width: 220px; }
.ver-summary { padding: 16px 20px; color: var(--muted); font-size: .92rem; border-bottom: 1px solid var(--line); }
.ver-summary b { color: var(--fg); }
.dl-group td:first-child { font-weight: 600; white-space: nowrap; }
.dl-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.dl { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 600; padding: 6px 11px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); cursor: pointer; text-decoration: none; }
.dl:hover { border-color: var(--accent); color: var(--accent); }
.dl.doc { color: var(--blue); border-color: color-mix(in srgb, var(--blue) 40%, var(--line)); }
.dl.doc:hover { background: color-mix(in srgb, var(--blue) 12%, transparent); }
.dl-locked { color: var(--muted); font-size: .86rem; font-style: italic; }

/* ---------- Pages de contenu (présentation, modules, mot de passe, admin) ---------- */
main.page { padding-block: 56px; min-height: 60vh; }
.content { max-width: 860px; margin: 0 auto; }
.content.wide { max-width: var(--maxw); }
.content h1, .content h1.major { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 700; margin-bottom: 10px; }
.content > h1 + p, .content .lead { color: var(--muted); font-size: 1.1rem; }
.content h2 { font-size: 1.5rem; font-weight: 600; margin: 40px 0 12px; padding-top: 8px; }
.content h3 { font-size: 1.18rem; font-weight: 600; margin: 26px 0 8px; color: var(--accent); }
.content p { margin: 0 0 14px; }
.content ul, .content ol { margin: 0 0 16px; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.content li { line-height: 1.55; }
.content a { color: var(--accent); }
.content img { border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); margin: 10px 0; }
.content pre { background: var(--ink); color: var(--ink-fg); border-radius: var(--radius); padding: 18px 20px; overflow-x: auto; font-family: var(--f-mono); font-size: .85rem; line-height: 1.5; margin: 0 0 18px; border: 1px solid var(--ink-line); }
.content pre code { font-family: inherit; color: inherit; background: none; padding: 0; }
.content code { font-family: var(--f-mono); font-size: .88em; background: var(--surface-2); padding: 2px 6px; border-radius: 5px; }
.content center { display: block; text-align: center; margin: 18px 0; }

/* Boutons hérités des anciennes pages */
.button, a.button, input[type="submit"], button.special { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-family: var(--f-body); font-weight: 600; font-size: .9rem; padding: 9px 15px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); cursor: pointer; text-decoration: none; margin: 3px 4px 3px 0; transition: background .12s ease, border-color .12s ease; }
.button:hover, a.button:hover, input[type="submit"]:hover { border-color: var(--accent); color: var(--accent); }
.button.special, input[type="submit"].special, input[type="submit"] { background: var(--accent); color: var(--accent-fg); border-color: transparent; }
.button.special:hover, input[type="submit"].special:hover, input[type="submit"]:hover { background: var(--accent-alt); color: var(--accent-fg); border-color: transparent; }
ul.actions { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 14px 0; }

/* Tableaux hérités (pages admin) */
.content .table-wrapper { overflow-x: auto; margin: 0 0 20px; }
.content table { width: 100%; border-collapse: collapse; font-size: .92rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.content table th { text-align: left; font-family: var(--f-display); font-weight: 600; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 11px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.content table td { padding: 11px 14px; border-bottom: 1px solid var(--line); }
.content table tbody tr:hover { background: var(--surface-2); }
.content table.alt tbody tr:nth-child(2n) { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }

/* Champ de connexion / formulaires hérités (grille skel) */
.row { display: flex; flex-wrap: wrap; gap: 14px; }
.row.uniform > * { flex: 1 1 240px; }
.select-wrapper { position: relative; display: inline-block; }
input[type="text"], input[type="password"], input[type="email"], textarea, select { font-family: var(--f-body); font-size: .95rem; padding: 11px 13px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.focus-ring:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

@media (max-width: 900px) {
  .hero .inner { grid-template-columns: 1fr; gap: 36px; padding-block: 52px; }
  .modules { grid-template-columns: repeat(2, 1fr); }
  .feats { grid-template-columns: repeat(2, 1fr); }
  .contact .grid { grid-template-columns: 1fr; gap: 32px; }
  .nav .links { gap: 14px; }
  .nav .links a:not(.keep) { display: none; }
}
@media (max-width: 560px) {
  section.blk, main.page { padding-block: 52px; }
  .modules { grid-template-columns: 1fr; }
  .feats { grid-template-columns: 1fr; }
  .mod.span-full { grid-column: span 1; }
  .two { grid-template-columns: 1fr; }
  .login-card { padding: 24px; }
}
