/* ═══════════════════════════════════════════════════════════════
   CLARO CLINIC — Booking Modal Styles (Rebuilt)
   Figma nodes 7:349, 7:419, 7:604, 7:664
   + Usability test fixes: Ernst 2 (Active State) + Ernst 3 (Paired Buttons)
   ═══════════════════════════════════════════════════════════════ */

/* ── OVERLAY ───────────────────────────────────────────────── */
.bm-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: var(--overlay-modal);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden;
  transition: opacity 0.35s var(--ease-out-expo), visibility 0.35s;
}
.bm-overlay.is-open { opacity: 1; visibility: visible; }

/* ── MODAL SHELL — Figma 780w, r=48 ────────────────────────── */
.bm-shell {
  width: 560px; max-width: calc(100vw - 32px);
  max-height: 90vh; overflow-y: auto;
  background: var(--color-white);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-modal);
  position: relative;
  transform: scale(0.95); opacity: 0;
  transition: transform 0.35s var(--ease-out-expo), opacity 0.35s var(--ease-out-expo);
}
.bm-overlay.is-open .bm-shell { transform: scale(1); opacity: 1; }

/* scrollbar styling */
.bm-shell::-webkit-scrollbar { width: 6px; }
.bm-shell::-webkit-scrollbar-track { background: transparent; }
.bm-shell::-webkit-scrollbar-thumb {
  background: var(--color-peach-200); border-radius: var(--radius-full);
}

/* ── CLOSE BUTTON — Figma 44×44, cream bg ──────────────────── */
/* Positioned below the progress bar (24px) + 16px gap = 40px */
.bm-close {
  position: absolute; top: 40px; right: 20px;
  width: 44px; height: 44px;
  background: var(--color-cream-100); border-radius: var(--radius-full);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--color-ink-900); z-index: 10;
  transition: background 0.2s, transform 0.2s;
}
.bm-close:hover { background: var(--color-peach-200); transform: scale(1.05); }
.bm-close:active { transform: scale(0.95); }

/* ── PROGRESS BAR (Endowed Progress Effect) ────────────────── */
.bm-progress-bar {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  gap: 8px; padding: 20px 48px 0;
}
.bm-progress-track {
  flex: 1; height: 4px;
  background: var(--color-peach-200);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.bm-progress-fill {
  height: 100%; width: 33.33%;
  background: var(--color-sage-500);
  border-radius: var(--radius-full);
  transition: width 0.4s var(--ease-out-expo);
}
.bm-progress-dots {
  display: flex; gap: 8px;
  position: absolute; bottom: -20px; left: 50%;
  transform: translateX(-50%);
}
.bm-dot {
  width: 8px; height: 8px;
  background: var(--color-peach-200); border-radius: var(--radius-full);
  transition: background 0.3s var(--ease-out-expo), transform 0.3s;
}
.bm-dot--active { background: var(--color-sage-500); transform: scale(1.25); }
.bm-dot--done { background: var(--color-sage-500); }

/* ── STEP CONTAINER ────────────────────────────────────────── */
.bm-step { padding: 32px 48px 48px; }
.bm-step--hidden { display: none; }

/* ── STEP HEADER ───────────────────────────────────────────── */
.bm-header { margin-bottom: 24px; }
.bm-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: 32px; line-height: 38px;
  color: var(--color-ink-900); margin-bottom: 8px;
}
.bm-subtitle {
  font-size: 16px; line-height: 24px; color: var(--color-ink-700);
}

/* ═══════════════════════════════════════════════════════════
   STEP 1: SERVICE SELECTION — Figma 7:349
   Ernst 2 fix: Drieledig selectiesignaal
   BUG 1 fix: 2×2 grid layout
   ═══════════════════════════════════════════════════════════ */
.bm-services {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}

.bm-service {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  gap: 12px; text-align: center;
  background: var(--color-cream-100);
  border: 2px solid transparent;
  border-radius: var(--radius-card);
  padding: 24px 16px 20px;
  cursor: pointer;
  transition:
    border-color 0.25s var(--ease-bounce),
    background 0.25s var(--ease-out-soft),
    transform 0.25s var(--ease-bounce),
    box-shadow 0.25s;
}
.bm-service:hover {
  background: var(--color-peach-200);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

/* ── Ernst 2: Drieledig selectiesignaal ──────────────────── */
/* Signal 1: Sage border */
.bm-service.is-selected {
  border-color: var(--color-sage-500);
  /* Signal 2: Sage background tint */
  background: rgba(75,110,91,0.08);
  box-shadow: 0 0 0 3px rgba(75,110,91,0.06);
}

.bm-service-icon {
  width: 48px; height: 48px; border-radius: var(--radius-full);
  background: var(--color-peach-200);
  display: flex; align-items: center; justify-content: center;
  color: var(--color-brown-700); flex-shrink: 0;
  transition: background 0.25s;
}
.bm-service.is-selected .bm-service-icon {
  background: rgba(75,110,91,0.12);
  color: var(--color-sage-500);
}

.bm-service-info { min-width: 0; }
.bm-service-name {
  display: block; font-family: var(--font-display);
  font-weight: 700; font-size: 16px; line-height: 20px;
  color: var(--color-ink-900); margin-bottom: 4px;
}
.bm-service-desc {
  font-size: 12px; font-weight: 400; line-height: 16px;
  color: var(--color-ink-700);
}

/* Signal 3: Animated checkmark badge — positioned top-right */
.bm-service-check {
  position: absolute; top: 10px; right: 10px;
  width: 24px; height: 24px; border-radius: var(--radius-full);
  background: var(--color-sage-500); color: var(--color-white);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: scale(0);
  transition: opacity 0.25s var(--ease-bounce), transform 0.25s var(--ease-bounce);
}
.bm-service.is-selected .bm-service-check {
  opacity: 1; transform: scale(1);
}

/* ═══════════════════════════════════════════════════════════
   STEP 2: CALENDAR + TIMESLOTS — Figma 7:419
   ═══════════════════════════════════════════════════════════ */
.bm-datetime {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
}

/* Calendar */
.bm-calendar { min-height: 260px; }
.bm-cal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.bm-cal-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: 15px; color: var(--color-ink-900);
}
.bm-cal-nav {
  width: 28px; height: 28px; border-radius: var(--radius-full);
  background: var(--color-cream-100); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--color-ink-900);
  transition: background 0.2s;
}
.bm-cal-nav:hover { background: var(--color-peach-200); }

.bm-cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px;
}
.bm-cal-day-label {
  text-align: center; font-size: 11px; font-weight: 600;
  color: var(--color-brown-600); padding: 4px 0;
  text-transform: uppercase;
}
.bm-cal-day {
  width: 100%; aspect-ratio: 1; border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 500; color: var(--color-ink-900);
  cursor: pointer; border: none; background: none;
  transition: background 0.2s, color 0.2s, transform 0.15s;
}
.bm-cal-day:hover:not(.bm-cal-day--disabled) {
  background: var(--color-cream-100); transform: scale(1.1);
}
.bm-cal-day--selected {
  background: var(--color-sage-500) !important;
  color: var(--color-white) !important;
  font-weight: 700;
}
.bm-cal-day--today {
  font-weight: 800;
  box-shadow: inset 0 -2px 0 var(--color-sage-500);
}
.bm-cal-day--disabled {
  color: var(--color-muted); cursor: default; opacity: 0.4;
}

/* Timeslots */
.bm-timeslots-panel {}
.bm-time-heading {
  font-family: var(--font-display); font-weight: 600;
  font-size: 15px; line-height: 20px; color: var(--color-ink-900);
  margin-bottom: 4px;
}
.bm-time-hint {
  font-size: 13px; line-height: 18px;
  color: var(--color-ink-700); margin-bottom: 12px;
}
.bm-slots { display: flex; flex-direction: column; gap: 8px; }
.bm-slot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-radius: var(--radius-full);
  background: var(--color-cream-100);
  border: 2px solid transparent; cursor: pointer;
  transition: border-color 0.25s var(--ease-bounce), background 0.25s, transform 0.15s;
}
.bm-slot:hover {
  background: var(--color-peach-200); transform: translateY(-1px);
}
.bm-slot.is-selected {
  border-color: var(--color-sage-500);
  background: rgba(75,110,91,0.08);
}
.bm-slot-time {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 500; line-height: 20px;
  color: var(--color-ink-900);
}
.bm-slot-label {
  font-size: 12px; font-weight: 500; color: var(--color-ink-700);
}

/* ═══════════════════════════════════════════════════════════
   STEP 3: CONTACT FORM — Figma 7:604
   ═══════════════════════════════════════════════════════════ */
.bm-form { display: flex; flex-direction: column; gap: 16px; }
.bm-field { display: flex; flex-direction: column; gap: 6px; }
.bm-label {
  font-weight: 500; font-size: 13px; line-height: 18px;
  color: var(--color-ink-900);
}
.bm-input {
  width: 100%; padding: 14px 20px;
  background: var(--color-cream-100);
  border: 2px solid transparent; border-radius: var(--radius-pill);
  font-family: var(--font-body); font-size: 15px;
  color: var(--color-ink-900);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.bm-input::placeholder { color: var(--color-muted); }
.bm-input:focus {
  border-color: var(--color-sage-500);
  box-shadow: 0 0 0 3px rgba(75,110,91,0.12);
}

/* Error Shake — usability test fix */
.bm-input.has-error {
  border-color: #C44;
  animation: inputShake 0.4s ease;
}
@keyframes inputShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.bm-checkbox {
  display: flex; align-items: flex-start; gap: 10px;
  cursor: pointer; font-size: 13px; line-height: 20px;
  color: var(--color-ink-700); margin-top: 4px;
}
.bm-checkbox input { display: none; }
.bm-checkmark {
  width: 22px; height: 22px; border-radius: var(--radius-sm);
  background: var(--color-cream-100);
  display: flex; align-items: center; justify-content: center;
  color: var(--color-white); flex-shrink: 0;
  transition: background 0.25s var(--ease-bounce), transform 0.2s;
}
.bm-checkbox input:checked + .bm-checkmark {
  background: var(--color-sage-500); transform: scale(1.05);
}
.bm-checkbox.shake { animation: inputShake 0.4s ease; }

/* ═══════════════════════════════════════════════════════════
   STEP 4: SUCCESS — Figma 7:664
   ═══════════════════════════════════════════════════════════ */
.bm-success {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 12px;
  padding: 40px 0 16px;
}
.bm-success-icon {
  width: 80px; height: 80px; border-radius: var(--radius-full);
  background: var(--color-peach-200);
  display: flex; align-items: center; justify-content: center;
  color: var(--color-sage-500); margin-bottom: 8px;
  animation: successPop 0.5s var(--ease-bounce) both;
}
@keyframes successPop {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}
.bm-success .bm-title { font-size: 28px; line-height: 34px; }
.bm-success-body {
  font-size: 15px; line-height: 24px;
  color: var(--color-ink-700); max-width: 380px;
}
.bm-success-hint {
  font-size: 13px; line-height: 18px;
  color: var(--color-muted); margin-bottom: 8px;
}

/* ═══════════════════════════════════════════════════════════
   STEP FOOTER — Ernst 3: Paired Buttons
   "Vorige stap" (ghost) links, "Volgende stap" (primary) rechts
   ═══════════════════════════════════════════════════════════ */
.bm-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 24px;
  border-top: 1px solid var(--border-warm);
  margin-top: 8px;
}
/* When only one button (Step 1), push it to the right */
.bm-footer--end { justify-content: flex-end; }

/* ═══════════════════════════════════════════════════════════
   CUSTOM CONFIRM DIALOG — BUG 2 fix
   Nielsen: "User Control & Freedom" + "Error Recovery"
   ═══════════════════════════════════════════════════════════ */
.bm-confirm-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(57,56,52,0.5);
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity 0.25s var(--ease-out-expo);
  pointer-events: none;
}
.bm-confirm-overlay.is-visible {
  opacity: 1; pointer-events: auto;
}

.bm-confirm-card {
  background: var(--color-white);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-modal);
  padding: 32px;
  max-width: 360px; width: calc(100vw - 48px);
  text-align: center;
  transform: scale(0.9) translateY(8px);
  transition: transform 0.3s var(--ease-out-expo);
}
.bm-confirm-overlay.is-visible .bm-confirm-card {
  transform: scale(1) translateY(0);
}

.bm-confirm-icon {
  width: 48px; height: 48px; border-radius: var(--radius-full);
  background: var(--color-peach-200);
  display: flex; align-items: center; justify-content: center;
  color: var(--color-brown-700);
  margin: 0 auto 16px;
}

.bm-confirm-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: 20px; line-height: 26px;
  color: var(--color-ink-900); margin-bottom: 8px;
}

.bm-confirm-text {
  font-size: 14px; line-height: 22px;
  color: var(--color-ink-700); margin-bottom: 24px;
}

.bm-confirm-actions {
  display: flex; gap: 12px;
}
.bm-confirm-actions .btn { flex: 1; justify-content: center; }
