:root {
  --bg: #0d1219;
  --panel: #151d28;
  --panel-2: #1b2532;
  --line: #273345;
  --ink: #e6ebf2;
  --muted: #93a0b2;
  --amber: #ffb000;          /* afficheurs MCP */
  --green: #3ddc84;          /* écran CDU */
  --accent: #4f9cff;
  --danger: #ff6b6b;
  --radius: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
code, pre, .mono { font-family: Consolas, "Cascadia Mono", "Courier New", monospace; }
code { background: var(--panel-2); padding: 1px 5px; border-radius: 4px; font-size: .92em; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .6em; }
h1 { font-size: clamp(1.9rem, 4.5vw, 3rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); margin-top: 0; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
section { padding: 56px 0; }
section.alt { background: var(--panel); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* En-tête */
.top { position: sticky; top: 0; z-index: 10; background: rgba(13, 18, 25, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; font-size: 1.1rem; }
.brand img { width: 30px; height: 30px; }
.brand:hover { text-decoration: none; }
nav { display: flex; gap: 4px; flex-wrap: wrap; }
nav a { color: var(--muted); padding: 6px 12px; border-radius: 6px; }
nav a:hover, nav a.on { color: var(--ink); background: var(--panel-2); text-decoration: none; }

/* Héros */
.hero { padding: 72px 0 56px; background: radial-gradient(ellipse at 70% 0%, #1d3557 0%, transparent 60%); }
.hero-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; }
.hero .lead { font-size: 1.2rem; color: var(--muted); }
.kicker { color: var(--amber); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; font-size: .85rem; margin-bottom: .6em; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.btn { display: inline-block; padding: 12px 22px; border-radius: 8px; font-weight: 600; border: 1px solid var(--line); color: var(--ink); background: var(--panel-2); 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.1); }
.btn.small { padding: 6px 12px; font-size: .9rem; }
.btn.danger { border-color: var(--danger); color: var(--danger); background: transparent; }

/* Afficheur façon MCP */
.mcp { background: #07090c; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: 0 20px 60px rgba(0, 0, 0, .45); }
.mcp-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.mcp-cell { background: #0e1116; border: 1px solid #222a35; border-radius: 6px; padding: 8px; text-align: center; }
.mcp-cell small { display: block; color: var(--muted); font-size: .7rem; letter-spacing: .1em; }
.mcp-cell b { font-family: Consolas, monospace; color: var(--amber); font-size: clamp(1.1rem, 2.6vw, 1.7rem); text-shadow: 0 0 8px rgba(255, 176, 0, .45); }
.cdu { margin-top: 12px; background: #050607; border: 1px solid #222a35; border-radius: 6px; padding: 10px 14px; font-family: Consolas, monospace; color: var(--green); font-size: clamp(.72rem, 1.6vw, .9rem); line-height: 1.5; white-space: pre; overflow: hidden; }
.cdu .w { color: #fff; }

/* Grilles et cartes */
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.card { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card h3 { margin-bottom: .4em; }
.card p:last-child { margin-bottom: 0; }
.card .ico { font-size: 1.6rem; margin-bottom: 6px; }
.muted { color: var(--muted); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--panel); border: 1px solid var(--line); color: var(--muted); }
.badge.ok { color: var(--green); border-color: rgba(61, 220, 132, .4); }
.badge.warn { color: var(--amber); border-color: rgba(255, 176, 0, .4); }
.badge.ko { color: var(--danger); border-color: rgba(255, 107, 107, .4); }

/* Tableaux */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; }

/* Captures */
.shot { margin: 0; }
.shot img { border: 1px solid var(--line); border-radius: var(--radius); display: block; }
.shot figcaption { color: var(--muted); font-size: .9rem; margin-top: 8px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; align-items: center; }
.split + .split { margin-top: 48px; }

/* Formulaires */
form .field { margin-bottom: 14px; }
label { display: block; font-weight: 600; margin-bottom: 4px; font-size: .95rem; }
input[type=text], input[type=email], input[type=password], input[type=date], select, textarea {
  width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.hp { position: absolute; left: -9999px; }
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; border: 1px solid var(--line); background: var(--panel-2); }
.alert.ok { border-color: rgba(61, 220, 132, .5); }
.alert.ko { border-color: rgba(255, 107, 107, .6); }
.keybox { word-break: break-all; font-family: Consolas, monospace; font-size: .85rem; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 12px; }

.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: s; position: relative; padding: 0 0 18px 46px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--panel-2); border: 1px solid var(--accent); color: var(--accent); display: grid; place-items: center; font-weight: 700; }

.foot { border-top: 1px solid var(--line); padding: 28px 0; color: var(--muted); font-size: .88rem; }

/* Admin */
.admin-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 24px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 28px; }
.kpi { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.kpi b { display: block; font-size: 1.8rem; color: var(--amber); font-family: Consolas, monospace; }
.kpi span { color: var(--muted); font-size: .88rem; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 140px; padding-top: 10px; border-bottom: 1px solid var(--line); }
.bars div { flex: 1; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; position: relative; }
.bars div:hover { background: var(--amber); }
.inline { display: inline; }

@media (max-width: 860px) {
  .hero-grid, .split, .g2, .g3 { grid-template-columns: 1fr; }
  .split .shot { order: -1; }
  section { padding: 40px 0; }
  .hero { padding: 40px 0; }
}
