/* =====================================================
   BookingPro — Frontend Styles
   ===================================================== */

:root {
  --bp-primary:      #2563eb;
  --bp-primary-dark: #1d4ed8;
  --bp-primary-light:#eff6ff;
  --bp-success:      #10b981;
  --bp-warning:      #f59e0b;
  --bp-danger:       #ef4444;
  --bp-text:         #1e293b;
  --bp-text-muted:   #64748b;
  --bp-border:       #e2e8f0;
  --bp-surface:      #ffffff;
  --bp-bg:           #f8fafc;
  --bp-radius:       12px;
  --bp-radius-sm:    8px;
  --bp-shadow:       0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
  --bp-shadow-hover: 0 4px 12px rgba(37,99,235,.18), 0 2px 6px rgba(0,0,0,.06);
  --bp-transition:   all .2s cubic-bezier(.4,0,.2,1);
}

/* Wrapper */
.bp-booking-wrapper {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  max-width: 860px;
  margin: 0 auto;
  color: var(--bp-text);
  position: relative;
}

/* ── Progress Bar ─────────────────────────────────── */
.bp-progress {
  display: flex;
  align-items: center;
  margin-bottom: 36px;
  padding: 0 4px;
}

.bp-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.bp-step-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bp-border);
  color: var(--bp-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  transition: var(--bp-transition);
}

.bp-step span {
  font-size: 12px;
  color: var(--bp-text-muted);
  text-align: center;
  font-weight: 500;
  transition: var(--bp-transition);
}

.bp-step.active .bp-step-icon {
  background: var(--bp-primary);
  color: #fff;
  box-shadow: 0 0 0 4px var(--bp-primary-light);
}

.bp-step.active span {
  color: var(--bp-primary);
  font-weight: 600;
}

.bp-step.completed .bp-step-icon {
  background: var(--bp-success);
  color: #fff;
}

.bp-step.completed .bp-step-icon::before {
  content: '✓';
}

.bp-step-line {
  flex: 1;
  height: 2px;
  background: var(--bp-border);
  margin: 0 8px;
  margin-bottom: 22px;
  transition: var(--bp-transition);
}

.bp-step-line.completed {
  background: var(--bp-success);
}

/* ── Panel ────────────────────────────────────────── */
.bp-panel {
  animation: bp-fade-in .3s ease;
}

@keyframes bp-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.bp-panel-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--bp-text);
  margin: 0 0 6px;
}

.bp-panel-subtitle {
  font-size: 14px;
  color: var(--bp-text-muted);
  margin: 0 0 24px;
}

/* ── Service Cards ────────────────────────────────── */
.bp-category-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--bp-text-muted);
  font-weight: 600;
  margin: 24px 0 12px;
  padding-left: 4px;
}

.bp-services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-bottom: 8px;
}

.bp-service-card {
  background: var(--bp-surface);
  border: 2px solid var(--bp-border);
  border-radius: var(--bp-radius);
  cursor: pointer;
  transition: var(--bp-transition);
  position: relative;
  overflow: hidden;
}

.bp-service-card:hover {
  border-color: var(--bp-primary);
  box-shadow: var(--bp-shadow-hover);
  transform: translateY(-2px);
}

.bp-service-card.selected {
  border-color: var(--bp-primary);
  background: var(--bp-primary-light);
  box-shadow: var(--bp-shadow-hover);
}

.bp-service-card-inner {
  padding: 18px;
}

.bp-service-header {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.bp-service-color {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  flex-shrink: 0;
  opacity: .85;
}

.bp-service-info h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 4px;
  color: var(--bp-text);
}

.bp-service-info p {
  font-size: 13px;
  color: var(--bp-text-muted);
  margin: 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bp-service-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.bp-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.bp-badge-time {
  background: #f1f5f9;
  color: var(--bp-text-muted);
}

.bp-badge-price {
  background: #d1fae5;
  color: #065f46;
}

.bp-service-select-indicator {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bp-primary);
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
}

.bp-service-card.selected .bp-service-select-indicator {
  display: flex;
}

/* ── Provider Cards ───────────────────────────────── */
.bp-providers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.bp-provider-card {
  background: var(--bp-surface);
  border: 2px solid var(--bp-border);
  border-radius: var(--bp-radius);
  padding: 20px 16px;
  cursor: pointer;
  transition: var(--bp-transition);
  text-align: center;
}

.bp-provider-card:hover {
  border-color: var(--bp-primary);
  box-shadow: var(--bp-shadow-hover);
  transform: translateY(-2px);
}

.bp-provider-card.selected {
  border-color: var(--bp-primary);
  background: var(--bp-primary-light);
}

.bp-provider-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
}

.bp-provider-name {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 2px;
  color: var(--bp-text);
}

.bp-provider-title-text {
  font-size: 12px;
  color: var(--bp-text-muted);
}

/* ── Calendar ─────────────────────────────────────── */
.bp-datetime-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 20px;
}

.bp-calendar-wrapper {
  background: var(--bp-surface);
  border: 1px solid var(--bp-border);
  border-radius: var(--bp-radius);
  padding: 20px;
}

.bp-calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.bp-cal-month {
  font-size: 15px;
  font-weight: 700;
  color: var(--bp-text);
}

.bp-cal-btn {
  background: none;
  border: 1px solid var(--bp-border);
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  color: var(--bp-text-muted);
  transition: var(--bp-transition);
  display: flex;
  align-items: center;
}

.bp-cal-btn:hover {
  border-color: var(--bp-primary);
  color: var(--bp-primary);
}

.bp-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.bp-cal-day-name {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--bp-text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 6px 0;
}

.bp-cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: default;
  color: var(--bp-text-muted);
  background: transparent;
  transition: var(--bp-transition);
}

.bp-cal-day.available {
  color: var(--bp-text);
  cursor: pointer;
  font-weight: 600;
}

.bp-cal-day.available:hover {
  background: var(--bp-primary-light);
  color: var(--bp-primary);
}

.bp-cal-day.selected {
  background: var(--bp-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(37,99,235,.4);
}

.bp-cal-day.today {
  border: 2px solid var(--bp-primary);
}

.bp-cal-day.past,
.bp-cal-day.unavailable {
  color: #cbd5e1;
  cursor: not-allowed;
  text-decoration: line-through;
}

.bp-cal-day.empty {
  background: transparent;
}

/* ── Time Slots ───────────────────────────────────── */
.bp-slots-wrapper {
  background: var(--bp-surface);
  border: 1px solid var(--bp-border);
  border-radius: var(--bp-radius);
  padding: 20px;
  overflow-y: auto;
  max-height: 360px;
}

.bp-slots-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--bp-text);
  margin: 0 0 14px;
}

.bp-slots-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.bp-slot {
  padding: 10px;
  border: 2px solid var(--bp-border);
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--bp-text);
  transition: var(--bp-transition);
  background: var(--bp-surface);
}

.bp-slot:hover {
  border-color: var(--bp-primary);
  background: var(--bp-primary-light);
  color: var(--bp-primary);
}

.bp-slot.selected {
  border-color: var(--bp-primary);
  background: var(--bp-primary);
  color: #fff;
}

.bp-slot.unavailable {
  border-color: #f1f5f9;
  background: #f8fafc;
  color: #cbd5e1;
  cursor: not-allowed;
  text-decoration: line-through;
}

.bp-empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--bp-text-muted);
}

.bp-empty-state .bp-empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

/* ── Summary Card ─────────────────────────────────── */
.bp-summary-card {
  background: var(--bp-bg);
  border: 1px solid var(--bp-border);
  border-radius: var(--bp-radius);
  padding: 20px;
  margin-bottom: 24px;
}

.bp-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--bp-border);
  font-size: 14px;
}

.bp-summary-row:last-child {
  border-bottom: none;
}

.bp-summary-label {
  color: var(--bp-text-muted);
  font-weight: 500;
}

.bp-summary-value {
  font-weight: 600;
  color: var(--bp-text);
}

.bp-summary-value.bp-price {
  color: var(--bp-primary);
  font-size: 16px;
}

/* ── Form ─────────────────────────────────────────── */
.bp-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.bp-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bp-form-group-full {
  grid-column: 1 / -1;
}

.bp-form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--bp-text);
}

.bp-req {
  color: var(--bp-danger);
}

.bp-input {
  padding: 11px 14px;
  border: 1.5px solid var(--bp-border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--bp-text);
  background: var(--bp-surface);
  transition: var(--bp-transition);
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
}

.bp-input:focus {
  outline: none;
  border-color: var(--bp-primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.bp-input.invalid {
  border-color: var(--bp-danger);
}

.bp-textarea {
  resize: vertical;
  min-height: 80px;
}

/* ── Buttons ──────────────────────────────────────── */
.bp-form-actions {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-top: 24px;
}

.bp-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: var(--bp-transition);
  font-family: inherit;
}

.bp-btn-primary {
  background: var(--bp-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(37,99,235,.3);
}

.bp-btn-primary:hover {
  background: var(--bp-primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37,99,235,.4);
}

.bp-btn-primary:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
}

.bp-btn-ghost {
  background: transparent;
  color: var(--bp-text-muted);
  border: 1.5px solid var(--bp-border);
}

.bp-btn-ghost:hover {
  border-color: var(--bp-text-muted);
  color: var(--bp-text);
}

/* ── Alert ────────────────────────────────────────── */
.bp-alert {
  padding: 14px 18px;
  border-radius: 8px;
  font-size: 14px;
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.bp-alert-error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

/* ── Loading ──────────────────────────────────────── */
.bp-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px;
  gap: 12px;
  color: var(--bp-text-muted);
  font-size: 14px;
  grid-column: 1 / -1;
}

.bp-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--bp-border);
  border-top-color: var(--bp-primary);
  border-radius: 50%;
  animation: bp-spin .7s linear infinite;
}

.bp-spinner-lg {
  width: 44px;
  height: 44px;
  border-width: 4px;
}

@keyframes bp-spin {
  to { transform: rotate(360deg); }
}

.bp-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bp-overlay-content {
  text-align: center;
  color: var(--bp-text-muted);
  font-size: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

/* ── Confirmation Page ────────────────────────────── */
.bp-confirmation-wrapper {
  max-width: 560px;
  margin: 40px auto;
  padding: 0 16px;
}

.bp-confirm-card {
  background: var(--bp-surface);
  border-radius: 16px;
  box-shadow: var(--bp-shadow);
  overflow: hidden;
}

.bp-confirm-header {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  padding: 40px 32px;
  text-align: center;
  color: #fff;
}

.bp-confirm-icon {
  width: 72px;
  height: 72px;
  background: rgba(255,255,255,.2);
  border-radius: 50%;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bp-confirm-icon-error {
  background: rgba(255,255,255,.2);
}

.bp-confirm-header h1 {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 8px;
}

.bp-confirm-header p {
  font-size: 14px;
  opacity: .9;
  margin: 0;
}

.bp-confirm-code {
  text-align: center;
  padding: 24px 32px;
  background: var(--bp-bg);
  border-bottom: 1px solid var(--bp-border);
}

.bp-confirm-code-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--bp-text-muted);
  font-weight: 600;
  display: block;
  margin-bottom: 8px;
}

.bp-confirm-code-value {
  font-size: 26px;
  font-weight: 700;
  font-family: monospace;
  color: var(--bp-primary);
  letter-spacing: 2px;
}

.bp-confirm-details {
  padding: 24px 32px;
}

.bp-confirm-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--bp-border);
  gap: 16px;
}

.bp-confirm-row:last-child {
  border-bottom: none;
}

.bp-confirm-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--bp-text-muted);
  font-weight: 500;
  flex-shrink: 0;
}

.bp-confirm-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--bp-text);
  text-align: right;
  display: flex;
  align-items: center;
  gap: 6px;
}

.bp-confirm-price {
  color: var(--bp-primary);
  font-size: 16px;
}

.bp-service-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.bp-confirm-actions {
  padding: 0 32px 24px;
  display: flex;
  gap: 12px;
  flex-direction: column;
}

.bp-confirm-note {
  padding: 16px 32px;
  background: var(--bp-bg);
  border-top: 1px solid var(--bp-border);
  font-size: 12px;
  color: var(--bp-text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.bp-confirm-error .bp-confirm-header {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 640px) {
  .bp-datetime-grid { grid-template-columns: 1fr; }
  .bp-form-grid { grid-template-columns: 1fr; }
  .bp-form-group-full { grid-column: 1; }
  .bp-services-grid { grid-template-columns: 1fr; }
  .bp-providers-grid { grid-template-columns: 1fr 1fr; }
  .bp-progress { gap: 0; }
  .bp-step span { display: none; }
  .bp-confirm-details { padding: 16px; }
  .bp-confirm-code { padding: 16px; }
  .bp-confirm-actions { padding: 0 16px 16px; }
  .bp-slots-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 400px) {
  .bp-providers-grid { grid-template-columns: 1fr; }
  .bp-slots-grid { grid-template-columns: 1fr 1fr; }
}
