:root {
  --bg: #0f1535;
  --bg-soft: #1a234e;
  --panel: rgba(22, 32, 74, 0.9);
  --panel-strong: rgba(26, 35, 78, 0.98);
  --ink: #ffffff;
  --muted: #cadcfc;
  --line: rgba(202, 220, 252, 0.16);
  --accent: #028090;
  --accent-dark: #026974;
  --accent-soft: rgba(2, 128, 144, 0.18);
  --good: #58d9a1;
  --bad: #ff9c8c;
  --pending: #ffd166;
  --shadow: 0 24px 70px rgba(4, 8, 24, 0.42);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Avenir Next", "Trebuchet MS", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top right, rgba(2, 128, 144, 0.22), transparent 24%),
    radial-gradient(circle at bottom left, rgba(2, 128, 144, 0.14), transparent 22%),
    linear-gradient(180deg, #0f1535 0%, #12193d 56%, #0b1230 100%);
}

button,
input {
  font: inherit;
}

.shell {
  width: min(1080px, calc(100% - 28px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

.hero,
.panel,
.stats article,
.question,
.empty {
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero,
.panel,
.stats article,
.question,
.empty {
  background: var(--panel);
  backdrop-filter: blur(10px);
}

.hero,
.panel,
.empty {
  border-radius: 28px;
}

.hero {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 18px;
  padding: 30px;
}

.hero::after {
  content: "";
  position: absolute;
  right: -50px;
  bottom: -50px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(2, 128, 144, 0.24), transparent 68%);
  pointer-events: none;
}

.panel {
  margin-top: 24px;
  padding: 24px;
}

#auth-panel {
  max-width: 660px;
  margin-left: auto;
  margin-right: auto;
}

.eyebrow,
.hero-tags span,
.badge {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  font-weight: 700;
}

.hero h1,
.panel-intro h2,
.dashboard h2,
.empty h3 {
  font-family: Georgia, "Times New Roman", serif;
}

.hero h1 {
  margin: 10px 0 12px;
  font-size: clamp(2.5rem, 5vw, 4.8rem);
  line-height: 0.96;
}

.panel-intro h2,
.dashboard h2 {
  margin: 8px 0 10px;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
}

.hero p,
.panel-intro p,
.dashboard p,
.empty p,
.question p {
  margin: 0;
  line-height: 1.55;
  color: var(--muted);
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-tags span,
.badge,
.switch,
.primary,
.ghost,
.answer,
.status {
  border-radius: 999px;
}

.hero-tags span {
  padding: 10px 14px;
  background: var(--accent-soft);
  color: #e6ffff;
}

.panel-intro {
  margin-bottom: 22px;
}

.switches {
  display: inline-flex;
  gap: 0;
  padding: 5px;
  border-radius: 999px;
  background: rgba(202, 220, 252, 0.1);
}

.switch,
.primary,
.ghost,
.answer {
  border: 0;
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease, color 140ms ease, opacity 140ms ease;
}

.switch {
  min-width: 124px;
  padding: 12px 16px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.switch.is-active {
  background: #ffffff;
  color: var(--bg);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
}

.switch:hover,
.primary:hover,
.ghost:hover,
.answer:hover {
  transform: translateY(-1px);
}

.form {
  margin-top: 22px;
  display: grid;
  gap: 16px;
}

.form label {
  display: grid;
  gap: 8px;
}

.form span {
  font-weight: 700;
}

.form input {
  width: 100%;
  padding: 15px 16px;
  border-radius: 18px;
  border: 1px solid rgba(202, 220, 252, 0.22);
  background: rgba(255, 255, 255, 0.98);
  color: #0f1535;
}

.form input:focus {
  outline: 2px solid rgba(2, 128, 144, 0.28);
  border-color: rgba(2, 128, 144, 0.46);
}

.primary,
.ghost {
  padding: 14px 18px;
  font-weight: 700;
}

.primary {
  background: var(--accent);
  color: #f2ffff;
}

.primary:hover {
  background: var(--accent-dark);
}

.ghost {
  background: rgba(202, 220, 252, 0.12);
  color: var(--ink);
}

.status {
  margin-top: 18px;
  padding: 13px 16px;
  background: rgba(202, 220, 252, 0.1);
}

.status.error {
  background: rgba(255, 156, 140, 0.14);
  color: var(--bad);
}

.status.success {
  background: rgba(88, 217, 161, 0.14);
  color: var(--good);
}

.dashboard-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.userbox {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  min-width: 220px;
  border-radius: 22px;
  background: rgba(202, 220, 252, 0.08);
}

.userbox span {
  color: var(--muted);
}

.stats {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.stats article {
  border-radius: 22px;
  padding: 18px;
  background: var(--panel-strong);
}

.stats span {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
}

.stats strong {
  display: block;
  margin-top: 10px;
  font-size: 2rem;
  line-height: 1;
}

.questions {
  margin-top: 22px;
}

.admin-panel {
  margin-top: 24px;
}

.admin-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-questions {
  margin-top: 22px;
  display: grid;
  gap: 14px;
}

.admin-overview-panel {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(88, 217, 161, 0.12), transparent 30%),
    rgba(202, 220, 252, 0.06);
  box-shadow: var(--shadow);
}

.admin-overview-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.admin-overview-head h3 {
  margin: 8px 0 6px;
  font-size: 1.35rem;
}

.admin-overview-head p {
  margin: 0;
  color: var(--muted);
}

.admin-overview-meter {
  margin-top: 18px;
  height: 16px;
  border-radius: 999px;
  overflow: hidden;
  display: flex;
  background: rgba(202, 220, 252, 0.08);
}

.admin-overview-meter span {
  display: block;
  height: 100%;
}

.admin-overview-meter .is-good {
  background: linear-gradient(90deg, #58d9a1 0%, #8ef0c2 100%);
}

.admin-overview-meter .is-bad {
  background: linear-gradient(90deg, #ff9c8c 0%, #ffb5aa 100%);
}

.admin-overview-meter .is-pending {
  background: linear-gradient(90deg, #ffd166 0%, #ffb347 100%);
}

.admin-overview-legend {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.admin-overview-legend article {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(202, 220, 252, 0.08);
}

.admin-overview-legend span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.admin-overview-legend strong {
  display: block;
  margin-top: 8px;
  font-size: 1.4rem;
}

.admin-question-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 20px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}

.admin-question-card h3 {
  margin: 0;
  font-size: 1.15rem;
}

.admin-question-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.admin-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.admin-meter-group {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.admin-meter-block {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(202, 220, 252, 0.08);
}

.admin-meter-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.admin-meter-label span {
  color: var(--muted);
  font-size: 0.82rem;
}

.admin-meter-label strong {
  font-size: 1rem;
}

.admin-meter {
  margin-top: 12px;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(202, 220, 252, 0.08);
}

.admin-meter.is-split {
  display: flex;
}

.admin-meter span {
  display: block;
  height: 100%;
}

.admin-meter .is-accent {
  background: linear-gradient(90deg, #72e2ed 0%, #028090 100%);
}

.admin-meter .is-good {
  background: linear-gradient(90deg, #58d9a1 0%, #8ef0c2 100%);
}

.admin-meter .is-bad {
  background: linear-gradient(90deg, #ff9c8c 0%, #ffb5aa 100%);
}

.admin-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.admin-grid article {
  padding: 14px;
  border-radius: 18px;
  background: rgba(202, 220, 252, 0.08);
}

.admin-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
}

.admin-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 1.2rem;
}

.distribution-card {
  margin-top: 16px;
  padding: 18px;
  border-radius: 20px;
  background: rgba(202, 220, 252, 0.06);
}

.distribution-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.distribution-head span {
  color: var(--muted);
  font-size: 0.9rem;
}

.distribution-list {
  display: grid;
  gap: 12px;
}

.distribution-row {
  display: grid;
  grid-template-columns: minmax(0, 160px) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.distribution-label {
  display: grid;
  gap: 4px;
}

.distribution-label strong {
  font-size: 0.95rem;
}

.distribution-label span {
  color: var(--muted);
  font-size: 0.8rem;
}

.distribution-bar {
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(202, 220, 252, 0.08);
}

.distribution-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.distribution-bar .is-option-a {
  background: linear-gradient(90deg, #72e2ed 0%, #028090 100%);
}

.distribution-bar .is-option-b {
  background: linear-gradient(90deg, #58d9a1 0%, #7fe7b0 100%);
}

.distribution-bar .is-option-c {
  background: linear-gradient(90deg, #ffd166 0%, #ffb347 100%);
}

.distribution-value {
  min-width: 48px;
  text-align: right;
  font-size: 0.95rem;
}

.question {
  border-radius: 24px;
  padding: 20px;
  background: var(--panel-strong);
}

.question-flow {
  display: grid;
  gap: 16px;
}

.question-journey {
  display: grid;
  gap: 14px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(202, 220, 252, 0.06);
}

.question-journey h3 {
  margin: 8px 0 6px;
  font-size: 1.2rem;
}

.question-journey p {
  margin: 0;
  color: var(--muted);
}

.journey-meter {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(202, 220, 252, 0.08);
}

.journey-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #58d9a1 0%, #72e2ed 100%);
}

.question-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.completion-card {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 20px 22px;
  border: 1px solid rgba(88, 217, 161, 0.18);
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(88, 217, 161, 0.12), transparent 32%),
    rgba(88, 217, 161, 0.08);
}

.completion-card h3 {
  margin: 8px 0 6px;
  font-size: 1.25rem;
}

.completion-card p {
  margin: 0;
  color: var(--muted);
}

.completion-chip {
  display: inline-flex;
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(88, 217, 161, 0.24);
  background: rgba(255, 255, 255, 0.12);
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 600;
  line-height: 1.35;
}

.completion-pill {
  min-width: 84px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.12);
  text-align: center;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--good);
}

.question-pill {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(202, 220, 252, 0.18);
  border-radius: 14px;
  background: rgba(202, 220, 252, 0.08);
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease, color 140ms ease, border-color 140ms ease;
}

.question-pill:hover {
  transform: translateY(-1px);
}

.question-pill.is-active {
  background: #ffffff;
  color: var(--bg);
  border-color: transparent;
}

.question-pill.is-answered {
  background: rgba(88, 217, 161, 0.14);
  color: var(--good);
  border-color: rgba(88, 217, 161, 0.2);
}

.question-pill.is-active.is-answered {
  background: linear-gradient(135deg, #ffffff 0%, #dffcf3 100%);
  color: #0c1839;
}

.question-spotlight {
  padding: 28px;
}

.question-lead {
  max-width: 56ch;
  font-size: 1.02rem;
}

.question-prompt {
  margin-top: 16px;
  max-width: 34ch;
  font-size: clamp(1.3rem, 2.4vw, 2rem);
  line-height: 1.15;
  color: var(--ink);
  font-weight: 700;
}

.answer-grid {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.answer-card {
  min-width: 0;
  min-height: 140px;
  padding: 22px 18px;
  display: grid;
  gap: 10px;
  align-content: space-between;
  justify-items: start;
  border: 1px solid rgba(202, 220, 252, 0.14);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(202, 220, 252, 0.1) 0%, rgba(202, 220, 252, 0.04) 100%);
  text-align: left;
}

.answer-card strong {
  font-size: 2.2rem;
  line-height: 1;
}

.answer-card span {
  color: var(--muted);
  font-weight: 600;
  line-height: 1.35;
}

.answer-card.is-selected {
  border-color: rgba(88, 217, 161, 0.34);
  background: linear-gradient(180deg, rgba(88, 217, 161, 0.18) 0%, rgba(88, 217, 161, 0.08) 100%);
}

.question-footer {
  margin-top: 18px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.question-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.question-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.question h3 {
  margin: 0;
  font-size: 1.25rem;
}

.question p {
  margin-top: 10px;
}

.answers,
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.answers {
  margin-top: 18px;
}

.answer {
  min-width: 72px;
  padding: 14px 18px;
  background: rgba(202, 220, 252, 0.1);
  color: var(--ink);
  font-weight: 800;
}

.answer:disabled,
.primary:disabled,
.ghost:disabled {
  opacity: 0.56;
  cursor: default;
  transform: none;
}

.meta {
  margin-top: 16px;
}

.badge {
  padding: 9px 12px;
  background: rgba(202, 220, 252, 0.1);
}

.badge.good {
  background: rgba(88, 217, 161, 0.14);
  color: var(--good);
}

.badge.bad {
  background: rgba(255, 156, 140, 0.14);
  color: var(--bad);
}

.badge.pending {
  background: rgba(255, 209, 102, 0.14);
  color: var(--pending);
}

.empty {
  margin-top: 22px;
  padding: 24px;
}

@media (max-width: 920px) {
  .stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-meter-group {
    grid-template-columns: 1fr;
  }

  .admin-overview-legend {
    grid-template-columns: 1fr;
  }

  .answer-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-head {
    flex-direction: column;
  }

  .admin-question-head,
  .distribution-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-badges {
    justify-content: flex-start;
  }

  .completion-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .distribution-row {
    grid-template-columns: 1fr;
  }

  .distribution-value {
    text-align: left;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 18px, 100%);
    padding: 18px 0 28px;
  }

  .hero,
  .panel,
  .empty {
    border-radius: 22px;
    padding: 18px;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .switches {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .switch {
    min-width: 0;
    width: 100%;
  }

  .userbox {
    width: 100%;
  }

  .question-spotlight,
  .question-journey,
  .admin-question-card {
    padding: 18px;
  }

  .question-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .question-controls {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
}
