/* Terminbuchung - Komponente "tb-" (identisch in fraia.de und frairaum-management.de).
   Nutzt nur Tokens aus style.css :root und die vorhandenen Buttons .btn / .btn--teal.
   Weiße Lesefläche auf Creme-Bühne. */
.tb { max-width: 760px; margin: 0 auto; font-family: var(--font-sans); color: var(--text); }
.tb *, .tb *::before, .tb *::after { box-sizing: border-box; }
.tb-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 30px 32px 34px; box-shadow: 0 18px 44px rgba(16,18,20,0.07); }
.tb-step[hidden] { display: none; }
.tb-step { animation: tb-fade var(--t) ease; }
@keyframes tb-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .tb-step { animation: none; } .tb-skel i { animation: none !important; } }

.tb-kicker { font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--emerald); display: flex; align-items: center; gap: 9px; }
.tb-kicker b { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--emerald); color: var(--white); font-size: 12px; }
.tb .tb-h { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; color: var(--text); margin: 10px 0 6px; max-width: none; }
.tb .tb-h:focus { outline: none; }
.tb .tb-h:focus-visible { outline: 2px solid var(--emerald); outline-offset: 4px; border-radius: 4px; }
.tb-lead { font-size: 15px; line-height: 1.55; color: var(--muted); margin: 0 0 22px; }

/* Tage */
.tb-days { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 20px; padding: 0; list-style: none; }
.tb-day, .tb-time { font-family: var(--font-sans); cursor: pointer; background: var(--white); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); transition: border-color var(--t), background var(--t), color var(--t), box-shadow var(--t); }
.tb-day { min-width: 72px; min-height: 60px; padding: 8px 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.25; }
.tb-day span { display: block; }
.tb-day__wt { font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.tb-day__dt { font-size: 15px; font-weight: 600; }
.tb-day:hover, .tb-time:hover { border-color: var(--teal); background: rgba(52,182,170,0.08); }
.tb-day[aria-pressed="true"], .tb-time[aria-pressed="true"] { background: var(--emerald); border-color: var(--emerald); color: var(--white); box-shadow: 0 6px 18px rgba(15,95,89,0.25); }
.tb-day[aria-pressed="true"] .tb-day__wt { color: rgba(255,255,255,0.85); }
.tb-times-h { font-family: var(--font-mono); font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.tb-times { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 24px; padding: 0; list-style: none; }
.tb-time { min-width: 88px; min-height: 48px; padding: 10px 16px; font-family: var(--font-mono); font-size: 15px; font-weight: 700; }
/* Aktionen */
.tb-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; margin-top: 8px; }
.tb .btn { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; }
.tb .btn[disabled], .tb .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; box-shadow: none; }
.tb-link { font-family: var(--font-sans); font-size: 15px; font-weight: 600; color: var(--emerald); background: none; border: 0; padding: 0 6px; min-height: 44px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.tb-link:hover { color: var(--text); }
.tb a { color: var(--emerald); }
.tb a.btn--teal { color: #06231F; }
.tb a:hover { text-decoration: underline; }
.tb a.btn:hover { text-decoration: none; }
.tb button:focus-visible, .tb a:focus-visible, .tb input:focus-visible, .tb textarea:focus-visible { outline: 2px solid var(--emerald); outline-offset: 2px; }

/* Gewählter Termin in Schritt 2 */
.tb-picked { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 14px; background: rgba(15,95,89,0.06); border: 1px solid rgba(15,95,89,0.22); border-radius: var(--radius); padding: 10px 16px; margin-bottom: 22px; }
.tb-picked__lbl { display: block; font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--emerald); margin-bottom: 2px; }
.tb-picked__when { font-size: 15px; font-weight: 700; }

/* Formular */
.tb-form { display: flex; flex-direction: column; gap: 16px; }
.tb-fld label { display: block; font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 5px; }
.tb-fld input[type="text"], .tb-fld input[type="email"], .tb-fld textarea { width: 100%; font-family: inherit; font-size: 16px; color: var(--text); background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 11px 13px; min-height: 48px; transition: border-color var(--t), box-shadow var(--t); }
.tb-fld textarea { min-height: 110px; resize: vertical; }
.tb-fld input:focus, .tb-fld textarea:focus { outline: none; border-color: var(--emerald); box-shadow: 0 0 0 3px rgba(15,95,89,0.15); }
.tb-fld [aria-invalid="true"] { border-color: #A15B4E; box-shadow: 0 0 0 3px rgba(161,91,78,0.15); }
.tb-err { display: block; color: #A15B4E; font-size: 13.5px; font-weight: 600; margin-top: 5px; }
.tb-err:empty { display: none; }
.tb-opt { text-transform: none; letter-spacing: 0; font-weight: 500; }
.tb-hinweis { font-size: 13px; line-height: 1.5; color: var(--muted); margin: 0; }
.tb-hinweis a { color: inherit; text-decoration: underline; }
.tb-hp { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; opacity: 0; }
.tb-status { font-size: 14.5px; line-height: 1.5; color: var(--muted); margin: 0; }
.tb-status:empty { display: none; }
.tb-status.is-err { color: #A15B4E; font-weight: 600; }
.tb-status.is-info { color: var(--text); }

/* Bestätigung */
.tb-done { border: 1px solid var(--emerald); background: rgba(15,95,89,0.07); border-radius: var(--radius-lg); padding: 22px 24px; margin: 18px 0 8px; }
.tb-done__when { font-size: 20px; font-weight: 700; margin: 0 0 4px; }
.tb-done__dur { font-size: 14.5px; color: var(--muted); margin: 0; }
.tb-hint { font-size: 15px; line-height: 1.55; color: var(--text); margin: 14px 0 0; }
.tb-hint--leise { font-size: 14px; color: var(--muted); margin-top: 8px; }
.tb-statisch { font-size: 15px; line-height: 1.6; color: var(--text); margin: 0; }

/* Ausweichtext und leerer Zustand */
.tb-fallback { border: 1px solid var(--border); background: var(--stone); border-radius: var(--radius); padding: 18px 20px; font-size: 15px; line-height: 1.6; color: var(--text); }
.tb-fallback p { margin: 0 0 10px; }
.tb-fallback p:last-child { margin-bottom: 0; }

/* Skelett */
.tb-skel { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 14px; }
.tb-skel i { display: block; height: 52px; width: 84px; border-radius: var(--radius); background: var(--stone-2); animation: tb-pulse 1.3s ease-in-out infinite; }
.tb-skel i:nth-child(2n) { animation-delay: .15s; }
.tb-skel i:nth-child(3n) { animation-delay: .3s; }
@keyframes tb-pulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }

.tb-sr { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 560px) {
  .tb-card { padding: 22px 16px 24px; }
  .tb .tb-h { font-size: 21px; }
  .tb-day { min-width: 64px; }
  .tb-actions .btn { width: 100%; }
}

/* Handy: Tage als eine wischbare Leiste, rechter Rand-Verlauf als Andeutung */
@media (max-width: 600px) {
  .tb-days { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding: 6px 32px 10px 4px; margin: -6px 0 10px; -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent); }
  .tb-days::-webkit-scrollbar { display: none; }
  .tb-days > li { flex: 0 0 auto; scroll-snap-align: start; }
  .tb-day[aria-pressed="true"] { box-shadow: 0 3px 8px rgba(15,95,89,0.22); }
}

/* Buchungsseite: dunkles Band oben (links Text und Person), rechts die weiße Karte, die über die
   Unterkante des Bands in den hellen Steingrund ragt. Das Band ist ein eigenes Element (.tb-band),
   damit die Karte in der Höhe frei wachsen kann, ohne dass ein fester Überlapp-Wert nötig ist. */
.tb-hero { background: var(--stone); padding: 116px 0 56px; overflow-x: clip; overflow-y: visible; }
.tb-hero__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); grid-template-rows: auto auto 1fr; column-gap: clamp(32px, 4.5vw, 72px); row-gap: 0; align-items: start; position: relative; }
.tb-band { grid-column: 1 / -1; grid-row: 1; align-self: stretch; margin: -116px 0 -6px; background: var(--ink); box-shadow: 0 0 0 100vmax var(--ink); clip-path: inset(0 -100vmax); }
.tb-hero__kopf, .tb-person { position: relative; z-index: 1; }
.tb-hero__kopf { grid-column: 1; grid-row: 1; padding-bottom: 30px; }
.tb-hero__buchung { grid-column: 2; grid-row: 1 / span 3; min-width: 0; position: relative; z-index: 2; }
.tb-person { grid-column: 1; grid-row: 2; align-self: start; }
.tb-hero h1 { margin: 14px 0 18px; }
.tb-hero .tb-hero__sub { font-size: 18px; margin-bottom: 22px; max-width: 480px; }
.tb-hero__buchung .tb { max-width: none; }
.tb-hero #terminbuchung { padding-bottom: 0; }
.tb-hero__buchung .tb-card { box-shadow: 0 30px 70px rgba(16,18,20,0.28), 0 6px 16px rgba(16,18,20,0.12); }
.tb-hero__buchung .tb-fallback { margin: 0; }
.tb-nb { white-space: nowrap; }
.tb-fakten { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.tb-fakten li { display: flex; align-items: center; gap: 12px; font-size: 16.5px; font-weight: 500; color: #E9ECEE; line-height: 1.3; }
.tb-fakten svg { flex: none; width: 22px; height: 22px; color: var(--teal-bright); }
.tb-person { display: flex; align-items: center; gap: 16px; margin-top: 44px; }
.tb-person__foto { display: block; width: 68px; height: 68px; border-radius: 50%; object-fit: cover; border: 2px solid var(--emerald); background: var(--stone-2); }
.tb-person__text { margin: 0; display: flex; flex-direction: column; gap: 3px; font-size: 14.5px; line-height: 1.4; color: var(--muted); }
.tb-person__text strong { font-size: 16.5px; font-weight: 600; color: var(--text); }

/* Kontaktwege (Telefon, Formular) unter dem Personenblock. Die frühere Liste
   "Was Sie erwartet" ist am 13.10.2026 entfallen (Floskeln). */
.tb-erwartet { grid-column: 1; grid-row: 3; align-self: start; position: relative; z-index: 1; margin-top: 34px; padding-top: 26px; border-top: 1px solid var(--border); }
/* Kleine Ueberschrift, genutzt auf kontakt.html ("Direkt erreichbar") */
.tb-erwartet__h { margin: 0 0 14px; font-family: var(--font-mono); font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--emerald); }
.tb-kontakt { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; }
.tb-kontakt__e { display: flex; align-items: flex-start; gap: 14px; }
.tb-kontakt__ic { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--white); border: 1px solid var(--border); color: var(--emerald); transition: background .2s, color .2s, border-color .2s; }
.tb-kontakt__ic svg { width: 20px; height: 20px; }
.tb-kontakt__t { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding-top: 2px; }
.tb-kontakt__l { font-size: 13.5px; line-height: 1.35; color: var(--muted); }
/* Doppelte Klasse, damit die globale Tipp-Regel fuer tel:-Links (inline-block + Polster) hier nicht greift */
.tb-kontakt .tb-kontakt__w { display: block; padding: 0; min-height: 0; font-size: 16.5px; font-weight: 600; line-height: 1.35; color: var(--emerald); text-decoration: none; white-space: nowrap; width: fit-content; border-radius: 4px; }
.tb-kontakt .tb-kontakt__w:hover { text-decoration: underline; text-underline-offset: 3px; }
.tb-kontakt .tb-kontakt__w:focus-visible { outline: 2px solid var(--emerald); outline-offset: 3px; }
.tb-kontakt__e:has(.tb-kontakt__w:hover) .tb-kontakt__ic { background: var(--emerald); border-color: var(--emerald); color: var(--white); }
@media (max-width: 600px) { .tb-kontakt .tb-kontakt__w { padding: 5px 0; } .tb-kontakt__t { gap: 0; } }
@media (max-width: 440px) { .tb-kontakt { grid-template-columns: 1fr; } }


@media (max-width: 959px) {
  .tb-hero { padding: 92px 0 96px; }
  .tb-hero__grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
  .tb-band { grid-column: 1; grid-row: 1; margin: -92px 0 0; padding-bottom: 0; }
  .tb-hero__kopf, .tb-hero__buchung, .tb-person { grid-column: 1; }
  .tb-hero__kopf { grid-row: 1; padding-bottom: 64px; }
  .tb-hero__buchung { grid-row: 2; margin-top: -40px; }
  /* Platz für das geladene Widget vorhalten, sonst springt die Seite (CLS) */
  .tb-hero #terminbuchung { min-height: 470px; }
  .tb-band { margin-bottom: 0; }
  .tb-person { grid-row: 3; margin-top: 30px; }
  .tb-erwartet { grid-row: 4; margin-top: 24px; padding-top: 22px; }
  .tb-hero .tb-hero__sub { font-size: 16.5px; margin-bottom: 16px; max-width: none; }
  .tb-fakten { flex-direction: row; flex-wrap: wrap; gap: 8px; }
  .tb-fakten li { gap: 7px; font-size: 13.5px; padding: 6px 12px 6px 9px; border: 1px solid rgba(255,255,255,0.2); border-radius: 100px; }
  .tb-fakten svg { width: 17px; height: 17px; }
}
@media (max-width: 560px) {
  .tb-hero h1 { margin: 10px 0 12px; }
}

/* Handy: feste Elemente (Zurück-Leiste unten links, Chat-Knopf unten rechts, zusammen bis 78 px
   Höhe über dem Rand, gemessen bei 390 px) dürfen den Buchen-Knopf nicht verdecken:
   78 px + 16 px Luft unterhalb der Komponente und beim Scrollen zum Knopf. */
@media (max-width: 600px) {
  #terminbuchung { padding-bottom: 94px; }
  .tb-hero #terminbuchung { padding-bottom: 0; }
  .tb-hero { padding-bottom: 110px; }
  #terminbuchung .tb-actions .btn { scroll-margin-bottom: 94px; }
}
