:root {
  --primary: #9C76E4; /* сиреневый акцент */
  --primary-light: #B8A2F0;
  --light-bg: #F8F5FF;
  --card-bg: #FFFFFF;
  --text: #2D2D2D;
  --text-light: #666666;
  --border-radius: 16px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Onest', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--light-bg);
  background: url('background.png') no-repeat center center;
  background-size: cover;
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.6;
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
  padding: 0;
}

/* Прозрачный оверлей для читаемости (если используется фоновая картинка) */
/*
body::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(248, 245, 255, 0.85);
  z-index: -1;
}
*/

.main-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  /* Увеличенный отступ сверху */
  padding: 80px 16px 20px;
  position: relative;
  z-index: 1;
}

/* Заголовок и подзаголовок — без фона */
header {
  text-align: center;
  margin-bottom: 32px;
  width: 100%;
  max-width: 700px;
  position: relative;
  z-index: 1;
}

header h1 {
  font-size: 35px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  line-height: 1.3;
}

.subtitle {
  font-size: 16px;
  color: var(--text-light);
  margin-top: 12px;
  line-height: 1.6;
  text-align: center;
}

/* Карточка с вопросами */
.question-card {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
  transition: var(--transition);
  animation: fadeInUp 0.5s ease forwards;
  opacity: 0;
  transform: translateY(20px);
  border: 1px solid #eee;
  width: 100%;
  max-width: 700px;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.question-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

h2 {
  margin-top: 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 14px;
  line-height: 1.4;
}

.instruction {
  font-style: italic;
  color: var(--text-light);
  margin-top: -8px;
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.5;
}

.option {
  margin: 12px 0;
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
}

.option label {
  min-width: 0;
  flex: 1;
  font-weight: 500;
  color: var(--text);
  word-break: break-word;
  padding-right: 12px;
  max-width: 100%;
}

/* === СТИЛЬ ДЛЯ ЗАКРУГЛЁННЫХ ВЫПАДАЮЩИХ СПИСКОВ === */
.option select {
  padding: 10px 14px;
  border: 1px solid #ddd;
  border-radius: var(--border-radius);
  font-size: 15px;
  background: #fff;
  color: var(--text);
  transition: var(--transition);
  min-width: 60px;
  cursor: pointer;
  -moz-appearance: none;
  -webkit-appearance: none;
  appearance: none;
  /* Сиреневая стрелка */
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3e%3cpath fill='%239C76E4' d='M7.4 10.8L3.2 6.6l-.9.9 5.1 5.1 5.1-5.1-.9-.9-4.2 4.2z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
}

.option select:hover,
.option select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(156, 118, 228, 0.15);
  outline: none;
}

/* Поля ввода */
input[type="text"],
input[type="radio"],
input[type="checkbox"] {
  padding: 10px 14px;
  border: 1px solid #ddd;
  border-radius: var(--border-radius);
  font-size: 15px;
  background: #fff;
  transition: var(--transition);
  color: var(--text);
  min-width: 0;
  flex: 0 0 auto;
}

/* Группа "Другое" — текст и поле на одной строке */
.other-option-group {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.other-option-group label {
  margin: 0;
  padding: 0;
  white-space: nowrap;
  font-weight: 500;
  color: var(--text);
  flex: 0 0 auto;
}

.other-option-group .other-text-inline {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 10px 14px;
  border: 1px solid #ddd;
  border-radius: var(--border-radius);
  font-size: 15px;
  background: #fff;
  color: var(--text);
}

.error {
  color: #e74c3c;
  font-size: 14px;
  margin-top: 10px;
  display: none;
  animation: shake 0.5s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}

button {
  display: block;
  margin: 40px auto 24px;
  padding: 14px 42px;
  font-size: 18px;
  font-weight: 600;
  color: white;
  background: var(--primary);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: var(--transition);
  letter-spacing: 0.5px;
  width: auto;
  min-width: 200px;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(156, 118, 228, 0.3);
}

button:active {
  transform: translateY(0);
}

button:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(156, 118, 228, 0.3);
}

#message {
  text-align: center;
  font-weight: 600;
  font-size: 18px;
  color: var(--primary);
  margin-top: 20px;
  opacity: 0;
  animation: fadeIn 0.6s forwards;
}

@keyframes fadeIn {
  to { opacity: 1; }
}

/* === СТРАНИЦА БЛАГОДАРНОСТИ === */
.thank-you-container {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  text-align: center;
  padding: 80px 20px 40px;
  max-width: 600px;
  margin: 0 auto;
  font-family: 'Onest', sans-serif;
}

.thank-you-container h2 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 24px;
  line-height: 1.3;
}

.thank-you-container p {
  font-size: 18px;
  color: var(--text-light);
  margin: 0 0 32px;
  line-height: 1.6;
}

.thank-you-button {
  display: inline-block;
  padding: 14px 42px;
  font-size: 18px;
  font-weight: 600;
  color: white;
  background: var(--primary);
  text-decoration: none;
  border-radius: 50px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(156, 118, 228, 0.3);
}

.thank-you-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(156, 118, 228, 0.4);
}

/* Адаптивность */
@media (max-width: 768px) {
  .main-container { padding: 60px 16px 20px; }
  header h1 { font-size: 24px; }
  .subtitle { font-size: 15px; }
  .question-card { padding: 22px; margin-bottom: 20px; }
  h2 { font-size: 18px; }
  .option label { min-width: auto; flex: none; margin-bottom: 8px; }
  .option select { background-position: right 10px center; background-size: 10px; }

  /* Мобильный стиль для "Другое" */
  .other-option-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .other-option-group label {
    white-space: normal;
  }

  button { padding: 12px 32px; font-size: 17px; min-width: 180px; }

  .thank-you-container { padding: 60px 20px 30px; }
  .thank-you-container h2 { font-size: 24px; }
  .thank-you-container p { font-size: 16px; }
}

@media (max-width: 480px) {
  .main-container { padding: 40px 16px 20px; }
  header h1 { font-size: 20px; }
  .question-card { padding: 18px; }
  h2 { font-size: 17px; }
  .option { flex-direction: column; align-items: flex-start; }
  .option label { margin-bottom: 6px; }
  input[type="radio"], input[type="checkbox"] { margin-bottom: 4px; }
  .option select { font-size: 14px; padding: 8px 12px; }

  .other-option-group .other-text-inline {
    width: 100%;
    font-size: 14px;
    padding: 8px 12px;
  }

  .thank-you-container { padding: 50px 20px 20px; }
  .thank-you-container h2 { font-size: 22px; }
  .thank-you-container p { font-size: 15px; }
  .thank-you-button { padding: 12px 32px; font-size: 17px; }
}