/* QuietConf — jetons dérivés du logo, thèmes clair et sombre */
:root {
  --brand: #4b3fd6;
  --brand-strong: #3a2fc0;
  --brand-soft: #ece9ff;
  --live: #14b8a6;
  --live-soft: #d5f7f1;
  --hand: #e59a0b;
  --hand-soft: #fff3d6;
  --danger: #dc3545;
  --danger-soft: #fde4e6;
  --ink: #14112b;
  --muted: #5b5875;
  --line: #e3e1ef;
  --bg: #f7f6fc;
  --card: #ffffff;
  --meter-bg: #e9e7f3;
  --shadow: 0 1px 2px rgb(20 17 43 / 6%), 0 4px 16px rgb(20 17 43 / 6%);
  --radius: 14px;
  --font: 'Outfit', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --brand: #8b83ff;
    --brand-strong: #a5a0ff;
    --brand-soft: #25224a;
    --live: #2dd4bf;
    --live-soft: #113a37;
    --hand: #f5b43a;
    --hand-soft: #3b2e12;
    --danger: #ff6b76;
    --danger-soft: #3e1a1f;
    --ink: #f4f3ff;
    --muted: #a7a4c2;
    --line: #2d2a4a;
    --bg: #110f22;
    --card: #1a1832;
    --meter-bg: #26233f;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 4px 16px rgb(0 0 0 / 25%);
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --brand: #8b83ff;
  --brand-strong: #a5a0ff;
  --brand-soft: #25224a;
  --live: #2dd4bf;
  --live-soft: #113a37;
  --hand: #f5b43a;
  --hand-soft: #3b2e12;
  --danger: #ff6b76;
  --danger-soft: #3e1a1f;
  --ink: #f4f3ff;
  --muted: #a7a4c2;
  --line: #2d2a4a;
  --bg: #110f22;
  --card: #1a1832;
  --meter-bg: #26233f;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.hidden { display: none !important; }
.row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.stack > * + * { margin-top: .75rem; }

/* ----- en-tête ----- */
.topbar {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem 16px; border-bottom: 1px solid var(--line);
  background: var(--card); position: sticky; top: 0; z-index: 5;
}
.brand { display: flex; align-items: center; gap: .5rem; text-decoration: none; color: var(--ink); font-size: 1.2rem; }
.brand img { width: 32px; height: 32px; }
.brand b { font-weight: 700; }
.brand em { font-style: normal; color: var(--brand); font-weight: 400; }
.topbar .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

main { padding: 16px; max-width: 1180px; margin: 0 auto; }
main.narrow { max-width: 520px; }

/* ----- cartes / formulaires ----- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow);
}
label { display: block; font-weight: 500; font-size: .9rem; margin-bottom: .25rem; }
input[type='text'], input[type='email'], input[type='password'], select {
  width: 100%; font: inherit; font-size: 1rem; padding: .7rem .8rem; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
}
input:focus-visible, button:focus-visible, select:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 1px; }
.check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; padding: .35rem 0; cursor: pointer; }
.check input { margin-top: .25rem; width: 1.1rem; height: 1.1rem; accent-color: var(--brand); }
.check small { display: block; color: var(--muted); }

button, .btn {
  font: inherit; font-weight: 600; font-size: .95rem; cursor: pointer;
  border: 1px solid transparent; border-radius: 10px; padding: .6rem 1rem;
  background: var(--brand); color: #fff; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  transition: background .15s, transform .05s;
}
button:hover, .btn:hover { background: var(--brand-strong); }
button:active { transform: translateY(1px); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.ghost, .btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
button.ghost:hover { background: var(--brand-soft); }
button.danger { background: var(--danger); }
button.live { background: var(--live); }
button.warn { background: var(--hand); color: #1b1300; }
button.sm { padding: .35rem .65rem; font-size: .85rem; border-radius: 8px; }
button.big { width: 100%; padding: 1.1rem; font-size: 1.2rem; border-radius: 16px; }
.error { color: var(--danger); font-size: .9rem; min-height: 1.2em; }

.pill { display: inline-flex; align-items: center; gap: .3rem; font-size: .75rem; font-weight: 600; padding: .15rem .55rem; border-radius: 99px; background: var(--brand-soft); color: var(--brand-strong); }
.pill.live { background: var(--live-soft); color: var(--live); }
.pill.hand { background: var(--hand-soft); color: var(--hand); }
.pill.off { background: var(--meter-bg); color: var(--muted); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }
.dot { width: .55rem; height: .55rem; border-radius: 50%; background: var(--muted); display: inline-block; flex: none; }
.dot.ok { background: var(--live); }
.dot.warn { background: var(--hand); }
.dot.bad { background: var(--danger); }

/* ----- page participant ----- */
.join-hero { text-align: center; padding: 2rem 0 1rem; }
.join-hero img { width: 88px; height: 88px; }
.status-card { text-align: center; padding: 1.5rem 1rem; }
.status-card .state { font-size: 1.35rem; font-weight: 700; margin: .25rem 0; }
.onair { border-color: var(--live); box-shadow: 0 0 0 3px var(--live-soft), var(--shadow); }
.speaker-list { list-style: none; padding: 0; margin: .75rem 0 0; display: grid; gap: .4rem; }
.speaker-list li { display: flex; align-items: center; gap: .5rem; justify-content: center; }
.eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 14px; }
.eq i { width: 3px; background: var(--live); border-radius: 2px; animation: eq 1s infinite ease-in-out; }
.eq i:nth-child(2) { animation-delay: .2s; } .eq i:nth-child(3) { animation-delay: .4s; }
@keyframes eq { 0%, 100% { height: 4px; } 50% { height: 14px; } }
@media (prefers-reduced-motion: reduce) { .eq i { animation: none; height: 10px; } }
.hand-btn[aria-pressed='true'] { background: var(--hand); color: #1b1300; }
.local-meter { height: 8px; border-radius: 99px; background: var(--meter-bg); overflow: hidden; }
.local-meter > div { height: 100%; width: 0; background: var(--live); transition: width .08s linear; }
.tip { display: flex; gap: .6rem; align-items: center; justify-content: center; color: var(--muted); font-size: .9rem; }
.banner { padding: .7rem 1rem; border-radius: 12px; background: var(--hand-soft); color: var(--ink); font-size: .95rem; }

/* ----- liste conférences ----- */
.conf-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.conf-card h3 { margin: 0; }
.code { font-family: ui-monospace, 'DejaVu Sans Mono', monospace; letter-spacing: .08em; font-weight: 600; }

/* ----- régie ----- */
.console { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 960px) { .console { grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); } }
.stage { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.strip {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px; display: flex; flex-direction: column; gap: .5rem; align-items: center; min-height: 340px;
}
.strip.empty { justify-content: center; color: var(--muted); border-style: dashed; box-shadow: none; text-align: center; font-size: .9rem; }
.strip.is-live { border-color: var(--live); }
.strip .name { font-weight: 700; text-align: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.strip .controls { display: flex; gap: 10px; align-items: stretch; height: 190px; }
.vu { width: 14px; height: 100%; border-radius: 7px; background: var(--meter-bg); position: relative; overflow: hidden; }
.vu > div {
  position: absolute; bottom: 0; left: 0; right: 0; height: 0%;
  background: linear-gradient(to top, var(--live) 0%, var(--live) 65%, var(--hand) 82%, var(--danger) 96%);
  background-size: 100% 190px; background-position: bottom;
  transition: height .09s linear;
}
.vu > span { position: absolute; left: 0; right: 0; height: 2px; background: var(--ink); opacity: .7; }
input.fader { writing-mode: vertical-lr; direction: rtl; height: 100%; width: 28px; accent-color: var(--brand); margin: 0; }
.db { font-variant-numeric: tabular-nums; font-size: .85rem; color: var(--muted); }
.strip .actions { display: flex; gap: .35rem; flex-wrap: wrap; justify-content: center; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { display: flex; align-items: center; gap: .5rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list .who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.panel-head h2 { margin: 0; }
.scroll { max-height: 460px; overflow: auto; }
.count { font-variant-numeric: tabular-nums; }

/* ----- QR ----- */
.qr-wrap { position: relative; width: min(100%, 360px); margin: 0 auto; aspect-ratio: 1; background: #fff; border-radius: 16px; padding: 10px; }
.qr-wrap img.qr { width: 100%; height: 100%; display: block; }
.qr-wrap img.qr-logo { position: absolute; width: 22%; height: 22%; left: 39%; top: 39%; border-radius: 18%; box-shadow: 0 0 0 6px #fff; }
dialog { border: 0; border-radius: 18px; padding: 20px; background: var(--card); color: var(--ink); width: min(94vw, 460px); box-shadow: var(--shadow); }
dialog::backdrop { background: rgb(10 8 30 / 55%); }
.projector { position: fixed; inset: 0; z-index: 50; background: #fff; color: #14112b; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2vh; padding: 3vh; text-align: center; }
.projector .qr-wrap { width: min(70vh, 90vw); }
.projector h1 { font-size: clamp(1.6rem, 4vw, 3.2rem); }
.projector .url { font-size: clamp(1rem, 2.4vw, 1.8rem); font-weight: 600; color: #4b3fd6; }
.toast { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: .6rem 1rem; border-radius: 10px; z-index: 60; font-size: .9rem; max-width: calc(100vw - 32px); }
table { width: 100%; border-collapse: collapse; }
td, th { text-align: left; padding: .5rem .25rem; border-bottom: 1px solid var(--line); font-size: .92rem; }
