/* Затемнение фона */
.booking-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  overflow-y: auto;
}

.booking-overlay.active {
  display: flex;
}

/* Карточка формы */
.booking-card {
  max-width: 500px;
  width: 100%;
  background: #ffffff;
  border-radius: 32px;
  padding: 32px;
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.15);
  position: relative;
  max-height: min(90vh, 860px);
  overflow-y: auto;
  box-sizing: border-box;
}

.booking-card .close-btn {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  font-size: 28px;
  color: #000;
  cursor: pointer;
  transition: 0.2s;
  line-height: 1;
}

.booking-card .close-btn:hover {
  color: #e49400;
}

.booking-card h2 {
  font-size: 28px;
  font-weight: 700;
  color: #1e2b3c;
  letter-spacing: -0.3px;
  margin-bottom: 8px;
}

.booking-card .subhead {
  color: #3d4a5a;
  font-size: 15px;
  line-height: 1.5;
  margin-bottom: 24px;
  margin-top: 20px;
  text-align: center;
  padding: 0;
  background: none;
  border-left: none;
  border-radius: 0;
}

.booking-card .subhead strong {
  font-size: 24px;
}

/* Поля формы */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 15px;
  color: #1e2b3c;
  margin-bottom: 6px;
  letter-spacing: -0.2px;
}

.form-group label .required {
  color: #c0392b;
  margin-left: 2px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 14px 24px;
  font-size: 16px;
  border: 2px solid #e6dfd9;
  border-radius: 5px;
  background: #fcfaf8;
  transition: 0.2s;
  color: #1e2b3c;
  outline: none;
  font-family: inherit;
  box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: #e49400;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(228, 148, 0, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 110px;
}

.form-group input::placeholder,
.form-group textarea::placeholder,
.form-group select::placeholder {
  color: #a79b90;
  font-weight: 400;
  font-size: 15px;
}

.form-group select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23999' stroke-width='2' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  cursor: pointer;
}

/* Кнопка отправки */
.submit-btn {
  width: 100%;
  max-width: 200px;
  background: #f2e4c8;
  color: #e49400;
  border: none;
  padding: 16px 24px;
  font-size: 18px;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: 0.2s;
  letter-spacing: 0.3px;
  margin: 6px auto 0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  height: auto;
  display: block;
  text-transform: none;
}

.submit-btn p {
  color: #e49400;
  font-size: 18px;
  font-weight: 600;
  line-height: normal;
  text-transform: uppercase;
  margin: 0;
}

.submit-btn:hover {
  opacity: 0.85;
  transform: scale(1.01);
  box-shadow: 0 8px 18px rgba(228, 148, 0, 0.25);
  background: #f2e4c8;
}

.submit-btn:active {
  transform: scale(0.97);
}

#bookingForm,
#reviewForm,
#questionForm {
  width: 100%;
}

/* Подвал формы */
.footnote {
  margin-top: 20px;
  font-size: 13px;
  color: #7a8a9a;
  text-align: center;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  padding-top: 18px;
}

.footnote span {
  background: #f0ebe6;
  padding: 2px 12px;
  border-radius: 30px;
  font-weight: 450;
}

/* Валидация */
.form-group input:invalid:not(:placeholder-shown),
.form-group textarea:invalid:not(:placeholder-shown) {
  border-color: #c0392b;
  background: #fff8f7;
}

.form-group input:valid:not(:placeholder-shown),
.form-group textarea:valid:not(:placeholder-shown) {
  border-color: #27ae60;
  background: #fafffd;
}

/* Уведомление об отправке */
.toast-notification {
  display: none;
  position: fixed;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: #27ae60;
  color: white;
  padding: 16px 32px;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 600;
  z-index: 2000;
  box-shadow: 0 8px 24px rgba(39, 174, 96, 0.3);
  animation: toastFadeIn 0.3s ease;
}

.toast-notification.active {
  display: block;
}

@keyframes toastFadeIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* Адаптив */
@media (max-width: 768px) {
  .booking-overlay {
    align-items: flex-end;
    padding: 16px;
  }

  .booking-card {
    max-width: 100%;
    max-height: min(88vh, 100%);
    border-radius: 28px;
    padding: 28px 20px 24px;
  }

  .booking-card h2 {
    font-size: 24px;
    line-height: 1.15;
    padding-right: 28px;
  }

  .booking-card .subhead {
    margin-top: 16px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.45;
  }

  .booking-card .subhead strong {
    font-size: 20px;
  }

  .booking-card .close-btn {
    top: 14px;
    right: 16px;
    font-size: 24px;
  }

  .form-group {
    margin-bottom: 16px;
  }

  .form-group label {
    font-size: 14px;
    margin-bottom: 8px;
  }

  .form-group input,
  .form-group textarea,
  .form-group select {
    min-height: 48px;
    padding: 12px 16px;
    font-size: 15px;
  }

  .form-group textarea {
    min-height: 104px;
  }

  .submit-btn {
    max-width: none;
    width: 100%;
    min-height: 52px;
    padding: 14px 20px;
    margin-top: 4px;
  }

  .submit-btn p {
    font-size: 16px;
  }
}

@media (max-width: 500px) {
  .booking-card {
    border-radius: 24px;
    padding: 24px 16px 20px;
  }

  .booking-card h2 {
    font-size: 22px;
  }

  .booking-card .subhead strong {
    font-size: 18px;
  }

  .form-group input,
  .form-group textarea,
  .form-group select {
    padding: 11px 14px;
    font-size: 14px;
  }

  .submit-btn p {
    font-size: 15px;
  }

  .toast-notification {
    top: 16px;
    width: calc(100% - 24px);
    padding: 14px 16px;
    font-size: 14px;
    text-align: center;
  }
}
