:root {
  --bg: #f5f3ff;
  --card: #ffffff;
  --ink: #1f1737;
  --muted: #655b7a;
  --primary: #5b2ee5;
  --primary-dark: #441fc0;
  --border: #e5ddff;
  --danger-bg: #ffe8e8;
  --danger-text: #9d1c1c;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top left, #efe8ff 0, var(--bg) 42%, #f8fbff 100%);
  min-height: 100vh;
}

a { color: inherit; }
.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.hero-card {
  width: min(720px, 100%);
  background: rgba(255,255,255,0.9);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: clamp(28px, 6vw, 56px);
  box-shadow: 0 24px 70px rgba(67, 40, 130, 0.15);
  text-align: center;
}
.brand-badge {
  display: inline-grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: var(--primary);
  color: white;
  font-weight: 900;
  font-size: 24px;
  margin-bottom: 18px;
}
h1 {
  font-size: clamp(32px, 6vw, 58px);
  line-height: 1.02;
  margin: 0 0 18px;
}
.lead {
  font-size: 19px;
  color: var(--muted);
  margin: 0 auto 30px;
  max-width: 580px;
}
.google-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 22px;
  border: 1px solid #dadce0;
  border-radius: 12px;
  background: #fff;
  text-decoration: none;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(30, 20, 70, 0.08);
}
.google-btn:hover { transform: translateY(-1px); }
.google-icon {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-weight: 900;
}
.tiny-note {
  color: var(--muted);
  font-size: 14px;
  margin-top: 24px;
}
.alert {
  background: var(--danger-bg);
  color: var(--danger-text);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 0 auto 20px;
  max-width: 520px;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  background: white;
  border-bottom: 1px solid var(--border);
}
.logo { font-weight: 900; font-size: 22px; }
.topbar nav { display: flex; gap: 18px; }
.topbar nav a { text-decoration: none; font-weight: 700; color: var(--muted); }
.dashboard {
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px 20px;
}
.welcome-card, .action-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: 0 12px 30px rgba(67, 40, 130, 0.08);
}
.welcome-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 24px;
  margin-bottom: 24px;
}
.welcome-card h1 { font-size: clamp(28px, 4vw, 42px); margin-bottom: 6px; }
.welcome-card p { margin: 0; color: var(--muted); }
.avatar {
  width: 70px;
  height: 70px;
  border-radius: 20px;
  object-fit: cover;
}
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.action-card { padding: 24px; }
.action-card h2 { margin: 0 0 10px; }
.action-card p { color: var(--muted); min-height: 96px; }
button {
  border: 0;
  background: var(--primary);
  color: white;
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 800;
}
button:disabled { opacity: .5; cursor: not-allowed; }
@media (max-width: 800px) {
  .grid { grid-template-columns: 1fr; }
  .topbar { padding: 14px 18px; }
}


/* CREATE POLL module */
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  background: var(--primary);
  color: white;
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}
.button-link.secondary {
  background: #f0ebff;
  color: var(--primary-dark);
  border: 1px solid var(--border);
}
.button-link.small {
  padding: 8px 12px;
  font-size: 14px;
}
.highlight-card {
  background: linear-gradient(135deg, #ffffff 0%, #f4efff 100%);
}
.lower-grid { margin-top: 18px; }
.home-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}
.page-wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 22px;
}
.page-head h1 {
  margin: 0 0 8px;
  font-size: clamp(34px, 5vw, 56px);
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 12px;
  font-weight: 900;
  color: var(--primary);
  margin: 0 0 8px;
}
.lead-left {
  color: var(--muted);
  font-size: 18px;
  margin: 0;
  max-width: 680px;
}
.form-card, .list-card, .empty-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 12px 30px rgba(67, 40, 130, 0.08);
}
.form-card label {
  display: block;
  font-weight: 800;
  margin-bottom: 18px;
}
input, textarea {
  width: 100%;
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 13px 14px;
  font: inherit;
  color: var(--ink);
  background: #fff;
}
textarea { resize: vertical; }
.options-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin: 6px 0 14px;
}
.options-head h2 {
  margin: 0;
  font-size: 22px;
}
.options-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
}
.form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 22px;
}
.wide-alert { margin-bottom: 18px; max-width: none; }
.success {
  background: #e9fff3;
  color: #0b6b3a;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 18px;
}
.poll-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}
.poll-row:last-child { border-bottom: 0; }
.poll-row h2 { margin: 0 0 8px; }
.poll-row p { margin: 0 0 10px; color: var(--muted); }
.row-actions { display: flex; align-items: center; }
.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  background: #f0ebff;
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 800;
  margin-right: 6px;
}
.live-layout {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 20px 60px;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 18px;
}
.host-panel, .qr-panel, .results-panel {
  background: white;
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 12px 30px rgba(67, 40, 130, 0.08);
  padding: 24px;
}
.results-panel { grid-column: 1 / -1; }
.host-panel h1 { margin: 0 0 10px; }
.live-question {
  font-size: 22px;
  color: var(--muted);
  margin: 0 0 22px;
}
.pin-box {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  background: #1f1737;
  color: white;
  border-radius: 22px;
  padding: 20px 30px;
  margin-bottom: 18px;
}
.pin-box span {
  font-weight: 800;
  opacity: .8;
}
.pin-box strong {
  font-size: clamp(42px, 8vw, 76px);
  letter-spacing: .08em;
  line-height: 1;
}
.join-link-box {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 18px;
}
.join-link-box p {
  grid-column: 1 / -1;
  margin: 0;
  font-weight: 800;
  color: var(--muted);
}
.qr-panel { text-align: center; }
.qr-panel h2 { margin-top: 0; }
.qr-img {
  width: 240px;
  max-width: 100%;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: white;
}
.danger-button {
  background: #e53935;
}
.results-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}
.results-head h2 { margin: 0; }
.results-bars {
  display: grid;
  gap: 14px;
}
.result-item {
  background: #faf8ff;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px;
}
.result-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.result-label span {
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}
.bar-track {
  height: 18px;
  background: #ebe5ff;
  border-radius: 999px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #5b2ee5, #9b7cff);
  transition: width .35s ease;
}
.join-card { max-width: 620px; }
.join-form {
  display: grid;
  gap: 12px;
  max-width: 420px;
  margin: 0 auto;
}
.poll-preview {
  text-align: left;
  background: #faf8ff;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 18px;
}
.poll-preview h2 { margin: 0 0 8px; }
.poll-preview p { margin: 0; color: var(--muted); }
.vote-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.vote-card {
  width: min(860px, 100%);
  background: white;
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: clamp(24px, 5vw, 44px);
  box-shadow: 0 24px 70px rgba(67, 40, 130, 0.15);
}
.vote-card h1 {
  margin: 0 0 24px;
  font-size: clamp(30px, 5vw, 52px);
}
.vote-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.vote-option {
  min-height: 110px;
  font-size: 22px;
  border-radius: 22px;
  text-align: left;
  padding: 20px;
  background: linear-gradient(135deg, #5b2ee5, #7d56ff);
}
.results-vote-card .results-head { margin-top: 8px; }
.empty-card {
  text-align: center;
  padding: 44px 24px;
}
.empty-card p { color: var(--muted); }

@media (max-width: 800px) {
  .page-head, .poll-row, .results-head { flex-direction: column; align-items: stretch; }
  .options-list, .vote-options { grid-template-columns: 1fr; }
  .live-layout { grid-template-columns: 1fr; }
  .join-link-box { grid-template-columns: 1fr; }
  .topbar nav { flex-wrap: wrap; justify-content: flex-end; }
}
