/* ==========================================================================
   Terminbuchung – öffentliche Seite (/termin) und Verwaltung (/admin/termine)
   Ergänzt app.css nur dort, wo die Bausteine nicht reichen. Präfix „bk-“.
   Ruhige Schrittfolge: Fortschritt oben, große Kacheln, eine Hauptaktion.
   ========================================================================== */

/* ── Kopf der Buchungsseite ─────────────────────────────────────────────── */
.bk-hero { max-width: 64ch; margin: 6px 0 30px; }
.bk-eyebrow { margin: 0 0 10px; font-size: .86rem; font-weight: 620; color: var(--signal); font-stretch: 112%; }
.bk-hero h1 { font-size: clamp(1.85rem, 1.25rem + 2.1vw, 2.75rem); font-weight: 620; font-stretch: 122%; letter-spacing: -0.022em; line-height: 1.08; margin: 0 0 14px; }
.bk-promise { margin: 0 0 8px; font-size: 1.14rem; font-weight: 580; color: var(--ink); }
.bk-lead { margin: 0; color: var(--muted); }

.bk-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 30px; align-items: start; }
.bk-card { background: var(--sheet); border: 1px solid var(--rule); border-radius: 14px; padding: 24px 28px 28px; scroll-margin-top: 18px; min-width: 0; }

/* ── Fortschritt (echte Reihenfolge: Tag, Uhrzeit, Angaben) ─────────────── */
.bk-steps { list-style: none; margin: 0 0 26px; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.bk-steps li { padding-top: 11px; border-top: 3px solid var(--rule); color: var(--muted); font-size: .9rem; min-width: 0; }
.bk-steps li.done { border-top-color: var(--ok); color: var(--ink-2); }
.bk-steps li.current { border-top-color: var(--signal); color: var(--ink); }
.bk-step { display: flex; gap: 9px; align-items: flex-start; color: inherit; text-decoration: none; min-width: 0; }
a.bk-step:hover .bk-step-label { color: var(--signal); }
.bk-num { flex: none; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--rule-strong); background: var(--sheet); font-size: .78rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.bk-num .ico { width: 14px; height: 14px; stroke-width: 2.6; }
.current .bk-num { background: var(--signal); border-color: var(--signal); color: var(--on-signal); }
.done .bk-num { background: var(--ok-wash); border-color: transparent; color: var(--ok); }
.bk-step-label { display: grid; line-height: 1.3; font-weight: 620; padding-top: 2px; min-width: 0; }
.bk-step-label small { font-weight: 460; color: var(--muted); font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Felder in zweispaltigen Rastern nicht strecken, wenn das Nachbarfeld einen Hinweis hat */
.fields > .field, .fields-3 > .field { align-content: start; }

/* ── Kartenkopf, Hinweise ───────────────────────────────────────────────── */
.bk-head h2 { font-size: 1.36rem; margin: 0 0 4px; }
.bk-head p { margin: 0 0 20px; color: var(--muted); }
.bk-label { margin: 0 0 9px; font-size: .84rem; font-weight: 600; font-stretch: 100%; letter-spacing: 0; color: var(--muted); }
.bk-note { display: flex; gap: 9px; align-items: flex-start; margin: 22px 0 0; padding-top: 16px; border-top: 1px solid var(--rule); font-size: .86rem; color: var(--muted); max-width: none; }
.bk-note .ico { margin-top: 2px; color: var(--idle); }
.bk-note-inline { font-size: .86rem; color: var(--muted); }
.bk-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--rule); }
.bk-foot .btn-quiet { margin-left: -10px; }
.bk-empty { text-align: center; padding: 26px 10px 18px; color: var(--muted); }
.bk-empty > .ico { width: 30px; height: 30px; color: var(--idle); margin-bottom: 8px; }
.bk-empty h2, .bk-empty h3 { color: var(--ink); margin-bottom: 6px; }
.bk-empty h2 { font-size: 1.3rem; }
.bk-empty p { margin: 0 auto 16px; max-width: 46ch; }
.bk-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 4px; }
.bk-empty .bk-actions { justify-content: center; }

/* ── Schritt 1: Tage ────────────────────────────────────────────────────── */
.bk-week + .bk-week { margin-top: 20px; }
.bk-days { display: grid; grid-template-columns: repeat(var(--cols, 5), minmax(0, 1fr)); gap: 8px; }
.bk-day {
  display: flex; flex-direction: column; align-items: flex-start; min-height: 104px; padding: 11px 12px 10px;
  border: 1px solid var(--rule-strong); border-radius: 11px; background: var(--sheet); color: var(--ink); text-decoration: none;
  transition: border-color .15s, background .15s, box-shadow .15s, transform .12s;
}
.bk-day-wd { font-size: .8rem; font-weight: 600; color: var(--muted); }
.bk-day-date { margin-top: 2px; font-size: 1.6rem; font-weight: 640; font-stretch: 116%; line-height: 1.05; font-variant-numeric: tabular-nums; }
.bk-day-mon { font-size: .86rem; color: var(--ink-2); }
.bk-day-free { margin-top: auto; padding-top: 6px; font-size: .8rem; font-weight: 640; color: var(--ok); }
a.bk-day:hover { border-color: var(--signal); background: var(--signal-wash); box-shadow: 0 6px 16px -10px color-mix(in srgb, var(--signal) 70%, transparent); }
a.bk-day:hover .bk-day-date { color: var(--signal-ink); }
a.bk-day:active, .bk-time:active { transform: translateY(1px); }
.bk-day.is-off { background: transparent; border-style: dashed; border-color: var(--rule); color: var(--muted); cursor: default; }
.bk-day.is-off .bk-day-date, .bk-day.is-off .bk-day-mon { color: var(--muted); }
.bk-day.is-off .bk-day-free { color: var(--muted); font-weight: 500; }

/* ── Schritt 2: Uhrzeiten ───────────────────────────────────────────────── */
.bk-daypart + .bk-daypart { margin-top: 20px; }
.bk-times { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.bk-time {
  display: grid; place-items: center; min-height: 54px; border: 1px solid var(--rule-strong); border-radius: 11px; background: var(--sheet);
  color: var(--ink); text-decoration: none; font-size: 1.12rem; font-weight: 620; font-stretch: 108%; font-variant-numeric: tabular-nums;
  transition: border-color .15s, background .15s, color .15s, transform .12s;
}
.bk-time:hover { border-color: var(--signal); background: var(--signal-wash); color: var(--signal-ink); }

/* ── Schritt 3: Angaben ─────────────────────────────────────────────────── */
.bk-chosen { display: flex; align-items: center; gap: 14px; padding: 12px 16px 12px 12px; margin-bottom: 22px; border-radius: 11px; background: var(--signal-wash); }
.bk-chosen .glyph { background: var(--sheet); }
.bk-chosen > div { flex: 1; min-width: 0; display: grid; }
.bk-chosen strong { font-weight: 640; }
.bk-chosen span { font-size: .9rem; color: var(--ink-2); }
.bk-chosen a { font-weight: 600; font-size: .92rem; }
.bk-hp { display: none !important; }
.bk-captcha { margin-top: 2px; }
.bk-captcha input { max-width: 150px; }
.bk-consent { margin-top: 4px; }
.bk-consent + .error { margin: -6px 0 12px 27px; font-size: .85rem; color: var(--bad); }
.bk-form .btn-block { margin-top: 8px; }
.bk-form textarea { min-height: 84px; }
.bk-reassure { display: flex; gap: 8px; align-items: flex-start; justify-content: center; margin: 12px auto 0; font-size: .86rem; color: var(--muted); text-align: left; max-width: 52ch; }
.bk-reassure .ico { color: var(--ok); margin-top: 2px; }

/* ── Seitenspalte ───────────────────────────────────────────────────────── */
.bk-aside { display: grid; gap: 22px; position: sticky; top: 22px; padding-top: 4px; }
.bk-person { display: flex; gap: 12px; align-items: center; }
.bk-person > div { display: grid; line-height: 1.35; }
.bk-person strong { font-weight: 640; }
.bk-person span { font-size: .87rem; color: var(--muted); }
.bk-avatar { flex: none; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--paper); font-weight: 700; font-stretch: 114%; letter-spacing: .02em; }
.bk-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 15px; }
.bk-facts li { display: flex; gap: 12px; align-items: flex-start; }
.bk-facts .ico { flex: none; margin-top: 3px; color: var(--signal); }
.bk-facts strong { display: block; font-size: .94rem; font-weight: 620; }
.bk-facts span { display: block; font-size: .86rem; color: var(--muted); line-height: 1.45; }
.bk-direct { display: grid; gap: 8px; padding-top: 18px; border-top: 1px solid var(--rule); }
.bk-direct p { margin: 0 0 2px; font-weight: 600; font-size: .92rem; }

/* ── Ergebnisseiten (gebucht, absagen) ──────────────────────────────────── */
.bk-result { max-width: 640px; margin: 4px auto 0; background: var(--sheet); border: 1px solid var(--rule); border-radius: 14px; padding: 26px 34px 30px; }
.bk-result .bk-steps { margin-bottom: 30px; }
.bk-result-mark { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 18px; background: var(--ok-wash); color: var(--ok); }
.bk-result-mark .ico { width: 28px; height: 28px; }
.bk-result-mark.warn { background: var(--warn-wash); color: var(--warn); }
.bk-result-mark.idle { background: var(--sheet-2); color: var(--muted); }
.bk-result h1 { font-size: clamp(1.55rem, 1.2rem + 1.2vw, 2rem); font-stretch: 120%; font-weight: 620; margin: 0 0 8px; }
.bk-result .lead { font-size: 1.05rem; color: var(--ink-2); }
.bk-summary { margin: 18px 0 20px; padding: 16px 18px; border-radius: 11px; background: var(--sheet-2); border: 1px solid var(--rule); }
.bk-result .notice { margin-bottom: 20px; }
.bk-small { margin: 18px 0 0; font-size: .88rem; color: var(--muted); }

/* ── Verwaltung ─────────────────────────────────────────────────────────── */
.bk-filter { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; margin: 0 0 18px; border: 1px solid var(--rule); border-radius: 9px; background: var(--sheet-2); }
.bk-filter a { padding: 6px 13px; border-radius: 6px; color: var(--ink-2); text-decoration: none; font-weight: 560; font-size: .9rem; }
.bk-filter a:hover { color: var(--ink); }
.bk-filter a[aria-current="page"] { background: var(--sheet); color: var(--ink); box-shadow: 0 1px 2px rgb(19 33 59 / .08), inset 0 0 0 1px var(--rule); }
.bk-filter .n { margin-left: 6px; color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 500; }
.bk-groups { display: grid; gap: 18px; }
.bk-when { flex: none; width: 66px; display: grid; line-height: 1.25; font-variant-numeric: tabular-nums; }
.bk-when strong { font-size: 1.1rem; font-weight: 650; font-stretch: 110%; }
.bk-when small { font-size: .8rem; color: var(--muted); }
.rows > li.is-past .bk-when, .rows > li.is-past .row-title { color: var(--muted); }
.bk-msg { margin: 5px 0 0; font-size: .88rem; color: var(--ink-2); max-width: 80ch; }
.bk-tags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.bk-tags .tag .ico { width: 13px; height: 13px; }
.bk-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.bk-chip { position: relative; display: inline-flex; }
.bk-chip input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.bk-chip span { display: inline-grid; place-items: center; min-width: 50px; height: 38px; padding: 0 12px; border: 1px solid var(--rule-strong); border-radius: 8px; font-weight: 600; font-size: .9rem; color: var(--ink-2); background: var(--sheet); transition: background .15s, border-color .15s, color .15s; }
.bk-chip input:checked + span { background: var(--signal-wash); border-color: var(--signal); color: var(--signal-ink); }
.bk-chip input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.bk-period { display: grid; line-height: 1.35; }
.bk-period small { color: var(--muted); font-size: .86rem; }
.bk-quote { margin: 0; padding: 10px 14px; border-left: 3px solid var(--rule-strong); background: var(--sheet-2); border-radius: 0 8px 8px 0; white-space: pre-line; overflow-wrap: anywhere; }

/* ── Responsiv ──────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .bk-layout { grid-template-columns: minmax(0, 1fr); }
  .bk-aside { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .bk-aside .bk-person { grid-column: 1 / -1; }
  .bk-direct { border-top: 0; padding-top: 0; }
}
@media (max-width: 640px) {
  .bk-hero { margin-bottom: 22px; }
  .bk-promise { font-size: 1.04rem; }
  .bk-card { padding: 18px 16px 20px; border-radius: 12px; margin: 0 -6px; }
  .bk-steps { gap: 6px; margin-bottom: 20px; }
  .bk-steps li { font-size: .84rem; }
  .bk-step { gap: 7px; }
  .bk-step-label small { display: none; }
  .bk-days { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
  .bk-day { grid-column-start: auto !important; min-height: 92px; padding: 9px 10px; }
  .bk-day-date { font-size: 1.4rem; }
  .bk-times { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bk-chosen { align-items: flex-start; }
  .bk-aside { grid-template-columns: minmax(0, 1fr); }
  .bk-direct { border-top: 1px solid var(--rule); padding-top: 18px; }
  .bk-result { padding: 20px 18px 24px; margin: 0 -6px; }
  .bk-when { width: 58px; }
  .bk-groups .rows > li { flex-wrap: wrap; align-items: flex-start; }
  .bk-groups .row-main { flex: 1 1 calc(100% - 110px); }
  .bk-groups .rows > li > .ico { align-self: center; }
  .bk-groups .bk-tags { order: 5; flex: 1 1 100%; padding-left: 72px; justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .bk-day, .bk-time { transition: none; }
}
