/* =========================================================
   ChanguBooking – Frontend Styles v1.0.0
   Mobile-first • Poppins • CSS Custom Properties
   ========================================================= */

:root {
  --cb-primary: #6C63FF;
  --cb-secondary: #FF6584;
  --cb-accent: #43C6AC;
  --cb-bg: #F7F8FC;
  --cb-card: #FFFFFF;
  --cb-border: #E8EAF0;
  --cb-text: #1A1A2E;
  --cb-muted: #6B7280;
  --cb-shadow: 0 4px 24px rgba(108, 99, 255, 0.10);
  --cb-radius: 16px;
  --cb-radius-sm: 10px;
  --cb-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --cb-font: 'Poppins', sans-serif;
}

.changubook-wrap * {
  box-sizing: border-box;
  font-family: var(--cb-font);
}

.changubook-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px 40px;
  color: var(--cb-text);
}

/* ── PROGRESS BAR ──────────────────────────────────────────── */
.cb-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 28px 0 36px;
  flex-wrap: nowrap;
}

.cb-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
  z-index: 1;
}

.cb-step-dot {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--cb-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cb-muted);
  font-size: 15px;
  transition: var(--cb-transition);
  border: 2px solid transparent;
}

.cb-step.active .cb-step-dot,
.cb-step.done .cb-step-dot {
  background: var(--cb-primary);
  color: #fff;
  box-shadow: 0 4px 16px rgba(108,99,255,.35);
  border-color: transparent;
}

.cb-step.done .cb-step-dot {
  background: var(--cb-accent);
}

.cb-step-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--cb-muted);
  letter-spacing: .4px;
  white-space: nowrap;
}

.cb-step.active .cb-step-label { color: var(--cb-primary); font-weight: 600; }
.cb-step.done  .cb-step-label  { color: var(--cb-accent); }

.cb-step-line {
  flex: 1;
  height: 2px;
  background: var(--cb-border);
  margin: 0 6px;
  margin-bottom: 22px;
  transition: var(--cb-transition);
  max-width: 60px;
}

.cb-step-line.done { background: var(--cb-accent); }

/* ── PANELS ────────────────────────────────────────────────── */
.cb-panel {
  display: none;
  animation: cbSlideIn .3s ease forwards;
}
.cb-panel.active { display: block; }

@keyframes cbSlideIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.cb-panel-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--cb-text);
  margin: 0 0 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.cb-panel-title i { color: var(--cb-primary); }

/* ── SERVICES GRID ─────────────────────────────────────────── */
.cb-services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 500px) {
  .cb-services-grid { grid-template-columns: 1fr 1fr; }
}

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

.cb-service-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--svc-color, var(--cb-primary));
  border-radius: 4px 0 0 4px;
  transition: var(--cb-transition);
}

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

.cb-service-card.selected {
  border-color: var(--cb-primary);
  background: linear-gradient(135deg, rgba(108,99,255,.07) 0%, rgba(108,99,255,.03) 100%);
}

.cb-service-card.selected::after {
  content: '\f00c';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  top: 14px; right: 14px;
  width: 22px; height: 22px;
  background: var(--cb-primary);
  color: #fff;
  border-radius: 50%;
  font-size: 11px;
  display: flex; align-items: center; justify-content: center;
  line-height: 22px; text-align: center;
}

.cb-svc-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-bottom: 6px;
}

.cb-service-card strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--cb-text);
}

.cb-svc-meta {
  font-size: 12px;
  color: var(--cb-muted);
  display: block;
  margin-bottom: 4px;
}

.cb-svc-desc {
  font-size: 12px;
  color: var(--cb-muted);
  margin: 6px 0 0;
  line-height: 1.5;
}

/* ── DATETIME WRAP ─────────────────────────────────────────── */
.cb-datetime-wrap {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 600px) {
  .cb-datetime-wrap { grid-template-columns: 1.2fr 1fr; }
}

/* ── CALENDAR ──────────────────────────────────────────────── */
.cb-calendar-wrap {
  background: var(--cb-card);
  border: 1px solid var(--cb-border);
  border-radius: var(--cb-radius);
  padding: 18px;
  box-shadow: 0 2px 12px rgba(0,0,0,.05);
}

.cb-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.cb-cal-header span {
  font-size: 15px;
  font-weight: 700;
  color: var(--cb-text);
}

.cb-cal-nav {
  background: none;
  border: 1px solid var(--cb-border);
  width: 34px; height: 34px;
  border-radius: 8px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--cb-text);
  transition: var(--cb-transition);
}

.cb-cal-nav:hover {
  background: var(--cb-primary);
  border-color: var(--cb-primary);
  color: #fff;
}

.cb-cal-days-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 6px;
}

.cb-cal-days-header span {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--cb-muted);
  padding: 4px 0;
  letter-spacing: .5px;
}

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

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

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

.cb-cal-day.available:hover {
  background: rgba(108,99,255,.12);
  color: var(--cb-primary);
}

.cb-cal-day.selected {
  background: var(--cb-primary) !important;
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(108,99,255,.4);
  border-radius: 10px;
}

.cb-cal-day.today::after {
  content: '';
  position: absolute;
  bottom: 3px;
  width: 4px; height: 4px;
  background: var(--cb-primary);
  border-radius: 50%;
}

.cb-cal-day.today.selected::after { background: rgba(255,255,255,.7); }

.cb-cal-day.full {
  color: var(--cb-secondary);
  cursor: not-allowed;
  font-size: 11px;
}

.cb-cal-day.full::before {
  content: '';
  position: absolute;
  inset: 3px;
  border: 1.5px solid currentColor;
  border-radius: 6px;
  opacity: .3;
}

.cb-cal-day.past, .cb-cal-day.empty {
  color: #ccc;
}

.cb-cal-legend {
  display: flex;
  gap: 14px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.cb-cal-legend span {
  font-size: 11px;
  color: var(--cb-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.cb-cal-legend em {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 3px;
  font-style: normal;
}

.leg-available { background: var(--cb-primary); }
.leg-full      { border: 1.5px solid var(--cb-secondary); background: transparent; }
.leg-past      { background: #E0E0E0; }

/* ── TIME SLOTS ────────────────────────────────────────────── */
.cb-slots-wrap {
  background: var(--cb-card);
  border: 1px solid var(--cb-border);
  border-radius: var(--cb-radius);
  padding: 18px;
  box-shadow: 0 2px 12px rgba(0,0,0,.05);
  min-height: 200px;
}

.cb-slots-hint {
  font-size: 13px;
  color: var(--cb-muted);
  text-align: center;
  margin: 40px 0;
}

.cb-slots-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.cb-slot {
  padding: 10px 6px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: var(--cb-transition);
  border: 2px solid var(--cb-border);
  color: var(--cb-text);
  background: var(--cb-bg);
  line-height: 1.3;
}

.cb-slot:hover:not(.booked) {
  border-color: var(--cb-primary);
  color: var(--cb-primary);
  background: rgba(108,99,255,.07);
}

.cb-slot.selected {
  background: var(--cb-primary);
  border-color: var(--cb-primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(108,99,255,.35);
}

.cb-slot.booked {
  color: #ccc;
  border-color: #eee;
  cursor: not-allowed;
  text-decoration: line-through;
  background: #fafafa;
}

.cb-slots-loader {
  text-align: center;
  padding: 40px 0;
}

/* ── SPINNER ───────────────────────────────────────────────── */
.cb-spinner {
  display: inline-block;
  width: 28px; height: 28px;
  border: 3px solid rgba(108,99,255,.2);
  border-top-color: var(--cb-primary);
  border-radius: 50%;
  animation: cbSpin .7s linear infinite;
}

@keyframes cbSpin {
  to { transform: rotate(360deg); }
}

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

@media (min-width: 500px) {
  .cb-form-grid { grid-template-columns: 1fr 1fr; }
}

.cb-field-full { grid-column: 1 / -1; }

.cb-field label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--cb-text);
  margin-bottom: 6px;
}

.cb-field label i { color: var(--cb-primary); }

.cb-field input,
.cb-field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--cb-border);
  border-radius: 10px;
  font-size: 14px;
  font-family: var(--cb-font);
  color: var(--cb-text);
  background: var(--cb-bg);
  transition: var(--cb-transition);
  outline: none;
  resize: vertical;
}

.cb-field input:focus,
.cb-field textarea:focus {
  border-color: var(--cb-primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(108,99,255,.12);
}

.cb-field input.error {
  border-color: var(--cb-secondary);
  background: rgba(255,101,132,.04);
}

/* ── SUMMARY BOX ───────────────────────────────────────────── */
.cb-summary {
  background: var(--cb-bg);
  border: 1px solid var(--cb-border);
  border-radius: var(--cb-radius);
  padding: 20px;
  margin-bottom: 24px;
}

.cb-summary-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--cb-border);
}

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

.cb-summary-row i {
  color: var(--cb-primary);
  width: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.cb-summary-row .cb-sr-key {
  font-size: 12px;
  color: var(--cb-muted);
  min-width: 80px;
}

.cb-summary-row .cb-sr-val {
  font-size: 14px;
  font-weight: 600;
  color: var(--cb-text);
}

/* ── BUTTONS ───────────────────────────────────────────────── */
.cb-nav-btns {
  display: flex;
  gap: 12px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.cb-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--cb-font);
  cursor: pointer;
  border: none;
  transition: var(--cb-transition);
  background: var(--cb-primary);
  color: #fff;
  box-shadow: 0 4px 16px rgba(108,99,255,.3);
}

.cb-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(108,99,255,.4);
}

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

.cb-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
  box-shadow: none;
}

.cb-btn-ghost {
  background: transparent;
  color: var(--cb-muted);
  box-shadow: none;
  border: 1.5px solid var(--cb-border);
}

.cb-btn-ghost:hover:not(:disabled) {
  border-color: var(--cb-primary);
  color: var(--cb-primary);
  background: rgba(108,99,255,.06);
  box-shadow: none;
}

.cb-btn-success {
  background: var(--cb-accent);
  box-shadow: 0 4px 16px rgba(67,198,172,.35);
}

.cb-btn-success:hover:not(:disabled) {
  box-shadow: 0 8px 24px rgba(67,198,172,.45);
}

.cb-btn-wa {
  background: #25D366;
  box-shadow: 0 4px 16px rgba(37,211,102,.35);
}

.cb-btn-wa:hover {
  box-shadow: 0 8px 24px rgba(37,211,102,.45);
}

/* ── SUBMITTING ────────────────────────────────────────────── */
.cb-submitting {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--cb-muted);
  margin-top: 14px;
}

/* ── SUCCESS SCREEN ────────────────────────────────────────── */
.cb-success-wrap {
  text-align: center;
  padding: 20px 0 40px;
}

.cb-success-icon {
  width: 90px; height: 90px;
  background: linear-gradient(135deg, var(--cb-accent), #27c99a);
  border-radius: 50%;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: cbPop .4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  box-shadow: 0 8px 32px rgba(67,198,172,.4);
}

.cb-success-icon i {
  font-size: 38px;
  color: #fff;
}

@keyframes cbPop {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.cb-success-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--cb-text);
  margin: 0 0 8px;
}

.cb-success-sub {
  font-size: 15px;
  color: var(--cb-muted);
  margin-bottom: 24px;
}

.cb-success-card {
  background: var(--cb-bg);
  border: 1px solid var(--cb-border);
  border-radius: var(--cb-radius);
  padding: 20px;
  text-align: left;
  margin-bottom: 28px;
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
}

.cb-ref-badge {
  display: inline-block;
  background: var(--cb-primary);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 50px;
  margin-bottom: 16px;
  letter-spacing: 1px;
}

.cb-success-detail {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 14px;
  color: var(--cb-text);
  border-bottom: 1px solid var(--cb-border);
}

.cb-success-detail:last-child { border-bottom: none; }
.cb-success-detail i { color: var(--cb-primary); width: 18px; text-align: center; }

.cb-wa-prompt {
  background: linear-gradient(135deg, #dcfce7, #d1fae5);
  border: 1.5px solid #86efac;
  border-radius: var(--cb-radius);
  padding: 20px 24px;
  margin-bottom: 24px;
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
}

.cb-wa-prompt-icon {
  font-size: 36px;
  margin-bottom: 10px;
}

.cb-wa-prompt h4 {
  font-size: 17px;
  font-weight: 700;
  color: #14532d;
  margin: 0 0 6px;
}

.cb-wa-prompt p {
  font-size: 13px;
  color: #166534;
  margin: 0 0 16px;
}

.cb-success-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── CALENDAR LOADING ──────────────────────────────────────── */
.cb-cal-loading {
  text-align: center;
  padding: 40px 0;
  grid-column: 1 / -1;
}

/* ── TOAST ─────────────────────────────────────────────────── */
.cb-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #1A1A2E;
  color: #fff;
  padding: 12px 24px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--cb-font);
  z-index: 9999;
  opacity: 0;
  transition: all .35s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
  max-width: 90vw;
}

.cb-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.cb-toast.error { background: #EF4444; }
.cb-toast.success { background: var(--cb-accent); }

/* ── RESPONSIVE ────────────────────────────────────────────── */
@media (max-width: 480px) {
  .cb-progress { gap: 0; padding: 20px 0 28px; }
  .cb-step-dot { width: 36px; height: 36px; font-size: 13px; }
  .cb-step-label { font-size: 10px; }
  .cb-step-line { max-width: 30px; }
  .cb-panel-title { font-size: 16px; }
  .cb-btn { padding: 11px 20px; font-size: 13px; }
  .cb-slots-grid { grid-template-columns: repeat(3, 1fr); }
  .cb-slot { font-size: 11px; padding: 8px 4px; }
}
