.form-section {
  max-width: 600px;
  margin: 3rem auto;
  padding: 2rem;
  border-radius: 12px;
  background: linear-gradient(135deg, #f9f9f9 0%, #f0f4f8 100%);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
  animation: fadeIn 0.6s ease;
}

.messages {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.85);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 10px;
  font-size: 1.2rem;
  text-align: center;
  max-width: 500px;
  width: auto;
  word-wrap: break-word;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  z-index: 9999;
  animation: fadeIn 0.5s ease;
}

/* Плавное появление */
@keyframes fadeIn {
  from { opacity: 0; transform: translate(-50%, -60%); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}
.messages-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.4); /* затемнение фона */
  z-index: 99999; /* выше всего */
}

.messages-overlay p {
  background: rgba(0, 0, 0, 0.85);
  color: white;
  padding: 1rem 2rem;
  border-radius: 8px;
  font-size: 1.2rem;
  max-width: 90%;
  text-align: center;
}

/* Адаптивность */
@media (max-width: 768px) {
  .messages-overlay p {
    font-size: 1rem;
  }
}



/* Лёгкая абстракция */
.form-section::before {
  content: '✏️';
  position: absolute;
  top: -20px;
  right: -20px;
  font-size: 5rem;
  opacity: 0.06;
  animation: floatIcon 6s ease-in-out infinite alternate;
}

@keyframes floatIcon {
  from { transform: translate(0,0) rotate(0deg); }
  to { transform: translate(-10px, 10px) rotate(6deg); }
}

/* Заголовок */
.form-section h2 {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 2rem;
  color: #0077cc;
  position: relative;
  z-index: 1;
}

/* Поля формы */
.form-group {
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 1;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #333;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  transition: border-color 0.2s, box-shadow 0.2s;
  background-color: #fff;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: #0077cc;
  box-shadow: 0 0 6px rgba(0, 119, 204, 0.15);
  outline: none;
}

/* Ошибки */
.form-group ul {
  margin-top: 0.5rem;
  color: #d00;
  font-size: 0.9rem;
  list-style: none;
  padding: 0;
}

/* Кнопка */
.btn-submit {
  display: block;
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  background: linear-gradient(135deg, #0077cc, #005fa3);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s;
  position: relative;
  z-index: 1;
}

.btn-submit:hover {
  background: linear-gradient(135deg, #005fa3, #004a80);
  transform: translateY(-2px);
}

/* Сообщения */
.alert {
  padding: 1rem;
  margin-bottom: 1.5rem;
  border-radius: 6px;
  font-weight: 500;
  animation: fadeIn 0.4s ease;
}

.alert-success {
  background: #d4edda;
  color: #155724;
}

.alert-danger {
  background: #f8d7da;
  color: #721c24;
}

/* Адаптивность */
@media (max-width: 768px) {
  .form-section {
    margin: 2rem 1rem;
    padding: 1.5rem;
  }

  .form-section h2 {
    font-size: 1.75rem;
  }

  .btn-submit {
    font-size: 0.95rem;
  }
}

@media (max-width: 480px) {
  .form-section {
    padding: 1.25rem;
  }

  .form-section h2 {
    font-size: 1.5rem;
  }
}

/* Сообщение об успешной отправке */
.success-message {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  background: #f0fff0;
  border: 2px solid #28a745;
  border-radius: 12px;
  padding: 2rem;
  text-align: center;

  color: #155724;
  font-size: 1.3rem;
  font-weight: 600;

  max-width: 600px;
  margin: 3rem auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.success-message p {
  margin-bottom: 1.5rem;
}

.success-message .btn-submit {
  background: #28a745;
  color: #fff;
  padding: 0.8rem 1.8rem;
  border-radius: 8px;
  font-size: 1rem;
  text-decoration: none;
  transition: background 0.3s ease;
}

.success-message .btn-submit:hover {
  background: #218838;
}

/* Адаптивность */
@media (max-width: 768px) {
  .success-message {
    font-size: 1.1rem;
    padding: 1.5rem;
    margin: 2rem 1rem;
  }
}

@media (max-width: 480px) {
  .success-message {
    font-size: 1rem;
    padding: 1rem;
  }
}
