/* === SURVEY === */

.visually-hidden {
  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 {
  background: var(--cream);
  padding-bottom: 72px;
}

.survey-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}

.survey-progress {
  height: 6px;
  background: rgba(13, 27, 42, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin: 0 auto 22px;
}

.survey-progress-fill {
  display: block;
  height: 100%;
  width: 25%;
  background: linear-gradient(90deg, #5A6BFF 0%, #A3B1FF 100%);
  border-radius: inherit;
}

.survey-card {
  background: var(--white);
  border-radius: 20px;
  box-shadow: var(--shadow-md);
  padding: 40px 40px 32px;
}

.survey-section {
  padding: 0;
  margin: 0;
}

.survey-section > .survey-section-title:first-child {
  margin-top: 0;
}

.survey-card h1 {
  font-family: var(--font-head);
  font-size: clamp(32px, 4vw, 44px);
  letter-spacing: -0.5px;
  color: var(--navy);
  line-height: 1.12;
  margin-bottom: 16px;
}

.survey-intro p,
.survey-copy p,
.survey-end p,
.survey-help {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-mid);
}

.survey-intro p,
.survey-copy > p {
  margin-bottom: 14px;
}

.survey-intro p:last-child,
.survey-copy > p:last-child {
  margin-bottom: 0;
}

.survey-section-title {
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1.8px;
  color: var(--blue);
  margin: 32px 0 22px;
}

.survey-section-title:focus {
  outline: none;
}

.survey-card fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-inline-size: 0;
}

.question {
  margin-bottom: 26px;
}

.question.is-invalid {
  border-left: 3px solid #C53030;
  padding-left: 12px;
}

.survey-question {
  display: block;
  width: 100%;
  float: none;
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--navy);
  margin-bottom: 12px;
  padding: 0;
}

.survey-help {
  margin: -4px 0 12px;
}

.place-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.choice,
.scale-choice {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 14px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--white);
  cursor: pointer;
  font-size: 15px;
  line-height: 1.4;
  color: var(--navy);
}

.choice:hover,
.scale-choice:hover {
  border-color: rgba(90, 107, 255, 0.45);
}

.choice:has(input:checked),
.scale-choice:has(input:checked) {
  border-color: var(--blue);
  background: var(--lavender);
}

.choice input,
.scale-choice input {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  border: 1.5px solid rgba(13, 27, 42, 0.28);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--white);
  flex-shrink: 0;
}

.choice input:checked,
.scale-choice input:checked {
  border-color: var(--blue);
  background: var(--blue);
  box-shadow: inset 0 0 0 4px #fff;
}

.choice input:focus-visible,
.scale-choice input:focus-visible,
.form-input:focus-visible,
.form-select:focus-visible,
.form-textarea:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.survey-card .form-input,
.survey-card .form-select,
.survey-card .form-textarea {
  font-size: 16px;
}

.include-list {
  margin-top: 8px;
}

.include-item {
  margin: 0 0 14px;
}

.include-name {
  display: block;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 2px;
}

.scale-head {
  display: none;
}

.scale-row {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.scale-row.is-invalid {
  background: #FFF8F8;
  border-radius: 12px;
  margin-left: -8px;
  margin-right: -8px;
  padding-left: 8px;
  padding-right: 8px;
}

.scale-statement {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--navy);
  margin-bottom: 10px;
}

.scale-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-error,
.survey-submit-error {
  color: #9B2C2C;
  font-size: 13px;
  line-height: 1.45;
  margin-top: 8px;
}

.survey-submit-error {
  text-align: center;
  margin-top: 16px;
}

.survey-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.survey-actions .btn-primary {
  margin-left: auto;
}

.survey-end {
  text-align: center;
  padding: 12px 8px 4px;
}

.survey-end h2 {
  font-family: var(--font-head);
  font-size: clamp(28px, 4vw, 36px);
  letter-spacing: -0.4px;
  color: var(--navy);
  margin-bottom: 14px;
}

.survey-end h2:focus {
  outline: none;
}

.survey-end p {
  max-width: 540px;
  margin: 0 auto 14px;
}

.survey-end .survey-actions {
  max-width: 420px;
  margin: 22px auto 0;
  text-align: left;
}

.survey-section[hidden],
#survey-confirmation[hidden],
#survey-form[hidden],
.field-error[hidden],
.survey-submit-error[hidden],
.survey-progress[hidden] {
  display: none !important;
}

@media (max-width: 700px) {
  .survey-card {
    padding: 28px 18px 22px;
  }

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

@media (max-width: 560px) {
  .survey-actions {
    flex-direction: column;
  }

  .survey-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .survey-actions .btn-primary {
    margin-left: 0;
  }
}

@media (min-width: 900px) {
  .scale-head {
    display: grid;
    grid-template-columns: minmax(220px, 1.35fr) minmax(0, 2.4fr);
    gap: 12px;
    align-items: end;
  }

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

  .scale-head-options span {
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
    color: var(--text-mid);
    padding: 0 2px 8px;
  }

  .scale-row {
    display: grid;
    grid-template-columns: minmax(220px, 1.35fr) minmax(0, 2.4fr);
    gap: 12px;
    align-items: center;
    margin-top: 0;
    padding: 14px 0;
  }

  .scale-row.is-invalid {
    margin-left: 0;
    margin-right: 0;
    padding-left: 8px;
    padding-right: 8px;
  }

  .scale-statement {
    margin-bottom: 0;
  }

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

  .scale-choice {
    border: 0;
    background: transparent;
    justify-content: center;
    min-height: 44px;
    padding: 8px 2px;
  }

  .scale-choice:hover,
  .scale-choice:has(input:checked) {
    border-color: transparent;
    background: transparent;
  }

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

@media (prefers-reduced-motion: reduce) {
  .survey-progress-fill {
    transition: none;
  }
}
