/*
  Struktur der gemeinsamen Bausteine (Anmeldung, Buchung, Popup, Toast).
  Farben, Schriften und Radien kommen aus den Variablen des jeweiligen Designs:
  --bg --surface --surface-2 --ink --muted --line --accent --accent-ink --radius --radius-sm --font --font-display
*/
.ic { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }
.is-hidden { display: none !important; }
[hidden] { display: none !important; }

/* ---------- Felder ---------- */
.f-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.f-field { display: grid; gap: 6px; min-width: 0; }
.f-wide { grid-column: 1 / -1; }
.f-field label { font-weight: 600; font-size: 0.9rem; display: flex; gap: 8px; align-items: baseline; }
.f-opt { font-weight: 400; color: var(--muted); font-size: 0.82rem; }
.f-field input, .f-field select, .f-field textarea {
  font: inherit; font-size: 1rem; color: var(--ink); background: var(--surface);
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; width: 100%;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.f-field textarea { resize: vertical; }
.f-field input:focus, .f-field select:focus, .f-field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.f-err { display: none; color: var(--error, #b3261e); font-size: 0.85rem; }
.was-validated .f-field :invalid { border-color: var(--error, #b3261e); }
.was-validated .f-field :invalid ~ .f-err { display: block; }

.chk { display: flex; gap: 12px; align-items: flex-start; font-size: 0.95rem; line-height: 1.45; cursor: pointer; }
.chk input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--accent); flex: none; }
.chk a { color: inherit; text-underline-offset: 3px; }
.was-validated .chk input:invalid + span { color: var(--error, #b3261e); }

/* ---------- Anmeldung ---------- */
.reg { display: grid; gap: 26px; }
.reg-status { display: flex; flex-wrap: wrap; gap: 8px 20px; font-weight: 600; font-size: 0.95rem; }
.reg-status span { display: inline-flex; gap: 8px; align-items: center; }
.reg-h { font-size: 1.05rem; margin: 0 0 12px; font-family: var(--font); font-weight: 700; letter-spacing: 0; }
.reg-tickets { display: grid; gap: 10px; }
.reg-ticket { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); transition: border-color 200ms ease, background-color 200ms ease; }
.reg-ticket.is-active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.reg-ticket-l { display: grid; gap: 2px; }
.reg-ticket-l span { color: var(--muted); font-variant-numeric: tabular-nums; }
.stepper { display: inline-flex; align-items: center; gap: 4px; }
.stepper button { width: 40px; height: 40px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); display: grid; place-items: center; cursor: pointer; transition: transform 140ms cubic-bezier(.23,1,.32,1), border-color 160ms ease; }
.stepper button:hover { border-color: var(--ink); }
.stepper button:active { transform: scale(0.92); }
.stepper output { min-width: 2ch; text-align: center; font-weight: 700; font-size: 1.1rem; font-variant-numeric: tabular-nums; display: inline-block; }
.stepper output.bump { animation: bump 260ms cubic-bezier(.23,1,.32,1); }
@keyframes bump { 0% { transform: translateY(-6px); opacity: .3; } 100% { transform: none; opacity: 1; } }

.reg-person { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
.reg-person legend { font-weight: 600; color: var(--muted); font-size: 0.85rem; margin-bottom: 10px; display: flex; align-items: center; gap: 10px; padding: 0; }
.reg-person.is-new { animation: rise 420ms cubic-bezier(.23,1,.32,1); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.reg-remove { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 4px; border-radius: 6px; display: inline-grid; }
.reg-remove:hover { color: var(--ink); }
.reg-add { display: inline-flex; gap: 8px; align-items: center; background: none; border: 1.5px dashed var(--line); color: var(--ink); padding: 11px 16px; border-radius: var(--radius-sm); font: inherit; font-weight: 600; cursor: pointer; transition: border-color 160ms ease; }
.reg-add:hover { border-color: var(--ink); }

.reg-pay { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.pay-opt, .chip, .seg label { position: relative; }
.pay-opt input, .chip input, .seg input { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.pay-box { display: grid; gap: 4px; padding: 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; height: 100%; background: var(--surface); transition: border-color 180ms ease, transform 160ms cubic-bezier(.23,1,.32,1); }
.pay-box .ic { width: 22px; height: 22px; color: var(--accent); }
.pay-box small { color: var(--muted); line-height: 1.35; }
.pay-opt input:checked + .pay-box { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.pay-opt input:focus-visible + .pay-box { outline: 2px solid var(--accent); outline-offset: 2px; }
.pay-opt:active .pay-box { transform: scale(0.98); }
.reg-sum { display: flex; justify-content: space-between; align-items: baseline; padding-top: 16px; border-top: 1.5px solid var(--line); font-size: 1.05rem; }
.reg-sum strong { font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.reg-checks { display: grid; gap: 12px; }
.reg-note { display: flex; gap: 10px; color: var(--muted); font-size: 0.9rem; margin: 0; line-height: 1.45; }

.reg-submit { display: inline-flex; align-items: center; justify-content: center; gap: 10px; font: inherit; font-weight: 700; font-size: 1.05rem; padding: 16px 26px; border: 0; border-radius: var(--btn-radius, var(--radius-sm)); background: var(--accent); color: var(--accent-ink); cursor: pointer; transition: transform 160ms cubic-bezier(.23,1,.32,1), background-color 200ms ease, opacity 200ms ease; }
.reg-submit:hover { background: color-mix(in srgb, var(--accent) 88%, var(--ink)); }
.reg-submit:active { transform: scale(0.97); }
.reg-submit:disabled { opacity: .55; cursor: not-allowed; }
.reg-submit.is-loading { opacity: .8; }
.reg-submit.is-loading .ic { animation: spin 700ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.reg-done { text-align: left; display: grid; gap: 10px; padding: 28px; border-radius: var(--radius); background: color-mix(in srgb, var(--accent) 9%, var(--surface)); border: 1.5px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.reg-done.is-in { animation: rise 520ms cubic-bezier(.23,1,.32,1); }
.reg-done h4 { margin: 0; font-size: 1.3rem; }
.reg-done p { margin: 0; line-height: 1.55; }
.reg-done-ic { width: 40px; height: 40px; color: var(--accent); }
.reg-back { color: var(--ink); font-weight: 600; text-underline-offset: 4px; }
.reg-none { display: grid; grid-template-columns: auto 1fr; gap: 12px 14px; align-items: start; padding: 22px; border-radius: var(--radius); background: var(--surface-2); }
.reg-none p { margin: 0; font-weight: 600; }
.reg-none > .ic { width: 24px; height: 24px; color: var(--accent); }
.reg-ics { grid-column: 2; display: inline-flex; gap: 8px; align-items: center; color: var(--ink); font-weight: 600; text-underline-offset: 4px; }

/* ---------- Buchung ---------- */
.bk { display: grid; grid-template-columns: minmax(280px, 400px) 1fr; gap: 40px; align-items: start; }
.bk-cal { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 20px; position: sticky; top: 100px; }
.bk-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.bk-month { font-size: 1.1rem; }
.bk-nav { width: 40px; height: 40px; border-radius: 999px; border: 1.5px solid var(--line); background: transparent; color: var(--ink); display: grid; place-items: center; cursor: pointer; transition: transform 140ms cubic-bezier(.23,1,.32,1), border-color 160ms ease; }
.bk-nav:hover { border-color: var(--ink); }
.bk-nav:active { transform: scale(0.92); }
.bk-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.bk-grid.slide-l { animation: calL 320ms cubic-bezier(.23,1,.32,1); }
.bk-grid.slide-r { animation: calR 320ms cubic-bezier(.23,1,.32,1); }
@keyframes calL { from { opacity: 0; transform: translateX(14px); filter: blur(2px); } }
@keyframes calR { from { opacity: 0; transform: translateX(-14px); filter: blur(2px); } }
.bk-wd span { text-align: center; font-size: 0.78rem; color: var(--muted); font-weight: 600; padding-bottom: 6px; }
.bk-day { aspect-ratio: 1; border: 0; border-radius: var(--radius-sm); font: inherit; font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer; background: color-mix(in srgb, var(--accent) 10%, var(--surface)); color: var(--ink); transition: transform 140ms cubic-bezier(.23,1,.32,1), background-color 160ms ease; }
.bk-day:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 24%, var(--surface)); }
.bk-day:active:not(:disabled) { transform: scale(0.92); }
.bk-day.past { background: transparent; color: color-mix(in srgb, var(--muted) 55%, transparent); cursor: default; }
.bk-day.busy { background: var(--surface-2); color: var(--muted); text-decoration: line-through; cursor: not-allowed; }
.bk-day.res { background: repeating-linear-gradient(135deg, var(--surface-2) 0 5px, transparent 5px 10px); color: var(--muted); cursor: not-allowed; }
.bk-day.is-picked { background: var(--accent) !important; color: var(--accent-ink); }
.bk-legend { display: flex; gap: 16px; margin-top: 14px; font-size: 0.85rem; color: var(--muted); }
.bk-legend span { display: inline-flex; gap: 6px; align-items: center; }
.lg { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.lg-free { background: color-mix(in srgb, var(--accent) 18%, var(--surface)); }
.lg-res { background: repeating-linear-gradient(135deg, var(--line) 0 3px, transparent 3px 6px); border: 1px solid var(--line); }
.lg-busy { background: var(--surface-2); border: 1px solid var(--line); }
.bk-form { display: grid; gap: 20px; }
.bk-fs { border: 0; padding: 0; margin: 0; display: grid; gap: 18px; min-width: 0; transition: opacity 240ms ease; }
.bk-fs:disabled { opacity: .45; }
.bk-picked { display: flex; gap: 14px; align-items: center; padding: 16px 18px; border-radius: var(--radius-sm); border: 1.5px dashed var(--line); color: var(--muted); }
.bk-picked .ic { width: 26px; height: 26px; }
.bk-picked.is-set { border-style: solid; border-color: var(--accent); color: var(--ink); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.bk-picked.is-set .ic { color: var(--accent); }
.bk-picked small { display: block; color: var(--muted); font-size: 0.82rem; }
.bk-picked strong { font-size: 1.1rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip span { display: inline-block; padding: 9px 15px; border-radius: 999px; border: 1.5px solid var(--line); cursor: pointer; font-weight: 600; font-size: 0.92rem; transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease; }
.chip input:checked + span { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip input:focus-visible + span, .seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.seg { display: inline-flex; border: 1.5px solid var(--line); border-radius: 999px; padding: 3px; width: max-content; }
.seg span { display: inline-block; padding: 8px 20px; border-radius: 999px; cursor: pointer; font-weight: 600; transition: background-color 180ms ease, color 180ms ease; }
.seg input:checked + span { background: var(--ink); color: var(--bg); }

/* ---------- Popup ---------- */
.pop { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px; background: color-mix(in srgb, #0c110e 55%, transparent); opacity: 0; transition: opacity 260ms ease; }
.pop.is-open { opacity: 1; }
.pop-card { position: relative; width: min(560px, 100%); background: var(--surface); color: var(--ink); border-radius: var(--radius); overflow: hidden; box-shadow: 0 30px 80px -20px rgba(8, 14, 10, .45); transform: translateY(16px) scale(0.97); transition: transform 420ms cubic-bezier(.23,1,.32,1); }
.pop.is-open .pop-card { transform: none; }
.pop-close { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border-radius: 999px; border: 0; background: color-mix(in srgb, var(--surface) 88%, transparent); color: var(--ink); display: grid; place-items: center; cursor: pointer; z-index: 2; }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 95; transform: translate(-50%, 20px); opacity: 0; background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 999px; font-weight: 600; font-size: 0.95rem; transition: transform 320ms cubic-bezier(.23,1,.32,1), opacity 240ms ease; pointer-events: none; }
.toast.is-in { transform: translate(-50%, 0); opacity: 1; }

@media (max-width: 860px) {
  .bk { grid-template-columns: 1fr; gap: 24px; }
  .bk-cal { position: static; }
}
@media (max-width: 560px) {
  h1, h2, h3, h4 { hyphens: auto; overflow-wrap: break-word; }
  .f-grid { grid-template-columns: 1fr; }
  .reg-pay { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
}
