/* ==========================================================================
   Denty — Booking modal
   One dialog, opened by every "Записаться" link sitewide (see
   js/booking-modal.js) — header CTA, mobile panel CTA, CTA-banner button.
   Compact premium-medical proportions: fixed ~410px width (not a
   percentage of the viewport), 48px fields, 12px radii. Every color below
   is one of the site's existing tokens — no new palette introduced.
   ========================================================================== */

.booking-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 260ms ease, visibility 260ms ease;
}

.booking-modal.is-open {
  opacity: 1;
  visibility: visible;
}

body.booking-no-scroll {
  overflow: hidden;
}

.booking-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 26, 45, 0.52);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

.booking-modal-dialog {
  position: relative;
  width: 410px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 36px;
  border-radius: 24px;
  background: var(--color-white);
  box-shadow: 0 24px 60px rgba(15, 26, 45, 0.28);
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  transition: opacity 260ms cubic-bezier(0.22, 1, 0.36, 1), transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.booking-modal.is-open .booking-modal-dialog {
  opacity: 1;
  transform: translateY(0) scale(1);
}

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

.booking-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: #f5f7fa;
  color: var(--color-secondary);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.booking-modal-close:hover {
  background: var(--color-primary);
  color: var(--color-white);
}

.booking-modal-close svg {
  width: 16px;
  height: 16px;
}

.booking-modal-title {
  padding-right: 32px;
  font-family: var(--font-base);
  font-size: 32px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--color-dark);
}

.booking-modal-subtitle {
  margin-top: 12px;
  font-size: 16px;
  line-height: 1.45;
  color: var(--color-secondary);
}

.booking-form {
  margin-top: 26px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.booking-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.booking-field label {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-dark);
}

.booking-field input {
  height: 48px;
  padding-inline: 16px;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  background: var(--color-white);
  font-family: var(--font-base);
  font-size: 15px;
  color: var(--color-dark);
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

.booking-field input::placeholder {
  color: var(--color-secondary);
}

.booking-field input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(1, 104, 255, 0.1);
}

/* ------------------------------------------------------- Custom select -- */
/* A real browser <select>'s open panel can't be restyled (native OS chrome
   on macOS/Windows) — this is a button + listbox pair instead, built to
   the same WAI-ARIA listbox pattern a native select gives you for free
   (arrow keys, Home/End, Enter/Escape, aria-activedescendant), so it's
   still fully keyboard-operable, just visually consistent with the rest
   of the form. See js/booking-modal.js for the interaction logic. */
.booking-select {
  position: relative;
}

.booking-select-trigger {
  width: 100%;
  height: 48px;
  padding-inline: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  background: var(--color-white);
  font-family: var(--font-base);
  font-size: 15px;
  color: var(--color-secondary);
  cursor: pointer;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

.booking-select-trigger.has-value {
  color: var(--color-dark);
}

.booking-select-trigger:focus-visible,
.booking-select.is-open .booking-select-trigger {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(1, 104, 255, 0.1);
}

.booking-select-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.booking-select-chevron {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  color: var(--color-secondary);
  transition: transform 200ms ease;
}

.booking-select.is-open .booking-select-chevron {
  transform: rotate(180deg);
}

.booking-select-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 1;
  max-height: 240px;
  overflow-y: auto;
  margin: 0;
  padding: 6px;
  list-style: none;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  background: var(--color-white);
  box-shadow: 0 16px 40px rgba(15, 26, 45, 0.16);
}

.booking-select-list[hidden] {
  display: none;
}

.booking-select-option {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--color-dark);
  cursor: pointer;
}

.booking-select-option.is-active {
  background: rgba(1, 104, 255, 0.08);
}

.booking-select-option[aria-selected="true"] {
  color: var(--color-primary);
  font-weight: 500;
}

.booking-select.has-error .booking-select-trigger {
  border-color: #e5484d;
}

.booking-submit {
  margin-top: 6px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 12px;
  background: var(--color-primary);
  color: var(--color-white);
  font-family: var(--font-base);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 200ms ease, transform 200ms ease, box-shadow 200ms ease;
}

.booking-submit:hover {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(1, 104, 255, 0.18);
}

.booking-form-note {
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
  color: var(--color-secondary);
}

.booking-form-note a {
  color: var(--color-primary);
  text-decoration: underline;
}

/* ------------------------------------------------------- Success view -- */
/* Swaps in for .booking-modal-view on successful submit (see
   js/booking-modal.js) — same dialog, same close button, just a shorter
   content block, so the dialog's own height:auto just settles smaller
   rather than needing a second modal. */
.booking-success {
  padding-block: 12px 4px;
  text-align: center;
}

.booking-success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(1, 104, 255, 0.08);
  color: var(--color-primary);
}

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

.booking-success-title {
  margin-top: 20px;
  font-family: var(--font-base);
  font-size: 21px;
  font-weight: 600;
  color: var(--color-dark);
}

.booking-success-text {
  margin-top: 8px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--color-secondary);
}

@media (max-width: 1024px) {
  .booking-modal-dialog {
    max-width: calc(100vw - 40px);
  }
}

@media (max-width: 640px) {
  .booking-modal {
    padding: 12px;
  }

  .booking-modal-dialog {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    padding: 24px;
    border-radius: 20px;
  }

  .booking-modal-title {
    font-size: 27px;
  }
}
