/* Rezerwator prezentacji — dwuczęściowy „bilet”: granatowy grzbiet z etapami + jasna karta kroku. */

.booking-dialog {
  width: min(1000px, calc(100vw - 32px));
  height: min(720px, calc(100dvh - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0; border: 0; border-radius: 4px; overflow: hidden;
  background: var(--sheet); color: var(--text);
  box-shadow: 0 60px 120px -40px rgba(0,0,0,.7);
}
.booking-dialog[open] { display: grid; grid-template-columns: 300px minmax(0, 1fr); }
@media (prefers-reduced-motion: no-preference) {
  .booking-dialog[open] { animation: bk-in .35s var(--ease); }
  .sheet-dialog[open] { animation: bk-in .3s var(--ease); }
}
@keyframes bk-in { from { opacity: 0; transform: translateY(14px) scale(.985); } }

/* granatowy grzbiet */
.bk-aside {
  position: relative; display: flex; flex-direction: column; gap: 22px; min-height: 0; overflow-y: auto;
  padding: 26px 24px 22px;
  background: var(--ink); color: var(--on-ink);
}
.bk-aside::after {
  content: ""; position: absolute; right: -1px; top: 0; bottom: 0; width: 12px;
  background: radial-gradient(circle at 100% 50%, var(--sheet) 5px, transparent 5.5px) 0 0 / 12px 18px repeat-y;
  pointer-events: none;
}
.booking-header { display: flex; justify-content: space-between; gap: 12px; }
.booking-kicker { font: var(--label); font-size: .6875rem; text-transform: uppercase; letter-spacing: .14em; color: var(--signal); }
.booking-header h2 { margin-top: 10px; font-size: 1.875rem; font-weight: 800; letter-spacing: -.04em; line-height: 1.02; color: #fff; }
.booking-header p { margin-top: 10px; font-size: .875rem; line-height: 1.55; color: var(--on-ink-muted); }

.booking-progress { display: grid; gap: 0; counter-reset: none; }
.booking-progress li {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-top: 1px solid var(--line-ink);
  font-size: .9375rem; font-weight: 700; color: var(--on-ink-muted);
}
.booking-progress li:last-child { border-bottom: 1px solid var(--line-ink); }
.booking-progress li span {
  display: grid; place-items: center; width: 28px; height: 28px; flex: none;
  border: 1px solid rgba(255,255,255,.25); border-radius: 2px;
  font-size: .75rem; font-variant-numeric: tabular-nums;
}
.booking-progress li[aria-current="step"] { color: #fff; }
.booking-progress li[aria-current="step"] span { background: var(--signal); border-color: var(--signal); color: var(--ink); }
.booking-progress li.is-done { color: #d3d9e3; }
.booking-progress li.is-done span { border-color: var(--signal); color: var(--signal); }

.booking-mode {
  padding: 12px 14px; border-left: 3px solid rgba(255,255,255,.35); background: rgba(255,255,255,.05);
  font-size: .8125rem; line-height: 1.5; color: #d3d9e3;
}
.booking-mode.is-live { border-color: var(--signal); background: rgba(168,220,60,.09); }
.booking-footer { margin-top: auto; padding-top: 16px; border-top: 1px dashed rgba(255,255,255,.18); font-size: .8125rem; color: var(--on-ink-muted); }
.booking-footer button {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 4px; padding: 6px 0;
  background: none; border: 0; color: #fff; font-weight: 700; font-size: .875rem;
  border-bottom: 1px solid rgba(255,255,255,.35);
}
.booking-footer button svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }
.booking-footer button:hover { color: var(--signal); border-color: var(--signal); }

/* jasna karta */
.bk-main { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.booking-step { display: flex; flex-direction: column; min-height: 100%; padding: clamp(22px, 3.5vw, 40px); }
.booking-step-heading { margin-bottom: 24px; }
.booking-step-number { font: var(--label); font-size: .6875rem; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); }
.booking-step-heading h3 { margin-top: 8px; font-size: clamp(1.5rem, 1.2rem + 1vw, 2.125rem); font-weight: 800; letter-spacing: -.04em; line-height: 1.05; }
.booking-step-heading h3:focus { outline: none; }
.booking-step-heading h3:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; }
.booking-step-heading p { margin-top: 8px; color: var(--muted); font-size: .9375rem; }
.booking-step-actions {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 20px;
  margin-top: auto; padding-top: 24px;
}
.booking-step-actions > .btn:only-child { margin-left: auto; }
.booking-hours { font-size: .8125rem; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.booking-back { min-height: 44px; padding: 0 4px; background: none; border: 0; font-weight: 700; font-size: .875rem; color: var(--muted); }
.booking-back:hover { color: var(--ink); }

/* krok 1: forma rozmowy */
.booking-type-options { display: grid; gap: 12px; }
.booking-type-option {
  position: relative; display: grid; grid-template-columns: 52px minmax(0, 1fr) 24px; align-items: center; gap: 16px;
  padding: 18px 20px; cursor: pointer;
  background: #fff; border: 1px solid var(--line-strong); border-radius: 3px;
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}
.booking-type-option input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.booking-type-option:hover { border-color: var(--ink); }
.booking-type-option:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.booking-type-option:has(input:focus-visible) { outline: 3px solid var(--ink); outline-offset: 3px; }
.booking-type-icon { display: grid; place-items: center; width: 52px; height: 52px; background: var(--stone); border-radius: 2px; transition: background-color .2s; }
.booking-type-option:has(input:checked) .booking-type-icon { background: var(--signal); }
.booking-type-icon svg { width: 26px; height: 26px; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linejoin: round; }
.booking-type-text strong { display: block; font-size: 1.0625rem; font-weight: 800; letter-spacing: -.015em; }
.booking-type-text small { display: block; margin-top: 2px; font-size: .875rem; color: var(--muted); line-height: 1.45; }
.booking-radio-mark { width: 22px; height: 22px; border: 2px solid var(--line-strong); border-radius: 50%; transition: border-color .2s, box-shadow .2s; }
.booking-type-option:has(input:checked) .booking-radio-mark { border-color: var(--ink); box-shadow: inset 0 0 0 4px #fff, inset 0 0 0 11px var(--ink); }

/* krok 2: termin */
.booking-time-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(20px, 3vw, 32px); align-items: start; }
.booking-weekdays, .booking-dates { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.booking-weekdays { margin-bottom: 6px; }
.booking-weekdays span { text-align: center; font: var(--label); font-size: .6875rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.booking-weekdays span:nth-child(n+6) { opacity: .55; }
.booking-date {
  display: grid; place-items: center; gap: 0; aspect-ratio: 1 / 1.05; min-height: 44px; padding: 4px 0;
  background: #fff; border: 1px solid var(--line-strong); border-radius: 2px;
  transition: border-color .15s, background-color .15s, color .15s;
}
.booking-date small { font-size: .625rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); line-height: 1; }
.booking-date strong { font-size: 1.0625rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.booking-date:hover:not(:disabled) { border-color: var(--ink); }
.booking-date.is-selected { background: var(--ink); border-color: var(--ink); color: #fff; }
.booking-date.is-selected small { color: var(--signal); }
.booking-date:disabled { cursor: not-allowed; background: transparent; border-style: dashed; border-color: var(--line); color: rgba(13,20,34,.3); }
.booking-date:disabled small { color: rgba(13,20,34,.3); }
.booking-empty-date { aspect-ratio: 1 / 1.05; }

.booking-times { padding: 18px; background: #fff; border: 1px solid var(--line-strong); border-radius: 3px; }
.booking-times-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.booking-times-head strong { font-size: 1.125rem; font-weight: 800; letter-spacing: -.02em; }
.booking-times-head small { font-size: .75rem; color: var(--muted); }
.booking-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 6px; }
.booking-slot {
  min-height: 44px; background: var(--sheet); border: 1px solid var(--line-strong); border-radius: 2px;
  font-weight: 800; font-size: .9375rem; font-variant-numeric: tabular-nums;
  transition: border-color .15s, background-color .15s, color .15s;
}
.booking-slot:hover { border-color: var(--ink); background: #fff; }
.booking-slot.is-selected { background: var(--signal); border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.booking-availability-message { margin-top: 12px; font-size: .8125rem; color: var(--muted); min-height: 1.4em; }
.booking-availability-message.is-error { color: #b4320d; font-weight: 700; }

/* krok 3: dane */
.booking-review { display: flex; flex-wrap: wrap; gap: 0; margin-bottom: 22px; border: 1px solid var(--line-strong); border-radius: 2px; background: #fff; }
.booking-review span { flex: 1 1 auto; padding: 10px 14px; border-left: 1px solid var(--line); font-size: .875rem; font-weight: 700; }
.booking-review span:first-child { border-left: 0; background: var(--ink); color: #fff; flex: 0 0 auto; }
.booking-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.booking-form-grid .form-wide { grid-column: 1 / -1; }
.booking-consent { display: grid; grid-template-columns: 20px 1fr; gap: 12px; align-items: start; margin-top: 4px; padding: 14px 16px; background: #fff; border: 1px solid var(--line-strong); border-radius: 3px; font-size: .875rem; line-height: 1.5; cursor: pointer; }
.booking-consent input { margin-top: 1px; }
.booking-form-error { margin-top: 14px; padding: 12px 14px; border-left: 3px solid var(--alert); background: rgba(255,92,46,.1); color: #8f280a; font-weight: 700; font-size: .875rem; }
#booking-submit:disabled { cursor: progress; }

/* rezultat */
.booking-result { justify-content: center; align-items: flex-start; }
.booking-result-icon { display: grid; place-items: center; width: 64px; height: 64px; background: var(--signal); border-radius: 2px; margin-bottom: 20px; }
.booking-result-icon svg { width: 32px; height: 32px; fill: none; stroke: var(--ink); stroke-width: 2.5; }
.booking-dialog[data-result="preview"] .booking-result-icon { background: transparent; box-shadow: inset 0 0 0 2px var(--ink); outline: 2px dashed var(--line-strong); outline-offset: 4px; }
.booking-dialog[data-result="pending_meet"] .booking-result-icon { background: var(--stone); box-shadow: inset 0 0 0 2px var(--ink); }
.booking-result h3 { font-size: clamp(1.625rem, 1.2rem + 1.4vw, 2.5rem); font-weight: 800; letter-spacing: -.04em; line-height: 1.05; max-width: 18ch; }
.booking-result h3:focus { outline: none; }
.booking-result h3:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; }
#booking-result-message { margin-top: 14px; max-width: 46ch; color: var(--muted); }
.booking-result-summary { display: flex; flex-wrap: wrap; margin-top: 22px; border: 1px solid var(--line-strong); background: #fff; border-radius: 2px; }
.booking-result-summary span { padding: 10px 14px; border-left: 1px solid var(--line); font-size: .875rem; font-weight: 700; }
.booking-result-summary span:first-child { border-left: 0; }
.booking-result-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* telefon i małe ekrany: pełny ekran, grzbiet na górze */
@media (max-width: 820px) {
  .booking-dialog { width: 100vw; height: 100dvh; max-width: 100vw; max-height: 100dvh; border-radius: 0; }
  .booking-dialog[open] { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .bk-aside { gap: 12px; padding: 14px var(--gutter) 12px; overflow: visible; }
  .bk-aside::after { display: none; }
  .booking-header h2 { margin-top: 4px; font-size: 1.375rem; }
  .booking-header p { display: none; }
  .booking-progress { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .booking-progress li { flex-direction: column; align-items: flex-start; gap: 6px; padding: 8px 0 0; border-top: 2px solid rgba(255,255,255,.18); border-bottom: 0 !important; font-size: .75rem; line-height: 1.2; }
  .booking-progress li span { display: none; }
  .booking-progress li[aria-current="step"] { border-top-color: var(--signal); }
  .booking-progress li.is-done { border-top-color: rgba(168,220,60,.55); }
  .booking-mode { padding: 8px 10px; font-size: .75rem; }
  .booking-footer { display: none; }
  .booking-time-layout { grid-template-columns: 1fr; }
  .booking-step { padding: 20px var(--gutter) 24px; }
  .booking-step-actions { position: sticky; bottom: 0; margin-inline: calc(var(--gutter) * -1); margin-bottom: -24px; padding: 14px var(--gutter); background: rgba(244,243,240,.96); border-top: 1px solid var(--line); }
  .booking-step-actions .btn { flex: 1 1 auto; }
  .booking-result .booking-result-actions .btn { flex: 1 1 auto; }
}
@media (max-width: 520px) {
  .booking-form-grid { grid-template-columns: 1fr; }
  .booking-type-option { grid-template-columns: 44px minmax(0, 1fr) 22px; gap: 12px; padding: 14px; }
  .booking-type-icon { width: 44px; height: 44px; }
  .booking-hours { width: 100%; }
  .booking-review span { flex: 1 1 100%; border-left: 0; border-top: 1px solid var(--line); }
  .booking-review span:first-child { border-top: 0; flex: 1 1 100%; }
  .booking-dates, .booking-weekdays { gap: 4px; }
}
