:root {
  --bg: #0f1115;
  --bg-dot: #1a1d24;
  --surface: #161922;
  --surface-hover: #1b1f2a;
  --border: #262a34;
  --border-hover: #3a4152;
  --text: #e8e9ec;
  --text-muted: #8b909c;
  --text-faint: #565b68;
  --accent: #7c9eff;
  --accent-dim: rgba(124, 158, 255, 0.14);
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 1px 1px, var(--bg-dot) 1px, transparent 0) 0 0 / 22px 22px,
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 46rem;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 3.5rem;
  display: flex;
  flex-direction: column;
}

/* nav */

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 3.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--accent);
}

.mark {
  flex-shrink: 0;
}

.mark-hub {
  fill: var(--text);
}

.wordmark {
  font-size: 1.15rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--text);
}

.nav-pill {
  font-size: 0.75rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  white-space: nowrap;
}

/* hero */

.hero {
  margin-bottom: 3.25rem;
}

.eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(1.9rem, 5vw, 2.75rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-weight: 650;
}

.hero-sub {
  margin: 0;
  max-width: 32rem;
  color: var(--text-muted);
  font-size: 1.02rem;
  line-height: 1.6;
}

/* grid */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.85rem;
  margin-bottom: 3rem;
}

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.25rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  transition: border-color 0.15s ease, background 0.15s ease;
  text-decoration: none;
  color: inherit;
}

.card:hover {
  border-color: var(--border-hover);
  background: var(--surface-hover);
}

.card-icon {
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: var(--accent-dim);
  color: var(--accent);
}

.card-icon svg {
  width: 1.15rem;
  height: 1.15rem;
}

.card--soon .card-icon {
  background: rgba(139, 144, 156, 0.12);
  color: var(--text-muted);
}

.card-body {
  flex-grow: 1;
}

.card h2 {
  margin: 0 0 0.3rem;
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.badge {
  align-self: flex-start;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  background: var(--accent-dim);
  color: var(--accent);
}

.card--soon .badge {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-faint);
}

/* footer */

.footer {
  color: var(--text-faint);
  font-size: 0.82rem;
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
}

.footer p {
  margin: 0;
}

.footer .footer-links {
  margin-top: 0.6rem;
}

.footer-links a {
  color: var(--text-faint);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--text);
}

@media (min-width: 40rem) {
  .page {
    padding-top: 3rem;
  }
}

/* shared page typography (used by every sub-app) */

.page--narrow {
  max-width: 30rem;
}

.page-title {
  margin: 0 0 0.4rem;
  font-size: clamp(1.5rem, 4vw, 2rem);
  letter-spacing: -0.015em;
  font-weight: 650;
}

.page-sub {
  margin: 0 0 1.75rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.page-hint {
  margin: -1.25rem 0 1.5rem;
  color: var(--text-faint);
  font-size: 0.85rem;
}

.alert {
  background: rgba(239, 120, 120, 0.1);
  border: 1px solid rgba(239, 120, 120, 0.35);
  color: #f0a3a3;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.88rem;
}

.alert ul,
.alert p {
  margin: 0;
  padding-left: 1.1rem;
}

/* nav links */

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.nav-link {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--text);
  border-color: var(--border-hover);
}

.nav-link--accent {
  color: var(--accent);
  border-color: rgba(124, 158, 255, 0.35);
  background: var(--accent-dim);
}

/* forms */

.poll-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.field-optional {
  font-weight: 400;
  color: var(--text-faint);
}

.field input[type="text"],
.field input[type="time"],
.field input[type="email"],
.field textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 0.6rem 0.75rem;
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
}

.checkbox-field input {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--accent);
}

.select-input {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 7px;
  padding: 0.45rem 0.6rem;
  cursor: pointer;
}

.select-input:focus {
  outline: none;
  border-color: var(--accent);
}

.hidden-inputs {
  display: none;
}

/* step-form building blocks (reusable by any multi-step creation form) */

.builder-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem 1.25rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.builder-card-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.builder-card-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 650;
}

.step-badge {
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.option-count {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-faint);
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 999px;
  padding: 0.3rem 0.4rem 0.3rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 500;
}

.chip button {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  line-height: 1;
}

.chip button:hover {
  background: rgba(124, 158, 255, 0.25);
}

/* buttons */

.btn {
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: 9px;
  padding: 0.55rem 1rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary {
  background: var(--accent);
  color: #0f1115;
}

.btn-primary:hover {
  filter: brightness(1.08);
}

.btn-secondary {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

.btn-secondary:hover {
  border-color: var(--border-hover);
}

.btn-ghost {
  background: none;
  border-color: var(--border);
  color: var(--text-muted);
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
}

.btn-danger {
  color: #f0a3a3;
}

.btn-danger:hover {
  border-color: #f0a3a3;
}

.btn-block {
  width: 100%;
}

.btn-sm {
  font-size: 0.8rem;
  padding: 0.4rem 0.75rem;
}

/* section / list / status-label building blocks (reusable by any sub-app) */

section {
  margin-bottom: 2rem;
}

.section-title {
  font-size: 1rem;
  font-weight: 650;
  margin: 0 0 0.75rem;
}

.section-title .muted {
  color: var(--text-faint);
  font-weight: 400;
}

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

.option-manage-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
}

.danger-zone {
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
  margin-top: 1rem;
}

.detail-label {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-radius: 4px;
  padding: 0.05rem 0.35rem;
  margin-right: 0.4rem;
}

.detail-label--yes {
  background: rgba(120, 210, 150, 0.16);
  color: #78d296;
}

/* share-link card (public link + QR, reusable by any sub-app) */

.link-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}

.link-card--warn {
  border-color: rgba(239, 190, 120, 0.4);
  background: rgba(239, 190, 120, 0.07);
}

.link-card-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.link-card-label svg {
  width: 0.95rem;
  height: 0.95rem;
  color: var(--accent);
}

.link-card-hint {
  margin: 0 0 0.6rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.qr-box {
  width: 9rem;
  height: 9rem;
  background: #fff;
  border-radius: 12px;
  padding: 0.55rem;
  margin: 0.9rem auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-box svg {
  display: block;
  width: 100%;
  height: 100%;
}

.link-row {
  display: flex;
  gap: 0.5rem;
}

.link-row input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  min-width: 0;
}

.owner-hint {
  margin: -0.5rem 0 1.25rem;
  color: var(--text-faint);
  font-size: 0.82rem;
  line-height: 1.5;
}

.owner-hint strong {
  color: var(--accent);
}

.admin-disclosure {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  margin-bottom: 1.5rem;
}

.admin-disclosure summary {
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.admin-disclosure summary svg {
  width: 0.9rem;
  height: 0.9rem;
  color: var(--accent);
}

.admin-disclosure[open] summary {
  margin-bottom: 0.7rem;
}

.admin-disclosure .link-card-hint {
  margin-top: 0.5rem;
}

/* 404 / error page */

.error-page {
  text-align: center;
  align-items: center;
  padding-top: 4rem;
}

.error-page .brand {
  margin-bottom: 2rem;
}

.error-page .eyebrow {
  margin-bottom: 0.5rem;
}

.error-actions {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
