/* ==========================================================
   Badr Clinic - Smart Appointment Booking Modal Stylesheet
   Pure Medical Luxury, Crisp White & Royal Navy, Accessible, 60fps
   Zero Bloat, Full Responsive, GPU-Accelerated
========================================================== */

:root {
  --bm-navy-deep: #122A6B;
  --bm-navy-dark: #091A38;
  --bm-text-body: #334155;
  --bm-text-muted: #64748B;
  --bm-cyan: #122A6B;
  --bm-cyan-glow: #122A6B;
  --bm-emerald: #16A34A;
  --bm-border-soft: #E8ECEF;
  --bm-bg-input: #F8FAFC;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

/* 1. Modal Overlay Backdrop */
.booking-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2500;
  background: rgba(9, 26, 56, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s;
  direction: rtl;
}

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

/* 2. Modal Dialog Window */
.booking-modal-dialog {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
  background: #FFFFFF;
  border-radius: 28px;
  border: 1px solid var(--bm-border-soft);
  box-shadow: 0 24px 60px rgba(9, 26, 56, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.8) inset;
  padding: 32px 32px 28px;
  transform: translateY(24px) scale(0.97);
  transition: transform 0.35s var(--ease-out-expo), opacity 0.35s ease;
  will-change: transform, opacity;
  -webkit-overflow-scrolling: touch;
}

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

/* 3. Header */
.booking-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid #E8ECEF;
}

.booking-head-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.booking-head-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: rgba(18, 42, 107, 0.08);
  color: #122A6B;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(18, 42, 107, 0.2);
}

.booking-head-icon svg {
  width: 24px;
  height: 24px;
  stroke: #122A6B !important;
}

.booking-modal-title {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 800;
  color: var(--bm-navy-deep);
  line-height: 1.3;
}

.booking-modal-subtitle {
  margin: 0;
  font-size: 13px;
  color: var(--bm-text-muted);
  font-weight: 600;
}

.booking-modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #E8ECEF;
  border: 1px solid var(--bm-border-soft);
  color: var(--bm-text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  padding: 0;
}

.booking-modal-close:hover,
.booking-modal-close:focus-visible {
  background: var(--bm-navy-deep);
  color: #FFFFFF;
  border-color: var(--bm-navy-deep);
  transform: rotate(90deg);
}

/* 4. Form Groups & Fields */
.booking-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

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

.booking-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--bm-navy-deep);
}

.booking-label-icon {
  color: var(--bm-cyan);
  display: flex;
  align-items: center;
}

.booking-label-icon svg {
  width: 16px;
  height: 16px;
}

.booking-label small {
  color: var(--bm-text-muted);
  font-weight: 500;
  font-size: 12px;
}

.booking-input,
.booking-select,
.booking-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1.5px solid var(--bm-border-soft);
  background: var(--bm-bg-input);
  font-family: inherit;
  font-size: 14.5px;
  color: var(--bm-navy-deep);
  transition: all 0.25s ease;
  outline: none;
}

.booking-input:focus,
.booking-select:focus,
.booking-textarea:focus {
  border-color: var(--bm-cyan);
  background: #FFFFFF;
  box-shadow: 0 0 0 4px rgba(18, 42, 107, 0.12);
}

.booking-input::placeholder,
.booking-textarea::placeholder {
  color: #94A3B8;
  font-size: 13.5px;
}

.booking-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23122A6B' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 14px center;
  background-size: 16px;
  padding-left: 38px;
  cursor: pointer;
}

.booking-textarea {
  resize: vertical;
  min-height: 70px;
  line-height: 1.6;
}

.booking-date-hint {
  font-size: 12px;
  color: var(--bm-text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 3px;
}

.booking-date-hint svg {
  color: #F59E0B;
  flex-shrink: 0;
}

/* 5. Period Selection Chips (Morning / Evening / Any) */
.booking-period-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.period-chip {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 12px 8px;
  border-radius: 14px;
  background: var(--bm-bg-input);
  border: 1.5px solid var(--bm-border-soft);
  cursor: pointer;
  transition: all 0.25s ease;
  user-select: none;
  text-align: center;
}

.period-chip input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.period-chip:hover {
  border-color: rgba(18, 42, 107, 0.4);
  background: #FFFFFF;
}

.period-chip.is-selected,
.period-chip:has(input:checked) {
  background: rgba(18, 42, 107, 0.08);
  border-color: var(--bm-cyan);
  box-shadow: 0 4px 14px rgba(18, 42, 107, 0.15);
}

.period-chip-title {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--bm-navy-deep);
  display: flex;
  align-items: center;
  gap: 5px;
}

.period-chip.is-selected .period-chip-title,
.period-chip:has(input:checked) .period-chip-title {
  color: var(--bm-cyan);
}

.period-chip-time {
  font-size: 11px;
  color: var(--bm-text-muted);
  font-weight: 600;
}

/* 6. Submit Button & WhatsApp Handshake */
.booking-submit-wrap {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-booking-submit {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 15px 28px;
  border-radius: 9999px;
  background: var(--bm-navy-deep);
  color: #FFFFFF;
  font-family: inherit;
  font-size: 15.5px;
  font-weight: 800;
  border: none;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(9, 26, 56, 0.25);
  transition: all 0.25s var(--ease-out-expo);
  outline: none;
}

.btn-booking-submit:hover,
.btn-booking-submit:focus-visible {
  transform: translateY(-2px);
  background: #091A38;
  box-shadow: 0 14px 32px rgba(9, 26, 56, 0.35);
}

.btn-booking-submit:active {
  transform: translateY(0);
}

.btn-booking-submit svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: #FFFFFF;
}

.booking-guarantee-note {
  font-size: 12px;
  color: var(--bm-text-muted);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0;
}

.booking-guarantee-note svg {
  color: var(--bm-cyan);
  flex-shrink: 0;
}

/* 7. Action buttons in Services Section (Inside Services Copy) */
.services-action-btns {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.btn-service-book-now {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 9999px;
  background: #FFFFFF;
  color: var(--bm-navy-deep);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 800;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  transition: all 0.25s var(--ease-out-expo);
  outline: none;
}

.btn-service-book-now:hover,
.btn-service-book-now:focus-visible {
  transform: translateY(-2px);
  background: #E8ECEF;
  color: #091A38;
  box-shadow: 0 10px 24px rgba(18, 42, 107, 0.35);
}

.btn-service-book-now:active {
  transform: translateY(0);
}

.btn-service-book-now svg {
  color: var(--bm-navy-deep);
  transition: color 0.2s ease;
}

.btn-service-book-now:hover svg,
.btn-service-book-now:focus-visible svg {
  color: #091A38;
}

/* 8. Mobile Responsiveness */
@media (max-width: 640px) {
  .booking-modal-dialog {
    padding: 24px 20px;
    border-radius: 24px;
  }

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

  .booking-period-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .period-chip {
    flex-direction: row;
    justify-content: space-between;
    padding: 10px 14px;
  }

  .btn-booking-submit {
    font-size: 14.5px;
    padding: 14px 20px;
  }

  .services-action-btns {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-service-book-now {
    justify-content: center;
  }
}
