/* Online-Termine von webbach. Gemeinsam für alle Betriebe.
   Die Farben --akzent, --akzent-text und --bg setzt jeder Betrieb in /termin/<betrieb>/farben.css.
   Keine Schriften von aussen: Systemschrift. Kein JavaScript. */

:root {
  --akzent: #1F5F8B;
  --akzent-text: #FFFFFF;
  --bg: #F7F5F2;
  --karte: #FFFFFF;
  --text: #1E1B19;
  --leise: #5C5550;
  --linie: #DDD6D0;
  --feld-rand: #807770;
  --warnung: #A3261C;
  --warnung-text: #FFFFFF;
  --warnung-bg: #FCEDEB;
  --hinweis-bg: #FFF6DB;
  --hinweis-rand: #C9A227;
  --erfolg: #1E7A46;
  --zu: #EFEBE7;
  --zu-text: #6E6660;
  --fokus: #1E1B19;
  --schatten: 0 1px 2px rgb(0 0 0 / 0.06), 0 2px 8px rgb(0 0 0 / 0.05);
  --rund: 12px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --karte: #1E2326;
    --text: #F2EFEC;
    --leise: #B9B2AC;
    --linie: #394045;
    --feld-rand: #8D959A;
    --warnung: #FF9B91;
    --warnung-text: #1B0E0C;
    --warnung-bg: #3A1E1B;
    --hinweis-bg: #33301F;
    --hinweis-rand: #B39A3E;
    --erfolg: #7FD7A2;
    --zu: #23292C;
    --zu-text: #A49D97;
    --fokus: #F2EFEC;
    --schatten: none;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; padding-block: 1.25rem 3rem; }

.breite { width: min(100% - 2rem, 44rem); margin-inline: auto; }
.breite--schmal { width: min(100% - 2rem, 32rem); }
.verwaltung .breite { width: min(100% - 2rem, 52rem); }

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.6rem; }
h1 { font-size: clamp(1.6rem, 1.3rem + 1.4vw, 2.1rem); letter-spacing: -0.01em; }
h2 { font-size: 1.25rem; margin-top: 2rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 1rem; }

a { color: var(--akzent); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--fokus); outline-offset: 2px; border-radius: 4px; }

.unsichtbar {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.springen { position: absolute; left: -999px; top: 0.5rem; padding: 0.5rem 1rem; background: var(--karte); z-index: 10; }
.springen:focus { left: 0.5rem; }

.leise { color: var(--leise); }
.nowrap { white-space: nowrap; }
.klein { font-size: 0.9rem; }

/* ---------------- Kopf und Fuss */

.demo {
  margin: 0; padding: 0.6rem 1rem; text-align: center; font-size: 0.9rem;
  background: var(--hinweis-bg); border-bottom: 1px solid var(--hinweis-rand);
}

.kopf { background: var(--karte); border-bottom: 1px solid var(--linie); }
.kopf__innen { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; padding-block: 0.8rem; }
.kopf__marke { margin: 0; display: flex; flex-direction: column; }
.kopf__name { font-weight: 700; font-size: 1.15rem; color: var(--text); text-decoration: none; }
a.kopf__name { display: inline-flex; align-items: center; min-height: 44px; margin-block: -0.5rem -0.3rem; }
a.kopf__name:hover { text-decoration: underline; }
.kopf__zusatz { font-size: 0.85rem; color: var(--leise); }

.kopf__innen { flex-wrap: nowrap; }
.menue { padding-bottom: 0.75rem; }
.menue ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.4rem; margin: 0; padding: 0; list-style: none; }
.menue a {
  display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 0.5rem;
  border: 1px solid var(--linie); border-radius: 10px; text-align: center;
  color: var(--text); text-decoration: none; font-size: 0.95rem;
}
.menue a:hover { border-color: var(--akzent); }
.menue a[aria-current="page"] { background: var(--akzent); border-color: var(--akzent); color: var(--akzent-text); font-weight: 600; }
.abmelden { margin: 0; flex: none; }

@media (min-width: 40em) {
  .menue ul { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.fuss { border-top: 1px solid var(--linie); padding-block: 1.25rem 2rem; color: var(--leise); font-size: 0.9rem; }
.fuss p { margin: 0 0 0.4rem; }
.fuss a { color: inherit; }
.fuss__klein { font-size: 0.85rem; }

/* ---------------- Schritte */

.schritte { display: flex; gap: 0.5rem; margin: 0 0 1.25rem; padding: 0; list-style: none; font-size: 0.85rem; color: var(--leise); }
.schritte li { flex: 1; padding-top: 0.45rem; border-top: 4px solid var(--linie); }
.schritte li.erledigt { border-top-color: var(--akzent); }
.schritte li[aria-current] { border-top-color: var(--akzent); color: var(--text); font-weight: 600; }

.einleitung { font-size: 1.1rem; }

/* ---------------- Auswahl der Behandlung */

.wahlen { display: grid; gap: 0.75rem; margin: 0 0 1.5rem; padding: 0; list-style: none; }
.wahl {
  position: relative; display: grid; gap: 0.15rem; padding: 1rem 2.75rem 1rem 1.1rem;
  background: var(--karte); border: 1px solid var(--linie); border-radius: var(--rund);
  color: var(--text); text-decoration: none; box-shadow: var(--schatten); min-height: 44px;
}
.wahl:hover { border-color: var(--akzent); }
.wahl__name { font-weight: 650; font-size: 1.08rem; color: var(--akzent); }
.wahl__info { font-size: 0.95rem; font-weight: 600; }
.wahl__text { font-size: 0.92rem; color: var(--leise); }
.wahl__pfeil { position: absolute; right: 1rem; top: 50%; translate: 0 -50%; font-size: 1.6rem; color: var(--akzent); }

/* ---------------- Gewählte Behandlung */

.gewaehlt {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.6rem 1rem; margin-bottom: 1.25rem; background: var(--karte);
  border: 1px solid var(--linie); border-radius: var(--rund);
}
.gewaehlt p { margin: 0; }
.gewaehlt__was { font-weight: 650; display: block; }
.gewaehlt__info { display: block; font-size: 0.95rem; }
.gewaehlt a { display: inline-flex; align-items: center; min-height: 44px; }

/* ---------------- Tage und Zeiten */

.woche__titel { margin-top: 0.5rem; font-size: 1rem; color: var(--leise); font-weight: 600; }
.tage {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0.35rem;
  margin: 0 0 0.5rem; padding: 0; list-style: none;
}
.tag {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.1rem;
  min-height: 4.5rem; padding: 0.4rem 0.1rem; border-radius: 10px; text-align: center;
  background: var(--karte); border: 1px solid var(--linie); color: var(--text); text-decoration: none;
}
a.tag:hover { border-color: var(--akzent); }
a.tag[aria-current] { background: var(--akzent); border-color: var(--akzent); color: var(--akzent-text); }
.tag--zu { background: var(--zu); color: var(--zu-text); border-color: transparent; }
.tag__name { font-size: 0.8rem; }
.tag__zahl { font-size: 1.15rem; font-weight: 700; line-height: 1.1; }
.tag__status { font-size: 0.72rem; line-height: 1.1; }

@media (max-width: 22em) {
  .tag__status { display: none; }
  .tag { min-height: 3.5rem; }
}

.woche__nav { display: flex; justify-content: space-between; gap: 0.5rem; margin-bottom: 1.5rem; }
.wochenwahl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; margin-bottom: 0.5rem; }
.wochenwahl .blaettern { justify-content: center; padding: 0 0.5rem; }
.blaettern {
  display: inline-flex; align-items: center; gap: 0.35rem; min-height: 44px; padding: 0 0.9rem;
  border: 1px solid var(--linie); border-radius: 999px; background: var(--karte);
  color: var(--text); text-decoration: none; font-size: 0.95rem;
}
.blaettern:hover { border-color: var(--akzent); }

.zeiten__titel { margin-top: 0; }
.zeiten__gruppe { margin: 1.1rem 0 0.5rem; font-size: 0.9rem; color: var(--leise); font-weight: 600; }
.zeiten {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(5.2rem, 1fr)); gap: 0.5rem;
  margin: 0; padding: 0; list-style: none;
}
.zeit {
  display: flex; align-items: center; justify-content: center; min-height: 48px;
  border: 2px solid var(--akzent); border-radius: 10px; background: var(--karte);
  color: var(--akzent); font-weight: 700; font-size: 1.05rem; text-decoration: none;
  font-variant-numeric: tabular-nums;
}
.zeit:hover { background: var(--akzent); color: var(--akzent-text); }

/* ---------------- Zu einem Datum springen */

.springen-form { margin: 0.25rem 0 1.5rem; }
.springen-form label { font-weight: 600; font-size: 0.95rem; }
.springen-form__zeile { display: flex; gap: 0.5rem; }
.springen-form__zeile input { flex: 1; min-width: 0; }
.springen-form__zeile .knopf { flex: none; }

/* ---------------- Ort wählen */

.wahlgruppe { border: 0; padding: 0; margin: 0; display: grid; gap: 0.25rem; }
.wahlgruppe legend { font-weight: 600; padding: 0; margin-bottom: 0.35rem; }
.wahlgruppe .feld--wahl {
  background: var(--karte); border: 1.5px solid var(--feld-rand); border-radius: 8px;
  padding: 0 0.75rem; min-height: 48px;
}
.wahlgruppe .feld--wahl:has(input:checked) { border-color: var(--akzent); border-width: 2px; }
.wahlgruppe .feld--wahl label { flex: 1; min-height: 44px; display: flex; align-items: center; cursor: pointer; }

/* ---------------- Karten, Zusammenfassung, Hinweise */

.karte {
  background: var(--karte); border: 1px solid var(--linie); border-radius: var(--rund);
  padding: 1rem 1.1rem; margin-bottom: 1.25rem; box-shadow: var(--schatten);
}
.karte h2 { margin-top: 0; }
.karte--warnung { border-color: var(--warnung); }
.karte__fuss { margin: 0.75rem 0 0; }
.karte__fuss a { display: inline-flex; align-items: center; min-height: 44px; }
.karte__hinweis { margin: 0.75rem 0 0; padding-top: 0.75rem; border-top: 1px solid var(--linie); }

.zusammen { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1rem; margin: 0; }
.zusammen dt { color: var(--leise); }
.zusammen dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

.hinweis {
  background: var(--hinweis-bg); border-left: 4px solid var(--hinweis-rand);
  padding: 0.75rem 1rem; border-radius: 6px; margin-bottom: 1.25rem;
}
.hinweis p:last-child { margin-bottom: 0; }

.fehlerkasten {
  background: var(--warnung-bg); border-left: 4px solid var(--warnung);
  padding: 0.75rem 1rem; border-radius: 6px; margin-bottom: 1.25rem;
}
.fehlerkasten ul { margin: 0; padding-left: 1.2rem; }
.fehlerkasten p:last-child { margin-bottom: 0; }
.fehlerkasten a { color: var(--text); display: inline-flex; align-items: center; min-height: 44px; }
.fehlerkasten li { line-height: 1.3; }

.erfolg { text-align: center; margin: 0.5rem 0 1.25rem; }
.erfolg__zeichen {
  display: inline-grid; place-items: center; width: 3.5rem; height: 3.5rem; margin: 0 0 0.75rem;
  border-radius: 50%; background: var(--erfolg); color: var(--karte); font-size: 1.8rem; font-weight: 700;
}

.liste { padding-left: 1.2rem; }

/* ---------------- Formular */

.formular { display: grid; gap: 1rem; margin-bottom: 1.5rem; }
.feld { display: grid; gap: 0.3rem; }
.feld label { font-weight: 600; }
.feld__frei { font-weight: 400; color: var(--leise); font-size: 0.9rem; }
.feld__hilfe { margin: 0; font-size: 0.9rem; color: var(--leise); }
.feld__fehler { margin: 0; color: var(--warnung); font-weight: 600; font-size: 0.95rem; }
.feld input, .feld textarea, .feld select {
  width: 100%; min-height: 48px; padding: 0.6rem 0.75rem; font: inherit; color: var(--text);
  background: var(--karte); border: 1.5px solid var(--feld-rand); border-radius: 8px;
}
.feld textarea { min-height: 6rem; resize: vertical; }
.feld input[aria-invalid="true"], .feld textarea[aria-invalid="true"] { border-color: var(--warnung); border-width: 2px; }
.feld input[readonly] { background: var(--zu); font-size: 0.85rem; }
.feld--wahl { display: flex; align-items: center; gap: 0.6rem; }
.feld--wahl input { width: 1.4rem; min-height: 1.4rem; height: 1.4rem; accent-color: var(--akzent); }
.feld--wahl label { font-weight: 400; }
.felder-zwei { display: grid; gap: 1rem; }
@media (min-width: 30em) { .felder-zwei { grid-template-columns: 1fr 1fr; } }

.falle { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  min-height: 48px; padding: 0.6rem 1.3rem; border: 2px solid var(--akzent); border-radius: 999px;
  background: var(--akzent); color: var(--akzent-text); font: inherit; font-weight: 650;
  text-decoration: none; cursor: pointer; text-align: center;
}
.knopf:hover { filter: brightness(0.92); }
.knopf--gross { width: 100%; font-size: 1.1rem; min-height: 54px; }
.knopf--rand { background: transparent; color: var(--akzent); }
.knopf--rand:hover { background: var(--akzent); color: var(--akzent-text); filter: none; }
.knopf--warnung { background: var(--warnung); border-color: var(--warnung); color: var(--warnung-text); }
.knoepfe { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1.5rem; }
@media (max-width: 30em) { .knoepfe .knopf { flex: 1 1 100%; } }

button.leise {
  min-height: 44px; padding: 0 0.75rem; background: none; border: 1px solid var(--linie);
  border-radius: 999px; color: var(--text); font: inherit; font-size: 0.92rem; cursor: pointer;
}
button.leise:hover { border-color: var(--akzent); }

/* ---------------- Verwaltung */

.titelzeile { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 1rem; }
.titelzeile h1 { margin: 0; }

.tag-block { margin-bottom: 1.25rem; }
.tag-kopf {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.6rem;
  margin: 1.5rem 0 0.5rem; font-size: 1.1rem;
}
.tag-kopf__info { font-size: 0.85rem; font-weight: 400; color: var(--leise); }
.tag-block--heute .tag-kopf { color: var(--akzent); }
.tag-kopf-zeile { display: flex; align-items: flex-end; justify-content: space-between; gap: 0.5rem; }
.tag-kopf-zeile .tag-kopf { flex: 1; }
.tag-neu {
  flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 0.8rem; margin-bottom: 0.25rem;
  border: 1px dashed var(--feld-rand); border-radius: 999px; color: var(--text); text-decoration: none; font-size: 0.9rem;
}
.tag-neu:hover { border-color: var(--akzent); border-style: solid; }

.marke {
  display: inline-block; padding: 0.05rem 0.5rem; border-radius: 999px; font-size: 0.75rem;
  font-weight: 600; background: var(--akzent); color: var(--akzent-text); vertical-align: middle;
}
.marke--leise { background: var(--zu); color: var(--zu-text); }

.eintraege { display: grid; gap: 0.4rem; margin: 0; padding: 0; list-style: none; }
.eintrag {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0.25rem 0.75rem;
  background: var(--karte); border: 1px solid var(--linie); border-left: 4px solid var(--akzent);
  border-radius: 8px; padding: 0.5rem 0.75rem;
}
.eintrag__link { display: grid; gap: 0.05rem; color: var(--text); text-decoration: none; min-height: 44px; align-content: center; }
.eintrag__link:hover .eintrag__name { text-decoration: underline; }
.eintrag__zeit { font-weight: 700; font-variant-numeric: tabular-nums; }
.eintrag__name { font-weight: 600; }
.eintrag__was { font-size: 0.9rem; color: var(--leise); }
.eintrag__tel a { display: inline-flex; align-items: center; min-height: 44px; white-space: nowrap; }
.eintrag--abgesagt { border-left-color: var(--linie); opacity: 0.75; }
.eintrag--abgesagt .eintrag__zeit, .eintrag--abgesagt .eintrag__was { text-decoration: line-through; }
.eintrag--sperre { border-left-color: var(--zu-text); background: var(--zu); }
.eintrag--sperre form { margin: 0; grid-row: span 2; grid-column: 2; }
.eintrag--sperre .eintrag__zeit, .eintrag--sperre .eintrag__name, .eintrag--sperre .eintrag__was { grid-column: 1; }

@media (prefers-reduced-motion: no-preference) {
  .wahl, .tag, .zeit, .knopf, .blaettern { transition: background-color 0.15s, border-color 0.15s, color 0.15s; }
}

@media print {
  .kopf .menue, .fuss, .knopf, .demo { display: none; }
}

/* ---------------- Passkeys (Verwaltung) */

.passkey-anmelden { display: grid; gap: 0.5rem; margin-bottom: 1.25rem; }
.passkey-anmelden[hidden], .passkey-meldung[hidden] { display: none; }
.nur-passkey { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--linie); }
.karte h3 { margin-top: 1.25rem; }

/* ---------------- Selbst ändern: Öffnungszeiten, Angebote, Serie */

.tag-zeiten, .orte-wahl, .serie-wahl {
  border: 1px solid var(--linie); border-radius: var(--rund); background: var(--karte);
  padding: 0.75rem 1rem 1rem; margin: 0; display: grid; gap: 0.5rem;
}
.tag-zeiten legend, .orte-wahl legend, .serie-wahl legend { font-weight: 700; padding: 0 0.25rem; }
.zeitfenster { display: grid; grid-template-columns: auto 1fr auto 1fr; align-items: center; gap: 0.4rem 0.5rem; }
.zeitfenster label { font-size: 0.85rem; color: var(--leise); }
.zeitfenster input {
  min-width: 0; min-height: 44px; padding: 0.4rem 0.5rem; font: inherit; color: var(--text);
  background: var(--karte); border: 1.5px solid var(--feld-rand); border-radius: 8px;
}
@media (max-width: 26em) {
  .zeitfenster { grid-template-columns: 1fr 1fr; }
  .zeitfenster label:nth-of-type(2) { grid-row: 1; grid-column: 2; }
  .zeitfenster input:nth-of-type(1) { grid-row: 2; grid-column: 1; }
  .zeitfenster input:nth-of-type(2) { grid-row: 2; grid-column: 2; }
}
.ort-zeile { display: grid; gap: 0.25rem; padding-bottom: 0.5rem; border-bottom: 1px dashed var(--linie); }
.ort-zeile:last-child { border-bottom: 0; }
.eintrag--leistung { grid-template-columns: 1fr auto; }
.eintrag__knoepfe { display: flex; gap: 0.25rem; }
.eintrag__knoepfe form { margin: 0; }
