/* =============================================================
   Digital Hive - custom demo booker on /Demo
   Loaded after demo.css; the scheduler column of the hero
   ============================================================= */

/* Wider booker column than /Demo's Calendly iframe so the calendar and
   times sit side by side on desktop */
@media (min-width: 900px) {
  .demo-hero .pr-hero__grid { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); align-items: center; gap: 56px; }
}
/* On phones the booker is the job; skip the decorative laptop above it */
@media (max-width: 899px) {
  .demo-hero .demo-hero__laptop { display: none; }
}

.booker {
  --bk-pad: var(--space-5);
  position: relative;
  background: var(--dh-white);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 48px -20px rgba(25, 51, 89, 0.28), 0 2px 6px rgba(25, 51, 89, 0.06);
  overflow: hidden;
  container-type: inline-size;
  scroll-margin-top: 96px;
}
@media (min-width: 600px) { .booker { --bk-pad: var(--space-6); } }

/* JS toggles [hidden]; class display rules below would otherwise win */
.booker [hidden] { display: none !important; }

/* ── Header ─────────────────────────────────────────────────── */
.booker__head {
  padding: var(--bk-pad) var(--bk-pad) var(--space-4);
  border-bottom: 1px solid var(--border-2);
}
.booker__meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-12);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--fg-accent-label);
}
.booker__title {
  margin: 6px 0 0;
  font-size: var(--fs-20);
  line-height: var(--lh-snug);
  color: var(--dh-navy);
}

/* ── Step indicator ─────────────────────────────────────────── */
.booker__steps {
  display: flex;
  gap: var(--space-2);
  margin: var(--space-4) 0 0;
  padding: 0;
  list-style: none;
  counter-reset: bk;
}
.booker__steps li {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-12);
  font-weight: var(--fw-semibold);
  color: var(--fg-3);
  counter-increment: bk;
}
.booker__steps li::before {
  content: counter(bk);
  display: grid;
  place-items: center;
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--border-1);
  font-size: 11px;
  transition: background var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out);
}
.booker__steps li.is-current { color: var(--dh-navy); }
.booker__steps li.is-current::before { background: var(--dh-navy); border-color: var(--dh-navy); color: var(--dh-white); }
.booker__steps li.is-done { color: var(--fg-2); }
.booker__steps li.is-done::before {
  content: '';
  background: var(--dh-orange) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23193359' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='5 12.5 10 17 19 7'/%3E%3C/svg%3E") center / 12px no-repeat;
  border-color: var(--dh-orange);
}

/* ── Panels ─────────────────────────────────────────────────── */
.booker__panel {
  padding: var(--space-5) var(--bk-pad) var(--bk-pad);
  animation: bk-in var(--dur-slow) var(--ease-out);
}
@keyframes bk-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .booker__panel { animation: none; }
}

/* Step 1: calendar beside times when the card is wide, stacked otherwise */
.booker__time {
  display: grid;
  gap: var(--space-5);
}
@container (min-width: 560px) {
  .booker__time { grid-template-columns: 1fr 168px; }
  .booker__slots { border-left: 1px solid var(--border-2); padding-left: var(--space-5); }
}

/* ── Calendar ───────────────────────────────────────────────── */
.cal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}
.cal__month {
  font-weight: var(--fw-bold);
  font-size: var(--fs-16);
  color: var(--dh-navy);
}
.cal__nav { display: flex; gap: 4px; }
.cal__nav button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-1);
  border-radius: 50%;
  background: var(--dh-white);
  color: var(--dh-navy);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.cal__nav button:hover:not(:disabled) { border-color: var(--dh-navy); }
.cal__nav button:disabled { opacity: 0.35; cursor: default; }

.cal__dow,
.cal__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
/* Always six week rows tall, so a five-row month and a six-row month (or the
   auto-advance to next month once times load) occupy the same height */
.cal__grid {
  grid-template-rows: repeat(6, 42px);
  align-content: start;
}
.cal__dow {
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--fg-3);
  text-align: center;
}
.cal__day {
  position: relative;
  height: 42px;
  width: 100%;
  max-width: 42px;
  justify-self: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  font: inherit;
  font-size: var(--fs-14);
  font-variant-numeric: tabular-nums;
  color: var(--fg-3);
  cursor: default;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.cal__day.is-open {
  background: rgba(25, 51, 89, 0.06);
  color: var(--dh-navy);
  font-weight: var(--fw-bold);
  cursor: pointer;
}
.cal__day.is-open:hover { background: rgba(25, 51, 89, 0.12); }
.cal__day.is-open:active { transform: scale(0.94); }
.cal__day.is-selected,
.cal__day.is-selected:hover { background: var(--dh-navy); color: var(--dh-white); }
.cal__day.is-today::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 5px;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--dh-orange);
}
.cal__day:focus-visible { outline: 2px solid var(--dh-orange); outline-offset: 2px; }

/* Loading shimmer on the grid while a month is fetched */
.booker.is-loading .cal__grid { position: relative; }
.booker.is-loading .cal__grid::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.8) 50%, transparent 70%);
  background-size: 200% 100%;
  animation: bk-shimmer 1.1s linear infinite;
}
@keyframes bk-shimmer { from { background-position: 150% 0; } to { background-position: -50% 0; } }

/* ── Time slots ─────────────────────────────────────────────── */
.slots__day {
  margin: 0 0 var(--space-3);
  min-height: 36px;
  display: flex;
  align-items: center;
  font-weight: var(--fw-bold);
  font-size: var(--fs-14);
  color: var(--dh-navy);
}
/* The list is sized for its loaded state from the first paint, so the times
   arriving never move the card or the page below it. Stacked: a fixed column
   count with room reserved for 12 slots (a day currently offers 10). Side by
   side: a fixed-height scrolling column. */
.slots__list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: min-content;
  align-content: start;
  gap: var(--space-2);
  min-height: calc(4 * 44px + 3 * var(--space-2));
}
@container (min-width: 420px) {
  .slots__list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    min-height: calc(3 * 44px + 2 * var(--space-2));
  }
}
@container (min-width: 560px) {
  /* In the 168px column a full date ("Wednesday, September 30") wraps to two
     lines, so reserve them before "Loading times…" is replaced */
  .slots__day { min-height: 44px; }
  .slots__list {
    grid-template-columns: 1fr;
    min-height: 0;
    height: 316px;
    overflow-y: auto;
    padding: 2px 6px 2px 2px;
    margin: -2px -6px -2px -2px;
    overscroll-behavior: contain;
  }
}
.slot {
  min-height: 44px;
  padding: 0 var(--space-2);
  white-space: nowrap;
  border: 1.5px solid var(--border-1);
  border-radius: var(--radius-md);
  background: var(--dh-white);
  font: inherit;
  font-size: var(--fs-14);
  font-weight: var(--fw-semibold);
  font-variant-numeric: tabular-nums;
  color: var(--dh-navy);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
/* Three columns on the narrowest phones leave ~88px a slot; "10:30 am" fits
   on one line only with slimmer side padding */
@container (max-width: 379px) {
  .slot { padding: 0 4px; }
}
.slot:hover { border-color: var(--dh-navy); background: rgba(25, 51, 89, 0.03); }
.slot:active { transform: scale(0.97); }
.slot:focus-visible { outline: 2px solid var(--dh-orange); outline-offset: 2px; }

.bk-empty { margin: 0; color: var(--fg-3); font-size: var(--fs-14); }

.bk-fallback {
  grid-column: 1 / -1;
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--bg-2);
  font-size: var(--fs-14);
  color: var(--fg-2);
}
.bk-fallback p { margin: 0; }
.bk-fallback p + p { margin-top: 4px; }

/* ── Time zone + status ─────────────────────────────────────── */
.booker__tz {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-2);
  font-size: var(--fs-12);
  color: var(--fg-2);
}
.booker__tz svg { flex: none; color: var(--fg-3); }
.booker__tz label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.booker__tz select {
  flex: 1;
  min-width: 0;
  min-height: 36px;
  padding: 0 28px 0 var(--space-2);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23193359' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") right 8px center / 12px no-repeat;
  font: inherit;
  font-weight: var(--fw-semibold);
  color: var(--dh-navy);
  appearance: none;
  cursor: pointer;
  text-overflow: ellipsis;
}
.booker__tz select:hover { border-color: var(--border-1); }
.booker__tz select:focus-visible { outline: 2px solid var(--dh-orange); outline-offset: 1px; }

.bk-status {
  margin: var(--space-3) 0 0;
  padding: 10px var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--fs-14);
  background: var(--bg-2);
  color: var(--fg-2);
}
.bk-status--warn { background: #fff4e5; color: #7a4a00; }

/* ── Step 2: details ────────────────────────────────────────── */
.bk-summary {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--bg-2);
}
.bk-summary svg { flex: none; margin-top: 2px; color: var(--dh-navy); }
.bk-summary__text { flex: 1; font-size: var(--fs-14); font-weight: var(--fw-semibold); color: var(--dh-navy); line-height: 1.4; }
.bk-summary button {
  flex: none;
  border: 0;
  padding: 0;
  background: none;
  font: inherit;
  font-size: var(--fs-14);
  font-weight: var(--fw-bold);
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.bk-form { display: grid; gap: var(--space-4); }
.bk-row { display: grid; gap: var(--space-4); }
@container (min-width: 420px) { .bk-row { grid-template-columns: 1fr 1fr; } }
.bk-questions,
.bk-location { display: grid; gap: var(--space-4); }
.bk-questions:empty,
.bk-location:empty { display: none; }

.bk-field label {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  margin-bottom: 6px;
  font-size: var(--fs-14);
  font-weight: var(--fw-semibold);
  color: var(--dh-navy);
}
.bk-field__opt { font-size: var(--fs-12); font-weight: var(--fw-regular); color: var(--fg-3); }
.bk-field__hint { margin: -2px 0 6px; font-size: var(--fs-12); color: var(--fg-3); }
.bk-field input:not([type="checkbox"]):not([type="radio"]),
.bk-field textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px var(--space-3);
  border: 1.5px solid var(--border-1);
  border-radius: var(--radius-md);
  background: var(--dh-white);
  font: inherit;
  font-size: var(--fs-16); /* 16px stops iOS zooming on focus */
  color: var(--fg-1);
  box-sizing: border-box;
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.bk-field textarea { resize: vertical; min-height: 84px; }
.bk-field input:focus,
.bk-field textarea:focus {
  outline: none;
  border-color: var(--dh-navy);
  box-shadow: 0 0 0 3px rgba(243, 146, 53, 0.35);
}
.bk-field [aria-invalid="true"] { border-color: var(--danger); }
.bk-field__error { margin: 6px 0 0; font-size: var(--fs-12); font-weight: var(--fw-semibold); color: var(--danger); }

.bk-choices { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.bk-choice {
  position: relative;
  display: inline-flex !important;
  margin: 0 !important;
  cursor: pointer;
}
.bk-choice input { position: absolute; opacity: 0; pointer-events: none; }
.bk-choice span {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 var(--space-3);
  border: 1.5px solid var(--border-1);
  border-radius: var(--radius-pill);
  font-size: var(--fs-14);
  font-weight: var(--fw-medium);
  color: var(--fg-2);
  transition: all var(--dur-fast) var(--ease-out);
}
.bk-choice:hover span { border-color: var(--dh-navy); }
.bk-choice input:checked + span { background: var(--dh-navy); border-color: var(--dh-navy); color: var(--dh-white); }
.bk-choice input:focus-visible + span { outline: 2px solid var(--dh-orange); outline-offset: 2px; }

/* Honeypot: off-screen, not display:none (some bots skip hidden fields) */
.bk-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.bk-form__error {
  margin: 0;
  padding: 10px var(--space-3);
  border-radius: var(--radius-md);
  background: #fdecec;
  color: #8a1c1c;
  font-size: var(--fs-14);
  font-weight: var(--fw-semibold);
}
.bk-form__foot { display: flex; flex-direction: column; gap: var(--space-3); }
.bk-form__foot .btn { width: 100%; justify-content: center; }
.bk-legal { margin: 0; font-size: var(--fs-12); color: var(--fg-3); line-height: 1.5; }
.bk-legal a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

.btn.is-busy { cursor: progress; opacity: 0.85; }
.btn.is-busy::before {
  content: '';
  width: 14px;
  height: 14px;
  margin-right: 8px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: bk-spin 0.7s linear infinite;
}
@keyframes bk-spin { to { transform: rotate(360deg); } }

/* ── Step 3: done ───────────────────────────────────────────── */
.bk-done { text-align: center; padding-top: var(--space-6); padding-bottom: var(--space-7); }
.bk-done__mark {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-4);
  border-radius: 50%;
  background: var(--dh-orange);
  color: var(--dh-navy);
  animation: bk-pop 360ms cubic-bezier(0.25, 1, 0.5, 1);
}
@keyframes bk-pop { from { transform: scale(0.6); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .bk-done__mark { animation: none; } }
.bk-done h3 { margin: 0 0 var(--space-2); font-size: var(--fs-24); color: var(--dh-navy); }
.bk-done h3:focus { outline: none; }
.bk-done__when { margin: 0 0 var(--space-4); font-weight: var(--fw-bold); color: var(--dh-navy); }
.bk-done__note { margin: 0 auto; max-width: 34ch; color: var(--fg-2); font-size: var(--fs-14); line-height: 1.5; }
.bk-done__note strong { color: var(--fg-1); word-break: break-all; }
.bk-done__links {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-5);
  font-size: var(--fs-14);
  color: var(--fg-3);
}
.bk-done__links a { font-weight: var(--fw-semibold); }

/* Prototype badge when running on mock data */
.booker[data-demo]::before {
  content: 'Preview data';
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--bg-2);
  font-size: 11px;
  font-weight: var(--fw-semibold);
  color: var(--fg-3);
}
