/* Buchungsseite. Farben und Schrift kommen als CSS-Variablen aus dem Branding. */
:root {
  --brand: #1f6f5c; --bg: #f4f1ea; --surface: #fff; --text: #1d2321;
  --radius: 14px; --font: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --on-brand: #fff;
}
:root {
  --muted: color-mix(in srgb, var(--text) 62%, var(--surface));
  --line: color-mix(in srgb, var(--text) 13%, var(--surface));
  --soft: color-mix(in srgb, var(--brand) 11%, var(--surface));
  --soft-strong: color-mix(in srgb, var(--brand) 22%, var(--surface));
  --r-sm: calc(var(--radius) * .6);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased;
  min-height: 100vh; display: flex; flex-direction: column;
}
body.embed { background: transparent; min-height: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--brand); }
.page { flex: 1; width: 100%; max-width: 1060px; margin: 0 auto; padding: 48px 16px 24px; }
body.embed .page { padding: 8px; }
body.preview .page { padding: 28px 16px 8px; }
.loading { text-align: center; color: var(--muted); padding: 80px 0; }

/* Kopf mit Marke */
.brand { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; margin-bottom: 32px; }
.logo { max-height: 72px; max-width: 220px; object-fit: contain; }
.monogram {
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand); color: var(--on-brand); font-weight: 700; font-size: 24px; letter-spacing: .02em;
}
.brand h1 { margin: 0; font-size: 28px; line-height: 1.2; letter-spacing: -.01em; }
.brand .tag { margin: 0; color: var(--muted); }
.brand .welcome { margin: 4px 0 0; max-width: 560px; color: var(--muted); text-wrap: pretty; }

/* Übersicht der Terminarten */
.types { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.type {
  display: flex; flex-direction: column; gap: 6px; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 20px 18px; border-top: 4px solid var(--c, var(--brand)); text-decoration: none; color: inherit;
  transition: transform .15s ease, box-shadow .15s ease;
}
.type:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -14px color-mix(in srgb, var(--text) 45%, transparent); }
.type:focus-visible { outline: 3px solid var(--soft-strong); outline-offset: 2px; }
.type h2 { margin: 0; font-size: 18px; }
.type p { margin: 0; color: var(--muted); font-size: 14px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 14px; }
.meta span { display: inline-flex; align-items: center; gap: 6px; }
.meta svg { width: 16px; height: 16px; flex: none; }

/* Buchungskarte */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  display: grid; grid-template-columns: 320px 1fr; overflow: hidden;
  box-shadow: 0 18px 40px -28px color-mix(in srgb, var(--text) 55%, transparent);
}
.card.narrow { grid-template-columns: 320px minmax(0, 520px); justify-content: center; }
.side { padding: 28px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 14px; }
.side .who { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.side .who img { max-height: 36px; max-width: 120px; object-fit: contain; }
.side .who .monogram { width: 36px; height: 36px; font-size: 14px; }
.side h2 { margin: 0; font-size: 24px; line-height: 1.25; }
.side .desc { color: var(--muted); margin: 0; white-space: pre-line; font-size: 15px; }
.side .meta { flex-direction: column; font-size: 15px; }
.side .chosen { color: var(--brand); font-weight: 600; }
.main { padding: 28px; min-width: 0; }
.main h3 { margin: 0 0 18px; font-size: 19px; }
.back {
  border: 1px solid var(--line); background: none; width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer; color: var(--brand);
}
.back:hover { background: var(--soft); }

/* Kalender */
.picker { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }
.picker.with-times { grid-template-columns: minmax(0, 1fr) 220px; }
.month-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.month-head strong { font-size: 16px; }
.nav { display: flex; gap: 6px; }
.nav button {
  width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--soft); color: var(--brand);
  cursor: pointer; display: grid; place-items: center;
}
.nav button:disabled { background: none; color: var(--line); cursor: default; }
.grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.grid .dow { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 6px 0; }
.day {
  aspect-ratio: 1; max-width: 48px; width: 100%; justify-self: center; border-radius: 50%;
  border: 0; background: none; color: var(--muted); cursor: default; font-size: 15px; position: relative;
}
.day.open { background: var(--soft); color: var(--brand); font-weight: 700; cursor: pointer; }
.day.open:hover { background: var(--soft-strong); }
.day.sel { background: var(--brand); color: var(--on-brand); }
.day.today::after {
  content: ""; position: absolute; left: 50%; bottom: 6px; width: 4px; height: 4px; margin-left: -2px;
  border-radius: 50%; background: currentColor;
}
.tzline { margin-top: 18px; font-size: 14px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tzline select { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 4px 8px; background: var(--surface); max-width: 100%; }
.times h4 { margin: 4px 0 14px; font-size: 15px; font-weight: 600; }
.times .list { display: flex; flex-direction: column; gap: 8px; max-height: 400px; overflow-y: auto; padding-right: 4px; }
.slot-row { display: flex; gap: 8px; }
.slot {
  flex: 1; padding: 11px 8px; border: 1px solid color-mix(in srgb, var(--brand) 55%, var(--surface));
  border-radius: var(--r-sm); background: var(--surface); color: var(--brand); font-weight: 600; cursor: pointer;
  transition: background .12s ease;
}
.slot:hover { border-color: var(--brand); background: var(--soft); }
.slot.sel { background: color-mix(in srgb, var(--text) 65%, var(--surface)); border-color: transparent; color: var(--surface); }
.slot-row .go {
  flex: 1; border: 0; border-radius: var(--r-sm); background: var(--brand); color: var(--on-brand);
  font-weight: 600; cursor: pointer; animation: pop .16s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translateX(-6px); } }
.empty { color: var(--muted); font-size: 14px; padding: 12px 0; }

/* Formular */
form { display: flex; flex-direction: column; gap: 16px; max-width: 520px; }
label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; }
label .opt { font-weight: 400; color: var(--muted); }
input, textarea {
  border: 1px solid var(--line); border-radius: var(--r-sm); padding: 11px 12px; background: var(--surface);
  font-weight: 400; font-size: 16px;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--brand); outline-offset: -1px; border-color: transparent; }
textarea { min-height: 96px; resize: vertical; }
.consent { font-size: 13px; color: var(--muted); font-weight: 400; }
.btn {
  border: 0; border-radius: 999px; padding: 13px 22px; background: var(--brand); color: var(--on-brand);
  font-weight: 700; cursor: pointer; align-self: flex-start; text-decoration: none; display: inline-flex; gap: 8px; align-items: center;
}
.btn:disabled { opacity: .6; cursor: wait; }
.btn.ghost { background: none; color: var(--brand); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--soft); }
.btn.danger { background: none; color: #b42318; border: 1px solid color-mix(in srgb, #b42318 35%, var(--surface)); }
/* Fragen */
.required-note { margin: 0; font-size: 14px; color: var(--text); background: var(--soft); border-radius: var(--r-sm); padding: 10px 14px; }
.req { color: #b42318; font-weight: 700; }
.qlabel { display: block; }
.field-q { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; border-radius: var(--r-sm); }
fieldset.field-q { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset.field-q legend { padding: 0; margin-bottom: 6px; }
.hint { font-weight: 400; font-size: 13px; color: var(--muted); margin-top: -2px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span { display: inline-block; padding: 9px 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  font-weight: 600; min-width: 64px; text-align: center; transition: background .12s ease, border-color .12s ease; }
.chip:hover span { border-color: var(--brand); }
.chip input:checked + span { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.chip input:focus-visible + span { outline: 3px solid var(--soft-strong); outline-offset: 2px; }
.confirm { display: flex; flex-direction: row; gap: 10px; align-items: flex-start; font-weight: 500; cursor: pointer; }
.confirm input { width: 20px; height: 20px; margin-top: 1px; flex: none; accent-color: var(--brand); }
.field-q.missing input:not([type=checkbox]):not([type=radio]), .field-q.missing textarea { border-color: #b42318; box-shadow: 0 0 0 1px #b42318; }
.field-q.missing .chip span { border-color: #b42318; }
.field-q.missing > .qlabel, .field-q.missing legend, .field-q.missing .confirm span { color: #b42318; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.policy { font-size: 14px; color: var(--text); background: var(--soft); border-radius: var(--r-sm); padding: 10px 14px; margin: 0; max-width: 520px; }
.secure { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--muted); margin: 0; }
.secure svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--brand); }
.tzhint { flex-basis: 100%; font-size: 13px; }
.error { background: color-mix(in srgb, #b42318 10%, var(--surface)); color: #8a1c12; padding: 10px 14px; border-radius: var(--r-sm); font-size: 14px; }

/* Bestätigung */
.done { text-align: center; padding: 44px 28px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.check {
  width: 64px; height: 64px; border-radius: 50%; background: var(--soft); color: var(--brand); display: grid; place-items: center;
  animation: pop .3s ease-out;
}
.done h2 { margin: 6px 0 0; font-size: 24px; }
.done p { margin: 0; color: var(--muted); max-width: 460px; }
.summary {
  margin: 14px 0 6px; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; text-align: left;
  display: flex; flex-direction: column; gap: 8px; min-width: min(100%, 380px);
}
.summary strong { font-size: 17px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 8px; }
.status-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--soft); color: var(--brand); }
.status-badge.off { background: color-mix(in srgb, #b42318 12%, var(--surface)); color: #8a1c12; }

.foot { text-align: center; font-size: 13px; color: var(--muted); padding: 20px 16px 28px; display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.foot a { color: var(--muted); }
.powered { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.powered b { color: var(--text); }

@media (max-width: 860px) {
  .page { padding-top: 24px; }
  .card, .card.narrow { grid-template-columns: 1fr; }
  .side { border-right: 0; border-bottom: 1px solid var(--line); padding: 22px; }
  .main { padding: 22px; }
  .picker.with-times { grid-template-columns: 1fr; }
  .times .list { max-height: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

.name2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.name2 > .field-q { min-width: 0; }
@media (max-width: 420px) { .name2 { grid-template-columns: 1fr; } }
