/* Smart Booking & Appointments — Front-End Styles */

:root {
  --wpba-primary:   #1D9E75;
  --wpba-primary-d: #0F6E56;
  --wpba-accent:    #3858E9;
  --wpba-text:      #1a1a2e;
  --wpba-muted:     #6b7280;
  --wpba-border:    #e5e7eb;
  --wpba-bg:        #f9fafb;
  --wpba-white:     #ffffff;
  --wpba-radius:    10px;
  --wpba-shadow:    0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
}

.wpba-form {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  max-width: 860px;
  margin: 0 auto;
  color: var(--wpba-text);
  font-size: 15px;
}

/* ── Step bar ──────────────────────────────────────────────────────────────── */
.wpba-steps {
  display: flex;
  gap: 4px;
  margin-bottom: 28px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.wpba-step {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border-radius: var(--wpba-radius);
  background: var(--wpba-bg);
  border: 1px solid var(--wpba-border);
  transition: all .2s;
}

.wpba-step.active { background: #e6f4ef; border-color: var(--wpba-primary); }
.wpba-step.done   { background: var(--wpba-primary); border-color: var(--wpba-primary); }

.wpba-step__dot {
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
  background: var(--wpba-border); color: var(--wpba-muted);
  flex-shrink: 0;
}
.wpba-step.active .wpba-step__dot { background: var(--wpba-primary); color: #fff; }
.wpba-step.done   .wpba-step__dot { background: rgba(255,255,255,.3); color: #fff; }

.wpba-step__label { font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wpba-step.done .wpba-step__label { color: #fff; }

/* ── Layout ────────────────────────────────────────────────────────────────── */
.wpba-form__layout { display: grid; grid-template-columns: 1fr 260px; gap: 24px; }
@media(max-width: 640px) { .wpba-form__layout { grid-template-columns: 1fr; } }

.wpba-step-title { font-size: 18px; font-weight: 600; margin: 0 0 16px; color: var(--wpba-text); }

/* ── Service cards ─────────────────────────────────────────────────────────── */
.wpba-service-grid { display: flex; flex-direction: column; gap: 10px; }

.wpba-service-card {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 16px; border: 1.5px solid var(--wpba-border);
  border-radius: var(--wpba-radius); background: var(--wpba-white);
  text-align: left; cursor: pointer; transition: all .15s;
  width: 100%;
}
.wpba-service-card:hover { border-color: var(--wpba-primary); box-shadow: var(--wpba-shadow); }

.wpba-service-card__dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; }
.wpba-service-card__body { flex: 1; min-width: 0; }
.wpba-service-card__body strong { font-size: 15px; display: block; margin-bottom: 4px; }
.wpba-service-card__body p { font-size: 13px; color: var(--wpba-muted); margin: 0 0 8px; line-height: 1.5; }

.wpba-service-card__meta { display: flex; gap: 10px; font-size: 12px; color: var(--wpba-muted); }
.wpba-service-card__meta span { background: var(--wpba-bg); border: 1px solid var(--wpba-border); border-radius: 20px; padding: 2px 8px; }

/* ── Staff cards ───────────────────────────────────────────────────────────── */
.wpba-staff-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }

.wpba-staff-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 16px 12px; border: 1.5px solid var(--wpba-border);
  border-radius: var(--wpba-radius); background: var(--wpba-white);
  cursor: pointer; transition: all .15s; text-align: center;
}
.wpba-staff-card:hover { border-color: var(--wpba-primary); box-shadow: var(--wpba-shadow); }
.wpba-staff-card--any { border-style: dashed; }

.wpba-staff-card__avatar {
  width: 52px; height: 52px; border-radius: 50%;
  background: #e6f4ef; color: var(--wpba-primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px; overflow: hidden; flex-shrink: 0;
}
.wpba-staff-card__avatar img { width: 100%; height: 100%; object-fit: cover; }
.wpba-staff-card__avatar--any { background: var(--wpba-bg); color: var(--wpba-muted); font-size: 22px; }

.wpba-staff-card__name { font-weight: 600; font-size: 14px; }
.wpba-staff-card__sub, .wpba-staff-card__bio { font-size: 12px; color: var(--wpba-muted); line-height: 1.4; }

/* ── Calendar ──────────────────────────────────────────────────────────────── */
.wpba-datetime-step { display: flex; flex-direction: column; gap: 20px; }
.wpba-cal { background: var(--wpba-white); border: 1px solid var(--wpba-border); border-radius: var(--wpba-radius); overflow: hidden; }

.wpba-cal__nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--wpba-border);
  font-weight: 600;
}
.wpba-cal__nav button { background: none; border: 1px solid var(--wpba-border); border-radius: 6px; width: 30px; height: 30px; cursor: pointer; font-size: 16px; display: flex; align-items: center; justify-content: center; }
.wpba-cal__nav button:hover { background: var(--wpba-bg); }

.wpba-cal__weekdays { display: grid; grid-template-columns: repeat(7, 1fr); padding: 8px 12px 4px; }
.wpba-cal__weekdays > div { text-align: center; font-size: 11px; font-weight: 600; color: var(--wpba-muted); }

.wpba-cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; padding: 4px 12px 12px; }

.wpba-cal__cell {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  border-radius: 6px; font-size: 13px; cursor: pointer;
  border: none; background: none; transition: all .12s;
}
.wpba-cal__cell--empty      { pointer-events: none; }
.wpba-cal__cell--disabled   { color: #ccc; cursor: not-allowed; }
.wpba-cal__cell--available:hover { background: #e6f4ef; color: var(--wpba-primary); }
.wpba-cal__cell--today      { font-weight: 700; }
.wpba-cal__cell--selected   { background: var(--wpba-primary) !important; color: #fff !important; }

/* ── Time slots ────────────────────────────────────────────────────────────── */
.wpba-slots__label { font-weight: 600; font-size: 14px; margin-bottom: 10px; }
.wpba-slots__empty { font-size: 13px; color: var(--wpba-muted); }
.wpba-slots__grid  { display: flex; flex-wrap: wrap; gap: 8px; }

.wpba-slot {
  padding: 8px 14px; border-radius: 6px; font-size: 13px; font-weight: 500;
  border: 1.5px solid var(--wpba-border); background: var(--wpba-white); cursor: pointer; transition: all .12s;
}
.wpba-slot:hover       { border-color: var(--wpba-primary); color: var(--wpba-primary); }
.wpba-slot--selected   { background: var(--wpba-primary); border-color: var(--wpba-primary); color: #fff; }

/* ── Details form ──────────────────────────────────────────────────────────── */
.wpba-details-form { display: flex; flex-direction: column; gap: 14px; }

.wpba-field { display: flex; flex-direction: column; gap: 5px; }
.wpba-field label { font-size: 13px; font-weight: 600; color: var(--wpba-text); }
.wpba-field input, .wpba-field textarea {
  padding: 9px 12px; border: 1.5px solid var(--wpba-border); border-radius: 8px;
  font-size: 14px; color: var(--wpba-text); background: var(--wpba-white);
  transition: border-color .15s; font-family: inherit;
}
.wpba-field input:focus, .wpba-field textarea:focus { outline: none; border-color: var(--wpba-primary); }
.wpba-field__error { font-size: 12px; color: #dc2626; }
.wpba-field textarea { resize: vertical; min-height: 80px; }

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.wpba-btn {
  padding: 11px 20px; border-radius: 8px; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all .15s; border: none; font-family: inherit;
}
.wpba-btn--primary  { background: var(--wpba-primary); color: #fff; }
.wpba-btn--primary:hover { background: var(--wpba-primary-d); }
.wpba-btn--secondary { background: var(--wpba-bg); color: var(--wpba-text); border: 1px solid var(--wpba-border); }
.wpba-btn--back { background: none; color: var(--wpba-muted); font-size: 13px; padding: 8px 0; margin-top: 12px; border: none; cursor: pointer; }
.wpba-btn--back:hover { color: var(--wpba-text); }

/* ── Summary sidebar ───────────────────────────────────────────────────────── */
.wpba-summary {
  background: var(--wpba-white); border: 1px solid var(--wpba-border);
  border-radius: var(--wpba-radius); padding: 16px;
  position: sticky; top: 20px;
}
.wpba-summary__service {
  border-left: 4px solid var(--wpba-primary); padding-left: 10px; margin-bottom: 14px;
}
.wpba-summary__service strong { display: block; font-size: 15px; margin-bottom: 2px; }
.wpba-summary__service span   { font-size: 12px; color: var(--wpba-muted); }
.wpba-summary__row { display: flex; justify-content: space-between; font-size: 13px; padding: 5px 0; border-bottom: 1px solid var(--wpba-border); }
.wpba-summary__row span:first-child { color: var(--wpba-muted); }
.wpba-summary__price { font-size: 20px; font-weight: 700; color: var(--wpba-primary); margin-top: 12px; text-align: right; }

/* ── Confirm screen ────────────────────────────────────────────────────────── */
.wpba-confirm { text-align: center; padding: 32px 16px; }
.wpba-confirm__icon {
  width: 64px; height: 64px; border-radius: 50%; background: #e6f4ef;
  color: var(--wpba-primary); font-size: 28px; display: flex; align-items: center;
  justify-content: center; margin: 0 auto 16px; font-weight: 700;
}
.wpba-confirm h2  { font-size: 22px; margin: 0 0 8px; }
.wpba-confirm p   { color: var(--wpba-muted); margin: 0 0 20px; }
.wpba-confirm__details {
  background: var(--wpba-bg); border-radius: var(--wpba-radius);
  padding: 16px; text-align: left; font-size: 14px;
}
.wpba-confirm__details > div { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--wpba-border); }
.wpba-confirm__details > div:last-child { border-bottom: none; }
.wpba-confirm__details span:first-child { color: var(--wpba-muted); }

/* ── States ────────────────────────────────────────────────────────────────── */
.wpba-loading { padding: 20px; text-align: center; color: var(--wpba-muted); font-size: 14px; }
.wpba-error   { background: #fef2f2; border: 1px solid #fee2e2; color: #dc2626; border-radius: 8px; padding: 12px; font-size: 13px; margin-top: 12px; }

.wpba-loading-overlay {
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.wpba-spinner {
  width: 28px; height: 28px; border: 3px solid var(--wpba-border);
  border-top-color: var(--wpba-primary); border-radius: 50%;
  animation: wpba-spin .7s linear infinite;
}
@keyframes wpba-spin { to { transform: rotate(360deg); } }

/* ── Dynamic details step ─────────────────────────────────────────────── */
.wpba-details-step { width: 100%; }
.wpba-details-form { width: 100%; }

.wpba-field { margin-bottom: 16px; }
.wpba-field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--wpba-text, #1a1a2e);
  margin-bottom: 5px;
}
.wpba-field input,
.wpba-field select,
.wpba-field textarea {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--wpba-border, #e5e7eb);
  border-radius: 8px;
  font-size: 14px;
  color: var(--wpba-text, #1a1a2e);
  background: #fff;
  box-sizing: border-box;
  transition: border-color .15s;
  font-family: inherit;
}
.wpba-field input:focus,
.wpba-field select:focus,
.wpba-field textarea:focus {
  outline: none;
  border-color: var(--wpba-primary, #1D9E75);
  box-shadow: 0 0 0 3px rgba(29,158,117,.1);
}
.wpba-field__error {
  display: block;
  font-size: 12px;
  color: #dc2626;
  margin-top: 4px;
}

/* Radio rows */
.wpba-radio-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  cursor: pointer;
}
.wpba-radio-row input[type="radio"] { flex-shrink: 0; }
.wpba-radio-row label { font-size: 14px; cursor: pointer; margin: 0; font-weight: 400; }

/* Checkbox field */
.wpba-field input[type="checkbox"] {
  width: 16px;
  height: 16px;
  padding: 0;
  cursor: pointer;
}

/* ── Package step ─────────────────────────────────────────────────────── */
.wpba-package-step { width: 100%; }

.wpba-package-card {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 2px solid var(--wpba-border, #e5e7eb);
  border-radius: 10px;
  padding: 14px 16px;
  cursor: pointer;
  margin-bottom: 10px;
  background: var(--wpba-white, #fff);
  transition: border-color .15s, background .15s;
}
.wpba-package-card:hover {
  border-color: var(--wpba-primary, #1D9E75);
}
.wpba-package-card input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--wpba-primary, #1D9E75);
  flex-shrink: 0;
  cursor: pointer;
}
.wpba-package-card strong { font-size: 14px; }
