:root {
  --paper: #f5efe6;
  --paper-strong: #fff9f0;
  --panel: rgba(255, 251, 245, 0.9);
  --panel-strong: rgba(255, 255, 255, 0.92);
  --ink: #18253b;
  --muted: #68758b;
  --line: rgba(24, 37, 59, 0.12);
  --line-strong: rgba(24, 37, 59, 0.2);
  --navy: #102845;
  --navy-soft: #1b4068;
  --copper: #d77431;
  --copper-soft: #efc49f;
  --green: #1d7b64;
  --danger: #b64734;
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --shadow: 0 24px 60px rgba(16, 40, 69, 0.12);
  --display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, serif;
  --sans: "Avenir Next", "Segoe UI", "Trebuchet MS", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(215, 116, 49, 0.18), transparent 26%),
    radial-gradient(circle at 84% 18%, rgba(16, 40, 69, 0.12), transparent 24%),
    linear-gradient(180deg, #fbf6ef 0%, #f4ecdf 100%);
  font: 15px/1.5 var(--sans);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(rgba(16, 40, 69, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 40, 69, 0.035) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.35), transparent 88%);
  pointer-events: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.84);
  color: var(--ink);
  font-weight: 700;
  transition: 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(16, 40, 69, 0.1);
  border-color: var(--line-strong);
}

.btn-primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--navy), var(--navy-soft));
  color: #fff;
}

.btn-danger {
  border-color: rgba(182, 71, 52, 0.18);
  background: rgba(182, 71, 52, 0.1);
  color: var(--danger);
}

.btn-block {
  width: 100%;
}

.panel {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.flash {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  margin-bottom: 14px;
  font-weight: 600;
}

.flash-error {
  background: rgba(182, 71, 52, 0.1);
  border-color: rgba(182, 71, 52, 0.18);
  color: var(--danger);
}

.flash-success {
  background: rgba(29, 123, 100, 0.1);
  border-color: rgba(29, 123, 100, 0.18);
  color: var(--green);
}

.inline-form {
  margin: 0;
}

.empty-box {
  padding: 18px;
  border: 1px dashed rgba(24, 37, 59, 0.18);
  border-radius: var(--radius-lg);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.45);
}

.survey-shell,
.admin-shell {
  max-width: 1360px;
  margin: 0 auto;
  padding: 24px 18px 40px;
}

.survey-hero,
.admin-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(16, 40, 69, 0.98), rgba(27, 64, 104, 0.94));
  color: #faf6ee;
  border-radius: 30px;
  box-shadow: var(--shadow);
}

.survey-hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 22px;
  padding: 28px 30px;
  margin-bottom: 18px;
}

.admin-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 28px 30px;
  margin-bottom: 18px;
}

.survey-hero::after,
.admin-hero::after {
  content: "";
  position: absolute;
  top: -56px;
  right: -54px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(215, 116, 49, 0.35) 0%, rgba(215, 116, 49, 0) 70%);
}

.survey-kicker,
.admin-kicker,
.thanks-mark,
.login-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(250, 246, 238, 0.72);
}

.survey-kicker::before,
.admin-kicker::before,
.login-kicker::before {
  content: "";
  width: 34px;
  height: 1px;
  background: rgba(250, 246, 238, 0.45);
}

.survey-hero h1,
.admin-hero h1,
.thanks-card h1,
.login-card h1 {
  margin: 14px 0 10px;
  font: 700 44px/0.98 var(--display);
  letter-spacing: -0.03em;
}

.survey-hero p,
.admin-hero p,
.thanks-card p,
.login-card p {
  margin: 0;
  color: rgba(250, 246, 238, 0.8);
}

.survey-hero__aside {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.survey-fact {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.08);
}

.survey-fact span {
  display: block;
  color: rgba(250, 246, 238, 0.66);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.survey-fact strong {
  display: block;
  margin-top: 8px;
  font-size: 18px;
  line-height: 1.2;
}

.survey-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  gap: 18px;
}

.panel-survey {
  padding: 24px;
}

.panel-guide {
  padding: 18px;
}

.survey-topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.survey-topbar h2,
.responses-header h2,
.panel h2 {
  margin: 0;
  font: 700 29px/1 var(--display);
  letter-spacing: -0.02em;
}

.survey-topbar p,
.responses-header p,
.panel h2 + p {
  margin: 8px 0 0;
  color: var(--muted);
}

.survey-step-counter {
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(16, 40, 69, 0.06);
  color: var(--navy);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.survey-step-nav {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.step-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 70px;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.75);
  color: inherit;
  transition: 0.16s ease;
  text-align: left;
}

.step-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(215, 116, 49, 0.35);
}

.step-chip.active {
  background: linear-gradient(135deg, var(--navy), var(--navy-soft));
  color: #fff;
  border-color: transparent;
}

.step-chip.done {
  box-shadow: inset 0 0 0 1px rgba(29, 123, 100, 0.18);
  border-color: rgba(29, 123, 100, 0.18);
}

.step-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(16, 40, 69, 0.08);
  color: var(--navy);
  font-weight: 700;
  flex: 0 0 auto;
}

.step-chip.active .step-index {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.step-copy strong {
  display: block;
  font-size: 14px;
}

.step-copy span {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.step-chip.active .step-copy span {
  color: rgba(255, 255, 255, 0.74);
}

.survey-card {
  padding: 22px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.75);
}

.survey-card__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.survey-card__header h3 {
  margin: 0;
  font: 700 33px/1 var(--display);
}

.survey-card__header p {
  margin: 8px 0 0;
  color: var(--muted);
}

.step-meta {
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(16, 40, 69, 0.06);
  color: var(--navy);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.flash-inline {
  margin-bottom: 14px;
}

.question-block + .question-block {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.question-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.question-heading h4 {
  margin: 0;
  font-size: 17px;
}

.question-heading span {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.choice-grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.choice-card {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.84);
  text-align: left;
  transition: 0.16s ease;
}

.choice-card:hover {
  transform: translateY(-1px);
  border-color: rgba(215, 116, 49, 0.34);
  box-shadow: 0 12px 22px rgba(16, 40, 69, 0.06);
}

.choice-card.selected {
  border-color: transparent;
  background: linear-gradient(135deg, var(--navy), var(--navy-soft));
  color: #fff;
}

.choice-card strong {
  display: block;
  font-size: 15px;
}

.choice-card small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.choice-card.selected small {
  color: rgba(255, 255, 255, 0.72);
}

.limit-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(215, 116, 49, 0.12);
  color: #8e4d1d;
  font-size: 12px;
  font-weight: 700;
}

.priority-legend {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: center;
}

.feature-list {
  display: grid;
  gap: 10px;
}

.feature-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.84);
}

.feature-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.feature-header strong {
  display: block;
  font-size: 15px;
}

.feature-header small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}

.feature-value {
  min-width: 40px;
  align-self: flex-start;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(16, 40, 69, 0.08);
  color: var(--navy);
  text-align: center;
  font-weight: 700;
}

.scale {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.scale-button {
  min-height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font-weight: 700;
}

.scale-button.selected {
  border-color: transparent;
  background: linear-gradient(135deg, #e7813d, var(--copper));
  color: #fff;
  box-shadow: 0 12px 22px rgba(215, 116, 49, 0.22);
}

.comment-grid {
  display: grid;
  gap: 10px;
}

.comment-grid textarea,
.login-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  padding: 12px 14px;
}

.comment-grid textarea {
  min-height: 84px;
  resize: vertical;
}

.survey-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

.survey-actions p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.survey-actions__buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.guide-card {
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.74);
}

.guide-card + .guide-card {
  margin-top: 12px;
}

.guide-card h3 {
  margin: 0 0 10px;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.guide-card ol,
.guide-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--ink);
}

.thanks-body,
.admin-login-body {
  display: grid;
  place-items: center;
}

.thanks-shell,
.login-shell {
  width: 100%;
  max-width: 560px;
  padding: 24px 18px;
}

.thanks-card,
.login-card {
  padding: 30px;
  border-radius: 30px;
  background: linear-gradient(135deg, rgba(16, 40, 69, 0.97), rgba(27, 64, 104, 0.94));
  color: #faf6ee;
  box-shadow: var(--shadow);
}

.thanks-actions {
  margin-top: 22px;
}

.login-form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.login-form label span {
  display: block;
  margin-bottom: 6px;
  color: rgba(250, 246, 238, 0.78);
  font-size: 13px;
  font-weight: 700;
}

.admin-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.btn-compact {
  min-height: 38px;
  padding: 0 14px;
  font-size: 13px;
}

.admin-alerts {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.metric {
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 10px;
  font-size: 28px;
  line-height: 1;
}

.metric small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
}

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

.admin-grid .panel {
  padding: 18px;
}

.panel-wide {
  grid-column: 1 / -1;
}

.bar-list,
.rank-list,
.response-cards {
  display: grid;
  gap: 10px;
}

.bar-row header,
.rank-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.bar-row header span,
.rank-row span {
  font-weight: 700;
  color: var(--navy);
}

.bar-track {
  overflow: hidden;
  height: 10px;
  margin-top: 6px;
  border-radius: 999px;
  background: rgba(16, 40, 69, 0.08);
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--copper), #f09f63);
}

.bar-fill.accent {
  background: linear-gradient(90deg, #df7a35, #f0b178);
}

.bar-fill.dark {
  background: linear-gradient(90deg, var(--navy), #3b628f);
}

.bar-fill.green {
  background: linear-gradient(90deg, var(--green), #53a78d);
}

.rank-row {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.rank-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.responses-panel {
  padding: 18px;
}

.responses-header {
  margin-bottom: 14px;
}

.response-card {
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.76);
}

.response-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.response-card__meta {
  min-width: 0;
}

.response-card__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.response-card header strong {
  display: block;
  font-size: 16px;
}

.response-card header p {
  margin: 4px 0 0;
  color: var(--muted);
}

.response-stage {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(16, 40, 69, 0.08);
  color: var(--navy);
  font-size: 12px;
  font-weight: 700;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(16, 40, 69, 0.08);
  color: var(--navy);
  font-size: 12px;
  font-weight: 700;
}

.response-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.response-grid h3 {
  margin: 0 0 4px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.response-grid p {
  margin: 0;
}

.comment-list {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.comment-list blockquote {
  margin: 0;
  padding: 12px 14px;
  border-left: 3px solid rgba(215, 116, 49, 0.5);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background: rgba(215, 116, 49, 0.07);
  color: var(--ink);
}

@media (max-width: 1240px) {
  .survey-hero,
  .survey-layout,
  .admin-grid,
  .admin-metrics {
    grid-template-columns: 1fr;
  }

  .admin-hero {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 860px) {
  .survey-shell,
  .admin-shell {
    padding: 16px 12px 32px;
  }

  .survey-hero,
  .admin-hero,
  .panel-survey,
  .responses-panel,
  .login-card,
  .thanks-card {
    padding: 20px 18px;
  }

  .survey-hero h1,
  .admin-hero h1,
  .thanks-card h1,
  .login-card h1 {
    font-size: 34px;
  }

  .survey-step-nav,
  .choice-grid,
  .choice-grid.cols-3,
  .response-grid,
  .survey-hero__aside,
  .admin-metrics {
    grid-template-columns: 1fr;
  }

  .survey-topbar,
  .survey-card__header,
  .survey-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-hero__actions,
  .survey-actions__buttons {
    width: 100%;
  }

  .scale {
    grid-template-columns: repeat(5, minmax(40px, 1fr));
  }

  .response-card header {
    flex-direction: column;
  }
}
