/* Multiscan — thème "console de diffusion".
   Fond charbon, accent ambre (voyant "on air"), donnees en monospace. */

:root {
  --bg: #14171c;
  --panel: #1b1f26;
  --panel-2: #21262f;
  --line: #2b313b;
  --text: #e8eaed;
  --text-dim: #8b93a1;
  --amber: #f2a93b;
  --green: #3ddc84;
  --red: #e0555a;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

/* ---------- Login ---------- */

.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 20% 20%, rgba(242, 169, 59, 0.08), transparent 40%),
    var(--bg);
}

.login-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 48px 40px;
  width: 340px;
  text-align: center;
}

.login-mark { display: flex; justify-content: center; gap: 6px; margin-bottom: 20px; }
.login-mark .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); opacity: 0.4; }
.login-mark .dot:nth-child(2) { opacity: 0.7; }
.login-mark .dot:nth-child(3) { opacity: 1; }

.login-card h1 { margin: 0 0 8px; font-size: 22px; letter-spacing: 0.02em; }
.login-sub { color: var(--text-dim); font-size: 14px; margin-bottom: 28px; }

.login-form { display: flex; flex-direction: column; gap: 12px; }

input[type="password"], input[type="text"], input[type="number"] {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  width: 100%;
}

input:focus { outline: 2px solid var(--amber); outline-offset: 1px; }

button { font-family: var(--sans); cursor: pointer; }

.login-form button {
  background: var(--amber);
  color: #1a1300;
  border: none;
  border-radius: 8px;
  padding: 11px;
  font-weight: 600;
  font-size: 14px;
}

.error { color: var(--red); font-size: 13px; margin-top: 14px; }

/* ---------- Topbar ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: 0.02em; }
.brand-mark { width: 10px; height: 10px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 8px var(--amber); }

.topbar-right { display: flex; align-items: center; gap: 14px; }

.pill {
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
}
.pill-ok { background: rgba(61, 220, 132, 0.12); color: var(--green); border: 1px solid rgba(61, 220, 132, 0.3); }
.pill-warn { background: rgba(242, 169, 59, 0.14); color: var(--amber); border: 1px solid rgba(242, 169, 59, 0.35); }

.link-btn {
  background: none; border: none; color: var(--text-dim);
  font-size: 13px; text-decoration: none; padding: 0;
}
.link-btn:hover { color: var(--text); }

/* ---------- Layout ---------- */

.content { max-width: 920px; margin: 0 auto; padding: 32px 24px 80px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px 24px;
  margin-bottom: 28px;
}
.panel h2 { margin: 0 0 16px; font-size: 15px; color: var(--text-dim); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }

/* ---------- Radio form ---------- */

.radio-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 140px; }
.field-wide { flex: 1 1 260px; }
.field-small { width: 100px; min-width: 100px; }
.field label { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.04em; }

.btn-primary {
  background: var(--amber);
  color: #1a1300;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-weight: 600;
  font-size: 13px;
  height: 38px;
}

/* ---------- Radios list ---------- */

.radios { display: flex; flex-direction: column; gap: 16px; }
.empty { color: var(--text-dim); text-align: center; padding: 40px 0; }

.radio-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 22px;
  transition: border-color 0.2s;
}
.radio-card.is-running { border-color: rgba(61, 220, 132, 0.35); }

.radio-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.radio-title { display: flex; align-items: center; gap: 10px; }
.radio-title h3 { margin: 0; font-size: 16px; font-weight: 600; }

.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.status-dot.on { background: var(--green); box-shadow: 0 0 6px var(--green); animation: pulse 1.6s infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.radio-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-form { display: inline; }

.btn-start, .btn-stop, .btn-ghost, .btn-danger {
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 7px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 500;
}
.btn-start { border-color: rgba(61, 220, 132, 0.4); color: var(--green); }
.btn-stop { border-color: rgba(242, 169, 59, 0.4); color: var(--amber); }
.btn-danger { border-color: rgba(224, 85, 90, 0.4); color: var(--red); }
.btn-ghost:hover { border-color: var(--text-dim); }

.radio-meta {
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-dim);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.edit-form {
  display: none;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.edit-form.open { display: flex; }

/* ---------- Log ---------- */

.log {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column-reverse;
  gap: 4px;
}
.log-empty { color: var(--text-dim); font-size: 12px; margin: 0; }

.log-line {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  display: flex;
  gap: 8px;
  align-items: baseline;
}
.log-time { opacity: 0.6; font-size: 10.5px; white-space: nowrap; }

.log-badge {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--panel-2);
}
.log-added .log-badge { color: var(--green); }
.log-duplicate .log-badge { color: var(--text-dim); }
.log-not_found .log-badge, .log-error .log-badge { color: var(--red); }
.log-unidentified .log-badge { color: var(--text-dim); }
.log-added, .log-duplicate, .log-not_found, .log-unidentified, .log-error { color: var(--text); }

@media (max-width: 600px) {
  .topbar { padding: 14px 16px; }
  .content { padding: 20px 14px 60px; }
  .radio-form { flex-direction: column; align-items: stretch; }
  .field-small { width: 100%; }
}
