/* ── Booking Flow Styles ── */

/* ── Progress Stepper ── */
.booking-progress {
  display: flex; align-items: center; justify-content: center;
  gap: 0; padding: 24px 0 32px; max-width: 600px; margin: 0 auto;
}
.step-item {
  display: flex; align-items: center; gap: 0;
}
.step-circle {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; font-weight: 700;
  border: 2px solid rgba(3,55,101,0.15);
  color: var(--text-muted); background: var(--white);
  transition: all 0.3s ease; flex-shrink: 0;
}
.step-circle.active {
  background: var(--navy); color: var(--white); border-color: var(--navy);
  box-shadow: 0 0 0 4px rgba(3,55,101,0.12);
}
.step-circle.done {
  background: var(--gold); color: var(--navy); border-color: var(--gold);
}
.step-label {
  font-size: 0.75rem; color: var(--text-muted); margin-top: 4px;
  text-align: center; white-space: nowrap;
}
.step-label.active { color: var(--navy); font-weight: 600; }
.step-label.done { color: var(--gold); }
.step-connector {
  width: 48px; height: 2px; background: rgba(3,55,101,0.12);
  margin: 0 4px; flex-shrink: 0;
  transition: background 0.3s ease;
}
.step-connector.done { background: var(--gold); }
.step-col {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}

/* ── Booking Container ── */
.booking-page {
  padding: 88px 24px 60px;
  min-height: 100vh;
}
.booking-container {
  max-width: 900px; margin: 0 auto;
}
.booking-title {
  font-size: 1.6rem; font-weight: 700; color: var(--navy);
  margin-bottom: 8px;
}
.booking-subtitle {
  color: var(--text-muted); margin-bottom: 24px; font-size: 1rem;
}

/* ── View Transitions ── */
.view-enter { animation: viewIn 0.3s ease both; }
.view-exit { animation: viewOut 0.2s ease both; }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes viewOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-8px); }
}

/* ── Service Grid (Booking) ── */
.svc-grid-book {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.svc-book-card {
  background: var(--white); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow); cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s ease;
  position: relative; overflow: hidden;
}
.svc-book-card:hover {
  border-color: var(--navy); box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}
.svc-book-card.selected {
  border-color: var(--gold); background: rgba(218,180,92,0.04);
}
.svc-book-card .card-name { font-size: 1.05rem; margin-bottom: 8px; }
.svc-meta {
  display: flex; gap: 12px; align-items: center;
  font-size: 0.85rem; color: var(--text-muted);
}
.svc-meta-item {
  display: flex; align-items: center; gap: 4px;
}

/* ── Provider Cards ── */
.provider-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px; margin-top: 16px;
}
.provider-card {
  background: var(--white); border-radius: var(--radius);
  padding: 20px; text-align: center; cursor: pointer;
  border: 2px solid transparent; box-shadow: var(--shadow);
  transition: all 0.2s ease; min-height: 44px;
}
.provider-card:hover { border-color: var(--navy); }
.provider-card.selected { border-color: var(--gold); background: rgba(218,180,92,0.04); }
.provider-avatar {
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  color: var(--white); display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; font-weight: 700;
  margin: 0 auto 10px;
}
.provider-name { font-weight: 600; color: var(--navy); font-size: 0.95rem; }
.provider-title { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }
.provider-skip {
  text-align: center; margin-top: 12px;
}
.provider-skip a {
  color: var(--text-muted); font-size: 0.9rem;
  cursor: pointer; text-decoration: underline;
}

/* ── Calendar ── */
.calendar-wrap {
  max-width: 420px; margin: 0 auto;
}
.cal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.cal-month {
  font-size: 1.1rem; font-weight: 700; color: var(--navy);
}
.cal-nav {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1.5px solid rgba(3,55,101,0.15);
  background: var(--white); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; color: var(--navy);
  transition: all 0.2s ease;
}
.cal-nav:hover { background: var(--navy); color: var(--white); }
.cal-nav:disabled { opacity: 0.3; cursor: not-allowed; }
.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 4px; text-align: center;
}
.cal-dow {
  font-size: 0.75rem; font-weight: 600; color: var(--text-muted);
  padding: 8px 0; text-transform: uppercase;
}
.cal-day {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; font-size: 0.9rem; font-weight: 500;
  cursor: pointer; transition: all 0.15s ease;
  border: none; background: none; color: var(--text);
  min-width: 44px; min-height: 44px;
}
.cal-day:hover:not(.disabled):not(.empty) {
  background: rgba(3,55,101,0.08);
}
.cal-day.today {
  border: 2px solid var(--gold);
}
.cal-day.selected {
  background: var(--navy); color: var(--white);
  font-weight: 700;
}
.cal-day.disabled {
  color: rgba(0,0,0,0.2); cursor: not-allowed;
}
.cal-day.empty { cursor: default; }
.cal-day.no-slots { opacity: 0.3; pointer-events: none; }
.cal-day.has-slots::after {
  content: '';
  position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--gold);
}
.cal-day { position: relative; }

/* ── Time Slots ── */
.slots-section { margin-top: 32px; }
.slots-title {
  font-size: 1rem; font-weight: 600; color: var(--navy); margin-bottom: 16px;
}
.slot-group {
  margin-bottom: 20px;
}
.slot-group-label {
  font-size: 0.8rem; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.04em;
  margin-bottom: 8px;
}
.slot-grid {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.slot-btn {
  padding: 10px 18px; border-radius: var(--radius-sm);
  border: 1.5px solid rgba(3,55,101,0.15);
  background: var(--white); color: var(--text);
  font-family: var(--font); font-size: 0.9rem; font-weight: 500;
  cursor: pointer; transition: all 0.15s ease;
  min-width: 90px; min-height: 44px; text-align: center;
}
.slot-btn:hover { border-color: var(--navy); color: var(--navy); }
.slot-btn.selected {
  background: var(--navy); color: var(--white); border-color: var(--navy);
}
.slot-btn .slot-provider {
  font-size: 0.7rem; color: var(--text-muted); display: block; margin-top: 2px;
}
.slot-btn.selected .slot-provider { color: rgba(255,255,255,0.7); }

.no-slots {
  text-align: center; padding: 32px; color: var(--text-muted);
  background: var(--bg-alt); border-radius: var(--radius);
}

/* ── Smart Suggestion Badge ── */
.slot-btn.recommended {
  border-color: var(--gold); position: relative;
}
.slot-btn.recommended::before {
  content: 'Best';
  position: absolute; top: -8px; right: -4px;
  background: var(--gold); color: var(--navy);
  font-size: 0.65rem; font-weight: 700;
  padding: 1px 6px; border-radius: 8px;
  text-transform: uppercase;
}

/* ── Client Form ── */
.form-card {
  background: var(--white); border-radius: var(--radius);
  padding: 32px; box-shadow: var(--shadow);
  max-width: 480px; margin: 0 auto;
}
.form-group {
  margin-bottom: 20px;
}
.form-label {
  display: block; font-size: 0.85rem; font-weight: 600;
  color: var(--navy); margin-bottom: 6px;
}
.form-label .required { color: #e74c3c; }
.form-input {
  width: 100%; padding: 12px 14px;
  border: 1.5px solid rgba(3,55,101,0.15);
  border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 0.95rem;
  outline: none; transition: border-color 0.2s ease;
  background: var(--white);
}
.form-input:focus { border-color: var(--navy); }
.form-input.error { border-color: #e74c3c; }
.form-hint {
  font-size: 0.8rem; color: var(--text-muted); margin-top: 4px;
}
.form-error {
  font-size: 0.8rem; color: #e74c3c; margin-top: 4px;
  display: none;
}
.form-error.visible { display: block; }

.phone-row {
  display: flex; gap: 8px;
}
.phone-prefix {
  width: 80px; flex-shrink: 0;
}

/* ── Booking Summary Sidebar ── */
.booking-layout {
  display: grid; grid-template-columns: 1fr 320px; gap: 32px;
  align-items: start;
}
.booking-summary {
  background: var(--white); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
  position: sticky; top: 88px;
}
.summary-title {
  font-size: 0.85rem; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.04em;
  margin-bottom: 16px;
}
.summary-row {
  display: flex; justify-content: space-between;
  padding: 8px 0; border-bottom: 1px solid rgba(3,55,101,0.06);
  font-size: 0.9rem;
}
.summary-row:last-child { border-bottom: none; }
.summary-label { color: var(--text-muted); }
.summary-value { color: var(--navy); font-weight: 600; text-align: right; }

/* ── Confirmation ── */
.confirm-card {
  background: var(--white); border-radius: var(--radius);
  padding: 40px; box-shadow: var(--shadow-lg);
  max-width: 520px; margin: 0 auto; text-align: center;
}
.confirm-icon {
  width: 72px; height: 72px; border-radius: 50%;
  background: linear-gradient(135deg, #27ae60, #2ecc71);
  color: var(--white); display: flex; align-items: center; justify-content: center;
  font-size: 2rem; margin: 0 auto 20px;
}
.confirm-code {
  font-size: clamp(1.5rem, 6vw, 2rem); font-weight: 700; color: var(--navy);
  letter-spacing: 0.08em; margin: 16px 0;
  padding: 12px 24px; background: var(--bg-alt);
  border-radius: var(--radius-sm); display: inline-block;
}
.confirm-details {
  text-align: left; margin: 24px 0;
  padding: 16px; background: var(--bg-alt);
  border-radius: var(--radius-sm);
}
.confirm-details .summary-row {
  border-color: rgba(3,55,101,0.08);
}

/* ── Calendar Actions ── */
.cal-actions {
  display: flex; gap: 8px; justify-content: center;
  margin-top: 20px; flex-wrap: wrap;
}
.cal-action-btn {
  padding: 10px 16px; border-radius: var(--radius-sm);
  border: 1.5px solid rgba(3,55,101,0.15);
  background: var(--white); color: var(--navy);
  font-family: var(--font); font-size: 0.85rem; font-weight: 500;
  cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all 0.2s ease;
}
.cal-action-btn:hover { border-color: var(--navy); background: rgba(3,55,101,0.04); }
.cal-action-btn svg { width: 16px; height: 16px; }

/* ── Booking Lookup ── */
.lookup-card {
  background: var(--white); border-radius: var(--radius);
  padding: 32px; box-shadow: var(--shadow);
  max-width: 480px; margin: 0 auto; text-align: center;
}
.lookup-input-row {
  display: flex; gap: 8px; margin-top: 16px;
}
.lookup-input-row .form-input { flex: 1; }

/* ── Loading Spinner ── */
.spinner {
  width: 32px; height: 32px; border-radius: 50%;
  border: 3px solid rgba(3,55,101,0.1);
  border-top-color: var(--navy);
  animation: spin 0.8s linear infinite;
  margin: 32px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-text {
  text-align: center; color: var(--text-muted);
  font-size: 0.9rem; margin-top: 8px;
}

/* ── Action Bar ── */
.action-bar {
  display: flex; gap: 12px; justify-content: space-between;
  align-items: center; margin-top: 32px;
  padding-top: 20px; border-top: 1px solid rgba(3,55,101,0.08);
}
.btn-back {
  padding: 12px 24px; border-radius: var(--radius-sm);
  border: 1.5px solid rgba(3,55,101,0.15);
  background: var(--white); color: var(--text);
  font-family: var(--font); font-size: 0.9rem; font-weight: 500;
  cursor: pointer; transition: all 0.2s ease;
}
.btn-back:hover { border-color: var(--navy); color: var(--navy); }
.btn-next {
  padding: 12px 24px; border-radius: var(--radius-sm);
  border: none; background: var(--navy); color: var(--white);
  font-family: var(--font); font-size: 0.95rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s ease;
}
.btn-next:hover { background: var(--navy-light); }
.btn-next:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-next.gold { background: var(--gold); color: var(--navy); }
.btn-next.gold:hover { background: var(--gold-light); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .booking-layout {
    grid-template-columns: 1fr;
  }
  .booking-summary {
    position: static;
    order: -1;
  }
  .svc-grid-book {
    grid-template-columns: 1fr;
  }
  .provider-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .booking-page {
    padding: 76px 16px 40px;
  }
  .form-card { padding: 24px; }
  .confirm-card { padding: 24px; }
  .step-connector { width: 24px; }
  .phone-row { flex-direction: column; }
  .phone-prefix { width: 100%; }
}

/* ── Focus Styles (Keyboard Navigation) ── */
.slot-btn:focus-visible,
.provider-card:focus-visible,
.cal-day:focus-visible {
  outline: 3px solid var(--navy, #033765);
  outline-offset: 2px;
}

.form-input:focus-visible {
  border-color: var(--navy, #033765);
  box-shadow: 0 0 0 3px rgba(3, 55, 101, 0.15);
  outline: none;
}

.btn-next:focus-visible,
.btn-back:focus-visible {
  outline: 3px solid var(--navy, #033765);
  outline-offset: 2px;
}

/* ── Small Screen Calendar Fix ── */
@media (max-width: 380px) {
  .cal-grid { gap: 2px; }
  .cal-day { font-size: 0.85rem; }
}

/* ── Form Input Direction ── */
.form-input[type="email"],
.form-input[type="tel"] {
  direction: ltr; /* Email and phone always LTR */
}
.form-input[type="text"] {
  direction: auto; /* Name adapts to content */
}

/* ── RTL Overrides ── */
[dir="rtl"] .booking-steps { direction: rtl; }
[dir="rtl"] .btn-next::after { content: '\2190'; margin-left: 0; margin-right: 8px; }
[dir="rtl"] .btn-back::before { content: '\2192'; margin-right: 0; margin-left: 8px; }
[dir="rtl"] .phone-row { flex-direction: row-reverse; }
[dir="rtl"] .form-input { text-align: right; }
[dir="rtl"] .provider-card { text-align: right; }
[dir="rtl"] .slot-btn { direction: ltr; } /* Keep times LTR */
