/* Termin buchen: the booking card on kontakt.html and kontakt-en.html (js/booking.js).
   Two steps and a confirmation in one card. Builds on werklicht.css (tokens, .wl-card, .wl-chip, .wl-mono, .btn),
   page.css (.form, .field) and the .kt- rules of page-partner.css (card, header row, title, submit row, done view).
   Selection is ink, never yellow: yellow marks only AEDIL. */
[data-booking]{ --bk-err:#B3261E; --bk-err-bg:rgba(179,38,30,.07) }
[data-look="nacht"] [data-booking]{ --bk-err:#FF9A8F; --bk-err-bg:rgba(255,120,105,.12) }

.bk-step{ display:grid; gap:20px; min-width:0 }
.bk-chips{ display:flex; flex-wrap:wrap; gap:6px; min-width:0 }
[data-booking] .kt-form-h{ align-items:flex-start }
[data-booking] .kt-form-h > .wl-mono{ flex:none; line-height:22px; white-space:nowrap }
.bk-ex{ background:var(--ink); color:var(--bg) }
.kt-form-t:focus, .bk-alert:focus{ outline:none }

/* ---------- step 1: day and time. Native radios under the chips, so arrow keys and screen readers just work ---------- */
.bk-pick{ display:grid; gap:18px; min-width:0 }
.bk-set{ border:0; margin:0; padding:0; min-width:0 }
.bk-set legend{ padding:0; margin:0 0 9px }
.bk-days{ display:grid; grid-template-columns:repeat(5, minmax(0, 1fr)); gap:6px }
.bk-times{ display:grid; grid-template-columns:repeat(4, minmax(0, 1fr)); gap:6px }
.bk-day, .bk-time{ position:relative; display:block; cursor:pointer }
.bk-day input, .bk-time input{ position:absolute; inset:0; width:100%; height:100%; margin:0; opacity:0; pointer-events:none }
.bk-day > span, .bk-time > span{ background:var(--card-solid); box-shadow:inset 0 0 0 1px var(--line2); color:var(--ink);
  transition:background-color var(--t-1) var(--ease), color var(--t-1) var(--ease), box-shadow var(--t-1) var(--ease) }
.bk-day > span{ display:grid; gap:5px; justify-items:center; padding:10px 4px 11px; border-radius:12px }
.bk-day small{ font:500 11px/1 var(--f-mono); letter-spacing:.05em; text-transform:uppercase; color:var(--muted); transition:color var(--t-1) var(--ease) }
.bk-day b{ font:600 15px/1.1 var(--f-sans); letter-spacing:-.01em; white-space:nowrap }
.bk-time > span{ display:grid; place-items:center; height:44px; border-radius:10px; font:600 15px/1 var(--f-sans) }
.bk-day input:not(:checked):hover + span, .bk-time input:not(:checked):not(:disabled):hover + span{ box-shadow:inset 0 0 0 1px var(--ink) }
/* a time that is taken (only the example times of the prototype show these) */
.bk-time:has(input:disabled){ cursor:not-allowed }
.bk-time input:disabled + span{ background:transparent; box-shadow:inset 0 0 0 1px var(--line); color:var(--faint); text-decoration:line-through }
.bk-day input:checked + span, .bk-time input:checked + span{ background:var(--ink); color:var(--bg); box-shadow:0 6px 14px -8px rgba(var(--sh), .6) }
.bk-day input:checked + span small{ color:color-mix(in srgb, var(--bg) 72%, transparent) }
.bk-day input:focus-visible + span, .bk-time input:focus-visible + span{ outline:2px solid var(--ink); outline-offset:2px }
.bk-set[aria-invalid="true"] .bk-time > span{ box-shadow:inset 0 0 0 1px var(--bk-err) }
.bk-tz{ margin:-6px 0 0; font:400 13px/1.4 var(--f-sans); color:var(--muted) }

/* while the calendar answers: the same grid, as quiet placeholders */
.bk-load{ display:grid; gap:18px; padding:23px 0 94px }
.bk-load .bk-times{ margin-top:23px }
.bk-load i{ display:block; border-radius:12px; background:var(--surface2) }
.bk-load .bk-days i{ height:57px }
.bk-load .bk-times i{ height:44px; border-radius:10px }
@media (prefers-reduced-motion:no-preference){
  .bk-load i{ animation:bk-wait 1.4s var(--ease-io) infinite alternate }
  .bk-load i:nth-child(2n){ animation-delay:.18s }
  .bk-load i:nth-child(3n){ animation-delay:.36s }
}
@keyframes bk-wait{ from{ opacity:1 } to{ opacity:.45 } }

/* nothing free, or the calendar cannot be reached */
.bk-msg{ display:grid; gap:14px; justify-items:start; margin:0; padding:18px 20px; border-radius:14px; background:var(--surface2); font:400 15.5px/1.5 var(--f-sans); color:var(--ink2) }
.bk-msg p{ margin:0; max-width:46ch }
.bk-msg b{ display:block; margin-bottom:4px; font:600 17px/1.3 var(--f-display); letter-spacing:-.02em; color:var(--ink) }
.bk-msg a, .bk-alert a{ color:var(--ink); font-weight:500; text-underline-offset:2px; overflow-wrap:anywhere }

/* ---------- messages: a taken slot, a failed booking, a field that needs attention ---------- */
.bk-alert{ margin:0; padding:12px 14px; border-radius:12px; background:var(--bk-err-bg); box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--bk-err) 34%, transparent); font:450 14.5px/1.45 var(--f-sans); color:var(--ink) }
.bk-err{ margin:0; font:500 13px/1.4 var(--f-sans); color:var(--bk-err) }
.bk-err:empty{ display:none }
.kt-submit .bk-err{ flex:1 1 180px }
.bk-chosen{ flex:1 1 180px; margin:0; font:400 14.5px/1.4 var(--f-sans); color:var(--ink2) }
.bk-chosen:empty{ display:none }
.bk-chosen b{ font-weight:600; color:var(--ink) }
[data-booking] .field input[aria-invalid="true"], [data-booking] .field textarea[aria-invalid="true"]{ box-shadow:inset 0 0 0 1.5px var(--bk-err) }
[data-booking] .field input[aria-invalid="true"]:focus, [data-booking] .field textarea[aria-invalid="true"]:focus{ box-shadow:inset 0 0 0 2px var(--bk-err) }

/* ---------- step 2: the chosen time stays in view above the fields ---------- */
.bk-sel{ display:flex; align-items:center; justify-content:space-between; gap:12px; padding:4px 12px 4px 16px; border-radius:12px; background:var(--surface2) }
.bk-sel p{ display:flex; flex-wrap:wrap; gap:2px 10px; margin:0; min-width:0; font:400 15px/1.35 var(--f-sans); color:var(--ink2) }
.bk-sel b{ font-weight:600; color:var(--ink) }
.bk-link{ flex:none; min-height:44px; padding:6px 4px; border:0; background:none; cursor:pointer; color:var(--ink); font:500 14px/1.2 var(--f-sans); text-decoration:underline; text-decoration-color:var(--line2); text-underline-offset:4px }
.bk-link:hover{ text-decoration-color:var(--ink) }
.bk-hp{ position:absolute!important; left:-9999px; width:1px; height:1px; overflow:hidden }
.bk-ts:empty{ display:none }
.btn.is-busy{ cursor:progress }
.btn.is-busy .a svg{ visibility:hidden }
.btn.is-busy .a{ position:relative }
.btn.is-busy .a::after{ content:""; position:absolute; inset:9px; border-radius:50%; border:1.6px solid currentColor; border-right-color:transparent }
@media (prefers-reduced-motion:no-preference){ .btn.is-busy .a::after{ animation:bk-spin .8s linear infinite } }
@keyframes bk-spin{ to{ transform:rotate(1turn) } }

/* ---------- the confirmation: date and time as a calendar leaf ---------- */
.bk-done > p{ max-width:none }
.bk-done > p b{ font-weight:600; color:var(--ink); overflow-wrap:anywhere }
.bk-ticket{ display:flex; align-items:center; gap:18px; padding:16px 18px 16px 16px; border-radius:14px; background:var(--card-solid); box-shadow:0 0 0 1px var(--line), 0 14px 30px -20px rgba(var(--sh), .45) }
.bk-cal{ flex:none; display:grid; grid-template-rows:auto 1fr; width:62px; overflow:hidden; border-radius:10px; text-align:center; box-shadow:inset 0 0 0 1px var(--line2) }
.bk-cal span{ padding:5px 0 4px; background:var(--ink); color:var(--bg); font:500 10.5px/1 var(--f-mono); letter-spacing:.08em; text-transform:uppercase }
.bk-cal b{ padding:7px 0 9px; font:600 27px/1 var(--f-display); letter-spacing:-.03em; color:var(--ink) }
.bk-when{ display:grid; gap:4px; margin:0; min-width:0 }
.bk-when b{ font:600 clamp(18px, 1.5vw, 21px)/1.2 var(--f-display); letter-spacing:-.02em; color:var(--ink) }
.bk-when > span{ font:400 15px/1.4 var(--f-sans); color:var(--ink2) }
.bk-profile{ display:flex; align-items:baseline; gap:10px; padding-top:16px; border-top:1px solid var(--line); font-size:15px!important; color:var(--ink2) }
.bk-profile .sq{ flex:none; transform:translateY(-1px) }
.bk-done .btn{ justify-self:start }
[data-booking] > .kt-proto{ margin-top:18px; padding-top:14px; border-top:1px dashed var(--line2) }

@media (prefers-reduced-motion:no-preference){
  .bk-step.bk-enter{ animation:bk-in .34s var(--ease) both }
}
@keyframes bk-in{ from{ opacity:0; transform:translateY(6px) } }

@media (max-width:480px){
  .bk-times{ grid-template-columns:repeat(3, minmax(0, 1fr)) }
  .bk-days{ gap:5px }
  .bk-day > span{ padding:9px 2px 10px; border-radius:11px }
  .bk-day b{ font-size:13.5px }
  .bk-load .bk-days i{ height:53px }
  .bk-ticket{ gap:14px; padding:14px }
  .bk-chosen{ order:-1; flex-basis:100% }
  /* the whole step fits one phone screen: tighter rows, a lower free-text field */
  .bk-step{ gap:16px }
  [data-booking] .kt-grid{ gap:14px }
  [data-booking] .field{ gap:6px }
  [data-booking] .field textarea{ min-height:76px }
  .bk-time > span{ height:44px }
  .bk-pick{ gap:14px }
  .bk-msg{ padding:16px }
}
