/* iopwblog booking widget + manage page. Works without the site's base CSS; restyle with
   .widget-booking { --bk-accent: #47b4e7; --bk-radius: 0; } in the site's custom CSS. */
.widget-booking, .bk-dialog, .bk-manage {
  --bk-accent: #1f4f7a;
  --bk-on-accent: #fff;
  --bk-line: color-mix(in srgb, currentColor 16%, transparent);
  --bk-soft: color-mix(in srgb, var(--bk-accent) 9%, transparent);
  --bk-muted: color-mix(in srgb, currentColor 62%, transparent);
  --bk-danger: #b42318;
  --bk-radius: 8px;
}
.bk, .bk *, .bk-dialog, .bk-manage, .bk-manage * { box-sizing: border-box; }
.bk { font: inherit; line-height: 1.45; max-width: 46rem; }
:where(.bk, .bk-manage) :where(button, input, textarea) { font: inherit; color: inherit; }
:where(.bk) button { cursor: pointer; }
.bk button:focus-visible, .bk input:focus-visible, .bk textarea:focus-visible, .bk-open:focus-visible, .bk-btn:focus-visible {
  outline: 2px solid var(--bk-accent); outline-offset: 2px;
}
.bk-title { margin: 0 0 14px; font-size: 1.35em; line-height: 1.25; }
.bk-step { margin: 0 0 10px; font-weight: 600; }
.bk-muted, .bk-zone { color: var(--bk-muted); font-size: .9em; margin: 8px 0 0; }
.bk-error { margin: 0 0 12px; padding: 8px 12px; border-left: 3px solid var(--bk-danger); color: var(--bk-danger); background: color-mix(in srgb, var(--bk-danger) 7%, transparent); }
.bk-link { background: none; border: 0; padding: 0; color: var(--bk-accent); text-decoration: underline; text-underline-offset: 2px; font-size: .92em; }

/* services */
.bk-services { display: grid; gap: 8px; }
.bk-service { display: grid; gap: 2px; text-align: left; padding: 12px 14px; background: transparent; border: 1px solid var(--bk-line); border-radius: var(--bk-radius); }
.bk-service:hover { border-color: var(--bk-accent); }
.bk-service-name, .bk-chosen-name { font-weight: 600; }
.bk-service-meta { color: var(--bk-muted); font-size: .9em; }
.bk-service-desc { color: var(--bk-muted); font-size: .92em; margin: 2px 0 0; }
.bk > .bk-service-desc { margin: -6px 0 16px; }
.bk-chosen { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px solid var(--bk-line); }

/* calendar + times: side by side when there is room */
.bk-body { display: grid; grid-template-columns: minmax(0, 19rem) minmax(0, 1fr); gap: 28px; align-items: start; }
@media (max-width: 640px) { .bk-body { grid-template-columns: minmax(0, 1fr); gap: 18px; } }
.bk-cal.is-busy .bk-grid { opacity: .45; }
.bk-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.bk-cal-title { font-weight: 600; }
.bk-nav { width: 34px; height: 34px; border: 1px solid var(--bk-line); border-radius: 50%; background: transparent; font-size: 20px; line-height: 1; }
.bk-nav:disabled { opacity: .3; cursor: default; }
.bk-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.bk-dow { text-align: center; font-size: .75em; color: var(--bk-muted); padding: 4px 0; }
.bk-day { position: relative; aspect-ratio: 1; min-height: 36px; border: 0; border-radius: var(--bk-radius); background: transparent; font-variant-numeric: tabular-nums; }
.bk-day:disabled { color: var(--bk-muted); opacity: .5; cursor: default; }
/* A day with free times: accent number and a short bar under it. */
.bk-day.is-free { color: var(--bk-accent); font-weight: 600; background: var(--bk-soft); }
.bk-day.is-free::after { content: ""; position: absolute; left: 50%; bottom: 6px; width: 12px; height: 2px; margin-left: -6px; border-radius: 1px; background: currentColor; }
.bk-day.is-free:hover { background: color-mix(in srgb, var(--bk-accent) 18%, transparent); }
.bk-day.is-picked, .bk-day.is-picked:hover { background: var(--bk-accent); color: var(--bk-on-accent); }
.bk-day.is-today { box-shadow: inset 0 0 0 1px var(--bk-line); }
.bk-day-label { margin: 0 0 10px; font-weight: 600; }
.bk-time-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr)); gap: 8px; }
.bk-time { padding: 9px 6px; border: 1px solid var(--bk-accent); border-radius: var(--bk-radius); background: transparent; color: var(--bk-accent); font-weight: 600; font-variant-numeric: tabular-nums; }
.bk-time:hover { background: var(--bk-accent); color: var(--bk-on-accent); }

/* details form */
.bk-form { display: grid; gap: 12px; max-width: 30rem; }
.bk-summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 10px 14px; border-radius: var(--bk-radius); background: var(--bk-soft); }
.bk-summary-when { font-weight: 600; }
.bk-field { display: grid; gap: 4px; }
.bk-field label { font-size: .92em; font-weight: 500; }
.bk-req { color: var(--bk-danger); }
.bk-field input, .bk-field textarea { width: 100%; padding: 9px 11px; border: 1px solid color-mix(in srgb, currentColor 28%, transparent); border-radius: var(--bk-radius); background: #fff; color: #1b1f24; }
.bk-submit, .bk-open, .bk-btn.bk-primary { padding: 11px 20px; border: 0; border-radius: var(--bk-radius); background: var(--bk-accent); color: var(--bk-on-accent); font-weight: 600; cursor: pointer; justify-self: start; }
.bk-submit:disabled { opacity: .6; cursor: progress; }
.bk-open { font: inherit; font-weight: 600; }

.bk-done { padding: 18px 20px; border-left: 3px solid var(--bk-accent); background: var(--bk-soft); }
.bk-done p { margin: 0 0 10px; }
.bk-done-head { font-weight: 700; font-size: 1.15em; }

/* popup */
.bk-dialog { width: min(48rem, calc(100vw - 24px)); max-height: calc(100vh - 32px); padding: 28px 28px 24px; border: 0; border-radius: 12px; background: #fff; color: #1b1f24; overflow: auto; }
.bk-dialog::backdrop { background: rgba(15, 20, 30, .55); }
.bk-close { position: absolute; top: 8px; right: 10px; width: 36px; height: 36px; border: 0; background: none; font-size: 26px; line-height: 1; color: inherit; cursor: pointer; }
@media (max-width: 640px) { .bk-dialog { padding: 24px 16px 18px; } }

/* manage page (/booking/{id}) */
.bk-manage { max-width: 34rem; line-height: 1.5; }
.bk-notice { padding: 10px 14px; border-left: 3px solid var(--bk-accent); background: var(--bk-soft); }
.bk-details { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: 10px 16px; margin: 0 0 22px; }
.bk-details dt { color: var(--bk-muted); }
.bk-details dd { margin: 0; font-weight: 500; }
.bk-details small { color: var(--bk-muted); font-weight: 400; }
.bk-status { display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: .9em; background: var(--bk-soft); color: var(--bk-accent); }
.bk-status.is-cancelled { color: var(--bk-danger); background: color-mix(in srgb, var(--bk-danger) 8%, transparent); }
.bk-status.is-pending, .bk-status.is-past { color: inherit; background: var(--bk-line); }
.bk-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 22px; }
.bk-actions form { margin: 0; }
.bk-btn { display: inline-block; padding: 10px 18px; border: 1px solid var(--bk-accent); border-radius: var(--bk-radius); color: var(--bk-accent); background: transparent; text-decoration: none; font-weight: 600; cursor: pointer; }
.bk-btn.bk-danger { border-color: var(--bk-danger); color: var(--bk-danger); }
.bk-cancel summary { cursor: pointer; color: var(--bk-muted); }
.bk-cancel form { padding-top: 8px; }
@media (max-width: 480px) { .bk-details { grid-template-columns: minmax(0, 1fr); gap: 2px; } .bk-details dd { margin-bottom: 10px; } }
@media (prefers-reduced-motion: no-preference) { .bk-day, .bk-time, .bk-service { transition: background-color .12s, color .12s, border-color .12s; } }
.bk-verify-msg { margin: 0; }
.bk-field input.bk-code { max-width: 10rem; font-size: 1.3em; letter-spacing: .25em; font-variant-numeric: tabular-nums; }
.bk-verify-links { display: flex; flex-wrap: wrap; gap: 16px; margin: 0; }
.bk-times, .bk-summary { scroll-margin-top: 80px; }
