/* Booking modal — match new-design sizes & radii exactly
   new-design tokens:
   - modal: max-w-2xl (42rem), max-h-[92vh], rounded-3xl (1.5rem)
   - rounded-xl = calc(0.875rem + 4px)
   - rounded-2xl = 1rem
   - rounded-lg = 0.875rem (--radius)
*/

/* Also on :root so partials that reuse .bm-* classes outside the booking modal
   (the patient dashboard reschedule picker) still resolve these tokens. */
:root,
.bm-root {
  --bm-radius: 0.875rem;
  --bm-radius-xl: calc(0.875rem + 4px);
  --bm-radius-2xl: 1rem;
  --bm-radius-3xl: 1.5rem;
  --bm-max-w: 42rem; /* max-w-2xl */
}

.bm-root button {
  border-style: solid;
}

/* Modal shell — same width/height as new-design */
.bm-root .bm-dialog {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  width: 100% !important;
  max-width: var(--bm-max-w) !important;
  max-height: 92vh !important;
  overflow: hidden;
  background: #fff;
  border-radius: var(--bm-radius-3xl) !important;
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
}

.bm-root .bm-dialog__inner {
  display: flex;
  flex-direction: column;
  max-height: 92vh;
  overflow: hidden;
  min-height: 0;
}

.bm-root .bm-dialog__body {
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
}

.bm-root .rounded-xl { border-radius: var(--bm-radius-xl) !important; }
.bm-root .rounded-2xl { border-radius: var(--bm-radius-2xl) !important; }
.bm-root .rounded-3xl { border-radius: var(--bm-radius-3xl) !important; }
.bm-root .rounded-lg { border-radius: var(--bm-radius) !important; }

.bm-option {
  border-width: 2px;
  border-style: solid;
  border-color: #e5e7eb; /* gray-200 */
  background: #fff;
  border-radius: var(--bm-radius-2xl) !important; /* rounded-2xl */
  transition: border-color 0.15s, background-color 0.15s;
}

.bm-option.is-active {
  border-color: #0EA882;
  background: rgba(14, 168, 130, 0.05);
}

.bm-option__icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--bm-radius-xl) !important;
  background: rgba(14, 168, 130, 0.15);
  color: #0EA882;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bm-option__icon svg {
  width: 18px;
  height: 18px;
}

.bm-option-sm {
  border-width: 1px;
  border-style: solid;
  border-color: #e5e7eb;
  background: #fff;
  border-radius: var(--bm-radius-xl) !important; /* rounded-xl */
  transition: border-color 0.15s, background-color 0.15s;
}

.bm-option-sm.is-active {
  border-color: #0EA882;
  background: rgba(14, 168, 130, 0.05);
}

/* Demo / chip buttons use rounded-lg in new-design */
.bm-root .bm-chip {
  border-width: 1px;
  border-style: solid;
  border-color: rgba(14, 168, 130, 0.4);
  background: #fff;
  color: #0EA882;
  border-radius: var(--bm-radius) !important; /* rounded-lg */
}

.bm-root .bm-chip:hover {
  background: rgba(14, 168, 130, 0.05);
}

.bm-pay {
  border-width: 2px;
  border-style: solid;
  border-color: #e5e7eb;
  overflow: hidden;
  border-radius: var(--bm-radius-xl) !important; /* rounded-xl */
  transition: border-color 0.15s;
}

.bm-pay.is-active {
  border-color: #0EA882;
}

.bm-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  border-width: 1px;
  border-style: solid;
  border-color: #e5e7eb;
  border-radius: var(--bm-radius-xl) !important; /* rounded-xl */
  transition: border-color 0.15s, background-color 0.15s, color 0.15s;
}

.bm-slot.is-active {
  border-color: #0EA882;
  background: #0EA882;
  color: #fff;
}

.bm-slot.is-past {
  color: #9ca3af;
  background: #f9fafb;
  border-color: #e5e7eb;
  cursor: default;
  opacity: 1;
}

.bm-slot.is-taken {
  color: #dc2626;
  background-color: #fef2f2;
  background-image: var(--dl-slot-stripes);
  border-color: #fecaca;
  cursor: not-allowed;
  opacity: 1;
}

.bm-slot.is-past .bm-slot__time,
.bm-slot.is-taken .bm-slot__time {
  text-decoration: line-through;
}

.bm-slot-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 11px;
  color: #6b7280;
}

.bm-slot-legend__swatch {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  border-radius: 3px;
  border: 1px solid #fecaca;
  background-color: #fef2f2;
  background-image: var(--dl-slot-stripes);
}

.bm-slot:not(.is-taken):not(.is-past):not(.is-active):hover {
  border-color: rgba(14, 168, 130, 0.4);
}

.bm-check {
  border-width: 2px;
  border-style: solid;
  border-color: #d1d5db;
  background: #fff;
  border-radius: 0.25rem; /* rounded */
  transition: border-color 0.15s, background-color 0.15s;
}

.bm-check.is-active {
  border-color: #0EA882;
  background: #0EA882;
}

.bm-input,
.bm-input-focus {
  border: 1px solid rgba(14, 168, 130, 0.35);
  background: #fff;
  border-radius: var(--bm-radius-xl) !important;
}

.bm-input:focus,
.bm-input-focus:focus {
  outline: none;
  border-color: #0EA882;
}

.bm-input.bm-input--pill,
.bm-btn.bm-btn--pill {
  border-radius: 9999px !important;
}

.bm-field-error {
  line-height: 1.35;
}

.bm-phone-field [data-phone-format-hint] {
  margin-top: 0.35rem;
  font-size: 0.7rem;
  color: #6b8f84;
}

.bm-phone-field .error {
  display: none;
}

.bm-phone-field [data-phone-input] > .flex {
  gap: 0.5rem;
}

.bm-phone-field [data-country-combobox] {
  width: 100%;
}

@media (min-width: 640px) {
  .bm-phone-field [data-country-combobox] {
    width: 14rem;
    flex-shrink: 0;
  }
}

.bm-phone-field [data-country-trigger] {
  border: 1px solid rgba(14, 168, 130, 0.35) !important;
  border-radius: var(--bm-radius-xl) !important;
  height: 42px;
  background: #fff;
}

.bm-phone-field [data-country-trigger]:focus {
  border-color: #0EA882 !important;
  outline: none;
  box-shadow: 0 0 0 1px #0EA882;
}

.bm-phone-field [data-country-panel] {
  z-index: 200;
}

.bm-input-focus {
  border-radius: var(--bm-radius) !important; /* payment fields: rounded-lg */
}

.bm-panel {
  border: 1px solid rgba(14, 168, 130, 0.35);
  border-radius: var(--bm-radius-2xl) !important;
}

.bm-status-dot {
  border: 2px solid #e5e7eb;
  background: #fff;
}

.bm-status-dot.is-active {
  border-color: #0EA882;
  background: #0EA882;
}

.bm-cal-day {
  border: 2px solid transparent;
  color: #374151;
  border-radius: var(--bm-radius) !important; /* rounded-lg */
}

.bm-cal-day:hover:not(.is-disabled):not(.is-selected) {
  background: #f2f8f6;
}

.bm-cal-day.is-selected {
  background: #0EA882;
  color: #fff;
  font-weight: 800;
  border-color: #0EA882;
}

.bm-cal-day.is-today {
  border-color: #0EA882;
  color: #0EA882;
  font-weight: 800;
}

.bm-cal-day.is-disabled {
  color: #d1d5db;
  cursor: not-allowed;
}

/* Footer Back / Continue / Pay — new-design rounded-xl */
.bm-btn {
  border-radius: var(--bm-radius-xl) !important;
}

.bm-btn--back {
  border: 1px solid rgba(14, 168, 130, 0.35);
  background: #fff;
  color: #0a1c17;
}

.bm-btn--back:hover {
  background: #f2f8f6;
}

.bm-btn--primary {
  background: #0EA882;
  color: #fff;
  border: 0 solid transparent;
}

.bm-btn--primary:disabled {
  opacity: 0.5;
}

/* Close button */
.bm-root .bm-close {
  width: 2rem;
  height: 2rem;
  border-radius: var(--bm-radius-xl) !important;
  background: #f2f8f6;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bm-root .bm-close:hover {
  background: rgba(14, 168, 130, 0.35);
}

.bm-root .bm-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--bm-radius-xl) !important;
  object-fit: cover;
  object-position: top;
}
