/* ============================================
   BallotBox Marketing Site — Shared Styles
   ============================================ */

:root {
  --navy: #103b57;
  --navy-dark: #0a2538;
  --navy-light: #1d5a82;
  --accent: #ffb547;
  --accent-warm: #f57f6c;
  --teal: #2dd4bf;
  --bg: #f7f9fc;
  --bg-soft: #eef3f8;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-muted: #475569;
  --text-soft: #64748b;
  --success: #10b981;
  --danger: #ef4444;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 40px rgba(15, 23, 42, 0.12);
  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 18px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--navy-light);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--navy);
}

h1, h2, h3, h4 {
  margin: 0 0 0.5em;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--text);
}

h1 { font-size: clamp(2rem, 4.5vw, 3.5rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 700; }
p { margin: 0 0 1em; color: var(--text-muted); }

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---------- Navigation ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.5rem;
  max-width: 1180px;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--navy);
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  display: grid;
  place-items: center;
  color: white;
  font-size: 0.85rem;
  box-shadow: var(--shadow-sm);
}

.brand-mark-svg {
  width: 20px;
  height: 20px;
}

.nav-links {
  display: flex;
  gap: 0.25rem;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  display: inline-block;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  font-size: 0.93rem;
  font-weight: 500;
  color: var(--text-muted);
}

.nav-links a:hover {
  background: var(--bg-soft);
  color: var(--navy);
}

.nav-links a.active {
  background: var(--navy);
  color: white;
}

.nav-cta {
  background: var(--navy);
  color: white !important;
  padding: 0.5rem 1rem !important;
  border-radius: 8px;
  font-weight: 600 !important;
}

.nav-cta:hover {
  background: var(--navy-dark);
  color: white !important;
}

.nav-cta-secondary {
  background: white;
  color: var(--navy) !important;
  padding: 0.5rem 1rem !important;
  border-radius: 8px;
  font-weight: 600 !important;
  border: 1px solid var(--navy);
}

.nav-cta-secondary:hover {
  background: var(--navy);
  color: white !important;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--navy);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 5rem 0 4rem;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(45, 212, 191, 0.12), transparent 60%),
    radial-gradient(900px 500px at 0% 100%, rgba(255, 181, 71, 0.10), transparent 60%),
    var(--bg);
  overflow: hidden;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  background: rgba(16, 59, 87, 0.08);
  color: var(--navy);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 1.2rem;
}

.hero-eyebrow .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.18);
}

.hero h1 {
  max-width: 18ch;
  margin-bottom: 1rem;
}

.hero h1 .accent {
  background: linear-gradient(120deg, var(--navy-light) 0%, var(--teal) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p.lead {
  font-size: 1.15rem;
  max-width: 55ch;
  margin-bottom: 1.8rem;
  color: var(--text-muted);
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.4rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--navy);
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  background: var(--navy-dark);
  color: white;
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background: white;
  color: var(--navy);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-soft);
  color: var(--navy);
}

.btn-ghost {
  background: transparent;
  color: var(--navy);
  padding: 0.65rem 1rem;
}

.btn-ghost:hover {
  background: rgba(16, 59, 87, 0.08);
  color: var(--navy);
}

/* ---------- Sections ---------- */
section {
  padding: 4rem 0;
}

section.alt {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 3rem;
}

.section-head .tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--navy-light);
  margin-bottom: 0.6rem;
}

/* ---------- Cards / Grid ---------- */
.grid {
  display: grid;
  gap: 1.5rem;
}

.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(16, 59, 87, 0.2);
}

.card .icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(16, 59, 87, 0.08), rgba(45, 212, 191, 0.18));
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  margin-bottom: 0.9rem;
  color: var(--navy);
}

.card h3 {
  margin-bottom: 0.4rem;
}

.card p {
  margin: 0;
  font-size: 0.95rem;
}

/* ---------- Code block ---------- */
.code-block {
  position: relative;
  background: #0e1a2b;
  color: #e2e8f0;
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.65;
  overflow-x: auto;
  border: 1px solid #1c2a3f;
}

.code-block pre {
  margin: 0;
  white-space: pre;
}

.code-block .copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-size: 0.75rem;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: background 0.15s ease;
}

.code-block .copy-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: white;
}

.code-block .copy-btn.copied {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.token-key { color: #93c5fd; }
.token-str { color: #fcd34d; }
.token-cmt { color: #64748b; font-style: italic; }
.token-fn  { color: #34d399; }
.token-num { color: #f0abfc; }

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  gap: 0.3rem;
  background: var(--bg-soft);
  padding: 0.3rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  width: fit-content;
  max-width: 100%;
}

.tab-btn {
  background: transparent;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 7px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  font-family: inherit;
  transition: background 0.15s ease, color 0.15s ease;
}

.tab-btn.active {
  background: white;
  color: var(--navy);
  box-shadow: var(--shadow-sm);
}

.tab-panel {
  display: none;
  animation: fade 0.2s ease;
}

.tab-panel.active {
  display: block;
}

@keyframes fade {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Accordion ---------- */
.accordion {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--surface);
}

.acc-item {
  border-bottom: 1px solid var(--border);
}

.acc-item:last-child {
  border-bottom: none;
}

.acc-header {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 1.1rem 1.3rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: inherit;
}

.acc-header:hover {
  background: var(--bg-soft);
}

.acc-icon {
  transition: transform 0.2s ease;
  color: var(--navy-light);
}

.acc-item.open .acc-icon {
  transform: rotate(45deg);
}

.acc-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.acc-item.open .acc-body {
  max-height: 1000px;
  padding: 0 1.3rem 1.2rem;
}

.acc-body p {
  margin: 0;
}

/* ---------- Step list ---------- */
.steps {
  display: grid;
  gap: 1.5rem;
  counter-reset: step;
}

.step {
  display: flex;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
}

.step-num {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--navy);
  color: white;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.95rem;
}

.step h3 {
  margin: 0 0 0.3rem;
  font-size: 1.05rem;
}

.step p {
  margin: 0;
  font-size: 0.93rem;
}

/* ---------- Pill / badge ---------- */
.pill {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--bg-soft);
  color: var(--navy);
}

.pill.success {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
}

.pill.warn {
  background: rgba(245, 127, 108, 0.15);
  color: #b45341;
}

/* ---------- Two-column with code ---------- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.split.reverse > :first-child {
  order: 2;
}

/* ---------- Pricing ---------- */
.pricing-toggle {
  display: inline-flex;
  background: var(--bg-soft);
  padding: 0.25rem;
  border-radius: 10px;
  gap: 0.25rem;
  margin: 0 auto 2.5rem;
}

.pricing-toggle button {
  background: transparent;
  border: none;
  padding: 0.55rem 1.2rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-muted);
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
}

.pricing-toggle button.active {
  background: white;
  color: var(--navy);
  box-shadow: var(--shadow-sm);
}

.pricing-toggle .save-pill {
  font-size: 0.7rem;
  color: var(--success);
  margin-left: 0.3rem;
  font-weight: 700;
}

.price-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 1.7rem;
  display: flex;
  flex-direction: column;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.price-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.price-card.featured {
  border-color: var(--navy);
  border-width: 2px;
  transform: scale(1.02);
  box-shadow: var(--shadow-md);
}

.price-card.featured:hover {
  transform: scale(1.02) translateY(-3px);
}

.price-card .ribbon {
  position: absolute;
  top: -12px;
  right: 20px;
  background: var(--navy);
  color: white;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.price-card .tier {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--navy-light);
  margin-bottom: 0.5rem;
}

.price-card .price {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

.price-card .price small {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-soft);
}

.price-card .tier-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  min-height: 2.6em;
  margin: 0.8rem 0 1.4rem;
}

.price-card ul {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  flex: 1;
}

.price-card li {
  padding: 0.45rem 0;
  font-size: 0.92rem;
  color: var(--text);
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
}

.price-card li::before {
  content: "✓";
  color: var(--success);
  font-weight: 700;
  flex-shrink: 0;
}

.price-card li.muted {
  color: var(--text-soft);
}

.price-card li.muted::before {
  content: "—";
  color: var(--text-soft);
}

/* ---------- Feature table ---------- */
.feature-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  font-size: 0.92rem;
}

.feature-table th,
.feature-table td {
  padding: 0.85rem 1rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.feature-table th {
  background: var(--bg-soft);
  font-weight: 700;
  color: var(--navy);
}

.feature-table td:first-child,
.feature-table th:first-child {
  text-align: left;
  font-weight: 600;
}

.feature-table tr:last-child td {
  border-bottom: none;
}

.feature-table .check { color: var(--success); font-weight: 700; }
.feature-table .dash { color: var(--text-soft); }

/* ---------- Interactive Poll Demo ---------- */
.poll-demo {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem;
  box-shadow: var(--shadow-md);
}

.poll-demo-head {
  font-size: 0.82rem;
  color: var(--text-soft);
  margin-bottom: 0.4rem;
  display: flex;
  justify-content: space-between;
}

.poll-demo h4 {
  font-size: 1.15rem;
  margin: 0 0 1rem;
  color: var(--text);
}

.option {
  display: flex;
  align-items: center;
  padding: 0.8rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  margin-bottom: 0.55rem;
  cursor: pointer;
  font-size: 0.95rem;
  transition: border-color 0.15s ease, background 0.15s ease;
  user-select: none;
}

.option:hover {
  border-color: var(--navy-light);
  background: var(--bg-soft);
}

.option.selected {
  border-color: var(--navy);
  background: rgba(16, 59, 87, 0.05);
  color: var(--navy);
  font-weight: 600;
}

.option .check-mark {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border);
  border-radius: 50%;
  margin-right: 0.7rem;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.option.selected .check-mark {
  border-color: var(--navy);
  background: var(--navy);
  color: white;
  font-size: 0.7rem;
}

.option.selected .check-mark::after {
  content: "✓";
}

.progress {
  height: 5px;
  background: var(--bg-soft);
  border-radius: 999px;
  overflow: hidden;
  margin: 0.5rem 0 1rem;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--navy), var(--teal));
  width: 33%;
  transition: width 0.3s ease;
}

/* ---------- Stats ---------- */
.stat {
  text-align: center;
  padding: 1.2rem;
}

.stat .num {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--navy);
  line-height: 1;
}

.stat .label {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-top: 0.4rem;
}

/* ---------- Footer ---------- */
footer {
  background: var(--navy-dark);
  color: #cbd5e1;
  padding: 3rem 0 2rem;
  margin-top: 4rem;
}

footer .container {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

footer h4 {
  color: white;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.8rem;
}

footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

footer li {
  padding: 0.25rem 0;
}

footer a {
  color: #cbd5e1;
  font-size: 0.92rem;
}

footer a:hover {
  color: white;
}

footer .brand-mark {
  background: linear-gradient(135deg, var(--teal), var(--navy-light));
}

footer .brand {
  color: white;
}

footer .footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.4rem;
  text-align: center;
  font-size: 0.85rem;
  color: #94a3b8;
}

/* ---------- Question type switcher ---------- */
.qtype-switcher {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.qtype-btn {
  background: white;
  border: 1.5px solid var(--border);
  padding: 0.55rem 1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}

.qtype-btn.active {
  background: var(--navy);
  color: white;
  border-color: var(--navy);
}

.qtype-btn:hover:not(.active) {
  border-color: var(--navy-light);
  color: var(--navy);
}

/* ---------- CTA banner ---------- */
.cta-banner {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  border-radius: var(--radius-lg);
  padding: 3rem 2.5rem;
  color: white;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-banner::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255, 181, 71, 0.18) 0%, transparent 60%);
  pointer-events: none;
}

.cta-banner h2 {
  color: white;
  margin-bottom: 0.6rem;
}

.cta-banner p {
  color: rgba(255, 255, 255, 0.85);
  max-width: 50ch;
  margin: 0 auto 1.5rem;
}

.cta-banner .btn-primary {
  background: white;
  color: var(--navy);
}

.cta-banner .btn-primary:hover {
  background: var(--accent);
  color: var(--navy-dark);
}

/* ---------- Animation utilities ---------- */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Anonymity flow diagram ---------- */
.flow {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.flow-step {
  padding: 1.4rem 1rem;
  text-align: center;
  border-right: 1px solid var(--border);
  position: relative;
}

.flow-step:last-child {
  border-right: none;
}

.flow-step .ring {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-soft);
  display: grid;
  place-items: center;
  margin: 0 auto 0.6rem;
  font-size: 1.3rem;
  color: var(--navy);
}

.flow-step h4 {
  font-size: 0.95rem;
  margin: 0 0 0.3rem;
}

.flow-step p {
  font-size: 0.82rem;
  margin: 0;
}

/* ---------- Voting flow widget ---------- */
.voting-flow {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.8rem;
  box-shadow: var(--shadow-md);
  max-width: 600px;
  margin: 0 auto;
}

.voting-flow .flow-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-soft);
  margin-bottom: 0.4rem;
}

.voting-flow h4 {
  font-size: 1.2rem;
  margin: 0.9rem 0 1rem;
}

.voting-flow .flow-controls {
  display: flex;
  gap: 0.6rem;
  margin-top: 1.4rem;
  justify-content: space-between;
}

.token-state-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
  margin: 0.9rem 0 1rem;
}

.token-state-panel > div {
  padding: 0.65rem 0.75rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.mini-label {
  display: block;
  color: var(--text-soft);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.status-text {
  color: var(--text-muted);
  text-transform: capitalize;
}

.status-text.in_progress {
  color: #b86b07;
}

.status-text.used {
  color: #047857;
}

.flow-help {
  margin: -0.25rem 0 0.75rem;
  color: var(--text-soft);
  font-size: 0.82rem;
}

.rank-select-grid,
.ranking-preview {
  display: grid;
  gap: 0.75rem;
}

.rank-select-grid label,
.ranking-preview label {
  display: grid;
  gap: 0.3rem;
}

.rank-select-grid label span,
.ranking-preview label span {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.flow-done {
  text-align: center;
  padding: 1.4rem 0.5rem 0.5rem;
}

.flow-done .check-icon {
  width: 64px;
  height: 64px;
  background: var(--success);
  color: white;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 2rem;
  font-weight: 700;
  margin: 0 auto 1rem;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

/* ---------- Anonymity simulator ---------- */
.anon-sim {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem;
  margin-top: 1.6rem;
}

.anon-buckets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.bucket {
  background: var(--bg-soft);
  border-radius: 10px;
  padding: 1rem;
  min-height: 240px;
  border: 1px dashed var(--border);
}

.bucket-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--navy);
  margin-bottom: 0.7rem;
  text-align: center;
}

.bucket-items {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.token-chip {
  background: white;
  padding: 0.5rem 0.7rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.token-chip .status {
  font-size: 0.66rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-family: var(--font-sans);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.token-chip .status.unused { background: var(--bg-soft); color: var(--text-soft); }
.token-chip .status.in_progress { background: rgba(255, 181, 71, 0.22); color: #b86b07; }
.token-chip .status.used { background: rgba(16, 185, 129, 0.18); color: #047857; }

.ballot-chip {
  background: white;
  padding: 0.6rem 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-size: 0.78rem;
}

.ballot-chip .label {
  font-weight: 700;
  color: var(--navy);
  font-size: 0.85rem;
}

.ballot-chip .meta {
  font-size: 0.7rem;
  color: var(--text-soft);
  margin-top: 2px;
}

/* ---------- Voter cards / token generator ---------- */
.voter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 0.9rem;
  margin-top: 1rem;
}

.voter-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 0.8rem;
  text-align: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.voter-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.voter-card .qr-img {
  width: 110px;
  height: 110px;
  margin: 0 auto 0.6rem;
  background: white;
  border: 1px solid var(--border);
  padding: 5px;
  border-radius: 6px;
}

.voter-card .qr-img svg {
  width: 100%;
  height: 100%;
  display: block;
}

.voter-card .qr-img img {
  width: 100%;
  height: 100%;
  display: block;
}

.voter-card .label {
  font-size: 0.7rem;
  color: var(--text-soft);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.voter-card .code {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--navy);
  background: var(--bg-soft);
  padding: 0.25rem 0.55rem;
  border-radius: 4px;
  display: inline-block;
  margin-top: 0.4rem;
}

.voter-card .vote-url {
  margin-top: 0.45rem;
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  overflow-wrap: anywhere;
}

.recipient-list {
  display: grid;
  gap: 0.25rem;
  margin-top: 0.55rem;
}

.recipient-list span {
  padding: 0.18rem 0.35rem;
  color: var(--text-muted);
  background: var(--bg-soft);
  border-radius: 4px;
  font-size: 0.68rem;
  overflow-wrap: anywhere;
}

.print-letter-demo {
  grid-column: 1 / -1;
  padding: 1rem;
  color: var(--text-muted);
  background: white;
  border: 1px dashed var(--border);
  border-radius: 10px;
}

.print-letter-demo strong {
  display: block;
  color: var(--navy);
  margin-bottom: 0.25rem;
}

.print-letter-demo p {
  margin: 0;
  font-size: 0.9rem;
}

.demo-api-warning,
.demo-poll-toolbar {
  grid-column: 1 / -1;
  padding: 1rem;
  background: white;
  border: 1px dashed var(--border);
  border-radius: 10px;
  color: var(--text-muted);
}

.demo-poll-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  border-style: solid;
}

.demo-poll-toolbar strong {
  color: var(--navy);
}

.demo-poll-toolbar p {
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
}

.demo-poll-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ---------- Guided embedded app walkthrough ---------- */
.guided-system {
  display: grid;
  grid-template-columns: minmax(280px, 0.38fr) minmax(0, 1fr);
  gap: 1.2rem;
  align-items: start;
}

.guide-panel,
.guided-embed {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.guide-panel {
  position: sticky;
  top: 86px;
  display: grid;
  gap: 1rem;
  padding: 1.1rem;
}

.guide-progress {
  display: grid;
  gap: 0.45rem;
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.guide-progress div {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--bg-soft);
}

.guide-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--navy), var(--teal));
  transition: width 0.2s ease;
}

.guide-card {
  position: relative;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}

.guide-arrow {
  position: absolute;
  top: 28px;
  right: -42px;
  width: 58px;
  height: 2px;
  background: var(--accent-warm);
  z-index: 2;
}

.guide-arrow::after {
  content: "";
  position: absolute;
  top: -6px;
  right: -1px;
  border-left: 12px solid var(--accent-warm);
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
}

.guide-eyebrow {
  margin: 0 0 0.4rem;
  color: var(--navy-light);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.guide-card h3 {
  margin-bottom: 0.45rem;
}

.guide-card p {
  margin-bottom: 0.75rem;
  font-size: 0.92rem;
}

.guide-card ul {
  display: grid;
  gap: 0.4rem;
  margin: 0;
  padding-left: 1.1rem;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.guide-actions,
.guide-tools,
.guided-embed-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.guide-actions .btn,
.guide-tools .btn,
.guided-embed-actions .btn {
  padding: 0.55rem 0.75rem;
  font-size: 0.82rem;
}

.guide-status {
  padding: 0.8rem;
  border-radius: 8px;
  background: var(--bg-soft);
  color: var(--text-muted);
  font-size: 0.86rem;
}

.guided-embed {
  overflow: hidden;
}

.guided-embed-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
}

.guided-embed-head strong {
  display: block;
  color: var(--navy);
}

.guided-embed-head span {
  color: var(--text-soft);
  font-size: 0.78rem;
}

.guided-frame-wrap {
  position: relative;
}

.guide-frame-arrow {
  position: absolute;
  top: 1rem;
  left: 1rem;
  width: 0;
  height: 0;
  border-left: 13px solid transparent;
  border-right: 13px solid transparent;
  border-top: 18px solid var(--accent-warm);
  filter: drop-shadow(0 2px 2px rgba(15, 23, 42, 0.18));
  z-index: 2;
}

.guided-frame-wrap iframe {
  display: block;
  width: 100%;
  height: min(860px, 82vh);
  border: 0;
  background: white;
}

/* ---------- Live trial editor ---------- */
.trial-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
  gap: 1.4rem;
  align-items: start;
}

.trial-editor,
.trial-output {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.3rem;
  box-shadow: var(--shadow-sm);
}

.trial-output {
  position: sticky;
  top: 86px;
}

.trial-editor {
  display: grid;
  gap: 1rem;
}

.trial-editor-head,
.trial-subhead,
.trial-item-title,
.trial-live-head,
.trial-token-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.trial-editor-head h3,
.trial-live-head h3 {
  margin-bottom: 0.25rem;
}

.trial-editor-head p,
.trial-live-head p {
  margin: 0;
  font-size: 0.9rem;
}

.trial-field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr minmax(120px, 0.45fr);
  gap: 0.8rem;
}

.trial-item-stack {
  display: grid;
  gap: 0.85rem;
}

.trial-item {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}

.trial-item-title {
  align-items: center;
}

.trial-item-title .btn {
  padding: 0.35rem 0.55rem;
  font-size: 0.8rem;
}

.trial-check {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  padding: 0.8rem;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: var(--bg-soft);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.trial-check input {
  margin-top: 0.25rem;
}

.trial-empty {
  display: grid;
  place-items: start;
  min-height: 220px;
  align-content: center;
  gap: 0.35rem;
  padding: 1rem;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: var(--bg-soft);
}

.trial-empty h3,
.trial-empty p {
  margin: 0;
}

.trial-empty.error {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.07);
}

.trial-actions,
.trial-export-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.trial-actions .btn,
.trial-export-row .btn {
  padding: 0.6rem 0.8rem;
  font-size: 0.84rem;
}

.trial-disabled-export {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 700;
}

.trial-note {
  margin-top: 1rem;
  padding: 0.8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-soft);
}

.trial-note strong {
  color: var(--navy);
  display: block;
  margin-bottom: 0.25rem;
}

.trial-note p {
  margin: 0;
  font-size: 0.88rem;
}

.trial-token-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.trial-token-card {
  display: grid;
  gap: 0.45rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  padding: 0.8rem;
  min-width: 0;
}

.trial-token-card img {
  width: 116px;
  height: 116px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px;
  background: white;
}

.trial-token-card code {
  color: var(--navy);
  background: var(--bg-soft);
  border-radius: 4px;
  padding: 0.2rem 0.35rem;
  font-size: 0.76rem;
  width: fit-content;
}

.trial-token-card a {
  font-size: 0.8rem;
  font-weight: 700;
}

.trial-token-card .btn {
  justify-content: center;
  padding: 0.5rem 0.65rem;
  font-size: 0.8rem;
}

.trial-limit-note {
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 600;
  margin-left: 0.35rem;
}

.trial-embed-shell {
  margin-top: 1rem;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: white;
}

.trial-embed-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0.8rem;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  color: var(--navy);
  font-size: 0.85rem;
}

.trial-embed-head span {
  color: var(--text-soft);
  font-size: 0.75rem;
}

.trial-embed-shell iframe {
  display: block;
  width: 100%;
  height: min(760px, 78vh);
  border: 0;
  background: white;
}

.trial-recipients {
  display: grid;
  gap: 0.25rem;
}

.trial-recipients span {
  padding: 0.18rem 0.35rem;
  color: var(--text-muted);
  background: var(--bg-soft);
  border-radius: 4px;
  font-size: 0.68rem;
  overflow-wrap: anywhere;
}

/* ---------- Live tally bar chart ---------- */
.tally-chart {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem;
}

.tally-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.7rem;
}

.tally-label {
  width: 130px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
}

.tally-bar-track {
  flex: 1;
  height: 28px;
  background: var(--bg-soft);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.tally-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--navy), var(--navy-light));
  width: 0%;
  transition: width 0.35s ease;
  border-radius: 6px;
}

.tally-count {
  width: 80px;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.locked-results {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-soft);
  border: 1px dashed var(--border);
  border-radius: 10px;
}

.locked-results p {
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
}

.results-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.results-toolbar p {
  margin: 0.25rem 0 0;
}

.results-toolbar p span {
  color: #5d73e8;
  font-size: 1.4rem;
  font-weight: 800;
}

.export-pills {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.export-pills span {
  padding: 0.35rem 0.6rem;
  color: var(--navy);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
}

.ranking-legend {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.65rem;
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.ranking-legend i {
  width: 13px;
  height: 13px;
  border-radius: 50%;
}

.ranking-table-demo {
  display: grid;
  grid-template-columns: 64px 180px minmax(220px, 1fr);
  align-items: center;
  gap: 1rem 0.75rem;
}

.ranking-header {
  color: var(--text);
  font-weight: 800;
}

.ranking-rank {
  text-align: center;
  color: var(--text);
}

.ranking-option {
  display: grid;
  color: var(--text);
  font-weight: 600;
}

.ranking-option small {
  color: var(--text-soft);
  font-weight: 500;
}

.ranking-bar-demo {
  display: flex;
  height: 24px;
  overflow: hidden;
  background: var(--bg-soft);
  border-radius: 5px;
}

.ranking-bar-demo span {
  border-right: 4px solid white;
}

.ranking-bar-demo span:last-child {
  border-right: none;
}

/* ---------- Live email preview ---------- */
.email-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 0.92rem;
  box-shadow: var(--shadow-sm);
}

.email-header {
  background: var(--bg-soft);
  padding: 0.9rem 1.2rem;
  border-bottom: 1px solid var(--border);
}

.email-header .row {
  display: flex;
  gap: 0.6rem;
  font-size: 0.85rem;
  margin-bottom: 0.2rem;
  align-items: baseline;
}

.email-header .row:last-child { margin-bottom: 0; }

.email-header .row .key {
  color: var(--text-soft);
  width: 64px;
  font-weight: 600;
  flex-shrink: 0;
}

.email-header .row .val {
  color: var(--text);
  word-break: break-all;
}

.email-body {
  padding: 1.2rem;
  white-space: pre-wrap;
  line-height: 1.6;
  font-size: 0.92rem;
  color: var(--text);
}

.email-body .link {
  color: var(--navy-light);
  text-decoration: underline;
  word-break: break-all;
}

/* ---------- Form inputs (reused) ---------- */
.text-input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.92rem;
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.15s ease;
}

.text-input:focus {
  outline: none;
  border-color: var(--navy);
}

.field-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  color: var(--text);
}

/* ---------- Stack pills (architecture grid) ---------- */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.8rem;
}

.stack-pill {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.9rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.stack-pill:hover {
  border-color: var(--navy-light);
  transform: translateY(-2px);
}

.stack-pill .name {
  font-weight: 700;
  color: var(--navy);
  font-size: 0.92rem;
}

.stack-pill .role {
  font-size: 0.78rem;
  color: var(--text-soft);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; gap: 2rem; }
  .split.reverse > :first-child { order: 0; }
  .flow { grid-template-columns: repeat(2, 1fr); }
  .flow-step:nth-child(2) { border-right: none; }
  .flow-step:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .anon-buckets { grid-template-columns: 1fr; }
  .bucket { min-height: 0; }
  .guided-system { grid-template-columns: 1fr; }
  .guide-panel { position: static; }
  .guide-arrow { display: none; }
  .trial-workspace { grid-template-columns: 1fr; }
  .trial-output { position: static; }
  .ranking-table-demo { grid-template-columns: 50px 1fr; }
  .ranking-table-demo .ranking-header:nth-child(3) { display: none; }
  .ranking-bar-demo { grid-column: 1 / -1; margin-bottom: 0.4rem; }
  footer .container { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: white;
    padding: 0.6rem;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
  .flow { grid-template-columns: 1fr; }
  .flow-step { border-right: none; border-bottom: 1px solid var(--border); }
  .flow-step:last-child { border-bottom: none; }
  .token-state-panel { grid-template-columns: 1fr; }
  .trial-field-grid,
  .trial-token-grid { grid-template-columns: 1fr; }
  .trial-editor-head,
  .trial-subhead,
  .guided-embed-head,
  .trial-live-head {
    flex-direction: column;
    align-items: stretch;
  }
  .locked-results,
  .results-toolbar,
  .demo-poll-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .demo-poll-actions { justify-content: flex-start; }
  footer .container { grid-template-columns: 1fr; }
  .hero { padding: 3rem 0 2.5rem; }
  section { padding: 3rem 0; }
}
