#test-wrapper .start-screen {
  position: relative;   /* чтобы z-index заработал */
  z-index: 2000;        /* над большинством Tilda-слоёв */
  pointer-events: auto; /* позволяем кнопкам принимать клики */
}

/* Обёртка всего теста */
#test-wrapper {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  padding: 5px;
  box-sizing: border-box;
  z-index: 1;
}

/* Базовые стили для контейнера теста */
#test-wrapper {
  max-width: 100%;
  margin: 0 auto;
  padding: 20px;
  box-sizing: border-box;
  background: #103028;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

/* Медиазапросы для разных разрешений */

/* 320px (мобильные) */
@media (max-width: 479px) {
  #test-wrapper {
    padding: 15px;
    margin: 10px;
    width: calc(100% - 20px);
  }
  
  .tilda-test-container {
    padding: 15px !important;
  }
  
  .question-text, .option {
    font-size: 14px;
  }
  
  .nav-btn, .submit-btn {
    padding: 8px 12px;
    font-size: 14px;
    width: 100px;
  }
  
  .options input[type="text"],
  .options input[type="email"] {
    width: 80px;
    padding: 8px;
  }
}

/* 480px (планшеты) */
@media (min-width: 480px) and (max-width: 767px) {
  #test-wrapper {
    padding: 20px;
    margin: 15px auto;
    width: calc(100% - 30px);
  }
  
  .tilda-test-container {
    padding: 20px !important;
  }
  
  .question-text {
    font-size: 15px;
  }
}

/* 768px-1199px (планшеты и небольшие десктопы) */
@media (min-width: 768px) and (max-width: 1199px) {
  #test-wrapper {
    padding: 25px;
    margin: 20px auto;
    width: 90%;
    max-width: 700px;
  }
}

/* 1200px-1919px (десктопы) */
@media (min-width: 1200px) and (max-width: 1919px) {
  #test-wrapper {
    padding: 30px;
    margin: 25px auto;
    width: 80%;
    max-width: 900px;
  }
}

/* 1920px+ (большие экраны) */
@media (min-width: 1920px) {
  #test-wrapper {
    padding: 40px;
    margin: 30px auto;
    width: 70%;
    max-width: 1000px;
  }
  
  .question-text {
    font-size: 18px;
  }
  
  .option {
    font-size: 16px;
  }
}

/* Общие адаптивные стили для элементов */
.tilda-test-container {
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.start-screen h1 {
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  margin-bottom: 15px;
}

.start-screen h2 {
  font-size: clamp(1.2rem, 3vw, 1.6rem);
}

.question {
  padding: clamp(15px, 3vw, 25px);
}

.navigation {
  flex-direction: column;
  gap: 10px;
}

@media (min-width: 480px) {
  .navigation {
    flex-direction: row;
    justify-content: space-between;
  }
}

/* Фикс для Tilda */
.t-records #test-wrapper,
.t-records .tilda-test-container {
  position: static !important;
  transform: none !important;
  width: auto !important;
  height: auto !important;
} 

/* Контейнер вопросов */
#test-wrapper .tilda-test-container {
  background: #FFF4DE;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

/* Стили заголовков только внутри теста */
#test-wrapper h1,
#test-wrapper h2 {
  font-family: 'Noto Serif', serif;
  color: #103028;
  text-align: center;
  margin: 0 0 20px;
}

/* Кнопки навигации */

 .navigation {
            display: flex;
            justify-content: space-between;
            margin-top: 20px;
 }
#test-wrapper .nav-btn,
#test-wrapper .submit-btn {
   font-family: Noto Serif, Regular;
 background-color: #E5A521;
            color: #FFF4DE;
            border: none;
            padding: 10px 20px;
            font-size: 16px;
            border-radius: 20px;
            margin: pauto;
            cursor: pointer;
            transition: background-color 0.3s;
}

.nav-btn1 {font-family: Noto Serif, Regular;
 background-color: #E5A521;
            color: #FFF4DE;
            border: none;
            padding: 10px 20px;
            font-size: 16px;
            border-radius: 20px;
            margin: pauto;
            cursor: pointer;
            transition: background-color 0.3s;
            margin: 0 auto;
            display: block;
}
}
#test-wrapper .nav-btn:hover,
#test-wrapper .submit-btn:hover, 
#test-wrapper .nav-btn1:hover {
 background-color: #2E69
}

/* Вопросы */
#test-wrapper .question {
  display: none;
  background: #FFF4DE;
  padding: 15px;
  border-radius: 8px;
  margin-top: 20px;
}
#test-wrapper .question.active {
  display: block;
}

/* Прогресс */
#test-wrapper .progress-container {
  background: #FFFFFF;
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 20px;
}
#test-wrapper .progress-bar {
  width: 0;
  height: 10px;
  background: #E5A521;
  transition: width 0.3s;
}
#test-wrapper .progress-text {
  text-align: center;
  font-weight: bold;
  color: #103028;
  margin-bottom: 10px;
}

/* Результат */
#test-wrapper #result {
  background: #FFF4DE;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  display: none;
  box-sizing: border-box;
}
#test-wrapper #result h2 {
  margin: 0 0 10px;
  font-size: 1.3em;
  font-family: 'Noto Serif', serif;
  color: #103028;
}
#test-wrapper #result p {
  margin: 0 0 20px;
  color: #103028;
}

/* Риски — цветная полоска слева */
#test-wrapper .high-risk,
#test-wrapper .medium-risk,
#test-wrapper .low-risk {
  background: #FFF4DE;
  border-left: 4px solid;
  padding: 15px;
  margin-bottom: 20px;
  color: #103028;
}
#test-wrapper .high-risk   { border-color: #f5c6cb; }
#test-wrapper .medium-risk { border-color: #ffeeba; }
#test-wrapper .low-risk    { border-color: #c3e6cb; }

/* Оверлей «анализирую» */
#loadingOverlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(255,255,255,0.8);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
#loadingOverlay.active { display: flex; }
#loadingOverlay .progress-bar {
  width: 0;
  transition: width 2s ease;
}
