/* ============================================================
   TrueBalance booking modal
   Engraved-silver booking scheduler.
   ============================================================ */

/* display:flex beats [hidden]'s display:none — without this the
   overlay is permanently on screen over every page. */
.tb-book-overlay[hidden] { display: none; }

/* Same story for the steps bar: offer mode hides it, and its display:flex
   would otherwise shine straight through the attribute. */
.tb-book-steps[hidden] { display: none; }

.tb-book-overlay {
  --tb-err: #A6413A;

  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: color-mix(in srgb, var(--ink) 52%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-5);
}

body.tb-book-open { overflow: hidden; }

.tb-book-modal {
  position: relative;
  width: min(560px, 100%);
  max-height: calc(100dvh - var(--sp-8));
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--lift-3);
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
}

.tb-book-close {
  position: absolute;
  top: var(--sp-3);
  right: var(--sp-3);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: transparent;
  color: var(--tx-lo);
  font-size: 1.25rem;
  line-height: 1;
  transition: color var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease);
}

.tb-book-close:hover { color: var(--tx-hi); border-color: var(--line-bright); }

.tb-book-head { padding: var(--sp-6) var(--sp-6) var(--sp-4); }
.tb-book-head h2 { margin: 0; }
.tb-book-sub {
  margin: var(--sp-2) 0 0;
  color: var(--tx-lo);
  font-family: var(--font-ui);
  font-size: var(--fs-sm);
}

/* Same sentence as the announcement bar, repeated where the date is actually
   chosen. Someone who opened the modal from a deep link never saw the bar,
   and the strip of dates does not explain why it starts when it does. */
.tb-book-notice {
  margin: var(--sp-3) 0 0;
  padding: .55rem .75rem;
  background: var(--paper-warm);
  border: 1px solid var(--line);
  border-left: 2px solid var(--ag-600);
  border-radius: var(--r);
  color: var(--tx);
  font-family: var(--font-ui);
  font-size: var(--fs-sm);
  line-height: 1.35;
}

.tb-book-steps {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0 var(--sp-6) var(--sp-4);
  font-family: var(--font-ui);
  font-size: var(--fs-xs);
  color: var(--tx-faint);
}

.tb-book-step {
  position: relative;
  padding-bottom: var(--sp-2);
}

.tb-book-step::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--line);
}

.tb-book-step.is-active { color: var(--tx-hi); }
.tb-book-step.is-active::after { background: var(--ink); }

.tb-book-body { padding: 0 var(--sp-6) var(--sp-6); }

.tb-book-loading {
  text-align: center;
  padding: var(--sp-8) 0;
  color: var(--tx-lo);
  font-family: var(--font-ui);
}

.tb-book-msg {
  text-align: center;
  padding: var(--sp-8) var(--sp-4);
  color: var(--tx-lo);
  font-family: var(--font-ui);
  font-size: var(--fs-sm);
  line-height: 1.7;
}

.tb-book-msg a {
  color: var(--tx-hi);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.tb-book-group + .tb-book-group { margin-top: var(--sp-6); }

.tb-book-group__title {
  font-family: var(--font-ui);
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--tx-lo);
  margin: 0 0 var(--sp-3);
  letter-spacing: 0.01em;
}

.tb-book-stack { display: flex; flex-direction: column; gap: var(--sp-2); }

.tb-book-opt {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: transparent;
  padding: var(--sp-4);
  transition: border-color var(--t-fast) var(--ease),
              background var(--t-fast) var(--ease),
              box-shadow var(--t-fast) var(--ease);
}

.tb-book-opt:hover {
  border-color: var(--line-bright);
  background: var(--paper-warm);
}

.tb-book-opt.is-active {
  border-color: var(--ink);
  background: var(--paper-warm);
  box-shadow: var(--deboss-soft);
}

.tb-book-opt__name {
  display: block;
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  color: var(--tx-hi);
  line-height: 1.25;
}

.tb-book-opt__meta {
  display: block;
  margin-top: var(--sp-1);
  font-family: var(--font-ui);
  font-size: var(--fs-xs);
  color: var(--tx-lo);
  line-height: 1.5;
}

.tb-book-step-h {
  font-family: var(--font-ui);
  font-size: var(--fs-sm);
  color: var(--tx-lo);
  margin-bottom: var(--sp-4);
}

.tb-book-step-h em {
  color: var(--tx-hi);
  font-style: normal;
  font-weight: 600;
}

.tb-book-mods {
  display: grid;
  gap: var(--sp-3);
  grid-template-columns: repeat(2, 1fr);
}

.tb-book-dates-wrap {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
}

.tb-book-arr {
  flex: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  background: var(--paper);
  color: var(--tx);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  transition: border-color var(--t-fast) var(--ease),
              color var(--t-fast) var(--ease);
}

.tb-book-arr:hover { border-color: var(--line-bright); color: var(--tx-hi); }

.tb-book-dates {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: var(--sp-2);
  overflow-x: auto;
  padding-bottom: var(--sp-1);
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}

.tb-book-date {
  flex: none;
  scroll-snap-align: start;
  min-width: 68px;
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--paper);
  text-align: center;
  font-family: var(--font-ui);
  font-size: var(--fs-xs);
  color: var(--tx-lo);
  line-height: 1.3;
  transition: border-color var(--t-fast) var(--ease),
              background var(--t-fast) var(--ease);
}

.tb-book-date span { display: block; }
.tb-book-date span:first-child {
  font-size: var(--fs-sm);
  color: var(--tx-hi);
  font-weight: 600;
  margin-bottom: 2px;
}

.tb-book-date.is-active {
  border-color: var(--ink);
  background: var(--paper-warm);
  color: var(--tx-hi);
}

.tb-book-times {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-2);
  max-height: 240px;
  overflow-y: auto;
  padding-right: var(--sp-1);
}

.tb-book-time {
  min-height: 44px;
  padding: var(--sp-2) var(--sp-1);
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--paper);
  font-family: var(--font-ui);
  font-size: var(--fs-xs);
  color: var(--tx);
  transition: border-color var(--t-fast) var(--ease),
              background var(--t-fast) var(--ease);
}

.tb-book-time:hover {
  border-color: var(--line-bright);
  background: var(--paper-warm);
}

.tb-book-summary {
  background: var(--paper-warm);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--sp-4);
  margin-bottom: var(--sp-5);
}

.tb-book-summary__row {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-4);
  font-family: var(--font-ui);
  font-size: var(--fs-sm);
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--line);
}

.tb-book-summary__row:last-child { border-bottom: none; }
.tb-book-summary__row span { color: var(--tx-lo); }
.tb-book-summary__row strong { color: var(--tx-hi); font-weight: 600; }

.tb-book-form { display: flex; flex-direction: column; gap: var(--sp-3); }
.tb-book-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
}

.tb-book-form input {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  padding: var(--sp-3) var(--sp-4);
  background: var(--paper);
  font-family: var(--font-ui);
  font-size: var(--fs-body);
  color: var(--tx-hi);
}

.tb-book-form input::placeholder { color: var(--tx-faint); }
.tb-book-form input:focus { outline: none; border-color: var(--ink); }
.tb-book-form input:invalid:not(:placeholder-shown) { border-color: var(--tb-err); }

.tb-book-actions {
  display: flex;
  gap: var(--sp-3);
  margin-top: var(--sp-5);
}

.tb-book-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--r);
  font-family: var(--font-ui);
  font-size: var(--fs-sm);
  font-weight: 600;
  border: 1px solid transparent;
  min-height: 48px;
  transition: background var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease),
              transform var(--t-fast) var(--ease);
}

.tb-book-btn--primary { background: var(--ink); color: var(--paper); }
.tb-book-btn--primary:hover:not(:disabled) { background: var(--ink-warm); }
.tb-book-btn--primary:disabled { opacity: 0.6; cursor: not-allowed; }

.tb-book-btn--ghost {
  color: var(--tx-hi);
  border-color: var(--line-strong);
  background: var(--paper);
  box-shadow: var(--edge-light);
}

.tb-book-btn--ghost:hover {
  border-color: var(--line-bright);
  background: var(--paper-warm);
}

.tb-book-err {
  color: var(--tb-err);
  font-family: var(--font-ui);
  font-size: var(--fs-xs);
  margin-top: var(--sp-2);
}

.tb-book-success {
  text-align: center;
  padding: var(--sp-6) 0;
}

.tb-book-success__mark {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--sp-4);
  border: 1px solid var(--line);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  color: var(--tx-hi);
  background: var(--paper-warm);
}

.tb-book-success h3 { margin-bottom: var(--sp-3); }
.tb-book-success p {
  color: var(--tx-lo);
  margin: 0 auto var(--sp-3);
  max-width: 40ch;
}

.tb-book-success__note { font-size: var(--fs-sm); }

/* Note under the time slots — who the visit is with and how long it runs. */
.tb-book-note {
  margin: var(--sp-3) 0 0;
  color: var(--tx-lo);
  font-family: var(--font-ui);
  font-size: var(--fs-xs);
  line-height: 1.5;
}

/* Step 3, the video-branch path screen */
.tb-book-path {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.tb-book-path__lead {
  display: block;
  font-family: var(--font-ui);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--tx-hi);
  line-height: 1.4;
}

.tb-book-path__meta {
  display: block;
  margin-top: var(--sp-1);
  font-family: var(--font-ui);
  font-size: var(--fs-xs);
  color: var(--tx-lo);
  line-height: 1.5;
}

/* Small inline text actions: the switch-to-video link at the foot of the
   clinic list, and the path screen's back link. */
.tb-book-switch {
  margin: var(--sp-4) 0 0;
  font-family: var(--font-ui);
  font-size: var(--fs-xs);
  color: var(--tx-lo);
  line-height: 1.6;
}

.tb-book-textlink {
  border: none;
  background: none;
  padding: 0;
  color: var(--tx-hi);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.tb-book-textlink:hover { color: var(--tx); }

/* Consent checkboxes on the details step. The specificity beats
   .tb-book-form input, which would otherwise stretch the box to 100%. */
.tb-book-check {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  font-family: var(--font-ui);
  font-size: var(--fs-xs);
  color: var(--tx);
  line-height: 1.5;
}

.tb-book-form .tb-book-check input {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  padding: 0;
  border: none;
  accent-color: var(--ink);
}

.tb-book-check__meta {
  display: block;
  margin-top: 2px;
  color: var(--tx-lo);
}

/* Full-width ghost phone link under the submit button */
.tb-book-call { width: 100%; margin-top: var(--sp-1); }

@media (max-width: 640px) {
  .tb-book-overlay {
    padding: 0;
    align-items: flex-end;
  }
  .tb-book-modal {
    width: 100%;
    max-height: calc(100dvh - var(--sp-5));
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
}

@media (max-width: 480px) {
  .tb-book-mods { grid-template-columns: 1fr; }
  .tb-book-times { grid-template-columns: repeat(2, 1fr); }
  .tb-book-row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .tb-book-overlay,
  .tb-book-close,
  .tb-book-opt,
  .tb-book-date,
  .tb-book-time,
  .tb-book-btn {
    transition: none;
  }
}
.tb-book-ts{margin:var(--sp-3) 0;min-height:0}
.tb-book-ts:empty{display:none}
