/* =========================================================
   asatoma-par.ru · booking-modal.css
   ─────────────────────────────────────────────────────────
   Модалка «Запись на услугу» — native <dialog>, на десктопе
   центрированная карточка, на мобайле bottom-sheet.
   Палитра — токены темы (--aa-*).
   ========================================================= */

.booking-modal {
  border: none;
  padding: 0;
  border-radius: 16px;
  max-width: 480px;
  width: calc(100vw - 48px);
  background: var(--aa-pearl, #EFE7DA);
  color: var(--aa-anthracite, #1D1D1B);
  box-shadow: 0 32px 96px -32px rgba(15, 30, 55, 0.32);
  opacity: 0;
  transition: opacity 240ms ease;
}
.booking-modal[open] { opacity: 1; }

.booking-modal::backdrop {
  background: rgba(15, 30, 55, 0.48);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.booking-modal__inner {
  padding: 40px 32px 32px;
  position: relative;
}

.booking-modal__close {
  position: absolute;
  top: 16px; right: 16px;
  width: 40px; height: 40px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 8px;
  color: var(--aa-anthracite, #1D1D1B);
  display: flex; align-items: center; justify-content: center;
  transition: background 200ms ease;
}
.booking-modal__close:hover { background: var(--aa-pearl-deep, #E6DCCB); }

/* ─── Шапка ─── */
.booking-modal__eyebrow {
  font-family: var(--aa-font-body, 'Manrope', sans-serif);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--aa-sapphire, #1E4A8C);
  margin: 0;
}
.booking-modal__title {
  font-family: var(--aa-font-display, 'Cormorant Garamond', serif);
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 500;
  line-height: 1.2;
  color: var(--aa-anthracite, #1D1D1B);
  margin: 8px 0 12px;
}
.booking-modal__meta {
  font-family: var(--aa-font-body, 'Manrope', sans-serif);
  font-size: 14px;
  color: var(--aa-ink-mute, #4A4A47);
  margin: 0 0 24px;
}
.booking-modal__meta-dot { margin: 0 8px; }

/* ─── Форма ─── */
.booking-form__row { margin-bottom: 16px; }
.booking-form__row[hidden] { display: none; }

.booking-form__label {
  display: block;
  font-family: var(--aa-font-body, 'Manrope', sans-serif);
  font-size: 13px; font-weight: 600;
  color: var(--aa-anthracite, #1D1D1B);
  margin-bottom: 6px;
}
.booking-form__row--inline { border: none; padding: 0; margin: 0 0 16px; }

.booking-form__row input[type="text"],
.booking-form__row input[type="tel"],
.booking-form__row input[type="date"],
.booking-form__row textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  font-family: var(--aa-font-body, 'Manrope', sans-serif);
  font-size: 16px;          /* iOS не зумит при фокусе */
  border: 1px solid var(--aa-hairline-strong, rgba(43,38,32,0.18));
  border-radius: 10px;
  background: #FFFFFF;
  color: var(--aa-anthracite, #1D1D1B);
  transition: border-color 200ms ease, box-shadow 200ms ease;
}
.booking-form__row input:focus,
.booking-form__row textarea:focus {
  outline: none;
  border-color: var(--aa-sapphire, #1E4A8C);
  box-shadow: 0 0 0 3px rgba(30, 74, 140, 0.12);
}
.booking-form__hint {
  font-family: var(--aa-font-body, 'Manrope', sans-serif);
  font-size: 12px;
  color: var(--aa-ink-soft, #6E675C);
  margin: 6px 0 0;
}

/* ─── Чипы «когда удобно» ─── */
.booking-form__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.booking-chip {
  padding: 10px 16px;
  border: 1px solid var(--aa-hairline-strong, rgba(43,38,32,0.18));
  background: #FFFFFF;
  color: var(--aa-anthracite, #1D1D1B);
  border-radius: 999px;
  font-family: var(--aa-font-body, 'Manrope', sans-serif);
  font-size: 14px;
  cursor: pointer;
  transition: background 200ms ease, color 200ms ease, border-color 200ms ease;
}
.booking-chip[aria-checked="true"] {
  background: var(--aa-sapphire, #1E4A8C);
  color: #FFFFFF;
  border-color: var(--aa-sapphire, #1E4A8C);
}

/* ─── Honeypot ─── */
.booking-form__honeypot {
  position: absolute;
  left: -9999px;
  width: 1px; height: 1px;
  opacity: 0;
}

/* ─── Согласие ─── */
.booking-form__consent {
  display: flex; gap: 10px; align-items: flex-start;
  font-family: var(--aa-font-body, 'Manrope', sans-serif);
  font-size: 13px;
  color: var(--aa-ink-mute, #4A4A47);
  margin: 8px 0 20px;
  cursor: pointer;
}
.booking-form__consent input { margin-top: 2px; flex: none; }
.booking-form__consent a {
  color: var(--aa-sapphire, #1E4A8C);
  text-decoration: underline;
}

/* ─── Submit ─── */
.booking-form__submit {
  width: 100%;
  padding: 16px 24px;
  background: var(--aa-sapphire, #1E4A8C);
  color: #FFFFFF;
  border: none;
  border-radius: 12px;
  font-family: var(--aa-font-body, 'Manrope', sans-serif);
  font-size: 16px; font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  transition: background 200ms ease, opacity 200ms ease;
}
.booking-form__submit:hover { background: var(--aa-sapphire-deep, #163866); }
.booking-form__submit:disabled { opacity: 0.5; cursor: not-allowed; }

.booking-form__submit-spinner {
  width: 18px; height: 18px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: booking-spin 720ms linear infinite;
  display: none;
}
.booking-form[data-state="submitting"] .booking-form__submit-spinner { display: inline-block; }
.booking-form[data-state="submitting"] .booking-form__submit-label { opacity: 0.6; }
@keyframes booking-spin { to { transform: rotate(360deg); } }

.booking-form__error {
  background: rgba(176, 65, 62, 0.08);
  border: 1px solid rgba(176, 65, 62, 0.28);
  color: #B0413E;
  padding: 12px 14px;
  border-radius: 10px;
  font-family: var(--aa-font-body, 'Manrope', sans-serif);
  font-size: 14px;
  margin-top: 12px;
}
.booking-form__error[hidden] { display: none; }

/* ─── Success ─── */
.booking-modal__success { text-align: center; padding: 24px 0 8px; }
.booking-modal__success[hidden] { display: none; }
.booking-modal__success-icon {
  width: 64px; height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: rgba(30, 74, 140, 0.08);
  color: var(--aa-sapphire, #1E4A8C);
  display: flex; align-items: center; justify-content: center;
}
.booking-modal__success-title {
  font-family: var(--aa-font-display, 'Cormorant Garamond', serif);
  font-size: 28px;
  color: var(--aa-anthracite, #1D1D1B);
  margin: 0 0 8px;
}
.booking-modal__success-text {
  font-family: var(--aa-font-body, 'Manrope', sans-serif);
  color: var(--aa-ink-mute, #4A4A47);
  line-height: 1.5;
  margin: 0 0 24px;
}
.booking-modal__success-close {
  padding: 14px 32px;
  background: var(--aa-sapphire, #1E4A8C);
  color: #FFFFFF;
  border: none; border-radius: 12px;
  font-family: var(--aa-font-body, 'Manrope', sans-serif);
  font-size: 15px; font-weight: 600;
  cursor: pointer;
}

/* ─── Mobile bottom-sheet (≤767px) ─── */
@media (max-width: 767px) {
  .booking-modal {
    max-width: 100vw;
    width: 100vw;
    inset: auto 0 0 0;
    margin: 0;
    border-radius: 20px 20px 0 0;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 320ms cubic-bezier(0.16, 1, 0.3, 1), opacity 240ms ease;
  }
  .booking-modal[open] { transform: translateY(0); }
  .booking-modal__inner { padding: 24px 20px 32px; }
  .booking-modal__inner::before {
    content: '';
    display: block;
    width: 40px; height: 4px;
    background: var(--aa-hairline-strong, rgba(43,38,32,0.2));
    border-radius: 2px;
    margin: 0 auto 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .booking-modal,
  .booking-modal[open] { transition: none; transform: none; }
}
