/* ============================================================
   РАЗДЕЛ: модалка записи на занятие. Префикс: booking-
   Модалка открывается с любой страницы, стили перекрывают
   слой .modal-* — в PROJECT_STYLE_PATHS файл стоит после
   ui/Modal/Modal.css и остального общего слоя.
   ============================================================ */
.modal-overlay--booking {
  align-items: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  background: rgb(27 30 23 / 68%);
  display: flex;
  justify-content: center;
  padding: 24px;
}

.modal-panel--booking {
  background: #fffdf6;
  border-radius: var(--radius-l);
  max-height: 780px;
  max-width: 854px;
  min-width: 0;
  overflow: hidden;
  width: min(1240px, calc(100vw - 48px));
  height: min(900px, calc(100dvh - 48px));
}

.modal-panel--booking .modal-header {
  background: transparent;
  border: 0;
  box-shadow: none;
  cursor: default;
  padding: 0;
  position: absolute;
  right: 15px;
  top: 14px;
  z-index: 3;
}

.modal-panel--booking .modal-grip { display: none; }

.modal-panel--booking .modal-title {
  clip-path: inset(50%);
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
  height: 1px;
}

.modal-panel--booking .modal-close {
  background: rgb(255 253 246 / 18%);
  color: #fffdf6;
  width: 40px;
  height: 40px;
}

.modal-panel--booking .modal-close:hover {
  background: rgb(255 253 246 / 34%);
  color: #fffdf6;
}

.modal-panel--booking .modal-body {
  background: #e6e3da;
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0;
  scrollbar-width: none;
}

.modal-panel--booking .modal-body::-webkit-scrollbar { display: none; }

.booking-form {
  /* background: #e6e3da; */
  color: #26291e;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, .25fr);
  height: 100%;
  isolation: isolate;
  min-height: 760px;
  overflow: hidden;
  position: relative;
}

.booking-form--content {
  align-content: start;
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 16px 24px;
}

.booking-form--head { margin-bottom: 4px; padding-right: 45px; }

.booking-form--eyebrow {
  color: #ad8c3d;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.17em;
  margin: 0 0 7px;
  text-transform: uppercase;
}

.booking-form--head h2 {
  color: #292d22;
  font-family: var(--font-heading, 'Fira Sans Extra Condensed', sans-serif);
  font-size: clamp(2.1rem, 3vw, 2.7rem);
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 0.98;
  margin: 0 0 2px;
  text-transform: uppercase;
}

.booking-form--head p:last-child {
  color: #66675c;
  font-size: 0.9rem;
  line-height: 1.4;
}

.booking-form--group {
  border: 0;
  margin: 0;
  min-width: 0;
  padding: 0;
}

.booking-form--group legend,
.booking-form--field > span:first-child {
  bottom: 2px;
  color: #626c54;
  font-size: 0.6rem;
  font-weight: 700;
  left: 6px;
  letter-spacing: 0.07em;
  position: relative;
  text-transform: uppercase;
  z-index: 1;
  justify-self: start;
}

.booking-form--choices {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr;
}

.booking-form--choices-format,
.booking-form--choices-practice { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.booking-form--choices-messenger { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.booking-form--choice {
  align-items: center;
  background: rgb(255 255 255 / 62%);
  border: 1px solid #e4dfd3;
  border-radius: 12px;
  color: #33362b;
  cursor: pointer;
  display: flex;
  font-size: 0.91rem;
  font-weight: 500;
  gap: 6px;
  padding: 9px 8px;
  position: relative;
  transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.booking-form--choice:hover { background: rgb(255 255 255 / 88%); border-color: #c7b57c; }
.booking-form--choice:has(input:checked) {background: #f0ffe9;border-color: #62ae3c;box-shadow: 0 0 0 1px rgb(185 154 73 / 12%);}
.booking-form--choice:has(input:focus-visible) { outline: 3px solid rgb(201 169 78 / 28%); outline-offset: 2px; }
.booking-form--choice input[type='radio'] {
  clip-path: inset(50%);
  opacity: 0;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
  height: 1px;
}
.booking-form--choice > span { min-width: 0; }
.booking-form--choice-icon { color: #a77e26; flex: 0 0 24px; }
.booking-form--choice-whatsapp .booking-form--choice-icon { color: #25d366; }
.booking-form--choice-viber .booking-form--choice-icon { color: #7360f2; flex: 0 0 24px; height: 24px; }
.booking-form--choice-telegram .booking-form--choice-icon { color: #27a7e7; }

.booking-form--fields { display: grid; gap: 13px; }
.booking-form--field { display: grid; gap: 0; min-width: 0; }

/* Клик по заблокированному полю телефона (мессенджер ещё не выбран)
   показывает эту подсказку вместо молчаливого игнорирования клика. */
.booking-form--field-hint {
  background: #cdb665;
  border-radius: var(--radius-m);
  padding: 5px 10px;
  color: #f1ede5;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  margin: 6px 2px 0;
}

.booking-form--input-wrap {
  align-items: center;
  background: rgb(255 255 255 / 88%);
  border: 1px solid #e1dbcc;
  border-radius: 10px;
  color: #6c5523;
  display: flex;
  gap: 12px;
  min-height: 47px;
  padding: 0 14px;
  position: relative;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.booking-form--input-icon { color: #725b2c; flex: 0 0 20px; }
.booking-form--input-wrap:focus-within { border-color: #a98b3f; box-shadow: 0 0 0 3px rgb(201 169 78 / 20%); }
.booking-form--input-wrap input {
  background: transparent;
  border: 0;
  color: #26291e;
  font: inherit;
  min-height: 45px;
  outline: 0;
  padding: 0;
  width: 100%;
}
.booking-form--input-wrap input:disabled { cursor: not-allowed; opacity: 0.66; }
.booking-form--input-wrap input::placeholder,
.booking-form--field textarea::placeholder { color: #99988c; }

/* Клик по disabled-инпуту телефона браузер до ancestor'ов не доводит —
   поэтому пока мессенджер не выбран, клики ловит этот прозрачный слой
   поверх поля, а не сам инпут. */
.booking-form--phone-lock {
  appearance: none;
  background: transparent;
  border: 0;
  cursor: not-allowed;
  inset: 0;
  padding: 0;
  position: absolute;
}

.booking-form--field textarea {
  background: rgb(255 255 255 / 88%);
  border: 1px solid #e1dbcc;
  border-radius: 10px;
  color: #26291e;
  font: inherit;
  line-height: 1.4;
  min-height: 60px;
  overflow: hidden;
  padding: 11px 14px;
  resize: none;
  width: 100%;
}

.booking-form--field textarea:focus { border-color: #a98b3f; outline: 3px solid rgb(201 169 78 / 20%); }

.booking-form--submit {
  align-items: center;
  background: #caa64e;
  border: 0;
  border-radius: 30px;
  color: #2c2e22;
  cursor: pointer;
  display: flex;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  gap: 14px;
  justify-content: center;
  margin: 2px auto 0;
  max-width: 370px;
  padding: 10px 24px;
  transition: background-color 150ms ease, transform 150ms ease;
  width: 100%;
}

.booking-form--submit:hover { background: #d5b866; transform: translateY(-1px); }
.booking-form--submit:disabled { cursor: progress; opacity: 0.65; transform: none; }

.booking-form--note {
  background: #edf0e2;
  border-radius: 9px;
  color: #555b43;
  font-size: 0.9rem;
  line-height: 1.45;
  margin: 0;
  padding: 12px 14px;
}

.booking-form--note.is-error { background: #f7e9e3; color: #8f4333; }

/* Экран успеха: перекрывает всю форму (оба столбца), фон формы виден
   сквозь блюр — вместо строки под кнопкой, чтобы подтверждение нельзя
   было пропустить. */
.booking-form--success {
  align-items: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: rgb(125 122 113 / 33%);
  border-radius: var(--radius-l);
  max-width: 380px;
  max-height: 420px;
  left: calc(50% - 190px);
  top: 45%;
  display: flex;
  flex-direction: column;
  gap: 18px;
  inset: 0;
  justify-content: center;
  padding: 32px;
  position: absolute;
  text-align: center;
  z-index: 4;
  margin: auto;
}

.booking-form--success[hidden] { display: none; }

.booking-form--success-icon {
  align-items: center;
  background: #dff3e3;
  border-radius: 50%;
  color: #2f9e44;
  display: flex;
  justify-content: center;
  width: 72px;
  height: 72px;
}

.booking-form--success-icon svg { width: 38px; height: 38px; }

.booking-form--success-text {
  color: #26291e;
  font-size: 1.05rem;
  line-height: 1.5;
  margin: 0;
  max-width: 360px;
}

.booking-form--success-close {
  align-items: center;
  background: #caa64e;
  border: 0;
  border-radius: 30px;
  color: #2c2e22;
  cursor: pointer;
  display: flex;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  justify-content: center;
  margin-top: 6px;
  max-width: 370px;
  min-height: 54px;
  padding: 12px 24px;
  transition: background-color 150ms ease, transform 150ms ease;
  width: 100%;
}

.booking-form--success-close:hover { background: #d5b866; transform: translateY(-1px); }

.booking-form--art {
  background: radial-gradient(ellipse at 23% 70%, #fbf2d8 0%, #77765c 36%, #34392b 100%);
  min-height: 100%;
  overflow: hidden;
  position: relative;
}

.booking-form--art::before,
.booking-form--art::after {
  border: 1px solid rgb(215 189 114 / 66%);
  border-radius: 50%;
  content: '';
  left: -65px;
  pointer-events: none;
  position: absolute;
  top: 16%;
  width: 520px;
  height: 520px;
}

.booking-form--art::after { left: -15px; top: 23%; width: 420px; height: 420px; }

.booking-form--art-brand {
  color: #f5e3a7;
  font-size: 0.72rem;
  font-weight: 600;
  left: 30px;
  letter-spacing: 0.2em;
  margin: 0;
  position: absolute;
  text-transform: uppercase;
  top: 30px;
  z-index: 1;
}

.booking-form--art img {
  bottom: 26%;
  object-fit: contain;
  object-position: center bottom;
  position: absolute;
  right: 10px;
  width: 100%;
  height: auto;
}

@media (max-width: 980px) {
  .modal-panel--booking { max-width: min(900px, calc(100vw - 32px)); width: min(900px, calc(100vw - 32px)); }
  .booking-form { grid-template-columns: minmax(0, 1fr) minmax(250px, 0.4fr); }
  .booking-form--content { padding: 29px 28px 24px; }
}

@media (max-width: 700px) {
  .modal-overlay--booking { padding: 8px; }
  .modal-panel--booking {
    border-radius: 20px;
    max-height: calc(100dvh - 16px);
    max-width: calc(100vw - 16px);
    width: calc(100vw - 16px);
    height: calc(100dvh - 16px);
  }
  .modal-panel--booking .modal-header { right: 9px; top: 9px; }
  .modal-panel--booking .modal-close { width: 36px; height: 36px; }
  .booking-form { display: flex; flex-direction: column; min-height: 100%; overflow: visible; }
  .booking-form--content {gap: 14px;order: 2;padding: 24px 18px 21px;}
  .booking-form--head p:last-child {margin-bottom: 2px;};
  .booking-form--head h2 { font-size: 2.2rem; }
  .booking-form--art { flex: 0 0 190px; min-height: 190px; order: 1; }
  .booking-form--art-brand { left: 20px; top: 22px; }
  .booking-form--art img {right: 13%;bottom: -53%;width: auto;height: 182%;}
  .booking-form--art::before { left: -60px; top: -25px; width: 290px; height: 290px; }
  .booking-form--art::after { left: -20px; top: 10px; width: 220px; height: 220px; }
  .booking-form--choices-format,
  .booking-form--choices-messenger {/* grid-template-columns: repeat(3, minmax(0, 1fr)); */}
  .booking-form--choice { font-size: 0.84rem; gap: 6px; justify-content: center; min-height: 45px; padding: 8px 5px; }
  .booking-form--choice-icon { flex-basis: 20px; }
  .booking-form--choice-viber .booking-form--choice-icon { flex-basis: 20px; height: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .booking-form--choice,
  .booking-form--input-wrap,
  .booking-form--submit { transition: none; }
}
