/*!
 * booking.css — DataLabelify booking widget.
 *
 * Self-contained. No framework, no CDN, no @import. Written entirely with CSS
 * logical properties so dir="rtl" (Arabic) mirrors without a second sheet.
 *
 * Playbook gotcha 9.3 is load-bearing here: NOTHING in this file starts at
 * opacity:0 waiting for JS to reveal it. The no-JS fallback (.dlb-noscript) is
 * visible by default and is hidden only once the root carries
 * data-dlb-ready="1", which only JS can set. Kill the JS and the fallback
 * stays on screen.
 *
 * Every colour is a custom property on .dlb, so a host page can retheme the
 * widget without editing this file.
 */

/* ------------------------------------------------------------------ tokens */

/* The tokens are declared on BOTH the hydrated root and the bare fallback.
   `.dlb` is added by JavaScript, so scoping them to `.dlb` alone would leave
   the no-JS fallback — the one thing that must look right without JS — with
   undefined custom properties and no font. */
.dlb,
.dlb-noscript {
  /* Brand — taken from the live Blocksy palette on datalabelify.com */
  --dlb-accent: #007ea7;
  --dlb-accent-ink: #ffffff;
  --dlb-accent-soft: #e6f2f7;
  --dlb-accent-dark: #00445b;

  --dlb-text: #3a4f66;
  --dlb-text-strong: #00445b;
  --dlb-text-muted: #6b7f96;

  --dlb-surface: #ffffff;
  --dlb-surface-muted: #fafbfc;
  --dlb-surface-sunk: #f2f5f7;

  --dlb-border: #e1e8ed;
  --dlb-border-strong: #c9d5de;

  --dlb-danger: #b3261e;
  --dlb-danger-soft: #fdecea;
  --dlb-success: #0f7b4f;
  --dlb-success-soft: #e8f5ef;

  --dlb-radius: 10px;
  --dlb-radius-sm: 6px;
  --dlb-focus: #00445b;

  --dlb-font: "Nunito Sans", "Montserrat", -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --dlb-shadow: 0 1px 2px rgba(0, 68, 91, 0.06), 0 8px 24px rgba(0, 68, 91, 0.08);

  /* Slot column width on the two-pane layout. */
  --dlb-slots-width: 268px;

  box-sizing: border-box;
  max-inline-size: 960px;
  margin-inline: auto;
  color: var(--dlb-text);
  font-family: var(--dlb-font);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  text-align: start;
}

.dlb {
  display: block;
}

.dlb *,
.dlb *::before,
.dlb *::after,
.dlb-noscript *,
.dlb-noscript *::before,
.dlb-noscript *::after {
  box-sizing: inherit;
}

/* --------------------------------------------------- host-theme insulation */

/* The widget is dropped into pages that still ship the full Blocksy theme
   stylesheet, which styles bare h2/h3/button/table/ul/input globally — an
   `h2 { text-transform: uppercase }` in the host is enough to shout the event
   title at the visitor. Everything the widget creates is neutralised here.
   Wrapped in :where() so it carries ZERO specificity: every rule further down
   this file still wins without needing !important, and a host page can still
   retheme via the custom properties. */
.dlb :where(h2, h3, h4, p, ul, ol, li, table, thead, tbody, tr, th, td,
            form, label, button, a, input, select, textarea, span, div, svg),
.dlb-noscript :where(h2, h3, h4, p, ul, ol, li, a, span, div) {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: none;
  box-shadow: none;
  text-shadow: none;
  text-transform: none;
  text-decoration: none;
  letter-spacing: normal;
  text-align: start;
  list-style: none;
  float: none;
  position: static;
  inline-size: auto;
  min-inline-size: 0;
  min-block-size: 0;
  max-inline-size: none;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  color: inherit;
}

.dlb :where(table) {
  border-collapse: collapse;
  border-spacing: 0;
}

/* --------------------------------------------------------- no-JS fallback */

/* Visible by default. JS sets data-dlb-ready="1" on the root and ALSO sets
   display:none inline, so the fallback disappears even if this stylesheet
   failed to load. */
.dlb-noscript {
  border: 1px solid var(--dlb-border);
  border-radius: var(--dlb-radius);
  background: var(--dlb-surface-muted);
  padding: 24px;
}

.dlb-noscript h2,
.dlb-noscript h3,
.dlb-noscript p {
  margin: 0 0 12px;
}

.dlb-noscript h2,
.dlb-noscript h3 {
  color: var(--dlb-text-strong);
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.3;
}

.dlb-noscript a {
  color: var(--dlb-accent);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.dlb-noscript p:last-child {
  margin-block-end: 0;
}

.dlb[data-dlb-ready="1"] .dlb-noscript {
  display: none;
}

/* ------------------------------------------------------------------ shell */

.dlb-card {
  border: 1px solid var(--dlb-border);
  border-radius: var(--dlb-radius);
  background: var(--dlb-surface);
  box-shadow: var(--dlb-shadow);
  overflow: hidden;
}

.dlb-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: baseline;
  justify-content: space-between;
  padding: 20px 24px;
  border-block-end: 1px solid var(--dlb-border);
  background: var(--dlb-surface-muted);
}

.dlb-head-main {
  min-inline-size: 0;
}

.dlb-title {
  margin: 0;
  color: var(--dlb-text-strong);
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.25;
}

.dlb-desc {
  margin: 6px 0 0;
  color: var(--dlb-text-muted);
  font-size: 0.9375rem;
}

.dlb-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.dlb-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border: 1px solid var(--dlb-border-strong);
  border-radius: 999px;
  background: var(--dlb-surface);
  color: var(--dlb-text-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
}

.dlb-step-count {
  color: var(--dlb-text-muted);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.dlb-body {
  padding: 20px 24px 24px;
}

.dlb-step-title {
  margin: 0 0 16px;
  color: var(--dlb-text-strong);
  font-size: 1.0625rem;
  font-weight: 800;
}

.dlb-step-title:focus-visible {
  outline: 2px solid var(--dlb-focus);
  outline-offset: 4px;
  border-radius: var(--dlb-radius-sm);
}

/* -------------------------------------------------------------- two panes */

.dlb-panes {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}

/* Cap the calendar rather than letting it eat the whole card: a 7-column grid
   stretched to 900px gives 120px-wide day cells, which reads as a spreadsheet,
   not a date picker. The freed width goes to the time column, which then fits
   two columns of slots and needs far less scrolling. */
@media (min-width: 720px) {
  .dlb-panes {
    grid-template-columns: minmax(0, 440px) minmax(var(--dlb-slots-width), 1fr);
    align-items: start;
    gap: 28px;
  }

  .dlb-pane-slots {
    border-inline-start: 1px solid var(--dlb-border);
    padding-inline-start: 24px;
  }
}

/* --------------------------------------------------------------- calendar */

.dlb-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-block-end: 12px;
}

.dlb-month {
  margin: 0;
  color: var(--dlb-text-strong);
  font-size: 1rem;
  font-weight: 800;
}

.dlb-nav {
  display: flex;
  gap: 6px;
}

.dlb-iconbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: 36px;
  block-size: 36px;
  padding: 0;
  border: 1px solid var(--dlb-border);
  border-radius: var(--dlb-radius-sm);
  background: var(--dlb-surface);
  color: var(--dlb-text);
  font: inherit;
  cursor: pointer;
}

.dlb-iconbtn:hover:not(:disabled) {
  border-color: var(--dlb-accent);
  color: var(--dlb-accent);
}

.dlb-iconbtn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Chevrons are inline SVG so no icon font or sprite is needed. Flipped for
   RTL, where "previous" points the other way. */
.dlb-iconbtn svg {
  inline-size: 16px;
  block-size: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dlb[dir="rtl"] .dlb-iconbtn svg {
  transform: scaleX(-1);
}

.dlb-grid {
  inline-size: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.dlb-grid th {
  padding-block: 0 8px;
  color: var(--dlb-text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-align: center;
  text-transform: uppercase;
}

.dlb-grid td {
  padding: 2px;
  text-align: center;
  vertical-align: middle;
}

.dlb-day {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  inline-size: 100%;
  min-block-size: 44px;
  padding: 4px 0;
  border: 1px solid transparent;
  border-radius: var(--dlb-radius-sm);
  background: var(--dlb-surface-sunk);
  color: var(--dlb-text-strong);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.dlb-day:hover:not([aria-disabled="true"]) {
  background: var(--dlb-accent-soft);
  border-color: var(--dlb-accent);
}

.dlb-day[aria-disabled="true"] {
  background: transparent;
  color: var(--dlb-text-muted);
  opacity: 0.45;
  cursor: not-allowed;
}

.dlb-day[aria-pressed="true"] {
  background: var(--dlb-accent);
  border-color: var(--dlb-accent);
  color: var(--dlb-accent-ink);
}

.dlb-day-dot {
  inline-size: 4px;
  block-size: 4px;
  margin-block-start: 3px;
  border-radius: 50%;
  background: var(--dlb-accent);
}

.dlb-day[aria-pressed="true"] .dlb-day-dot {
  background: var(--dlb-accent-ink);
}

.dlb-day[aria-disabled="true"] .dlb-day-dot {
  visibility: hidden;
}

.dlb-today {
  box-shadow: inset 0 0 0 1px var(--dlb-border-strong);
}

/* ------------------------------------------------------------------ slots */

.dlb-slots-title {
  margin: 0 0 12px;
  color: var(--dlb-text-strong);
  font-size: 0.9375rem;
  font-weight: 800;
}

.dlb-slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  max-block-size: 340px;
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
}

@media (min-width: 720px) {
  .dlb-slots {
    grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
    max-block-size: 396px;
    padding-inline-end: 4px;
  }
}

.dlb-slot {
  inline-size: 100%;
  padding: 10px 12px;
  border: 1px solid var(--dlb-border-strong);
  border-radius: var(--dlb-radius-sm);
  background: var(--dlb-surface);
  color: var(--dlb-text-strong);
  font: inherit;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: center;
  cursor: pointer;
}

.dlb-slot:hover {
  border-color: var(--dlb-accent);
  background: var(--dlb-accent-soft);
  color: var(--dlb-accent-dark);
}

.dlb-slot[aria-pressed="true"] {
  border-color: var(--dlb-accent);
  background: var(--dlb-accent);
  color: var(--dlb-accent-ink);
}

/* --------------------------------------------------------------- timezone */

.dlb-tz {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-block-start: 16px;
  padding-block-start: 16px;
  border-block-start: 1px solid var(--dlb-border);
  color: var(--dlb-text-muted);
  font-size: 0.875rem;
}

.dlb-tz-name {
  color: var(--dlb-text-strong);
  font-weight: 700;
}

.dlb-tz-panel {
  display: grid;
  gap: 8px;
  margin-block-start: 12px;
  padding: 12px;
  border: 1px solid var(--dlb-border);
  border-radius: var(--dlb-radius-sm);
  background: var(--dlb-surface-muted);
}

.dlb-tz-panel[hidden] {
  display: none;
}

.dlb-tz-panel select {
  block-size: 180px;
}

/* ----------------------------------------------------------------- fields */

.dlb-form {
  display: grid;
  gap: 16px;
  max-inline-size: 520px;
}

.dlb-field {
  display: grid;
  gap: 6px;
}

.dlb-label {
  color: var(--dlb-text-strong);
  font-size: 0.875rem;
  font-weight: 700;
}

.dlb-optional {
  color: var(--dlb-text-muted);
  font-weight: 600;
}

.dlb-req {
  color: var(--dlb-danger);
}

.dlb input[type="text"],
.dlb input[type="email"],
.dlb input[type="tel"],
.dlb input[type="search"],
.dlb select,
.dlb textarea {
  inline-size: 100%;
  padding: 10px 12px;
  border: 1px solid var(--dlb-border-strong);
  border-radius: var(--dlb-radius-sm);
  background: var(--dlb-surface);
  color: var(--dlb-text-strong);
  font: inherit;
  font-size: 1rem;
}

.dlb textarea {
  min-block-size: 88px;
  resize: vertical;
}

.dlb input:hover,
.dlb select:hover,
.dlb textarea:hover {
  border-color: var(--dlb-accent);
}

.dlb [aria-invalid="true"] {
  border-color: var(--dlb-danger);
}

.dlb-fielderr {
  color: var(--dlb-danger);
  font-size: 0.8125rem;
  font-weight: 600;
}

.dlb-fielderr:empty {
  display: none;
}

/* Honeypot. Clipped off-screen rather than display:none — some bots skip
   display:none inputs. aria-hidden + tabindex=-1 keep it out of the AT tree
   and out of the tab order. */
.dlb-hp {
  position: absolute !important;
  inline-size: 1px;
  block-size: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------------------------------------------------------------- buttons */

.dlb-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-block-start: 4px;
}

.dlb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-block-size: 44px;
  padding: 10px 20px;
  border: 1px solid var(--dlb-accent);
  border-radius: var(--dlb-radius-sm);
  background: var(--dlb-accent);
  color: var(--dlb-accent-ink);
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.dlb-btn:hover:not(:disabled) {
  background: var(--dlb-accent-dark);
  border-color: var(--dlb-accent-dark);
}

.dlb-btn:disabled {
  opacity: 0.55;
  cursor: progress;
}

.dlb-btn-ghost {
  background: transparent;
  border-color: var(--dlb-border-strong);
  color: var(--dlb-text-strong);
}

.dlb-btn-ghost:hover:not(:disabled) {
  background: var(--dlb-surface-sunk);
  border-color: var(--dlb-accent);
  color: var(--dlb-accent-dark);
}

.dlb-btn-danger {
  background: transparent;
  border-color: var(--dlb-danger);
  color: var(--dlb-danger);
}

.dlb-btn-danger:hover:not(:disabled) {
  background: var(--dlb-danger-soft);
}

.dlb-linkbtn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--dlb-accent);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

/* One focus treatment for everything focusable inside the widget. */
.dlb :focus-visible {
  outline: 2px solid var(--dlb-focus);
  outline-offset: 2px;
}

/* ---------------------------------------------------- summary / feedback */

.dlb-summary {
  display: grid;
  gap: 4px;
  max-inline-size: 520px;   /* line up with .dlb-form */
  margin-block-end: 20px;
  padding: 14px 16px;
  border: 1px solid var(--dlb-border);
  border-inline-start: 3px solid var(--dlb-accent);
  border-radius: var(--dlb-radius-sm);
  background: var(--dlb-surface-muted);
}

.dlb-summary-when {
  color: var(--dlb-text-strong);
  font-weight: 800;
}

.dlb-summary-tz {
  color: var(--dlb-text-muted);
  font-size: 0.875rem;
}

.dlb-note {
  margin: 0 0 16px;
  color: var(--dlb-text-muted);
  font-size: 0.9375rem;
}

.dlb-empty {
  margin: 0;
  padding: 16px 0;
  color: var(--dlb-text-muted);
  font-size: 0.9375rem;
}

.dlb-alert {
  display: grid;
  gap: 10px;
  justify-items: start;
  margin-block-end: 16px;
  padding: 14px 16px;
  border: 1px solid var(--dlb-danger);
  border-radius: var(--dlb-radius-sm);
  background: var(--dlb-danger-soft);
  color: var(--dlb-danger);
  font-size: 0.9375rem;
  font-weight: 600;
}

.dlb-alert[hidden] {
  display: none;
}

.dlb-done {
  display: grid;
  gap: 8px;
  justify-items: start;
  padding: 20px;
  border: 1px solid var(--dlb-success);
  border-radius: var(--dlb-radius-sm);
  background: var(--dlb-success-soft);
}

.dlb-done-when {
  color: var(--dlb-success);
  font-size: 1.125rem;
  font-weight: 800;
}

.dlb-done p {
  margin: 0;
}

.dlb-ref {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.875rem;
  letter-spacing: 0.04em;
}

/* ------------------------------------------------------------ loading state */

.dlb-skeleton {
  display: grid;
  gap: 8px;
}

/* Base state is a visible grey block. The shimmer is decoration layered on an
   already-visible element — it is never what makes the element visible. */
.dlb-sk {
  block-size: 44px;
  border-radius: var(--dlb-radius-sm);
  background: var(--dlb-surface-sunk);
}

.dlb-sk-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

@media (prefers-reduced-motion: no-preference) {
  .dlb-sk {
    animation: dlb-pulse 1.4s ease-in-out infinite;
  }
}

@keyframes dlb-pulse {
  0%,
  100% {
    background-color: var(--dlb-surface-sunk);
  }
  50% {
    background-color: var(--dlb-border);
  }
}

.dlb-busy {
  color: var(--dlb-text-muted);
  font-size: 0.875rem;
}

/* Screen-reader-only live region. */
.dlb-sr {
  position: absolute !important;
  inline-size: 1px;
  block-size: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------------------------------------------------------- small screens */

@media (max-width: 420px) {
  .dlb {
    font-size: 15px;
  }

  .dlb-head,
  .dlb-body {
    padding-inline: 16px;
  }

  .dlb-head {
    padding-block: 16px;
  }

  .dlb-slots {
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    max-block-size: none;
  }

  .dlb-day {
    min-block-size: 40px;
    font-size: 0.875rem;
  }

  .dlb-actions .dlb-btn {
    flex: 1 1 140px;
  }
}

/* At 360px the grid still needs 7 columns; shrink the gutter rather than let
   the table overflow the page. */
@media (max-width: 380px) {
  .dlb-grid td {
    padding: 1px;
  }

  .dlb-day {
    min-block-size: 36px;
    font-size: 0.8125rem;
  }

  .dlb-head,
  .dlb-body {
    padding-inline: 12px;
  }
}

@media print {
  .dlb-actions,
  .dlb-nav,
  .dlb-tz-panel {
    display: none;
  }
}
