/* ============================================================
   Live Poll — gaya bersama
   Latar abu terang, kartu putih, aksen merah (desain migunesia)
   ============================================================ */
:root {
  --bg: #e8e8ea;
  --card: #ffffff;
  --card-2: #ffffff;
  --ink: #111111;
  --ink-2: #555555;
  --ink-3: #8a8a8a;
  --line: #e6e6e6;
  --track: #ececee;
  --accent: #e3202a;
  --accent-ink: #d0161f;
  --accent-soft: #fdecec;
  --bar: #1c1c1c;
  --danger: #ef4444;
  --warn: #f59e0b;
  --radius: 22px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 14px 34px -22px rgba(0, 0, 0, .25);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { background: var(--bg); }
body {
  font-family: var(--font);
  color: var(--ink);
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Brand ---------- */
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--accent); box-shadow: 0 6px 16px rgba(227, 32, 42, .35);
}
.brand-mark svg { width: 20px; height: 20px; }
.brand-name { font-weight: 800; letter-spacing: .02em; font-size: 15px; line-height: 1.1; }
.brand-sub { font-size: 12px; color: var(--ink-2); font-weight: 600; }

/* ---------- Live pill ---------- */
.live {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px;
  background: #fff; color: var(--ink); font-size: 12px; font-weight: 700;
  border: 1px solid var(--line); white-space: nowrap;
}
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); position: relative; }
.live-dot::after {
  content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--accent);
  animation: ping 1.6s ease-out infinite;
}
.live.off .live-dot { background: var(--ink-3); }
.live.off .live-dot::after { display: none; }
@keyframes ping { from { transform: scale(.6); opacity: .9; } to { transform: scale(1.6); opacity: 0; } }

/* ---------- Kartu ---------- */
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  border: 0;
}

/* ---------- Bar hasil (gaya referensi) ---------- */
.results { display: grid; gap: 18px; }
.result-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 7px; }
.result-label { font-weight: 700; font-size: 15px; }
.result-votes { font-size: 13px; color: var(--ink-3); font-weight: 600; }
.result-mine {
  margin-left: auto; font-size: 11px; font-weight: 800; color: var(--accent-ink);
  background: var(--accent-soft); padding: 3px 8px; border-radius: 999px; letter-spacing: .02em;
}
.bar { height: 26px; background: var(--track); border-radius: 999px; overflow: hidden; position: relative; }
.bar-fill {
  height: 100%; min-width: 44px; border-radius: 999px; background: var(--c, var(--bar));
  display: flex; align-items: center; padding-left: 10px;
  transition: width .9s cubic-bezier(.22, 1, .36, 1);
}
.bar-pct { color: #fff; font-weight: 800; font-size: 12px; font-variant-numeric: tabular-nums; }
.bump { animation: bump .5s ease; }
@keyframes bump { 30% { transform: scale(1.04); } }

/* ---------- Tombol ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 12px; padding: 13px 20px; font-weight: 800; font-size: 15px;
  background: var(--ink); color: #fff; transition: transform .15s ease, background .2s, opacity .2s;
  text-decoration: none;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: #c9141d; }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn-ghost:hover { background: #fff; }
.btn-danger { background: #fee2e2; color: #b91c1c; }
.btn-danger:hover { background: #fecaca; }
.btn-sm { padding: 8px 12px; font-size: 13px; border-radius: 10px; }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 50; width: min(92vw, 380px); }
.toast {
  background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px; font-size: 14px; font-weight: 600;
  box-shadow: 0 12px 30px rgba(0,0,0,.3); animation: toastIn .3s ease; display: flex; gap: 10px; align-items: center;
}
.toast.err { background: #7f1d1d; }
.toast.ok::before { content: '✓'; color: var(--accent); font-weight: 900; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Status banner ---------- */
.notice {
  display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 12px;
  background: #fef3c7; color: #92400e; font-weight: 700; font-size: 14px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
