/* ============================================================
   Модальное окно «Записаться на приём»
   ============================================================ */

/* Обёртка */
.appt-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100000;
  align-items: center;
  justify-content: center;
}
.appt-modal.is-open {
  display: flex;
}

/* Фон */
.appt-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  animation: apptFadeIn 0.2s ease;
}

/* Диалог */
.appt-modal__dialog {
  position: relative;
  width: min(440px, calc(100% - 32px));
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
  animation: apptSlideUp 0.3s ease;
  z-index: 1;
}

/* Кнопка закрытия */
.appt-modal__close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 999px;
  background: #f2f4f8;
  color: #1f2937;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 2;
  transition: background 0.15s;
}
.appt-modal__close:hover {
  background: #e5e7eb;
}

/* Тело */
.appt-modal__body {
  padding: 32px 28px 28px;
}

/* Заголовок */
.appt-modal__title {
  margin: 0 0 6px;
  font-size: 1.4rem;
  font-weight: 700;
  color: #111;
  line-height: 1.25;
  padding-right: 36px;
}

.appt-modal__subtitle {
  margin: 0 0 22px;
  font-size: 0.9rem;
  color: #666;
  line-height: 1.45;
}

/* Поле ввода */
.appt-modal__field {
  margin-bottom: 18px;
}

.appt-modal__label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 6px;
}

.appt-modal__input {
  display: block;
  width: 100%;
  padding: 12px 14px;
  font-size: 1rem;
  border: 2px solid #e0e3e8;
  border-radius: 10px;
  background: #fafbfc;
  color: #111;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.appt-modal__input:focus {
  border-color: #3a96e8;
  background: #fff;
}

.appt-modal__error {
  display: block;
  margin-top: 4px;
  font-size: 0.8rem;
  color: #e31f26;
  min-height: 1.1em;
}

/* Чекбокс согласия */
.appt-modal__consent {
  margin-bottom: 20px;
}

.appt-modal__checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 0;
}

.appt-modal__checkbox {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.appt-modal__checkbox-custom {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border: 2px solid #ccd0d5;
  border-radius: 5px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, background 0.15s;
  margin-top: 1px;
}

.appt-modal__checkbox:checked + .appt-modal__checkbox-custom {
  background: #3a96e8;
  border-color: #3a96e8;
}
.appt-modal__checkbox:checked + .appt-modal__checkbox-custom::after {
  content: '';
  display: block;
  width: 6px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-top: -2px;
}

.appt-modal__consent-text {
  font-size: 0.75rem;
  line-height: 1.45;
  color: #888;
}
.appt-modal__consent-text a {
  color: #3a96e8;
  text-decoration: underline;
}
.appt-modal__consent-text a:hover {
  color: #2a7acc;
}

/* Кнопка отправки */
.appt-modal__submit {
  display: block;
  width: 100%;
  padding: 13px 20px;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background: #e31f26;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}
.appt-modal__submit:hover {
  background: #c41920;
}
.appt-modal__submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Экран успеха */
.appt-modal__success {
  text-align: center;
  padding: 20px 0;
}

.appt-modal__success-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  background: #e8f5e9;
  color: #2e7d32;
  border-radius: 50%;
  font-size: 28px;
  line-height: 56px;
}

.appt-modal__success-title {
  margin: 0 0 6px;
  font-size: 1.2rem;
  font-weight: 700;
  color: #111;
}

.appt-modal__success-text {
  margin: 0;
  font-size: 0.9rem;
  color: #666;
}

/* Анимации */
@keyframes apptFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes apptSlideUp {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ─── Мобильная адаптация ─────────────────────────────── */
@media (max-width: 600px) {
  .appt-modal {
    align-items: flex-end;
  }

  .appt-modal__dialog {
    width: 100%;
    border-radius: 18px 18px 0 0;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    animation: apptSlideFromBottom 0.3s ease;
  }

  .appt-modal__body {
    padding: 24px 16px 20px;
  }

  .appt-modal__title {
    font-size: 1.2rem;
  }
}

@keyframes apptSlideFromBottom {
  from { opacity: 0; transform: translateY(100%); }
  to   { opacity: 1; transform: translateY(0); }
}
