/* Mesure Wi-Fi — page de test. Esprit instrument de mesure radio : sombre par défaut, mode clair en option. */
:root {
  --bg: #050a17; --bg-glow: rgba(34, 211, 238, .10); --card: #0a1326; --card-2: #0e1a32; --line: #1b2a4a; --line-2: #14213d; --grid: rgba(94, 234, 255, .045);
  --ink: #e8f1fc; --ink-2: #b0c0d8; --muted: #8597b6;
  --accent: #22d8ee; --accent-2: #67e8f9; --accent-soft: rgba(34, 216, 238, .16); --on-accent: #031220;
  /* Échelle de qualité : A vert, B vert-jaune, C jaune, D orange, E rouge */
  --qa: #3ee483; --qb: #b4e83a; --qc: #fcd34d; --qd: #fb923c; --qe: #ff6b78; --qi: #22d8ee; --on-q: #031220;
  --font: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #edf2f9; --bg-glow: rgba(0, 120, 138, .08); --card: #fff; --card-2: #f4f7fc; --line: #d3dceb; --line-2: #e3e9f3; --grid: rgba(0, 90, 120, .05);
  --ink: #0a1426; --ink-2: #34445e; --muted: #55657e;
  --accent: #00788a; --accent-2: #006a7a; --accent-soft: rgba(0, 120, 138, .14); --on-accent: #fff;
  --qa: #12793f; --qb: #47720d; --qc: #8a6100; --qd: #b4500c; --qe: #c0262d; --qi: #00788a; --on-q: #fff;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
body { background: radial-gradient(1100px 520px at 50% -180px, var(--bg-glow), transparent 70%) no-repeat, var(--bg); min-height: 100vh; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); } .small { font-size: 14px; }
.mono { font-family: var(--mono); }

/* En-tête */
.top { border-bottom: 1px solid var(--line-2); }
.top-in { display: flex; align-items: center; gap: 12px; height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; letter-spacing: -.01em; flex: 1; min-width: 0; }
.mark { width: 34px; height: 34px; border-radius: 10px; border: 1.5px solid var(--accent); color: var(--accent); display: grid; place-items: center; box-shadow: 0 0 14px var(--accent-soft), inset 0 0 10px var(--accent-soft); flex: none; }
.top-link { color: var(--ink-2); text-decoration: none; font-size: 15px; padding: 8px 4px; }
.top-link:hover { color: var(--ink); }
.theme-btn { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink-2); display: grid; place-items: center; cursor: pointer; flex: none; }
.theme-btn:hover { color: var(--accent); border-color: var(--accent); }
.theme-btn .sun { display: none; }
:root[data-theme="light"] .theme-btn .sun { display: block; }
:root[data-theme="light"] .theme-btn .moon { display: none; }

/* Titre */
.hero { padding: 34px 0 20px; }
.eyebrow { font-family: var(--mono); font-size: 12.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin: 0 0 10px; }
.hero h1 { font-size: clamp(30px, 6vw, 46px); line-height: 1.08; letter-spacing: -.035em; margin: 0 0 10px; font-weight: 700; }
.hero p { margin: 0; color: var(--ink-2); max-width: 62ch; }

/* Panneaux */
.panel { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 22px; margin-bottom: 18px; }
.panel-label { font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }
.panel-label::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }

/* Cadrans */
.gauges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.gauge { background: var(--card-2) linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 100% 14px; border: 1px solid var(--line-2); border-radius: 14px; padding: 12px 8px 14px; text-align: center; transition: border-color .2s, box-shadow .2s; min-width: 0; --q: var(--accent); }
.gauge.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), 0 0 24px var(--accent-soft); }
.gauge[data-q="A"] { --q: var(--qa); } .gauge[data-q="B"] { --q: var(--qb); } .gauge[data-q="C"] { --q: var(--qc); } .gauge[data-q="D"] { --q: var(--qd); } .gauge[data-q="E"] { --q: var(--qe); }
.dial { position: relative; width: 100%; max-width: 180px; margin: 0 auto; aspect-ratio: 1 / .86; }
.dial svg { position: absolute; inset: 0; width: 100%; height: auto; overflow: visible; }
.dial path { fill: none; stroke-linecap: round; }
.dial .trk { stroke: var(--line); stroke-width: 7; }
.dial .ticks { transform-box: view-box; stroke: var(--muted); stroke-width: 3; stroke-linecap: butt; stroke-dasharray: .4 9.6; stroke-dashoffset: .2; opacity: .55; transform: scale(.8); transform-origin: 50% 50%; }
.dial .arc { stroke: var(--q); stroke-width: 7; stroke-dasharray: 0 100; filter: drop-shadow(0 0 4px var(--q)); transition: stroke-dasharray .3s, stroke .3s; }
.read { position: absolute; inset: 0; display: grid; place-content: center; padding-top: 6%; }
.gauge .v { font-family: var(--mono); font-size: clamp(20px, 5.4vw, 40px); font-weight: 600; letter-spacing: -.05em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.gauge .v.long { font-size: clamp(16px, 4.2vw, 32px); }
.gauge .u { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.gauge .k { font-size: 14px; color: var(--ink-2); line-height: 1.25; margin-top: 2px; }
.scope { display: block; width: 100%; height: 34px; margin-top: 14px; overflow: hidden; }
.scope path { fill: none; stroke: var(--accent); stroke-width: 1.6; opacity: .35; vector-effect: non-scaling-stroke; }
body.running .scope path { opacity: .9; animation: scope 1.1s linear infinite; }
@keyframes scope { to { transform: translateX(-50px); } }

.progress { height: 6px; border-radius: 99px; background: var(--line-2); overflow: hidden; margin: 8px 0 18px; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent-2), var(--accent)); box-shadow: 0 0 10px var(--accent); transition: width .25s; }
.actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.actions .muted { flex: 1 1 240px; }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 12px; padding: 10px 16px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; min-height: 44px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); box-shadow: 0 0 22px var(--accent-soft); }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.big { padding: 13px 24px; font-size: 17px; }
.btn:disabled { opacity: .6; cursor: default; }

/* Résultat */
.res-head { display: flex; gap: 18px; align-items: center; margin-bottom: 8px; }
.grade { --q: var(--muted); --s: 0; width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; position: relative; flex: none;
  font-family: var(--mono); font-size: 38px; font-weight: 600; color: var(--q); background: var(--card-2); box-shadow: 0 0 22px color-mix(in srgb, var(--q) 25%, transparent); }
.grade::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(var(--q) calc(var(--s) * 1%), var(--line) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 calc(100% - 6px)); mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 calc(100% - 6px)); }
.grade.A { --q: var(--qa); } .grade.B { --q: var(--qb); } .grade.C { --q: var(--qc); } .grade.D { --q: var(--qd); } .grade.E { --q: var(--qe); }
.score { font-family: var(--mono); font-size: 13px; }
.score b { color: var(--ink); font-weight: 600; }
.verdict { font-size: 22px; font-weight: 700; letter-spacing: -.02em; line-height: 1.25; }
.group { font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 18px 0 2px; }
.check { display: grid; grid-template-columns: 26px 1fr; gap: 10px; padding: 11px 2px; border-bottom: 1px solid var(--line-2); }
.check .ic { --c: var(--qi); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; margin-top: 1px; color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); }
.check.ok .ic { --c: var(--qa); } .check.warn .ic { --c: var(--qc); } .check.bad .ic { --c: var(--qe); }
.check .l { font-weight: 600; } .check .val { font-family: var(--mono); font-size: 13.5px; color: var(--ink-2); margin-left: 6px; overflow-wrap: anywhere; }
.check .tx { color: var(--ink-2); font-size: 15px; }
.check .adv { font-size: 14px; margin-top: 6px; padding: 8px 11px; border-radius: 9px; background: var(--card-2); border-left: 3px solid var(--accent); }

/* Appli PC */
.pc { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; }
.pc h2 { margin: 0 0 8px; font-size: 21px; letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; }
.pc h2 svg { color: var(--accent); flex: none; }
.pc p { margin: 0 0 10px; color: var(--ink-2); }
.pc ul { margin: 0; padding-left: 18px; color: var(--ink-2); }
.pc li + li { margin-top: 4px; }
.pc b { color: var(--ink); }
.pc-dl { text-align: center; display: grid; gap: 8px; }
.pc-dl .small { font-family: var(--mono); font-size: 12.5px; }
footer { padding: 6px 16px 44px; }

@media (max-width: 680px) {
  .gauges { gap: 6px; } .gauge { padding: 8px 3px 10px; } .gauge .k { font-size: 12.5px; } .gauge .u { font-size: 11.5px; }
  .pc { grid-template-columns: 1fr; } .pc-dl .btn { width: 100%; }
  .panel { padding: 16px; border-radius: 16px; }
  .hero { padding: 26px 0 16px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
