:root {
  color: #111827;
  background: #f3f5f7;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background: #f3f5f7;
}

button,
label,
textarea {
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.survey-shell {
  min-height: 100svh;
  padding: clamp(1rem, 4vw, 3.5rem);
  display: grid;
  place-items: center;
  background: #f3f5f7;
}

.survey-card {
  width: min(100%, 1120px);
  min-height: min(760px, calc(100svh - 2rem));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #dfe4ea;
  border-radius: clamp(1rem, 2vw, 1.5rem);
  background: #ffffff;
  box-shadow: 0 24px 64px rgb(15 23 42 / 8%);
}

.survey-header {
  min-height: 84px;
  padding: 1.25rem clamp(1.25rem, 4vw, 3.25rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  border-bottom: 1px solid #e5e9ee;
}

.brand-mark {
  display: inline-flex;
  align-items: baseline;
  color: #172033;
  font-size: 1.2rem;
  font-weight: 850;
}

.brand-mark span:nth-child(3) {
  margin: 0 0.03em;
  color: #2563eb;
  font-size: 0.8em;
}

.progress-wrap {
  width: min(310px, 55%);
  display: grid;
  gap: 0.45rem;
  color: #64748b;
  font-size: 0.76rem;
  font-weight: 700;
  text-align: right;
}

.progress-track {
  width: 100%;
  height: 5px;
  overflow: hidden;
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: #e5e9ee;
}

.progress-track::-webkit-progress-bar {
  border-radius: 999px;
  background: #e5e9ee;
}

.progress-track::-webkit-progress-value {
  border-radius: 999px;
  background: #2563eb;
}

.progress-track::-moz-progress-bar {
  border-radius: 999px;
  background: #2563eb;
}

.intro-panel,
.question-panel {
  width: min(100%, 880px);
  margin: auto;
  padding: clamp(2.5rem, 7vw, 6.5rem) clamp(1.25rem, 6vw, 4.5rem);
  animation: panel-in 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.question-panel.logo-panel {
  width: min(100%, 1020px);
  padding-top: clamp(2rem, 5vw, 4rem);
  padding-bottom: clamp(2rem, 5vw, 4rem);
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

.eyebrow {
  margin: 0 0 0.9rem;
  color: #2563eb;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1 {
  max-width: 850px;
  margin: 0;
  color: #111827;
  font-size: clamp(2.2rem, 6vw, 4.6rem);
  font-weight: 760;
  line-height: 0.98;
  text-wrap: balance;
}

.question-panel h1 {
  font-size: clamp(2rem, 5vw, 3.8rem);
}

.lead,
.meaning {
  max-width: 720px;
  margin: 1.4rem 0 0;
  color: #5f6b7a;
  font-size: clamp(1.05rem, 2.2vw, 1.28rem);
  line-height: 1.65;
}

.lead.small {
  font-size: 1rem;
}

.meaning {
  padding-left: 1.15rem;
  border-left: 3px solid #cbd5e1;
}

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

legend {
  color: #111827;
  font-size: 1.08rem;
  font-weight: 760;
}

.required-note {
  margin: 0.35rem 0 1rem;
  color: #6b7280;
  font-size: 0.84rem;
}

.rating-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.65rem;
}

.rating-option {
  min-height: 74px;
  padding: 0.75rem 0.55rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.58rem;
  cursor: pointer;
  border: 1px solid #d9dee5;
  border-radius: 0.85rem;
  background: #ffffff;
  color: #4b5563;
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.rating-option:hover {
  transform: translateY(-2px);
  border-color: #93a8c7;
}

.rating-option:focus-within {
  outline: 3px solid rgb(37 99 235 / 20%);
  outline-offset: 2px;
}

.rating-option[data-selected='true'] {
  border-color: #1d4ed8;
  background: #1d4ed8;
  color: #ffffff;
}

.rating-dot {
  width: 11px;
  height: 11px;
  border: 2px solid currentColor;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px transparent;
}

.rating-option[data-selected='true'] .rating-dot {
  background: #bfdbfe;
  box-shadow: inset 0 0 0 2px #1d4ed8;
}

.primary-action {
  min-height: 48px;
  margin-top: 2rem;
  padding: 0.75rem 1.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  cursor: pointer;
  border-radius: 999px;
  background: #1d4ed8;
  color: #ffffff;
  font-weight: 760;
  box-shadow: 0 10px 24px rgb(29 78 216 / 18%);
  transition:
    background 160ms ease,
    transform 160ms ease;
}

.primary-action:hover:not(:disabled) {
  transform: translateY(-1px);
  background: #1e40af;
}

.primary-action:focus-visible {
  outline: 3px solid rgb(37 99 235 / 28%);
  outline-offset: 3px;
}

.primary-action:disabled {
  cursor: not-allowed;
  background: #94a3b8;
  box-shadow: none;
}

.logo-grid {
  margin-top: 1.75rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.logo-rating-card {
  margin: 0;
  padding: 0.85rem;
  border: 1px solid #dfe4ea;
  border-radius: 1rem;
  background: #ffffff;
}

.logo-placeholder {
  aspect-ratio: 4 / 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  overflow: hidden;
  border: 1px dashed #b8c2cf;
  border-radius: 0.75rem;
  background: #f7f9fb;
  color: #64748b;
  text-align: center;
}

.logo-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #ffffff;
}

.logo-placeholder strong {
  color: #1f2937;
  font-size: 0.9rem;
}

.logo-placeholder span {
  font-size: 0.72rem;
}

.logo-question {
  min-height: 2.6rem;
  margin: 0.9rem 0 0.6rem;
  color: #374151;
  font-size: 0.83rem;
  font-weight: 740;
  line-height: 1.45;
}

.logo-rating-card .rating-grid {
  grid-template-columns: 1fr;
  gap: 0.38rem;
}

.logo-rating-card .rating-option {
  min-height: 38px;
  padding: 0.45rem 0.6rem;
  flex-direction: row;
  justify-content: flex-start;
  font-size: 0.76rem;
}

.textarea-label {
  margin: 2rem 0 0.55rem;
  display: block;
  color: #1f2937;
  font-size: 0.92rem;
  font-weight: 760;
}

#name-suggestion {
  width: 100%;
  min-height: 145px;
  resize: vertical;
  padding: 0.9rem 1rem;
  border: 1px solid #d5dbe3;
  border-radius: 0.75rem;
  background: #ffffff;
  color: #111827;
  font-size: 1rem;
  line-height: 1.6;
}

#name-suggestion:focus {
  outline: 3px solid rgb(37 99 235 / 18%);
  border-color: #2563eb;
}

.error-message {
  margin: 1rem 0 0;
  color: #a43c32;
  font-size: 0.9rem;
}

.survey-footer {
  margin-top: auto;
  padding: 1rem clamp(1.25rem, 4vw, 3.25rem);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid #e5e9ee;
  color: #7b8796;
  font-size: 0.72rem;
  font-weight: 650;
}

.success-card {
  min-height: min(610px, calc(100svh - 2rem));
  align-items: center;
  justify-content: center;
  padding: 3rem;
  text-align: center;
}

.success-card .brand-mark {
  margin-bottom: 3rem;
}

.success-card h1,
.success-card .lead {
  margin-inline: auto;
}

.success-icon {
  width: 64px;
  height: 64px;
  margin-bottom: 1.5rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e8f0e7;
  color: #2f6b43;
  font-size: 1.8rem;
  font-weight: 800;
}

.noscript-message {
  max-width: 36rem;
  margin: 2rem auto;
  padding: 1rem;
  color: #7f1d1d;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 800px) {
  .survey-shell {
    padding: 0;
    place-items: stretch;
  }

  .survey-card {
    min-height: 100svh;
    border: 0;
    border-radius: 0;
  }

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

@media (max-width: 560px) {
  .survey-header {
    min-height: 74px;
  }

  .progress-wrap {
    width: 62%;
  }

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

  .rating-option,
  .logo-rating-card .rating-option {
    min-height: 44px;
    padding: 0.6rem 0.75rem;
    flex-direction: row;
    justify-content: flex-start;
  }

  .success-card {
    padding-inline: 1.5rem;
  }
}
