:root {
  --color-black: #000000;
  --color-white: #ffffff;
  --color-accent: #9290c4;
  --color-soft: #f6f6fb;
  --ring-size: 78px;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--color-black);
  background:
    linear-gradient(135deg, rgba(146, 144, 196, 0.24), rgba(255, 255, 255, 0) 42%),
    var(--color-white);
  font-family: "Work Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.survey-shell {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 0;
}

.survey-panel {
  width: 100%;
  max-width: 760px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px 18px;
  background: var(--color-white);
}

.survey-header {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: start;
}

.brand-mark {
  color: var(--color-accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.survey-logo {
  display: block;
  width: clamp(54px, 15vw, 76px);
  height: auto;
  margin: 0 auto 14px;
}

h1,
h2,
legend {
  margin: 0;
  font-weight: 800;
  letter-spacing: 0;
}

h1 {
  max-width: 17ch;
  font-size: clamp(1.7rem, 8vw, 2.8rem);
  line-height: 1.05;
}

h2 {
  font-size: clamp(1.55rem, 7vw, 2.35rem);
  line-height: 1.08;
}

.progress-ring {
  position: relative;
  width: var(--ring-size);
  height: var(--ring-size);
  display: grid;
  place-items: center;
  color: var(--color-black);
}

.progress-ring svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.progress-ring circle {
  fill: none;
  stroke-width: 10;
}

.progress-ring-track {
  stroke: #ececf5;
}

.progress-ring-value {
  stroke: var(--color-accent);
  stroke-linecap: round;
  stroke-dasharray: 301.59;
  stroke-dashoffset: 301.59;
  transition: stroke-dashoffset 220ms ease;
}

.progress-ring span {
  position: relative;
  font-size: 0.92rem;
  font-weight: 800;
}

.intro-copy {
  margin: 26px 0 14px;
}

.intro-copy p {
  max-width: 34rem;
  margin: 0 0 10px;
  font-size: 1rem;
  line-height: 1.45;
}

.intro-copy span,
.question-meta {
  font-size: 0.86rem;
  font-weight: 700;
}

.completion-status {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 18px;
  padding: 10px 0 12px;
  background: var(--color-white);
}

.completion-status > span {
  font-size: 0.86rem;
  font-weight: 800;
}

.survey-card {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 460px;
  padding: 22px;
  border: 1px solid #e9e9f2;
  border-radius: 8px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.08);
}

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

.anonymous-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  color: var(--color-black);
  background: rgba(146, 144, 196, 0.22);
  border: 1px solid rgba(146, 144, 196, 0.5);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  width: 100%;
  min-height: 2.6em;
  margin-bottom: 20px;
  font-size: clamp(1.25rem, 5.4vw, 1.85rem);
  line-height: 1.16;
}

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

.option-card {
  position: relative;
}

.option-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.option-card label {
  width: 100%;
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 14px 15px;
  border: 1px solid #d9d9e6;
  border-radius: 8px;
  background: var(--color-white);
  font-weight: 700;
  line-height: 1.25;
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.option-card label::before {
  content: "";
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border: 2px solid var(--color-accent);
  border-radius: 999px;
  box-shadow: inset 0 0 0 5px var(--color-white);
}

.option-card input:checked + label {
  border-color: var(--color-black);
  background: var(--color-soft);
}

.option-card input:checked + label::before {
  background: var(--color-accent);
}

.option-card input:focus-visible + label,
.btn:focus-visible,
.form-control:focus {
  outline: 3px solid rgba(146, 144, 196, 0.45);
  outline-offset: 2px;
  box-shadow: none;
}

.comment-block,
.conditional-block {
  margin-top: 8px;
}

.comment-block .form-label,
.conditional-block .form-label {
  font-weight: 800;
}

.conditional-block {
  padding: 16px;
  border: 1px solid rgba(146, 144, 196, 0.5);
  border-radius: 8px;
  background: rgba(146, 144, 196, 0.14);
}

.conditional-title {
  margin: 0 0 14px;
  font-weight: 800;
}

.form-control {
  border-color: #d9d9e6;
  border-radius: 8px;
  font-weight: 500;
}

.form-control:focus {
  border-color: var(--color-accent);
}

.field-note {
  margin: 9px 0 0;
  color: #5d5d6c;
  font-size: 0.88rem;
}

.form-message {
  min-height: 1.35em;
  margin: 18px 0 0;
  font-size: 0.9rem;
  font-weight: 700;
}

.form-message-danger {
  color: #b42318;
}

.form-message-success {
  color: #146c43;
}

.survey-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: auto;
  padding-top: 24px;
}

.btn {
  min-height: 50px;
  border-radius: 8px;
  font-weight: 800;
}

.btn-dark {
  --bs-btn-bg: var(--color-black);
  --bs-btn-border-color: var(--color-black);
  --bs-btn-hover-bg: var(--color-accent);
  --bs-btn-hover-border-color: var(--color-accent);
}

.btn-outline-dark {
  --bs-btn-color: var(--color-black);
  --bs-btn-border-color: var(--color-black);
  --bs-btn-hover-bg: var(--color-black);
  --bs-btn-hover-border-color: var(--color-black);
}

.complete-view {
  flex: 1;
  padding: 26px 22px;
  border: 1px solid #e9e9f2;
  border-radius: 8px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.08);
}

.complete-view p {
  margin: 14px 0 22px;
  line-height: 1.5;
}

.accent-tile {
  display: grid;
  gap: 8px;
  margin: 0 0 22px;
  padding: 16px;
  border: 1px solid rgba(146, 144, 196, 0.5);
  border-radius: 8px;
  background: rgba(146, 144, 196, 0.18);
}

.accent-tile strong {
  font-weight: 800;
}

.accent-tile span {
  line-height: 1.45;
}

.complete-note {
  color: #5d5d6c;
  font-weight: 700;
}

@media (min-width: 768px) {
  :root {
    --ring-size: 92px;
  }

  .survey-shell {
    align-items: center;
    padding: 32px;
  }

  .survey-panel {
    min-height: auto;
    padding: 38px;
    border: 1px solid #ececf5;
    border-radius: 8px;
  }

  h1 {
    max-width: none;
  }

  .survey-card {
    min-height: 520px;
  }

  .survey-header {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

.admin-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 24px 18px 42px;
}

.admin-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.admin-header h1 {
  max-width: none;
  font-size: clamp(1.8rem, 7vw, 3rem);
}

.admin-logout {
  flex: 0 0 auto;
  min-height: 42px;
  padding-inline: 18px;
}

.admin-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.metric-card,
.stat-block,
.comment-item {
  border: 1px solid #e9e9f2;
  border-radius: 8px;
  background: var(--color-white);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.06);
}

.metric-card {
  display: grid;
  gap: 8px;
  padding: 18px;
}

.metric-card span {
  font-weight: 700;
}

.metric-card strong {
  font-size: 1.95rem;
  line-height: 1;
}

.admin-section {
  margin-top: 30px;
}

.admin-section h2 {
  margin-bottom: 14px;
  font-size: clamp(1.35rem, 5vw, 1.9rem);
}

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

.stat-block {
  padding: 18px;
}

.stat-block h3 {
  margin: 0 0 18px;
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.25;
}

.stat-block h3 span,
.admin-note {
  color: var(--color-accent);
}

.stat-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
  gap: 8px 12px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid #eeeeF6;
}

.stat-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.92rem;
  font-weight: 700;
}

.stat-label strong,
.stat-row em {
  white-space: nowrap;
  font-style: normal;
}

.stat-bar {
  grid-column: 1 / -1;
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #ececf5;
}

.stat-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--color-accent);
}

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

.admin-note {
  margin: 14px 0 0;
  font-size: 0.9rem;
  font-weight: 800;
}

.comment-item {
  padding: 16px;
}

.comment-item p {
  margin: 0 0 10px;
  line-height: 1.45;
}

.comment-item > strong {
  display: block;
  margin-bottom: 6px;
  font-weight: 800;
}

.feedback-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.feedback-rating,
.feedback-source {
  display: inline-flex;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}

.feedback-rating {
  background: rgba(146, 144, 196, 0.18);
}

.feedback-source {
  background: var(--color-accent);
  color: var(--color-white);
}

.comment-item time,
.empty-state {
  color: #5d5d6c;
  font-size: 0.88rem;
  font-weight: 600;
}

@media (min-width: 768px) {
  .admin-shell {
    padding: 42px 32px 64px;
  }

  .stat-row {
    grid-template-columns: minmax(260px, 0.8fr) minmax(220px, 1fr) 64px;
  }

  .stat-bar {
    grid-column: auto;
  }
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 18px;
}

.login-panel {
  width: min(100%, 460px);
  padding: 24px;
  border: 1px solid #e9e9f2;
  border-radius: 8px;
  background: var(--color-white);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.08);
}

.login-panel h1 {
  max-width: none;
  margin-bottom: 26px;
  font-size: clamp(1.8rem, 8vw, 2.7rem);
  text-align: center;
}

.login-logo {
  margin-bottom: 18px;
}

.login-form {
  display: grid;
  gap: 16px;
}

.login-form .form-label {
  font-weight: 800;
}

@media (max-width: 520px) {
  .admin-header {
    display: grid;
  }

  .admin-logout {
    width: 100%;
  }
}
