/* AutoVote : thème « redstone », commun à l'accueil et au tableau de bord */
/* Polices servies par le site (licence OFL, voir web/fonts) : aucune requête vers un tiers */
@font-face { font-family: "Bricolage Grotesque"; src: url("/assets/fonts/bricolage-grotesque.woff2") format("woff2"); font-weight: 500 800; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("/assets/fonts/instrument-sans.woff2") format("woff2"); font-weight: 400 600; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/assets/fonts/ibm-plex-mono-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/assets/fonts/ibm-plex-mono-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --bg: #141519;         /* deepslate */
  --bg-2: #1b1d22;
  --bg-3: #23262d;
  --line: #2e323a;
  --line-2: #3d424c;
  --text: #ebe7df;
  --muted: #a29e95;
  --dim: #6f6d68;
  --redstone: #ff3b2f;   /* signal allumé */
  --redstone-off: #5a201b;
  --lamp: #ffcd57;       /* lampe allumée : actions et votes validés */
  --lamp-ink: #2a1d02;
  --fail: #ff7d6e;
  --wait: #c9b8ff;
  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --body: "Instrument Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", monospace;
  --radius: 10px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.6 var(--body); overflow-wrap: break-word; }
a { color: inherit; }
p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--lamp); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--redstone); color: #fff; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 760px) { .wrap { padding: 0 32px; } }

/* ─── Typo ─────────────────────────────────────────────────────── */
h1, h2, h3, .title {
  font-family: var(--display); font-weight: 800; letter-spacing: -.025em; line-height: 1.02; margin: 0;
  font-variation-settings: "opsz" 96;
}
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.lit { color: var(--lamp); }
.fail { color: var(--fail); }
.wait { color: var(--wait); }
code { font: .88em var(--mono); background: var(--bg-3); padding: 1px 6px; border-radius: 4px; }

/* ─── Boutons ──────────────────────────────────────────────────── */
.btn, button {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font: 600 .95rem/1 var(--body); text-decoration: none; cursor: pointer;
  padding: 13px 20px; border-radius: 999px;
  border: 1px solid var(--lamp); background: var(--lamp); color: var(--lamp-ink);
  transition: transform .12s, background .15s, border-color .15s, color .15s;
}
.btn:hover, button:hover { background: #ffd978; }
.btn:active, button:active { transform: translateY(1px); }
.btn.quiet, button.quiet { background: transparent; color: var(--text); border-color: var(--line-2); }
.btn.quiet:hover, button.quiet:hover { border-color: var(--text); background: transparent; }
button.small, .btn.small { padding: 8px 14px; font-size: .85rem; }
button.danger { background: transparent; color: var(--fail); border-color: color-mix(in srgb, var(--fail) 45%, transparent); }
button.danger:hover { background: transparent; border-color: var(--fail); }
button.danger.armed { background: var(--fail); color: var(--bg); border-color: var(--fail); }
button.text { background: none; border: 0; padding: 0; border-radius: 0; color: var(--muted); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
button.text:hover { color: var(--text); background: none; }
button:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }
@media (prefers-reduced-motion: reduce) { .btn, button { transition: none; } }

/* ─── Barre du haut ────────────────────────────────────────────── */
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.topbar .wrap { display: flex; align-items: center; gap: 28px; min-height: 66px; }
.brand { white-space: nowrap; flex: none; display: inline-flex; align-items: center; gap: 10px; font: 800 1.15rem var(--display); letter-spacing: -.02em; text-decoration: none; }
.lamp-icon { width: 18px; height: 18px; border-radius: 4px; background: var(--lamp); box-shadow: 0 0 0 3px #3a2e12, 0 0 18px color-mix(in srgb, var(--lamp) 55%, transparent); }
.toplinks { display: flex; gap: 22px; margin-right: auto; }
.toplinks a { color: var(--muted); text-decoration: none; font-weight: 500; font-size: .95rem; }
.toplinks a:hover { color: var(--text); }
.topactions { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.topactions a.plain { color: var(--muted); text-decoration: none; font-weight: 500; }
.topactions a.plain:hover { color: var(--text); }
@media (max-width: 780px) { .toplinks { display: none; } .topbar .wrap { gap: 12px; } .topactions { gap: 12px; } .topactions .btn.small { padding: 8px 12px; } }
@media (max-width: 420px) { .topactions a.plain { display: none; } }

/* ─── Formulaires ──────────────────────────────────────────────── */
.card { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); }
.field { display: grid; gap: 6px; }
.field label, .label { font-size: .85rem; font-weight: 600; color: var(--muted); }
input[type=text], input[type=password], input[type=number], input[type=url], select, textarea {
  font: 500 1rem var(--body); color: var(--text); background: var(--bg); width: 100%;
  border: 1px solid var(--line-2); padding: 11px 13px; border-radius: 8px;
}
input:focus, select:focus, textarea:focus { border-color: var(--lamp); outline: none; }
input::placeholder, textarea::placeholder { color: var(--dim); }
textarea { font: .85rem/1.5 var(--mono); min-height: 72px; resize: vertical; }
.check { display: flex; gap: 10px; align-items: center; }
input[type=checkbox], input[type=radio] { accent-color: var(--redstone); width: 17px; height: 17px; }
.hint { font-size: .9rem; color: var(--muted); }
.notice { font-size: .9rem; color: var(--muted); min-height: 1.4em; }
.notice.error { color: var(--fail); }
.notice.success { color: var(--lamp); }

/* ─── Répéteur : 4 crans qui s'allument pendant le cooldown ────── */
.repeater {
  --notch: var(--redstone-off);
  display: inline-grid; grid-template-columns: repeat(4, 7px); gap: 3px; align-items: center;
  padding: 6px 8px; border-radius: 5px; background: #2b2b2b; border: 1px solid #3a3a3a;
  box-shadow: inset 0 -2px 0 #1e1e1e;
}
.repeater i { width: 7px; height: 7px; border-radius: 2px; background: var(--notch); }
.repeater i.on { background: var(--redstone); box-shadow: 0 0 6px color-mix(in srgb, var(--redstone) 70%, transparent); }
.repeater.powered { border-color: var(--redstone); box-shadow: inset 0 -2px 0 #1e1e1e, 0 0 14px color-mix(in srgb, var(--redstone) 40%, transparent); }
.repeater.busy i.on { animation: tick .9s steps(2) infinite; }
@keyframes tick { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .repeater.busy i.on { animation: none; } }

.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--dim); display: inline-block; flex: none; }
.dot.on { background: var(--lamp); box-shadow: 0 0 10px var(--lamp); }
.dot.err { background: var(--fail); }
