/**
 * Terminbuchung – schlichte Gestaltung, die Farben, Schrift und Rundung der Website übernimmt.
 * Anpassbar über Variablen, z. B. im Template:  .tb { --tb-akzent: #2a69b8; --tb-radius: 8px; }
 * Vorrang hat das Template: Werte von basis (--ui-*) werden genutzt, wenn vorhanden.
 * @copyright (C) 2026 Jomluna
 * @license   GNU General Public License version 2 or later
 */
.tb {
  --tb-akzent: var(--ui-color-action, #1f5fa8);
  --tb-auf-akzent: var(--ui-color-on-action, #ffffff);
  --tb-text: var(--ui-color-text, inherit);
  --tb-gedaempft: var(--ui-color-text-muted, #5c6670);
  --tb-rand: var(--ui-color-border-strong, #c4ccd4);
  --tb-flaeche: var(--ui-color-bg, #ffffff);
  --tb-radius: var(--ui-radius-sm, 6px);
  --tb-pille: var(--ui-radius-pill, 999px);
  container-type: inline-size;
  color: var(--tb-text);
}

.tb [hidden] { display: none !important; }

.tb__intro > :first-child { margin-top: 0; }
.tb__status { margin: 0 0 1rem; color: var(--tb-gedaempft); }
.tb__status a { color: inherit; text-decoration: underline; }
.tb__frage { margin: 0 0 0.75rem; font-weight: 600; }
.tb__schritt + .tb__schritt { margin-top: 1.5rem; }

/* Tage und Uhrzeiten als Knöpfe; gewählt = gefüllt */
.tb__tage, .tb__zeiten { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tb__tag, .tb__zeit, .tb__aendern {
  font: inherit;
  color: var(--tb-text);
  background: var(--tb-flaeche);
  border: 1px solid var(--tb-rand);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}
.tb__tag {
  display: grid;
  justify-items: center;
  min-width: 4.5rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--tb-radius);
  line-height: 1.25;
}
.tb__tag-kurz { font-size: 0.8rem; color: var(--tb-gedaempft); text-transform: uppercase; letter-spacing: 0.04em; }
.tb__tag-datum { font-weight: 600; }
.tb__zeit { min-width: 4.5rem; min-height: 2.75rem; padding: 0.5rem 1rem; border-radius: var(--tb-pille); font-variant-numeric: tabular-nums; }
.tb__tag:hover, .tb__zeit:hover { border-color: var(--tb-akzent); }
.tb__tag[aria-pressed="true"], .tb__zeit[aria-pressed="true"] { border-color: var(--tb-akzent); background: var(--tb-akzent); color: var(--tb-auf-akzent); }
.tb__tag[aria-pressed="true"] .tb__tag-kurz { color: inherit; }
.tb__tag:focus-visible, .tb__zeit:focus-visible, .tb__aendern:focus-visible { outline: 3px solid var(--tb-akzent); outline-offset: 2px; }

/* Angaben */
.tb__formular { margin-top: 1.5rem; }
.tb__auswahl { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; padding: 0.875rem 1rem; border: 1px solid var(--tb-rand); border-radius: var(--tb-radius); }
.tb__auswahl p { margin: 0; }
.tb__auswahl-label { display: block; color: var(--tb-gedaempft); font-size: 0.875rem; }
.tb__aendern { padding: 0.35rem 0.9rem; border-radius: var(--tb-pille); font-size: 0.875rem; }
.tb__arten { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; margin: 1.25rem 0 0; padding: 0; border: 0; }
.tb__arten legend { margin-bottom: 0.5rem; padding: 0; font-weight: 600; }
.tb__art { display: inline-flex; align-items: center; gap: 0.5rem; cursor: pointer; }
.tb__art input { width: 1.1rem; height: 1.1rem; margin: 0; accent-color: var(--tb-akzent); }
.tb__felder { display: grid; gap: 1rem; margin-top: 1.25rem; }
/* Zwei Spalten nur, wenn der Kasten selbst breit genug ist (auch in schmalen Seitenspalten richtig) */
@container (min-width: 34rem) { .tb__felder { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tb__feld--breit { grid-column: 1 / -1; } }
.tb__feld label { display: block; margin-bottom: 0.35rem; font-weight: 600; }
.tb__optional { color: var(--tb-gedaempft); font-weight: 400; }
.tb__feld input, .tb__feld textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 2.75rem;
  padding: 0.6rem 0.8rem;
  font: inherit;
  color: var(--tb-text);
  background: var(--tb-flaeche);
  border: 1px solid var(--tb-rand);
  border-radius: var(--tb-radius);
}
.tb__feld input:focus, .tb__feld textarea:focus { outline: none; border-color: var(--tb-akzent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tb-akzent) 30%, transparent); }
.tb__feld [aria-invalid="true"] { border-color: #b3261e; }
.tb__falle { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.tb__datenschutz { margin: 1rem 0 0; color: var(--tb-gedaempft); font-size: 0.875rem; }
.tb__datenschutz a { color: inherit; text-decoration: underline; }
.tb__fehler { margin: 1rem 0 0; color: #b3261e; font-weight: 600; }
.tb__knopf { margin-top: 1.25rem; }
.tb__knopf:not(.ww-btn) {
  padding: 0.75rem 1.5rem;
  font: inherit;
  font-weight: 600;
  color: var(--tb-auf-akzent);
  background: var(--tb-akzent);
  border: 0;
  border-radius: var(--tb-pille);
  cursor: pointer;
}
.tb__knopf[disabled] { opacity: 0.7; cursor: progress; }
.tb__danke { padding: 1.25rem; border: 1px solid var(--tb-akzent); border-radius: var(--tb-radius); font-weight: 600; }
.tb__danke:focus { outline: none; }

/* Absage-Seite */
.tb-absage { max-width: 40rem; padding-block: clamp(2rem, 1.5rem + 3vw, 4rem); }
.tb-absage__termin { padding: 1rem; border: 1px solid var(--ui-color-border-strong, #c4ccd4); border-radius: var(--ui-radius-sm, 6px); }

@media (prefers-reduced-motion: reduce) {
  .tb__tag, .tb__zeit, .tb__aendern { transition: none; }
}
