/* =========================================================================
   CMT Booking — front-end UI modelled on LatePoint's booking form.
   Layout: side panel (progress + step description) | form (heading/body/footer)
   | summary panel. Design tokens measured from LatePoint's rendered form.
   Namespaced .cmtbk-* so nothing clashes with the theme.
   ========================================================================= */
.cmtbk-w {
  --bk-accent: #ff5900;
  --bk-accent-d: #e24f00;
  --bk-head: #14161d;   /* headings          (LatePoint rgb(20,22,29))  */
  --bk-text: #3d3c39;   /* body text         (LatePoint rgb(61,60,57))  */
  --bk-muted: #7c85a3;  /* secondary text    (LatePoint rgb(124,133,163)) */
  --bk-line: rgba(0, 0, 0, 0.07);
  --bk-soft: #f6f7fb;
  --bk-panel: #fbfbfd;
  --bk-e: cubic-bezier(0.23, 1, 0.32, 1);
  font-family: "Poppins", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  font-weight: 400;
  color: var(--bk-text);
  max-width: 980px;
  margin: 0 auto;
  -webkit-font-smoothing: antialiased;
}
.cmtbk-w *, .cmtbk-w *::before, .cmtbk-w *::after { box-sizing: border-box; }

.cmtbk-empty {
  background: #fff; border: 1px solid var(--bk-line); border-radius: 10px;
  padding: 40px; text-align: center; color: var(--bk-muted);
}

/* ---- Shell: 3 columns like LatePoint ---- */
.cmtbk-form-element {
  display: flex;
  background: #fff;
  border: 1px solid var(--bk-line);
  border-radius: 10px;
  box-shadow: 0 18px 50px -28px rgba(20, 22, 29, 0.35);
  overflow: hidden;
  min-height: 520px;
}

/* ============ SIDE PANEL (LatePoint: 270px, padding 40/40/25) ============ */
.cmtbk-side-panel {
  width: 270px; flex: 0 0 270px;
  background: var(--bk-panel);
  border-right: 1px solid var(--bk-line);
  padding: 34px 32px 24px;
  display: flex; flex-direction: column;
}
.cmtbk-progress { padding-bottom: 26px; }
.cmtbk-progress ul { list-style: none; margin: 0; padding: 0; }
.cmtbk-progress li { position: relative; padding: 0 0 22px 26px; }
.cmtbk-progress li:last-child { padding-bottom: 0; }
/* connector line */
.cmtbk-progress li::after {
  content: ""; position: absolute; left: 7px; top: 16px; bottom: 2px; width: 2px;
  background: var(--bk-line);
}
.cmtbk-progress li:last-child::after { display: none; }
/* bullet */
.cmtbk-progress li::before {
  content: ""; position: absolute; left: 0; top: 3px; width: 16px; height: 16px;
  border-radius: 50%; border: 2px solid #d7dae6; background: #fff;
  transition: border-color 0.25s var(--bk-e), background 0.25s var(--bk-e);
}
.cmtbk-progress li.active::before { border-color: var(--bk-accent); box-shadow: 0 0 0 4px rgba(255, 89, 0, 0.13); }
.cmtbk-progress li.done::before { border-color: var(--bk-accent); background: var(--bk-accent); }
.cmtbk-progress li.done::after { background: var(--bk-accent); opacity: 0.45; }
.cmtbk-progress .progress-item span {
  font-size: 13px; font-weight: 600; color: var(--bk-muted);
  transition: color 0.25s var(--bk-e);
}
.cmtbk-progress li.active .progress-item span { color: var(--bk-head); }
.cmtbk-progress li.done .progress-item span { color: var(--bk-text); }

.cmtbk-step-desc-w { flex: 1; position: relative; }
.cmtbk-step-desc { display: none; }
.cmtbk-step-desc.active { display: block; animation: cmtbkFade 0.35s var(--bk-e); }
.cmtbk-desc-media {
  width: 62px; height: 62px; border-radius: 50%;
  background: rgba(255, 89, 0, 0.1); color: var(--bk-accent);
  display: grid; place-items: center; margin-bottom: 16px;
}
.cmtbk-desc-media svg { width: 28px; height: 28px; }
.cmtbk-desc-title { font-size: 20px; font-weight: 700; color: var(--bk-head); margin: 0 0 8px; line-height: 1.25; }
.cmtbk-desc-content { font-size: 14px; color: var(--bk-muted); }
.cmtbk-questions { font-size: 14px; color: var(--bk-muted); padding-top: 18px; border-top: 1px solid var(--bk-line); }
.cmtbk-questions p { margin: 0 0 4px; }

/* ============ FORM COLUMN ============ */
.cmtbk-form-w { flex: 1; min-width: 0; display: flex; flex-direction: column; background: #fff; }
.cmtbk-heading-w {
  padding: 18px 32px; border-bottom: 1px solid var(--bk-line);
  display: flex; align-items: center; min-height: 62px;
}
.cmtbk-heading-text { font-size: 20px; font-weight: 700; color: var(--bk-head); margin: 0; }

.cmtbk-body { flex: 1; padding: 30px 32px; overflow-y: auto; }
.cmtbk-step-content { display: none; }
.cmtbk-step-content.active { display: block; animation: cmtbkFade 0.35s var(--bk-e); }
@keyframes cmtbkFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---- Service rows (LatePoint os-item, ~67px tall) ---- */
.cmtbk-items { display: flex; flex-direction: column; }
.cmtbk-item { margin-bottom: 10px; }
.cmtbk-item:last-child { margin-bottom: 0; }
.cmtbk-item {
  border: 1px solid var(--bk-line); border-radius: 8px; background: #fff; cursor: pointer;
  max-height: 220px; overflow: hidden;
  transition: border-color 0.2s var(--bk-e), box-shadow 0.2s var(--bk-e), background 0.2s var(--bk-e),
              max-height 0.26s var(--bk-e), opacity 0.18s var(--bk-e), margin 0.26s var(--bk-e), border-width 0.26s var(--bk-e);
}
.cmtbk-item-i { display: flex; align-items: center; gap: 14px; padding: 12px 14px; }
.cmtbk-item-img {
  width: 44px; height: 44px; flex: 0 0 44px; border-radius: 8px; background: var(--bk-soft);
  background-size: cover; background-position: center; display: grid; place-items: center;
  color: var(--bk-accent); font-weight: 700; font-style: normal; font-size: 17px;
}
.cmtbk-item-img i { font-style: normal; }
.cmtbk-item-name-w { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cmtbk-item-name { font-size: 15px; font-weight: 600; color: var(--bk-head); }
.cmtbk-item-desc {
  font-size: 13px; color: var(--bk-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cmtbk-item-meta { text-align: right; display: flex; flex-direction: column; gap: 2px; white-space: nowrap; }
.cmtbk-item-dur { font-size: 12px; color: var(--bk-muted); }
.cmtbk-item-price { font-size: 14px; font-weight: 700; color: var(--bk-accent); }
@media (hover: hover) and (pointer: fine) {
  .cmtbk-w .cmtbk-item:hover { border-color: var(--bk-accent); background: #fff; box-shadow: 0 8px 20px -14px rgba(255, 89, 0, 0.55); }
}
.cmtbk-w .cmtbk-item.selected {
  border-color: var(--bk-accent); background: rgba(255, 89, 0, 0.04);
  box-shadow: 0 0 0 1px var(--bk-accent) inset;
}


/* Once a service is chosen the list folds to just that service, so the footer
   (and the Next button) come straight into reach without scrolling. */
.cmtbk-items.is-collapsed .cmtbk-item:not(.selected) {
  max-height: 0; opacity: 0; margin-bottom: 0; border-width: 0; pointer-events: none;
}
.cmtbk-change {
  display: none; margin-top: 12px; padding: 0; background: none; border: none; cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: 600; color: var(--bk-accent);
}
.cmtbk-items.is-collapsed + .cmtbk-change { display: inline-block; }
.cmtbk-w .cmtbk-change:hover, .cmtbk-w .cmtbk-change:focus, .cmtbk-w .cmtbk-change:active {
  color: var(--bk-accent) !important; background: none !important; box-shadow: none !important;
  border: none !important; transform: none !important; opacity: 1 !important;
}

/* ---- Date & time: calendar + slots side by side ---- */
/* Calendar fills the panel; the times list stays hidden until a date is picked
   (LatePoint behaviour: the time selector appears below the calendar). */
.cmtbk-datepick { display: block; }
.cmtbk-cal { width: 100%; }
.cmtbk-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cmtbk-cal-title { font-size: 15px; font-weight: 700; color: var(--bk-head); }
/* Month nav: real icon buttons — locked hover (Astra recolors bare buttons),
   press feedback, inert when disabled, larger target on touch. */
.cmtbk-w .cmtbk-cal-nav {
  width: 32px; height: 32px; flex: 0 0 32px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px; border: 1px solid var(--bk-line);
  background: #fff; color: var(--bk-text); cursor: pointer; line-height: 0;
  transition: border-color 0.18s var(--bk-e), color 0.18s var(--bk-e), background 0.18s var(--bk-e), transform 0.14s var(--bk-e);
}
.cmtbk-cal-nav svg { width: 16px; height: 16px; display: block; }
@media (hover: hover) and (pointer: fine) {
  .cmtbk-w .cmtbk-cal-nav:hover:not([disabled]) {
    border-color: var(--bk-accent) !important;
    color: var(--bk-accent) !important;
    background: #fff !important;
  }
}
.cmtbk-w .cmtbk-cal-nav:focus-visible { outline: none; border-color: var(--bk-accent); box-shadow: 0 0 0 3px rgba(255, 89, 0, 0.16); }
.cmtbk-w .cmtbk-cal-nav:active:not([disabled]) { transform: scale(0.94); }
.cmtbk-w .cmtbk-cal-nav[disabled] {
  opacity: 0.3; cursor: default; pointer-events: none;
  border-color: var(--bk-line) !important; color: var(--bk-text) !important; background: #fff !important;
}
@media (pointer: coarse) {
  .cmtbk-w .cmtbk-cal-nav { width: 40px; height: 40px; flex: 0 0 40px; }
}
/* Availability still loading: dim the grid, keep it interactive-looking */
.cmtbk-cal.is-loading .cmtbk-cal-grid { opacity: 0.45; transition: opacity 0.18s var(--bk-e); }
.cmtbk-cal .cmtbk-cal-grid { transition: opacity 0.18s var(--bk-e); }
.cmtbk-cal-dows, .cmtbk-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cmtbk-cal-dows { margin-bottom: 4px; }
.cmtbk-cal-dows span { text-align: center; font-size: 11px; font-weight: 600; color: var(--bk-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.cmtbk-day {
  aspect-ratio: 1; display: grid; place-items: center; border-radius: 8px; border: 1px solid transparent;
  background: var(--bk-soft); color: var(--bk-text); font-size: 13px; font-weight: 500; cursor: pointer;
  transition: border-color 0.18s var(--bk-e), background 0.18s var(--bk-e), color 0.18s var(--bk-e);
}
.cmtbk-day.empty { background: none; cursor: default; }
.cmtbk-w .cmtbk-day.off { background: none; color: #c8ccd8; cursor: default; }
@media (hover: hover) and (pointer: fine) {
  .cmtbk-w .cmtbk-day:not(.off):not(.empty):hover { border-color: var(--bk-accent); color: var(--bk-head); background: #fff; }
}
.cmtbk-w .cmtbk-day.selected { background: var(--bk-accent) !important; color: #fff !important; border-color: var(--bk-accent); font-weight: 600; }
.cmtbk-day.today:not(.selected) { box-shadow: 0 0 0 1px var(--bk-accent) inset; }

.cmtbk-times { display: none; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--bk-line); }
.cmtbk-datepick.has-date .cmtbk-times { display: block; animation: cmtbkFade 0.3s var(--bk-e); }
.cmtbk-cal-note { display: none; margin: 12px 0 0; font-size: 13px; color: var(--bk-muted); text-align: center; }
.cmtbk-cal-note.is-show { display: block; }
.cmtbk-times-head { font-size: 13px; font-weight: 600; color: var(--bk-head); margin-bottom: 10px; min-height: 20px; }
.cmtbk-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.cmtbk-hint, .cmtbk-loading { font-size: 13px; color: var(--bk-muted); margin: 2px 0; }
.cmtbk-slot {
  padding: 9px 12px; border-radius: 8px; border: 1px solid var(--bk-line); background: #fff;
  color: var(--bk-text); font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer; text-align: center;
  transition: border-color 0.18s var(--bk-e), background 0.18s var(--bk-e), color 0.18s var(--bk-e);
}
@media (hover: hover) and (pointer: fine) {
  .cmtbk-w .cmtbk-slot:hover:not(.selected) { border-color: var(--bk-accent); background: #fff !important; color: var(--bk-head) !important; }
}
.cmtbk-w .cmtbk-slot.selected { background: var(--bk-accent) !important; border-color: var(--bk-accent); color: #fff !important; }

/* custom time request */
.cmtbk-customWrap { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--bk-line); }
.cmtbk-customToggle {
  background: none; border: none; padding: 0; cursor: pointer; font-family: inherit;
  font-size: 12.5px; font-weight: 600; color: var(--bk-accent); text-align: left;
}
.cmtbk-w .cmtbk-customToggle:hover, .cmtbk-w .cmtbk-customToggle:focus, .cmtbk-w .cmtbk-customToggle:active {
  color: var(--bk-accent) !important; background: none !important; box-shadow: none !important;
  border: none !important; transform: none !important; opacity: 1 !important;
}
.cmtbk-custom { max-height: 0; opacity: 0; overflow: hidden; transition: max-height 0.28s var(--bk-e), opacity 0.28s var(--bk-e), margin-top 0.28s var(--bk-e); margin-top: 0; }
.cmtbk-custom.is-open { max-height: 260px; opacity: 1; margin-top: 10px; }
.cmtbk-customRow { display: flex; gap: 8px; }
.cmtbk-customRow .cmtbk-field { flex: 1; margin-bottom: 8px; }

/* ---- Fields ---- */
.cmtbk-fields { display: grid; gap: 14px; }
.cmtbk-field { display: block; margin: 0; }
.cmtbk-label { display: block; font-size: 13px; font-weight: 600; color: var(--bk-head); margin-bottom: 5px; }
.cmtbk-w .cmtbk-in {
  width: 100%; height: auto !important; padding: 11px 13px; font-family: inherit; font-size: 14px;
  line-height: 1.45; color: var(--bk-text); background: #fff;
  border: 1px solid var(--bk-line); border-radius: 8px;
  transition: border-color 0.18s var(--bk-e), box-shadow 0.18s var(--bk-e);
}
.cmtbk-w .cmtbk-in:focus { outline: none; border-color: var(--bk-accent); box-shadow: 0 0 0 3px rgba(255, 89, 0, 0.12); }
.cmtbk-w select.cmtbk-in {
  -webkit-appearance: none; -moz-appearance: none; appearance: none; cursor: pointer; padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' stroke='%2314161d' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; background-size: 12px 8px;
}
textarea.cmtbk-in { resize: vertical; }
.cmtbk-conditional { max-height: 0; opacity: 0; overflow: hidden; transition: max-height 0.28s var(--bk-e), opacity 0.28s var(--bk-e); }
.cmtbk-conditional.is-open { max-height: 120px; opacity: 1; }
.cmtbk-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* ---- Review + done ---- */
.cmtbk-review dl, .cmtbk-done-summary dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; }
.cmtbk-review dt, .cmtbk-done-summary dt { font-size: 13px; color: var(--bk-muted); }
.cmtbk-review dd, .cmtbk-done-summary dd { margin: 0; font-size: 14px; font-weight: 600; color: var(--bk-head); text-align: right; }
.cmtbk-review { background: var(--bk-soft); border: 1px solid var(--bk-line); border-radius: 10px; padding: 18px 20px; }
.cmtbk-done { text-align: center; padding: 20px 0; }
.cmtbk-done-icon {
  width: 66px; height: 66px; margin: 0 auto 16px; border-radius: 50%;
  background: rgba(255, 89, 0, 0.12); color: var(--bk-accent); display: grid; place-items: center;
}
.cmtbk-done-icon svg { width: 30px; height: 30px; }
.cmtbk-done h4 { font-size: 20px; font-weight: 700; color: var(--bk-head); margin: 0 0 14px; }
.cmtbk-done-summary { text-align: left; background: var(--bk-soft); border: 1px solid var(--bk-line); border-radius: 10px; padding: 16px 18px; margin-bottom: 14px; }
.cmtbk-done-note { font-size: 14px; color: var(--bk-muted); margin: 0; }

.cmtbk-error {
  display: none; background: #fff4f4; border: 1px solid #e0b4b4; color: #93251f;
  border-radius: 8px; padding: 10px 13px; font-size: 13px; margin-bottom: 16px;
}
.cmtbk-error.is-show { display: block; }

/* ============ FOOTER (LatePoint: padding 10, top hairline) ============ */
.cmtbk-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border-top: 1px solid var(--bk-line); background: #fff;
}
.cmtbk-dots { display: flex; gap: 6px; }
.cmtbk-dot { width: 7px; height: 7px; border-radius: 50%; background: #d7dae6; transition: background 0.25s var(--bk-e), transform 0.25s var(--bk-e); }
.cmtbk-dot.active { background: var(--bk-accent); transform: scale(1.25); }
.cmtbk-dot.done { background: var(--bk-accent); opacity: 0.45; }

.cmtbk-w .cmtbk-btn {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  font-family: inherit; font-size: 14px; font-weight: 600; line-height: 1;
  padding: 11px 20px; border-radius: 8px; border: 1px solid transparent;
  transition: background 0.2s var(--bk-e), border-color 0.2s var(--bk-e), transform 0.16s var(--bk-e), opacity 0.2s var(--bk-e);
}
.cmtbk-w .cmtbk-btn-primary { background: var(--bk-accent); border-color: var(--bk-accent); color: #fff; }
@media (hover: hover) and (pointer: fine) {
  .cmtbk-w .cmtbk-btn-primary:hover:not(.disabled) { background: var(--bk-accent-d) !important; border-color: var(--bk-accent-d); color: #fff !important; }
}
.cmtbk-w .cmtbk-btn-white { background: #fff; border-color: var(--bk-line); color: var(--bk-text); }
@media (hover: hover) and (pointer: fine) {
  .cmtbk-w .cmtbk-btn-white:hover:not(.disabled) { border-color: var(--bk-accent); color: var(--bk-accent) !important; background: #fff !important; }
}
.cmtbk-w .cmtbk-btn:active:not(.disabled) { transform: scale(0.97); }
.cmtbk-w .cmtbk-btn.disabled { opacity: 0.4; cursor: default; pointer-events: none; }
.cmtbk-arr { font-size: 17px; line-height: 1; }

/* ============ SUMMARY PANEL ============ */
.cmtbk-summary-w {
  width: 236px; flex: 0 0 236px; background: var(--bk-panel);
  border-left: 1px solid var(--bk-line); padding: 24px 22px;
}
.cmtbk-summary-head { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.09em; color: var(--bk-muted); margin-bottom: 14px; }
.cmtbk-summary-empty { font-size: 13px; color: var(--bk-muted); margin: 0; }
.cmtbk-summary-row { padding: 10px 0; border-bottom: 1px solid var(--bk-line); }
.cmtbk-summary-row:last-child { border-bottom: 0; }
.cmtbk-summary-row .k { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--bk-muted); margin-bottom: 3px; }
.cmtbk-summary-row .v { display: block; font-size: 14px; font-weight: 600; color: var(--bk-head); }
.cmtbk-summary-total {
  display: flex; align-items: center; justify-content: space-between; margin-top: 14px;
  padding-top: 14px; border-top: 1px solid var(--bk-line); font-size: 13px; color: var(--bk-muted);
}
.cmtbk-total-val { font-size: 17px; font-weight: 700; color: var(--bk-accent); }

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  .cmtbk-form-element { flex-wrap: wrap; }
  .cmtbk-side-panel {
    width: 100%; flex: 0 0 100%; border-right: 0; border-bottom: 1px solid var(--bk-line);
    padding: 22px 22px 18px;
  }
  .cmtbk-progress { padding-bottom: 0; }
  .cmtbk-progress ul { display: flex; gap: 6px; }
  .cmtbk-progress li { flex: 1; padding: 0; text-align: center; }
  .cmtbk-progress li::before { position: static; margin: 0 auto 6px; display: block; }
  .cmtbk-progress li::after { left: 50%; right: -50%; top: 8px; bottom: auto; width: auto; height: 2px; }
  .cmtbk-progress .progress-item span { font-size: 11px; }
  .cmtbk-step-desc-w, .cmtbk-questions { display: none; }
  .cmtbk-form-w { flex: 1 1 100%; }
  .cmtbk-summary-w {
    width: 100%; flex: 0 0 100%; border-left: 0; border-top: 1px solid var(--bk-line); order: 3;
  }
}
@media (max-width: 640px) {
  .cmtbk-heading-w { padding: 15px 18px; min-height: 54px; }
  .cmtbk-heading-text { font-size: 17px; }
  .cmtbk-body { padding: 20px 18px; }
  .cmtbk-slots { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
  .cmtbk-item-desc { display: none; }
  .cmtbk-footer { padding: 10px 12px; }
  .cmtbk-w .cmtbk-btn { padding: 10px 15px; font-size: 13px; }
  .cmtbk-customRow { flex-direction: column; gap: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .cmtbk-step-content.active, .cmtbk-step-desc.active { animation: none; }
  .cmtbk-w .cmtbk-btn, .cmtbk-day, .cmtbk-slot, .cmtbk-item { transition: border-color 0.15s ease, background 0.15s ease; transform: none !important; }
}
