/* rebootit.fr — banc de diagnostic
   Thème du site rebootit.fr : fond marine très sombre à trame pointillée,
   typo mono, accent cyan. */

:root {
  --bg: #050d16;
  --panel: #081521;
  --panel-2: #0a1a29;
  --edge: #123044;
  --ink: #e9f2f8;
  --muted: #7e94a6;
  --cyan: #29e2ff;
  --cyan-soft: rgba(41, 226, 255, .12);
  --lcd-bg: #04101b;
  --ok: #3ce08e;
  --err: #ff5d5d;
  --warn: #ffc555;
  --radius: 8px;
  --mono: "JetBrains Mono", ui-monospace, "IBM Plex Mono", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  background-image: radial-gradient(circle at 1px 1px, rgba(41,226,255,.10) 1px, transparent 0);
  background-size: 18px 18px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 14.5px;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- barre haute ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 16px 26px;
  background: rgba(5, 13, 22, .85);
  border-bottom: 1px solid var(--edge);
  backdrop-filter: blur(4px);
}
.logo { display: flex; align-items: center; text-decoration: none; }
.logo-img { height: 28px; width: auto; display: block; }

.nav { display: flex; gap: 6px; }
.nav a {
  display: flex; align-items: center; gap: 7px;
  color: var(--muted); text-decoration: none;
  font-size: 13px; padding: 7px 12px; border-radius: 6px;
  border: 1px solid transparent;
}
.nav a:hover { color: var(--ink); background: var(--panel-2); }
.nav a[aria-current="page"] { color: var(--cyan); border-color: var(--edge); background: var(--panel); }
.nav svg { width: 15px; height: 15px; }

/* ---------- grille des modules ---------- */
.bench {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding: 26px;
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
  align-content: start;
}
.module {
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  display: flex; flex-direction: column;
  overflow: hidden;
}

.module-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 16px;
  border-bottom: 1px solid var(--edge);
  background: var(--panel-2);
}
.module-head h2 {
  margin: 0; font-size: 14px; font-weight: 700; letter-spacing: .5px;
  display: flex; align-items: center; gap: 10px; text-transform: uppercase;
}
.mod-id {
  font-size: 12px; font-weight: 700; color: var(--cyan);
  width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--cyan); border-radius: 5px;
  background: var(--cyan-soft);
}
.mod-status {
  font-size: 11px; letter-spacing: .5px;
  padding: 3px 10px; border-radius: 20px; border: 1px solid var(--edge);
  color: var(--muted); background: var(--panel);
}
.mod-status[data-state="run"] { color: var(--warn); border-color: rgba(255,197,85,.4); background: rgba(255,197,85,.08); }
.mod-status[data-state="ok"]  { color: var(--ok);  border-color: rgba(60,224,142,.4); background: rgba(60,224,142,.08); }
.mod-status[data-state="err"] { color: var(--err); border-color: rgba(255,93,93,.4); background: rgba(255,93,93,.08); }

.module-body { padding: 16px; display: flex; flex-direction: column; gap: 14px; flex: 1; }
.module-body .module-note { padding: 0; }
.module-note { margin: 0; padding: 0 16px 14px; font-size: 12px; color: var(--muted); }

/* ---------- champs & afficheurs ---------- */
.conn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field, .result { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field-label {
  font-size: 10.5px; letter-spacing: 1.4px;
  text-transform: uppercase; color: var(--muted);
}
.lcd-inline {
  font-size: 14.5px; font-weight: 500;
  background: var(--lcd-bg); color: var(--cyan);
  border: 1px solid var(--edge); border-radius: 6px;
  padding: 8px 10px;
  text-shadow: 0 0 8px rgba(41, 226, 255, .45);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lcd-small { font-size: 12px; }

/* grand afficheur du speed test */
.lcd-main {
  background: var(--lcd-bg);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  padding: 18px 20px 14px;
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
}
.lcd-value {
  font-weight: 700;
  font-size: clamp(44px, 7vw, 64px); line-height: 1;
  color: var(--cyan);
  text-shadow: 0 0 18px rgba(41, 226, 255, .55);
  font-variant-numeric: tabular-nums;
}
.lcd-unit { font-size: 17px; color: var(--muted); }
.lcd-phase { margin-left: auto; font-size: 11.5px; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; }

.meter { position: relative; height: 12px; border-radius: 6px; background: var(--lcd-bg); border: 1px solid var(--edge); overflow: hidden; }
.meter-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #0d5a6b, var(--cyan));
  transition: width .25s linear;
}
.meter-ticks {
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(90deg, transparent 0, transparent calc(10% - 1px), rgba(5,13,22,.8) calc(10% - 1px), rgba(5,13,22,.8) 10%);
}

.results { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.results-3 { grid-template-columns: repeat(3, 1fr); }

/* ---------- boutons & contrôles ---------- */
.btn {
  font-family: var(--mono); font-size: 13.5px; font-weight: 700;
  padding: 10px 18px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--edge); background: var(--panel-2); color: var(--ink);
  transition: transform .05s ease, background .15s ease, border-color .15s ease;
}
.btn:hover { border-color: var(--cyan); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .select:focus-visible, .check input:focus-visible, .nav a:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.btn-primary { background: var(--cyan); border-color: var(--cyan); color: #04222c; }
.btn-primary:hover { background: #5deaff; }
.btn-primary::after { content: " →"; }
.btn[disabled] { opacity: .5; cursor: wait; }

.field-row { display: flex; gap: 10px; }
.select {
  flex: 1; min-width: 0;
  font-family: var(--mono); font-size: 12.5px;
  padding: 9px 10px; border-radius: 6px;
  border: 1px solid var(--edge); background: var(--lcd-bg); color: var(--ink);
}
.check { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.check input { accent-color: var(--cyan); }

/* ---------- vidéo & vu-mètre ---------- */
.video-wrap {
  position: relative; aspect-ratio: 16/9;
  background: var(--lcd-bg); border: 1px solid var(--edge); border-radius: var(--radius);
  overflow: hidden;
}
.video-wrap video { width: 100%; height: 100%; object-fit: cover; display: block; }
.video-empty {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--muted);
  padding: 20px; text-align: center;
}
.vu {
  width: 100%; height: 120px; display: block;
  background: var(--lcd-bg); border: 1px solid var(--edge); border-radius: var(--radius);
}

/* ---------- pied ---------- */
.foot {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px 26px; border-top: 1px solid var(--edge);
  font-size: 11.5px; color: var(--muted); background: var(--panel);
}

@media (max-width: 860px) {
  .bench { grid-template-columns: 1fr; padding: 14px; gap: 14px; }
  .results { grid-template-columns: repeat(2, 1fr); }
  .conn-grid { grid-template-columns: 1fr; }
  .topbar { padding: 12px 14px; flex-wrap: wrap; }
  .nav a span { display: none; }
  .nav a { padding: 8px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .meter-fill { transition: none; }
}
