* {
  box-sizing: border-box;
  transition: all 0.3s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-image: url("bg.jpg");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  font-family: 'Segoe UI', Roboto, -apple-system, sans-serif;
  margin: 0;
  padding: 0;
  color: #333;
  line-height: 1.6;
  position: relative;
}

body::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(41, 128, 185, 0.3) 0%, rgba(142, 68, 173, 0.2) 100%);
  z-index: -1;
}

html, body {
  min-height: 100%;
  overflow-y: auto;
}

.form-container {
  max-width: 650px;
  margin: 40px auto;
  background-color: rgba(255, 255, 255, 0.97);
  padding: 35px 45px;
  border-radius: 20px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1), 0 5px 15px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.form-container:hover {
  transform: translateY(-5px);
}

.form-header {
  height: 120px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 15px;
  margin-bottom: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
}

.form-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #3498db, #2ecc71);
}

.header-logo {
  max-height: 90px;
  object-fit: contain;
  transition: transform 0.3s ease;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.header-logo:hover {
  transform: scale(1.05);
}

.form-group {
  margin-bottom: 22px;
  position: relative;
}

label {
  display: block;
  margin-top: 16px;
  margin-bottom: 8px;
  font-size: 15px;
  font-weight: 600;
  color: #2c3e50;
  transition: color 0.3s ease;
  letter-spacing: 0.3px;
}

label i {
  margin-right: 8px;
  color: #3498db;
  width: 18px;
  text-align: center;
  font-size: 16px;
}

label:hover {
  color: #3498db;
}

input, select, textarea {
  width: 100%;
  padding: 14px 16px;
  margin-top: 4px;
  border: 1px solid #ddd;
  border-radius: 10px;
  font-size: 15px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.03);
  transition: all 0.3s ease;
  background-color: rgba(255, 255, 255, 0.9);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
  background-color: #fff;
  transform: translateY(-2px);
}

button[type="submit"] {
  width: 100%;
  margin-top: 35px;
  background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
  color: #fff;
  padding: 16px;
  font-weight: bold;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  font-size: 16px;
  letter-spacing: 0.8px;
  box-shadow: 0 6px 12px rgba(46, 204, 113, 0.3);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
}

button[type="submit"]::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: all 0.6s ease;
}

button[type="submit"]:hover::before {
  left: 100%;
}

button[type="submit"]:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 15px rgba(46, 204, 113, 0.4);
  background: linear-gradient(135deg, #27ae60 0%, #219653 100%);
}

.error-message {
  background-color: rgba(231, 76, 60, 0.1);
  border-left: 4px solid #e74c3c;
  padding: 12px 15px;
  border-radius: 5px;
  margin: 15px 0;
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.question-block {
  margin-top: 30px;
}

.question-group {
  margin-top: 25px;
  padding: 22px;
  border: 1px solid #e0e0e0;
  border-radius: 15px;
  background-color: #f8f9fa;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
  transition: all 0.3s ease;
  position: relative;
}

.question-group:hover {
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.08);
  border-color: #d0d7de;
  transform: translateY(-2px);
}

.section-title {
  font-weight: bold;
  font-size: 17px;
  color: #2c3e50;
  flex: 1;
  cursor: pointer;
  margin-bottom: 12px;
  display: block;
  position: relative;
}

.title-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.1);
}

.xeyr-button {
  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
  color: white;
  border: none;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-left: 10px;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  width: auto;
  margin-top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.5px;
}

.xeyr-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.15);
  background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
}

.xeyr-button:active {
  transform: translateY(1px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.xeyr-button i {
  margin-right: 5px;
  font-size: 12px;
}

.section-title {
  padding-left: 24px;
  transition: all 0.3s ease;
  letter-spacing: 0.3px;
}

.section-title:before {
  content: '▶';
  position: absolute;
  left: 0;
  font-size: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #3498db;
  transition: transform 0.3s ease;
}

.section-title:hover {
  color: #3498db;
}

.question-group > label:first-of-type {
  font-weight: bold;
  margin-bottom: 10px;
  display: block;
}

.question-group > label + label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 20px;
  font-weight: normal;
  margin-top: 10px;
}

.question-group input[type="radio"] {
  margin: 0;
  accent-color: #3498db;
}

.question-group div {
  margin-top: 12px;
}

.question-group .subquestion {
  margin-top: 10px;
  padding-left: 15px;
  border-left: 2px solid #e0e0e0;
}

.question-group .subquestion > div {
  font-weight: 500;
  margin-bottom: 6px;
}

.question-group .subquestion label {
  display: inline-flex;
  align-items: center;
  margin-right: 18px;
  gap: 8px;
  font-weight: normal;
}

.question-group label input[type="checkbox"] {
  margin-right: 8px;
  accent-color: #3498db;
}

.question-group input[type="text"] {
  margin-top: 10px;
  width: 100%;
}

.photo-preview {
  margin-top: 15px;
  min-height: 40px;
  border: 1px dashed #ddd;
  border-radius: 8px;
  padding: 5px;
  text-align: center;
  background-color: #f8f9fa;
}

.photo-preview img {
  max-height: 200px;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.thanks {
  display: none;
  text-align: center;
  font-size: 18px;
  font-weight: bold;
  color: #27ae60;
  margin-top: 35px;
  padding: 15px;
  background-color: #f0fff4;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}


/* 🔥 Mobile-first адаптация */
@media screen and (max-width: 768px) {
  .form-container {
    margin: 20px auto;
    padding: 25px;
    width: 95%;
    border-radius: 12px;
  }
  

  .header-logo {
      max-height: 60px;
  }

  input, select, textarea {
      font-size: 16px;
      padding: 10px 12px;
  }

  label {
      font-size: 15px;
      margin-top: 12px;
  }

  button {
      font-size: 17px;
      padding: 12px;
  }
  
  .question-group {
      padding: 15px;
      margin-top: 15px;
  }
  
  .section-title {
      font-size: 15px;
  }
}

/* Дополнительные стили для очень маленьких экранов */
@media screen and (max-width: 400px) {
  .form-container {
      margin: 15px 10px;
      padding: 20px 15px;
  }
  
  .form-header {
      height: 70px;
  }
  
  .header-logo {
      max-height: 50px;
  }
}

/* Стили для анимации загрузки */
.loading-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.9);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 30px;
  background-color: white;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.loading-logo {
  width: 150px;
  margin-bottom: 20px;
  animation: pulse 1.5s infinite alternate;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #f3f3f3;
  border-top: 5px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 15px 0;
}

.loading-text {
  font-size: 18px;
  font-weight: bold;
  color: #333;
  margin-top: 10px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes pulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.05); }
}
