/* ============================================================
   Therapy Booking Plugin — Premium Frontend Styles v2
   ============================================================ */

:root {
  --tb-green:       #2d6a5f;
  --tb-green-dark:  #1f4d45;
  --tb-green-mid:   #3d8a7d;
  --tb-green-pale:  #e6f0ee;
  --tb-green-tint:  #f2f8f6;
  --tb-gold:        #b8956a;
  --tb-text:        #1a1a1a;
  --tb-muted:       #6b7280;
  --tb-light:       #9ca3af;
  --tb-border:      #e5e9e7;
  --tb-bg:          #f8f7f4;
  --tb-white:       #ffffff;
  --tb-shadow-xs:   0 1px 3px rgba(0,0,0,.06);
  --tb-shadow-sm:   0 2px 8px rgba(0,0,0,.08);
  --tb-shadow-md:   0 6px 24px rgba(0,0,0,.10);
  --tb-shadow-lg:   0 12px 48px rgba(0,0,0,.13);
  --tb-radius:      12px;
  --tb-radius-sm:   8px;
  --tb-radius-xs:   5px;
  --tb-serif:       Georgia, 'Times New Roman', serif;
  --tb-sans:        -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --tb-transition:  all .22s cubic-bezier(.4,0,.2,1);
}

/* ── Reset & Base ── */
#tb-booking-widget *,
#tb-booking-widget *::before,
#tb-booking-widget *::after { box-sizing: border-box; }

#tb-booking-widget {
  max-width: 900px;
  margin: 0 auto;
  font-family: var(--tb-serif);
  color: var(--tb-text);
  position: relative;
  padding-bottom: 8px;
}

/* ═══════════════════════════════════════════
   PROGRESS BAR — Top, clean horizontal steps
   ═══════════════════════════════════════════ */
.tb-progress {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  margin-bottom: 48px;
  padding: 0;
  gap: 0;
}

.tb-prog-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
  min-width: 80px;
}

.tb-prog-dot {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--tb-border);
  background: var(--tb-white);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--tb-transition);
  position: relative;
  z-index: 2;
}

.tb-prog-dot span {
  font-family: var(--tb-sans);
  font-size: 13px;
  font-weight: 700;
  color: var(--tb-light);
  transition: var(--tb-transition);
  line-height: 1;
}

.tb-prog-label {
  font-family: var(--tb-sans);
  font-size: 11px;
  font-weight: 500;
  color: var(--tb-light);
  text-transform: uppercase;
  letter-spacing: .08em;
  white-space: nowrap;
  transition: var(--tb-transition);
  text-align: center;
}

/* Active step */
.tb-prog-step.active .tb-prog-dot {
  background: var(--tb-green);
  border-color: var(--tb-green);
  box-shadow: 0 0 0 5px var(--tb-green-pale);
}
.tb-prog-step.active .tb-prog-dot span { color: #fff; }
.tb-prog-step.active .tb-prog-label {
  color: var(--tb-green);
  font-weight: 700;
}

/* Done step */
.tb-prog-step.done .tb-prog-dot {
  background: var(--tb-green);
  border-color: var(--tb-green);
}
.tb-prog-step.done .tb-prog-dot span { color: #fff; }
.tb-prog-step.done .tb-prog-label { color: var(--tb-green-mid); }

/* Connector line between dots */
.tb-prog-line {
  flex: 1;
  height: 2px;
  background: var(--tb-border);
  margin-top: 19px; /* vertically center with dot */
  min-width: 32px;
  max-width: 80px;
  transition: background .4s;
}
.tb-prog-line.done { background: var(--tb-green); }

/* Hide payment step until needed */
.tb-prog-step-pay,
.tb-prog-line-pay { display: none; }
.tb-has-payment .tb-prog-step-pay { display: flex; }
.tb-has-payment .tb-prog-line-pay { display: block; }

/* ═══════════════════════════════
   STEP WRAPPER
   ═══════════════════════════════ */
.tb-step {
  animation: tbFadeUp .3s cubic-bezier(.4,0,.2,1) both;
}
.tb-hidden { display: none !important; }

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

/* ── Step Heading ── */
.tb-step-heading {
  text-align: center;
  margin-bottom: 36px;
}
.tb-step-heading h3 {
  font-size: 26px;
  color: var(--tb-green-dark);
  margin: 0 0 8px;
  font-weight: normal;
  letter-spacing: -.01em;
}
.tb-step-heading p {
  font-family: var(--tb-sans);
  font-size: 14px;
  color: var(--tb-muted);
  margin: 0;
}

/* ═══════════════════════════════════════
   SERVICE CARDS — 4 across, airy & clean
   ═══════════════════════════════════════ */
.tb-service-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 36px;
}
@media (max-width: 800px) { .tb-service-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 480px) { .tb-service-grid { grid-template-columns: 1fr; } }

.tb-card {
  cursor: pointer;
  position: relative;
  display: block;
}
.tb-card input[type="radio"] { display: none; }

/* Popular badge */
.tb-card-popular-badge {
  display: none;
  position: absolute;
  top: 0; left: 50%;
  transform: translate(-50%, -50%);
  background: var(--tb-gold);
  color: #fff;
  font-family: var(--tb-sans);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .12em;
  padding: 4px 12px;
  border-radius: 20px;
  white-space: nowrap;
  z-index: 3;
  text-transform: uppercase;
}
.tb-card-popular .tb-card-popular-badge { display: block; }

.tb-card-body {
  border: 1.5px solid var(--tb-border);
  border-radius: var(--tb-radius);
  padding: 24px 20px 20px;
  background: var(--tb-white);
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: var(--tb-transition);
  position: relative;
  overflow: hidden;
}

/* Subtle top accent line */
.tb-card-body::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--tb-border);
  transition: var(--tb-transition);
}

.tb-card:hover .tb-card-body {
  border-color: var(--tb-green-mid);
  box-shadow: var(--tb-shadow-md);
  transform: translateY(-3px);
}
.tb-card:hover .tb-card-body::before {
  background: var(--tb-green-mid);
}

/* Selected state */
.tb-card input:checked ~ .tb-card-body,
.tb-card input:checked + .tb-card-body {
  border-color: var(--tb-green);
  background: var(--tb-green-tint);
  box-shadow: 0 0 0 3px rgba(45,106,95,.15), var(--tb-shadow-md);
  transform: translateY(-3px);
}
.tb-card input:checked ~ .tb-card-body::before,
.tb-card input:checked + .tb-card-body::before {
  background: var(--tb-green);
}

/* Free tag */
.tb-card-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--tb-green-pale);
  color: var(--tb-green);
  font-family: var(--tb-sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 14px;
  width: fit-content;
}

/* Price */
.tb-card-price {
  display: flex;
  align-items: baseline;
  gap: 2px;
  margin-bottom: 10px;
  line-height: 1;
}
.tb-card-currency {
  font-family: var(--tb-sans);
  font-size: 16px;
  font-weight: 600;
  color: var(--tb-green);
  align-self: flex-start;
  margin-top: 5px;
}
.tb-card-amount {
  font-family: var(--tb-sans);
  font-size: 40px;
  font-weight: 700;
  color: var(--tb-green-dark);
  letter-spacing: -.02em;
  line-height: 1;
}
.tb-card-amount-free {
  font-family: var(--tb-sans);
  font-size: 32px;
  font-weight: 700;
  color: var(--tb-green-dark);
}
.tb-card-per {
  font-family: var(--tb-sans);
  font-size: 12px;
  color: var(--tb-muted);
  margin-left: 3px;
  line-height: 1.3;
}

.tb-card-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--tb-text);
  margin: 0 0 6px;
  font-family: var(--tb-sans);
}
.tb-card-desc {
  font-size: 12px;
  color: var(--tb-muted);
  font-family: var(--tb-sans);
  line-height: 1.55;
  margin: 0 0 16px;
  flex: 1;
}

.tb-card-divider {
  height: 1px;
  background: var(--tb-border);
  margin: 0 0 14px;
}

.tb-card-features {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
}
.tb-card-features li {
  font-family: var(--tb-sans);
  font-size: 12px;
  color: var(--tb-text);
  padding: 3px 0;
  display: flex;
  align-items: center;
  gap: 7px;
  line-height: 1.4;
}
.tb-feat-check {
  width: 16px; height: 16px;
  background: var(--tb-green-pale);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 9px;
  color: var(--tb-green);
  font-weight: 800;
}

.tb-card-select {
  font-family: var(--tb-sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--tb-green);
  letter-spacing: .04em;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: gap .2s;
}
.tb-card:hover .tb-card-select,
.tb-card input:checked ~ .tb-card-body .tb-card-select {
  gap: 8px;
}

/* ═══════════════════════════════════
   DATE & TIME STEP
   ═══════════════════════════════════ */
.tb-datetime-wrap {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 20px;
  margin-bottom: 32px;
}
@media (max-width: 620px) { .tb-datetime-wrap { grid-template-columns: 1fr; } }

.tb-panel {
  background: var(--tb-white);
  border: 1.5px solid var(--tb-border);
  border-radius: var(--tb-radius);
  padding: 24px;
}
.tb-panel-title {
  font-family: var(--tb-sans);
  font-size: 11px;
  font-weight: 700;
  color: var(--tb-muted);
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tb-panel-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--tb-border);
}

/* Calendar */
.tb-cal-nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.tb-cal-month {
  font-family: var(--tb-sans);
  font-size: 15px;
  font-weight: 700;
  color: var(--tb-green-dark);
}
.tb-cal-btn {
  width: 32px; height: 32px;
  border: 1.5px solid var(--tb-border);
  border-radius: var(--tb-radius-xs);
  background: var(--tb-white);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--tb-green);
  font-size: 14px;
  transition: var(--tb-transition);
  padding: 0;
}
.tb-cal-btn:hover { background: var(--tb-green-pale); border-color: var(--tb-green); }

.tb-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.tb-cal-day-hdr {
  text-align: center;
  font-family: var(--tb-sans);
  font-size: 10px;
  font-weight: 700;
  color: var(--tb-light);
  padding: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.tb-cal-day {
  text-align: center;
  padding: 8px 2px;
  border-radius: var(--tb-radius-xs);
  font-family: var(--tb-sans);
  font-size: 13px;
  cursor: pointer;
  transition: var(--tb-transition);
  border: 1.5px solid transparent;
  color: var(--tb-text);
  font-weight: 500;
}
.tb-cal-day:hover:not(.tb-cal-off):not(.tb-cal-empty) {
  background: var(--tb-green-pale);
  border-color: var(--tb-green-mid);
  color: var(--tb-green-dark);
}
.tb-cal-day.tb-cal-today {
  font-weight: 800;
  color: var(--tb-green);
}
.tb-cal-day.tb-cal-picked {
  background: var(--tb-green) !important;
  color: #fff !important;
  border-color: var(--tb-green);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(45,106,95,.3);
}
.tb-cal-day.tb-cal-off,
.tb-cal-day.tb-cal-empty {
  color: #d1d5db;
  cursor: default;
  font-weight: 400;
}

/* Slots */
.tb-slots-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  color: var(--tb-light);
  font-family: var(--tb-sans);
  font-size: 13px;
  text-align: center;
  gap: 10px;
}
.tb-slots-empty-icon { font-size: 36px; opacity: .35; }

.tb-slots-date {
  font-family: var(--tb-sans);
  font-size: 12px;
  font-weight: 700;
  color: var(--tb-green-dark);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 14px;
}

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

.tb-slot {
  border: 1.5px solid var(--tb-border);
  border-radius: var(--tb-radius-sm);
  padding: 11px 8px;
  text-align: center;
  cursor: pointer;
  font-family: var(--tb-sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--tb-text);
  background: var(--tb-white);
  transition: var(--tb-transition);
}
.tb-slot:hover:not(.tb-slot-taken) {
  border-color: var(--tb-green);
  background: var(--tb-green-pale);
  color: var(--tb-green-dark);
  transform: translateY(-1px);
  box-shadow: var(--tb-shadow-xs);
}
.tb-slot.tb-slot-on {
  background: var(--tb-green);
  border-color: var(--tb-green);
  color: #fff;
  box-shadow: 0 3px 10px rgba(45,106,95,.3);
  transform: translateY(-1px);
}
.tb-slot.tb-slot-taken {
  color: #d1d5db;
  cursor: not-allowed;
  text-decoration: line-through;
  font-weight: 400;
  background: var(--tb-bg);
}

/* ═══════════════════════════
   DETAILS STEP
   ═══════════════════════════ */
.tb-summary-strip {
  background: var(--tb-green-tint);
  border: 1.5px solid var(--tb-green-pale);
  border-left: 4px solid var(--tb-green);
  border-radius: var(--tb-radius-sm);
  padding: 14px 20px;
  margin-bottom: 28px;
  font-family: var(--tb-sans);
  font-size: 13px;
  color: var(--tb-green-dark);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 24px;
  line-height: 1.6;
}
.tb-summary-strip strong { font-weight: 700; }

.tb-fields { display: grid; gap: 20px; margin-bottom: 32px; }

.tb-field label {
  display: block;
  font-family: var(--tb-sans);
  font-size: 11px;
  font-weight: 700;
  color: var(--tb-muted);
  letter-spacing: .09em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.tb-req { color: var(--tb-green); margin-left: 2px; }
.tb-opt { font-weight: 400; text-transform: none; letter-spacing: 0; color: #c4c9cf; font-size: 11px; }

.tb-field input {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid var(--tb-border);
  border-radius: var(--tb-radius-sm);
  font-family: var(--tb-serif);
  font-size: 15px;
  color: var(--tb-text);
  background: var(--tb-white);
  transition: var(--tb-transition);
  -webkit-appearance: none;
  appearance: none;
}
.tb-field input:focus {
  outline: none;
  border-color: var(--tb-green);
  box-shadow: 0 0 0 3px rgba(45,106,95,.12);
}
.tb-field input::placeholder { color: #c4c9cf; }

/* ═══════════════════════════
   PAYMENT STEP
   ═══════════════════════════ */
.tb-pay-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 20px;
  margin-bottom: 28px;
}
@media (max-width: 580px) { .tb-pay-layout { grid-template-columns: 1fr; } }

.tb-order-card {
  background: var(--tb-bg);
  border: 1.5px solid var(--tb-border);
  border-radius: var(--tb-radius);
  padding: 22px;
  align-self: start;
}
.tb-order-card-title {
  font-family: var(--tb-sans);
  font-size: 11px;
  font-weight: 700;
  color: var(--tb-muted);
  letter-spacing: .09em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.tb-order-line {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--tb-border);
  font-family: var(--tb-sans);
  font-size: 13px;
  color: var(--tb-text);
  gap: 8px;
}
.tb-order-line:last-child { border-bottom: none; }
.tb-order-line.tb-total {
  font-weight: 700;
  font-size: 16px;
  color: var(--tb-green-dark);
  padding-top: 14px;
}
.tb-order-line span:last-child { text-align: right; font-weight: 600; }

.tb-stripe-card {
  background: var(--tb-white);
  border: 1.5px solid var(--tb-border);
  border-radius: var(--tb-radius);
  padding: 22px;
}
.tb-stripe-field-label {
  font-family: var(--tb-sans);
  font-size: 11px;
  font-weight: 700;
  color: var(--tb-muted);
  letter-spacing: .09em;
  text-transform: uppercase;
  margin-bottom: 10px;
  display: block;
}
#tb-stripe-element {
  border: 1.5px solid var(--tb-border);
  border-radius: var(--tb-radius-sm);
  padding: 14px;
  background: var(--tb-bg);
  transition: border-color .2s, box-shadow .2s;
}
#tb-stripe-element.StripeElement--focus {
  border-color: var(--tb-green);
  box-shadow: 0 0 0 3px rgba(45,106,95,.12);
}
#tb-card-errors {
  color: #dc2626;
  font-family: var(--tb-sans);
  font-size: 13px;
  margin-top: 10px;
  min-height: 18px;
  line-height: 1.4;
}
.tb-security-note {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--tb-sans);
  font-size: 12px;
  color: var(--tb-muted);
  margin-top: 14px;
}
.tb-security-note svg { flex-shrink: 0; opacity: .5; }

/* ═══════════════════════════
   STEP FOOTER — Nav buttons
   ═══════════════════════════ */
.tb-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  gap: 12px;
}

.tb-btn-next,
.tb-btn-pay {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--tb-green);
  color: #fff;
  border: none;
  padding: 14px 28px;
  border-radius: var(--tb-radius-sm);
  font-family: var(--tb-serif);
  font-size: 15px;
  cursor: pointer;
  transition: var(--tb-transition);
  box-shadow: 0 2px 10px rgba(45,106,95,.25);
  white-space: nowrap;
}
.tb-btn-next:hover:not(:disabled),
.tb-btn-pay:hover:not(:disabled) {
  background: var(--tb-green-dark);
  box-shadow: 0 4px 18px rgba(45,106,95,.35);
  transform: translateY(-1px);
}
.tb-btn-next:disabled {
  background: #e5e7eb;
  color: var(--tb-light);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}
.tb-btn-arrow { font-size: 16px; transition: transform .2s; }
.tb-btn-next:hover:not(:disabled) .tb-btn-arrow,
.tb-btn-pay:hover:not(:disabled) .tb-btn-arrow { transform: translateX(3px); }

.tb-btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1.5px solid var(--tb-border);
  color: var(--tb-muted);
  padding: 13px 20px;
  border-radius: var(--tb-radius-sm);
  font-family: var(--tb-sans);
  font-size: 14px;
  cursor: pointer;
  transition: var(--tb-transition);
}
.tb-btn-back:hover { background: var(--tb-bg); border-color: var(--tb-muted); color: var(--tb-text); }

/* ═══════════════════════════
   CONFIRMATION
   ═══════════════════════════ */
#tb-step-confirm { padding: 20px 0 40px; }

.tb-confirm-center { text-align: center; }

.tb-confirm-tick {
  width: 72px; height: 72px;
  background: var(--tb-green);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  margin: 0 auto 24px;
  box-shadow: 0 6px 24px rgba(45,106,95,.3);
  animation: tbPop .45s cubic-bezier(.175,.885,.32,1.275) both;
}
@keyframes tbPop {
  from { transform: scale(.4); opacity: 0; }
  to   { transform: scale(1);  opacity: 1; }
}

#tb-step-confirm h3 {
  font-size: 28px;
  color: var(--tb-green-dark);
  margin: 0 0 8px;
  font-weight: normal;
}
.tb-confirm-sub {
  font-family: var(--tb-sans);
  font-size: 15px;
  color: var(--tb-muted);
  margin: 0 0 28px;
}

.tb-confirm-details {
  background: var(--tb-green-tint);
  border: 1.5px solid var(--tb-green-pale);
  border-radius: var(--tb-radius);
  padding: 24px 32px;
  display: inline-block;
  text-align: left;
  font-family: var(--tb-sans);
  font-size: 14px;
  line-height: 2;
  color: var(--tb-green-dark);
  min-width: 300px;
  margin-bottom: 20px;
}
.tb-confirm-details strong { font-weight: 700; }

.tb-confirm-note {
  font-family: var(--tb-sans);
  font-size: 13px;
  color: var(--tb-light);
  max-width: 420px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ═══════════════════════════
   LOADING OVERLAY
   ═══════════════════════════ */
#tb-loading {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--tb-radius);
  z-index: 100;
}
.tb-spinner-wrap { text-align: center; }
.tb-spinner {
  width: 42px; height: 42px;
  border: 3px solid var(--tb-green-pale);
  border-top-color: var(--tb-green);
  border-radius: 50%;
  animation: tbSpin .7s linear infinite;
  margin: 0 auto 14px;
}
.tb-spinner-label {
  font-family: var(--tb-sans);
  font-size: 13px;
  color: var(--tb-muted);
}
@keyframes tbSpin { to { transform: rotate(360deg); } }
