/* ===== МОДАЛЬНОЕ ОКНО И ФОРМА ===== */

/* Кнопка открытия */
button.open-modal-btn {
  background: #3959eb;
  color: white;
  border: none;
  padding: 12px 34px;
  border-radius: 25px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.3s ease;
}

button.open-modal-btn:hover {
  background: #2a47c4;
}

/* Модальное окно */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
}

.modal.show {
  display: block;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.modal-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 560px;
  margin: 50px auto;
  background: white;
  border-radius: 25px;
  padding: 42px 45px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: #666;
  line-height: 1;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  color: #000;
  background: none;
}

.modal-header {
  color: #05131d;
  max-width: 360px;
  margin-bottom: 25px;
  text-align: center;
}

.modal-header h2 {
  margin: 0 0 16px 0;
  font-size: 24px;
}

.modal-header p {
  margin: 0;
  color: #5c5c5c;
  font-size: 14px;
}

/* Форма */
.modal-form {
  margin-top: 20px;
  width: 100%;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: #333;
  font-weight: 500;
  font-size: 14px;
}

.form-group input,
.form-group input[type="email"],
.form-group input[type="number"],
.form-group input[type="tel"],
.form-group input[type="text"],
.form-group textarea {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: 15px;
  font-size: 16px;
  transition: border 0.3s ease;
  box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #3959eb;
  box-shadow: 0 0 0 2px rgba(57, 89, 235, 0.1);
}

.form-group input.error,
.form-group textarea.error {
  border-color: #dc3545;
}

.error-message {
  display: block;
  color: #dc3545;
  font-size: 12px;
  margin-top: 5px;
  min-height: 18px;
}

input[type="tel"] {
  font-family: monospace;
}

/* Кнопка отправки */
.form-footer {
  margin-top: 30px;
}

button.submit-btn {
  width: 100%;
  padding: 15px;
  background: #3959eb;
  color: white;
  border: none;
  border-radius: 25px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  height: 50px;
}

button.submit-btn:active {
  background: #2a47c4;
}

button.submit-btn:hover:not(:disabled) {
  background: #2a47c4;
  transform: translateY(-1px);
}

button.submit-btn:disabled {
  background: #cccccc;
  cursor: not-allowed;
  transform: none;
}

button.submit-btn .spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Текст политики */
.privacy-text {
  margin-top: 15px;
  font-size: 12px;
  color: #666;
  line-height: 1.5;
  text-align: center;
}

.privacy-text a {
  color: #3959eb;
  text-decoration: none;
}

.privacy-text a:hover {
  text-decoration: underline;
}

/* Сообщения формы */
.form-message {
  margin-top: 20px;
  padding: 15px;
  border-radius: 6px;
  text-align: center;
  display: none;
}

.form-message.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
  display: block;
}

.form-message.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
  display: block;
}

/* Адаптивность */
@media (max-width: 600px) {
  .modal-container {
    margin: 20px;
    padding: 20px;
  }

  .modal-header h2 {
    font-size: 20px;
  }

  .submit-btn {
    padding: 12px;
  }
}
