/* Face avant de baie : ardoise bleutee, voyants, creteometres a segments. Police DIN deja presente sur le systeme. */
:root {
  color-scheme: dark;
  --room: #12171d;        /* fond, la piece */
  --panel: #1c242c;       /* face avant d'un appareil */
  --panel-edge: #2a3540;  /* chanfrein */
  --groove: #0f1419;      /* rainure entre modules */
  --ink: #d5dde4;         /* serigraphie */
  --muted: #7f8c98;
  --led-g: #4fd17f; --led-a: #f2b33d; --led-r: #ee5b4e; --seg-off: #26313b;
  --amber: #f2b33d;
  --din: "Bahnschrift", "DIN Alternate", "DIN Next", "D-DIN", "Barlow Semi Condensed", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--room); color: var(--ink); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
main { max-width: 980px; margin: 0 auto; padding: calc(32px + env(safe-area-inset-top, 0px)) max(20px, env(safe-area-inset-right, 0px)) calc(72px + env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px)); }
h1, h2, .din { font-family: var(--din); font-weight: 600; letter-spacing: .01em; }
h1 { font-size: 26px; margin: 0; font-weight: 600; }
h2 { font-size: 17px; margin: 40px 0 12px; color: var(--ink); }
a { color: var(--ink); }
.muted { color: var(--muted); font-size: 13px; }
.row { display: flex; align-items: center; gap: 12px; }
.grow { flex: 1; min-width: 0; }

/* Appareil en baie : plaque avec oreilles a vis */
.card {
  position: relative; background: linear-gradient(#212a33, var(--panel) 38px);
  border: 1px solid var(--panel-edge); border-top-color: #34414d; border-radius: 6px;
  padding: 16px 34px; margin-bottom: 12px;
}
.card::before, .card::after {
  content: ""; position: absolute; top: 16px; width: 9px; height: 9px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #5d6a76, #2b343d 70%); box-shadow: inset 0 0 0 1px #0d1115;
}
.card::before { left: 12px; } .card::after { right: 12px; }

/* Voyants */
.lamp { display: inline-flex; align-items: center; gap: 7px; font-family: var(--din); font-size: 13.5px; color: var(--muted); white-space: nowrap; }
.lamp i { width: 9px; height: 9px; border-radius: 50%; background: #3a454f; box-shadow: inset 0 -1px 1px rgba(0,0,0,.5); }
.lamp.g i { background: var(--led-g); box-shadow: 0 0 6px var(--led-g); } .lamp.g { color: var(--ink); }
.lamp.a i { background: var(--led-a); box-shadow: 0 0 6px var(--led-a); } .lamp.a { color: var(--ink); }
.lamp.r i { background: var(--led-r); box-shadow: 0 0 6px var(--led-r); } .lamp.r { color: var(--ink); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #3a454f; flex: none; }
.dot.on { background: var(--led-g); box-shadow: 0 0 7px var(--led-g); }

/* Boutons : touches de pupitre ; la touche principale est retroeclairee */
button, .btn {
  font-family: var(--din); font-size: 14px; letter-spacing: .02em; color: var(--ink); text-decoration: none; display: inline-block;
  background: linear-gradient(#2b3540, #222b34); border: 1px solid #3b4855; border-bottom-color: #151b21;
  border-radius: 5px; padding: 7px 14px; cursor: pointer;
}
button:hover, .btn:hover { border-color: #566676; }
button:active, .btn:active { transform: translateY(1px); }
button.primary, .btn.primary {
  color: #1d1406; font-weight: 600; background: linear-gradient(#f6c25a, #e9a62a);
  border-color: #f7cd73 #c88a1b #a8720f; box-shadow: 0 0 12px rgba(242,179,61,.25);
}
button:disabled { opacity: .45; cursor: default; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

input[type=text], input[inputmode=numeric] {
  background: var(--groove); color: var(--ink); border: 1px solid var(--panel-edge); border-radius: 5px;
  padding: 9px 11px; font: inherit;
}
.code { font-family: var(--din); font-size: 34px; letter-spacing: 10px; width: 230px; text-align: center; color: var(--amber);
        background: #0b0f13; text-shadow: 0 0 8px rgba(242,179,61,.35); font-variant-numeric: tabular-nums; }
.err { color: #f08a80; min-height: 22px; } .okmsg { color: #8be0a8; }
.center { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.secret { font-family: ui-monospace, Consolas, monospace; background: var(--groove); border: 1px solid var(--panel-edge); padding: 6px 8px; border-radius: 5px; word-break: break-all; }
label { display: flex; gap: 8px; align-items: center; color: var(--muted); }
code { font-size: 13px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
