/* TSR Live Polls — brand tokens from TSRLABS-AI/tsrsolutions.com src/styles/brand.css */
:root {
  --brand: #23416c;
  --brand-light: #457b9d;
  --brand-dark: #1b3355;
  --accent: #a8dadc;
  --brand-surface: #eef7f8;
  --alert: #e63946;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --radius: 0.625rem;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--gray-900);
  background: var(--brand-surface);
  line-height: 1.5;
}

a {
  color: var(--brand-light);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.site-header {
  background: var(--brand);
  color: #fff;
  border-bottom: 3px solid var(--accent);
}

.site-header.light {
  background: #fff;
  color: var(--brand);
  border-bottom: 3px solid var(--brand);
}

.site-header .inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-mark img {
  height: 36px;
  width: auto;
  display: block;
}

.brand-mark .app-name {
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  opacity: 0.95;
}

.site-header.light .brand-mark .app-name {
  color: var(--brand);
}

.header-meta {
  font-size: 0.85rem;
  opacity: 0.9;
  text-align: right;
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.card + .card {
  margin-top: 1rem;
}

h1,
h2,
h3 {
  margin: 0 0 0.75rem;
  color: var(--brand-dark);
  letter-spacing: -0.015em;
}

h1 {
  font-size: 1.75rem;
}
h2 {
  font-size: 1.25rem;
}

.lede {
  color: var(--gray-600);
  margin: 0 0 1.25rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: none;
  border-radius: 0.375rem;
  padding: 0.6rem 1rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  background: var(--brand);
  color: #fff;
  text-decoration: none;
}
.btn:hover {
  background: var(--brand-dark);
  text-decoration: none;
}
.btn.secondary {
  background: var(--brand-light);
}
.btn.ghost {
  background: transparent;
  color: var(--brand);
  border: 1px solid var(--gray-300);
}
.btn.danger {
  background: var(--alert);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

input[type="text"],
input[type="password"] {
  width: 100%;
  max-width: 28rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: 0.375rem;
  font: inherit;
}
label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--gray-700);
  font-size: 0.9rem;
}
.field {
  margin-bottom: 1rem;
}

.join-code {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}

.code-chip {
  display: inline-block;
  background: var(--brand-surface);
  border: 1px solid var(--accent);
  color: var(--brand-dark);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.12em;
  font-size: 0.95rem;
}

.session-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.session-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--gray-200);
}
.session-list li:last-child {
  border-bottom: none;
}

.status {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--gray-200);
  color: var(--gray-700);
}
.status.live {
  background: var(--accent);
  color: var(--brand-dark);
}
.status.closed {
  background: var(--gray-800);
  color: #fff;
}

.option-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.option-btn {
  width: 100%;
  text-align: left;
  padding: 1rem 1.1rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  background: #fff;
  font: inherit;
  font-weight: 600;
  color: var(--brand-dark);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.option-btn:hover:not(:disabled) {
  border-color: var(--brand-light);
  background: var(--brand-surface);
}
.option-btn:disabled {
  opacity: 0.65;
  cursor: default;
}
.option-btn.selected {
  border-color: var(--brand);
  background: var(--brand-surface);
}

.bar-row {
  margin: 0.85rem 0;
}
.bar-label {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 0.35rem;
}
.bar-track {
  height: 1.35rem;
  background: var(--gray-100);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--gray-200);
}
.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-light), var(--accent));
  border-radius: 999px;
  min-width: 0;
  transition: width 0.35s ease;
}

.presenter-hero {
  text-align: center;
  margin-bottom: 1.5rem;
}
.presenter-hero .join-code {
  font-size: 3rem;
}
.presenter-question {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  text-align: center;
  margin: 1rem 0 1.5rem;
}

.qr-box {
  display: inline-block;
  background: #fff;
  padding: 0.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
}
.qr-box img {
  display: block;
  width: 160px;
  height: 160px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.qr-box--presenter img {
  width: 260px;
  height: 260px;
}

.notes {
  background: var(--brand-surface);
  border-left: 4px solid var(--accent);
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  color: var(--gray-700);
  font-size: 0.95rem;
}

.alert {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--alert);
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 800px) {
  .grid-2 {
    grid-template-columns: 1.4fr 1fr;
  }
}

.muted {
  color: var(--gray-500);
  font-size: 0.9rem;
}

.footer-note {
  margin-top: 2rem;
  text-align: center;
  color: var(--gray-500);
  font-size: 0.85rem;
}

.vote-total {
  text-align: center;
  font-size: 1.1rem;
  color: var(--gray-600);
  margin-bottom: 0.5rem;
}

/* Mobile header — reduce wrap so vote UI stays roomy */
@media (max-width: 560px) {
  .site-header .inner {
    flex-wrap: wrap;
    padding: 0.55rem 0.85rem;
    gap: 0.35rem 0.75rem;
  }

  .brand-mark {
    gap: 0.45rem;
    min-width: 0;
  }

  .brand-mark img {
    height: 28px;
  }

  .brand-mark .app-name {
    font-size: 0.8rem;
  }

  .header-meta {
    flex: 1 1 100%;
    text-align: left;
    font-size: 0.75rem;
  }

  .wrap {
    padding: 1rem 0.85rem 2rem;
  }
}
