/* Страница теста — блок вступления */
.test-intro {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1px 19px 92px;
  max-width: 900px;
  margin: 0 auto;
  margin-top: 8vh;
}

.test-title {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(26px, 4vw, 37px);
  font-weight: 700;
  color: #c2f0c2;;
  margin-bottom: 16px;
  line-height: 1.2;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5), 0 0 24px rgba(45, 58, 45, 0.4);
  white-space: nowrap;
  opacity: 0;
  animation: fadeInUp 0.75s ease-out forwards;
}

.test-subtitle {
  font-family: "Montserrat Alternates", sans-serif;
  font-size: 18px;
  color: #d2d9d2;
  margin-bottom: 24px;
  line-height: 1.5;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5), 0 0 16px rgba(0, 0, 0, 0.25);
  opacity: 0;
  animation: fadeInUp 0.75s ease-out 0.12s forwards;
}

.test-note {
  font-family: "Montserrat Alternates", sans-serif;
  font-size: 14px;
  color: #d2d9d2;
  margin-bottom: 32px;
  line-height: 1.6;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
  opacity: 0;
  animation: fadeInUp 0.75s ease-out 0.24s forwards;
}

.btn-start-test {
  margin-top: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  opacity: 0;
  animation: fadeInUp 0.75s ease-out 0.36s forwards;
}

/* Модальное окно */
.test-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.test-modal.open {
  opacity: 1;
  visibility: visible;
}

.test-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.test-modal-box {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-light);
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
  padding: 32px 28px;
}

.test-screen {
  min-height: 200px;
}

.test-screen.hidden {
  display: none;
}

.test-modal-title {
  font-family: "Cormorant Garamond", serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--green-dark);
  margin-bottom: 20px;
  line-height: 1.3;
}

.test-scale-list {
  list-style: none;
  margin-bottom: 28px;
  text-align: left;
}

.test-scale-list li {
  font-family: "Montserrat Alternates", sans-serif;
  font-size: 15px;
  color: var(--text-main);
  padding: 6px 0;
  border-bottom: 1px solid var(--border-soft);
}

.test-scale-list li:last-child {
  border-bottom: none;
}

.test-scale-list strong {
  display: inline-block;
  width: 24px;
  color: var(--green-dark);
}

.btn-modal-start {
  width: 100%;
  max-width: 200px;
}

/* Вопрос */
.test-question-progress {
  font-family: "Montserrat Alternates", sans-serif;
  font-size: 13px;
  color: var(--text-soft);
  margin-bottom: 16px;
}

.test-question-text {
  font-family: "Cormorant Garamond", serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--green-dark);
  margin-bottom: 24px;
  line-height: 1.4;
}

.test-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.test-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1.5px solid var(--border-soft);
  border-radius: var(--radius-l);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
  font-family: "Montserrat Alternates", sans-serif;
  font-size: 15px;
  color: var(--text-main);
}

.test-option:hover {
  border-color: var(--green-light);
  background: var(--green-pale);
}

.test-option.selected {
  border-color: var(--green-dark);
  background: var(--green-pale);
}

.test-option input {
  display: none;
}

.test-option-value {
  font-weight: 600;
  color: var(--green-dark);
  min-width: 24px;
}

.btn-next {
  margin-top: 24px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  max-width: 220px;
  display: block;
}

/* Результаты */
.test-results-title {
  font-family: "Cormorant Garamond", serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--green-dark);
  margin-bottom: 20px;
}

.test-results-block {
  text-align: left;
  padding: 20px 0;
  margin-bottom: 24px;
  border-top: 1px solid var(--border-soft);
}

.test-results-emoji {
  font-size: 32px;
  margin-bottom: 8px;
}

.test-results-range {
  font-family: "Montserrat Alternates", sans-serif;
  font-size: 14px;
  color: var(--text-soft);
  font-weight: 500;
  margin-bottom: 8px;
}

.test-results-title-inner {
  font-family: "Cormorant Garamond", serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--green-dark);
  margin-bottom: 12px;
}

.test-results-text {
  font-family: "Montserrat Alternates", sans-serif;
  font-size: 15px;
  color: var(--text-main);
  line-height: 1.6;
  margin-bottom: 16px;
}

.test-results-recommendation {
  font-family: "Montserrat Alternates", sans-serif;
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1.6;
}

.btn-close-results {
  width: 100%;
  max-width: 200px;
}

/* Планшет */
@media (max-width: 768px) {
  .test-intro {
    padding: 24px 20px 48px;
    margin-top: 4vh;
  }

  .test-title {
    font-size: clamp(22px, 5vw, 28px);
  }
}

/* Мобильные */
@media (max-width: 520px) {
  .test-intro {
    padding: 20px var(--safe-inline, 16px) 40px;
    margin-top: 2vh;
    gap: 0;
  }

  .test-title {
    font-size: clamp(20px, 6vw, 24px);
    white-space: normal;
    margin-bottom: 14px;
    line-height: 1.3;
  }

  .test-subtitle {
    font-size: 16px;
    margin-bottom: 20px;
  }

  .test-note {
    font-size: 13px;
    margin-bottom: 28px;
  }

  .btn-start-test {
    min-height: var(--touch-min, 44px);
    width: 100%;
    max-width: 280px;
    padding: 14px 24px;
  }

  .test-modal {
    padding: 12px;
    align-items: flex-end;
  }

  .test-modal-box {
    padding: 24px 20px 28px;
    max-height: 92vh;
    border-radius: var(--radius-l, 24px) var(--radius-l, 24px) 0 0;
  }

  .test-modal-title {
    font-size: 18px;
  }

  .test-scale-list {
    font-size: 14px;
    padding-left: 20px;
  }

  .test-option {
    padding: 14px 16px;
    font-size: 14px;
    min-height: 48px;
  }

  .test-question-text {
    font-size: 17px;
  }

  .btn-next,
  .btn-modal-start,
  .btn-close-results {
    min-height: var(--touch-min, 44px);
    width: 100%;
  }
}

@media (max-width: 380px) {
  .test-title {
    font-size: 18px;
  }

  .test-modal-box {
    padding: 20px 16px 24px;
  }
}
