/* RIAC 2026 audience polls — single theme, mobile-first, no external assets. */
:root {
  --navy: #0b1a33;
  --navy-2: #12264a;
  --graphite: #2b3340;
  --ink: #1a1f2b;
  --muted: #6b7280;
  --line: #d9dee7;
  --bg: #f4f6fa;
  --card: #ffffff;
  --accent: #c9a24b;      /* muted gold */
  --accent-ink: #1a1400;
  --live: #1f9d55;
  --danger: #b42318;
  --radius: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 18px; line-height: 1.45;
  color: var(--ink); background: var(--bg);
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--navy-2); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 15px; }
.inline { display: inline; }

/* Header / footer */
.site-header { background: var(--navy); color: #fff; padding: 12px 16px; border-bottom: 3px solid var(--accent); }
.brand { color: #fff; text-decoration: none; display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; font-size: 15px; letter-spacing: .02em; }
.brand-main { font-weight: 700; text-transform: uppercase; }
.brand-sep { opacity: .6; }
.brand-sub { opacity: .9; }
.site-footer { margin-top: auto; padding: 18px 16px; text-align: center; color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); background: var(--card); }
.page { width: 100%; max-width: 720px; margin: 0 auto; padding: 20px 16px 40px; flex: 1; }

/* Landing */
.hero { margin-bottom: 20px; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: 13px; color: var(--muted); margin: 0 0 6px; }
h1 { font-size: 26px; line-height: 1.25; margin: 0 0 8px; color: var(--navy); }
.lead { margin: 0 0 4px; font-size: 18px; }
.section-title { font-size: 17px; text-transform: uppercase; letter-spacing: .06em; color: var(--graphite); margin: 24px 0 10px; }
.poll-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.poll-link { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; text-decoration: none; color: var(--ink); min-height: 64px; }
.poll-link:active { background: #eef1f6; }
.poll-num { font-weight: 700; font-size: 20px; color: var(--navy); min-width: 34px; }
.poll-text { flex: 1; display: flex; flex-direction: column; }
.poll-panel { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.poll-q { font-size: 16px; }
.badge { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 4px 8px; border-radius: 999px; white-space: nowrap; }
.badge-live { background: var(--live); color: #fff; }
.badge-closed { background: #e5e7eb; color: var(--graphite); }
.badge-draft { background: #fff; color: var(--muted); border: 1px solid var(--line); }

/* Poll page */
.question { font-size: 24px; margin: 0 0 6px; }
.notice { background: var(--card); border-left: 4px solid var(--accent); padding: 14px 16px; border-radius: 6px; font-size: 18px; margin: 16px 0 8px; }
.field { display: block; margin: 16px 0; }
.field-label { display: block; font-weight: 600; margin-bottom: 6px; }
.field-hint { display: block; font-size: 14px; color: var(--muted); margin-top: 4px; }
input[type=text], input[type=password], input[type=search] {
  width: 100%; font: inherit; font-size: 18px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; min-height: 48px;
}
input:focus { outline: 3px solid rgba(201,162,75,.45); border-color: var(--accent); }
.options { display: flex; flex-direction: column; gap: 10px; margin: 8px 0 16px; }
.option {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  min-height: 56px; padding: 12px 14px; font: inherit; font-size: 18px; line-height: 1.3;
  background: var(--card); color: var(--ink); border: 2px solid var(--line); border-radius: var(--radius); cursor: pointer;
}
.option .dot { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--graphite); display: inline-block; position: relative; }
.option[aria-checked="true"] { border-color: var(--navy); background: #eef2fa; font-weight: 600; }
.option[aria-checked="true"] .dot { border-color: var(--navy); }
.option[aria-checked="true"] .dot::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--navy); }
.option:focus-visible { outline: 3px solid rgba(201,162,75,.6); }
.btn {
  display: inline-block; font: inherit; font-size: 16px; font-weight: 600; padding: 10px 16px; min-height: 44px;
  border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--navy); text-decoration: none; cursor: pointer; text-align: center;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn-primary:not(:disabled):active { background: var(--navy-2); }
.btn-big { width: 100%; font-size: 20px; min-height: 56px; padding: 14px 18px; }
.btn-link { background: none; border: none; color: var(--navy-2); text-decoration: underline; padding: 8px 0; }
.btn-sm { font-size: 14px; padding: 6px 10px; min-height: 36px; }
.btn-danger { color: var(--danger); border-color: #f3c6c2; }
.btn-ghost { color: var(--muted); }
.btn-on { background: #e8f5ee; border-color: var(--live); color: #14532d; }
.error { color: var(--danger); font-weight: 600; margin: 8px 0; }
.success { background: #eef7f1; border-left: 4px solid var(--live); padding: 14px 16px; border-radius: 6px; margin: 16px 0 8px; }
.success p { margin: 0 0 4px; }
.success-title { font-size: 20px; font-weight: 700; }
.footer-links { margin-top: 28px; font-size: 15px; }
.results { margin-top: 24px; }

/* Bars (shared by guest results, admin, presenter) */
.bar-row { margin: 0 0 12px; }
.bar-label { display: flex; justify-content: space-between; gap: 12px; font-size: 16px; margin-bottom: 4px; }
.bar-value { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--graphite); }
.bar-track { background: #e6e9f0; border-radius: 6px; height: 18px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--navy); border-radius: 6px; width: 0; transition: width .4s ease; }
.bar-row.mine .bar-fill { background: var(--accent); }
.bar-row.leader .bar-fill { background: var(--accent); }

/* Admin */
.admin h1 { font-size: 24px; }
.admin-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.admin-nav { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.question-sm { font-size: 20px; }
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.table { border-collapse: collapse; width: 100%; font-size: 15px; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { background: #f0f2f7; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--graphite); }
.table td.num { font-weight: 700; white-space: nowrap; }
.table td.actions { white-space: nowrap; }
.table td.actions form, .table td.actions a { margin: 2px 4px 2px 0; }
.table td.q .muted { display: block; }
.status { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 4px 8px; border-radius: 999px; background: #e5e7eb; color: var(--graphite); }
.status-open { background: var(--live); color: #fff; }
.status-draft { background: #fff; border: 1px solid var(--line); color: var(--muted); }
.live-row { display: flex; align-items: center; gap: 8px; margin: 8px 0 16px; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: #c4c9d4; display: inline-block; }
.live-dot.on { background: var(--live); box-shadow: 0 0 0 4px rgba(31,157,85,.2); }
.live-dot.poll { background: var(--accent); }
.search { margin: 4px 0 10px; }
.login { max-width: 420px; margin: 40px auto; }
.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.qr-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.qr-img svg { width: 100%; height: auto; display: block; }
.qr-label { font-weight: 600; margin: 10px 0 4px; font-size: 15px; }
.qr-url { font-size: 13px; word-break: break-all; margin-bottom: 8px; }
.qr-dl { display: flex; gap: 8px; }
.message { text-align: center; padding: 40px 0; }

/* Presenter screen */
.present-body { background: var(--navy); color: #fff; font-size: 28px; }
.present { min-height: 100vh; display: flex; flex-direction: column; padding: 3vh 4vw; }
.present-head { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: 20px; opacity: .85; text-transform: uppercase; letter-spacing: .08em; }
.present-brand { font-weight: 700; }
.present-question { font-size: clamp(30px, 4.2vw, 56px); line-height: 1.2; margin: 3vh 0 4vh; }
.present-bars { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 2.2vh; }
.present-bars .bar-label { font-size: clamp(20px, 2.4vw, 34px); }
.present-bars .bar-value { color: #dfe4ee; }
.present-bars .bar-track { background: rgba(255,255,255,.14); height: clamp(22px, 3.4vh, 40px); }
.present-bars .bar-fill { background: #ffffff; }
.present-bars .bar-row.leader .bar-fill { background: var(--accent); }
.present-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-top: 3vh; }
.present-total { font-size: clamp(22px, 2.6vw, 36px); }
.present-qr { display: flex; align-items: center; gap: 16px; }
.present-qr-img { background: #fff; padding: 8px; border-radius: 8px; width: clamp(110px, 14vh, 200px); }
.present-qr-img svg { display: block; width: 100%; height: auto; }
.present-qr-text { font-size: 18px; text-transform: uppercase; letter-spacing: .1em; line-height: 1.4; }
.present-url { text-transform: none; letter-spacing: 0; opacity: .8; }
.present .status { font-size: 14px; }
@media (max-width: 640px) { .present-foot { flex-direction: column; align-items: flex-start; } }
