/* Medientrupp Booking — Design-System: Violet-600, Plus Jakarta Sans, Slate */
:root {
  --brand: #7c3aed;
  --brand-soft: rgba(124, 58, 237, 0.08);
  --text: #0f172a;
  --text-soft: #64748b;
  --border: rgba(15, 23, 42, 0.1);
  --bg: #f8fafc;
  --card: #ffffff;
  --radius: 8px;
  --ok: #038164;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.45;
}

.page {
  min-height: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 16px 64px;
}

body.embed { background: transparent; }
body.embed .page { padding: 8px 0; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.08);
  width: 100%;
  max-width: 1040px;
  min-height: 560px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.embed .card { box-shadow: none; }

.loading {
  margin: auto;
  color: var(--text-soft);
  padding: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.loading::before {
  content: '';
  width: 28px;
  height: 28px;
  border: 3px solid var(--brand-soft);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: mt-spin 0.7s linear infinite;
}

@keyframes mt-spin { to { transform: rotate(360deg); } }

/* Lade-Zustand während Netzwerk-Anfragen: Karte dimmen + Klicks blocken */
#app.busy .card { opacity: 0.55; pointer-events: none; transition: opacity 0.15s; }
#app.busy { cursor: progress; }

/* Sichtbarer Fokus-Ring für Tastatur-Navigation (A11y) */
button:focus-visible, a:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
button:focus:not(:focus-visible) { outline: none; }

/* ------------------------------- Branding-Kopf ------------------------------ */

.brand-logo {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.5px;
  overflow: hidden;
  flex-shrink: 0;
}

.brand-logo img { width: 100%; height: 100%; object-fit: cover; }

/* Breites Wordmark-Logo (SVG) statt rundem Avatar */
.brand-logo-img { height: 34px; width: auto; max-width: 240px; display: block; }
.landing .brand-logo-img { height: 42px; margin-bottom: 18px; }
.info-panel .brand-logo-img { margin: 10px 0 6px; }

/* MedienTrupp-Wordmark: Prefix violett, Suffix dunkel */
.wm-prefix { color: var(--brand); }
.wm-suffix { color: var(--text); }

/* ------------------------------ Landing (Liste) ----------------------------- */

.landing {
  padding: 48px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1;
}

.landing .brand-logo { width: 72px; height: 72px; font-size: 26px; margin-bottom: 16px; }

.landing h1 { font-size: 22px; margin-bottom: 6px; }

.landing .welcome { color: var(--text-soft); max-width: 460px; margin-bottom: 32px; }

.event-list { width: 100%; max-width: 560px; display: flex; flex-direction: column; gap: 0; border-top: 1px solid var(--border); }

.event-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 8px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  text-align: left;
  background: none;
  border-left: none; border-right: none; border-top: none;
  width: 100%;
  font: inherit;
  color: inherit;
  transition: background 0.12s;
}

.event-item:hover { background: var(--brand-soft); }

.event-dot { width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0; }

.event-item .ev-name { font-weight: 600; font-size: 16px; }
.event-item .ev-meta { color: var(--text-soft); font-size: 14px; }
.event-item .chev { margin-left: auto; color: var(--text-soft); flex-shrink: 0; }

/* ------------------------------ Buchungs-Layout ----------------------------- */

.booking {
  display: grid;
  grid-template-columns: 330px 1fr;
  flex: 1;
}

.booking.with-times { grid-template-columns: 330px 1fr 240px; }

.info-panel {
  border-right: 1px solid var(--border);
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.back-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: none;
  color: var(--brand);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  transition: background 0.12s;
}

.back-btn:hover { background: var(--brand-soft); }

.info-panel .brand-name { color: var(--text-soft); font-weight: 600; font-size: 14px; margin-top: 10px; }

.info-panel h1 { font-size: 24px; font-weight: 700; margin: 4px 0 16px; line-height: 1.25; }

.meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-soft);
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 10px;
}

.meta-row svg { flex-shrink: 0; }

.info-desc { color: var(--text-soft); font-size: 14px; margin-top: 12px; white-space: pre-line; }

.selected-when {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 10px;
}

/* --------------------------------- Kalender --------------------------------- */

.cal-panel { padding: 24px 30px; display: flex; flex-direction: column; min-width: 0; }

.cal-panel h2 { font-size: 19px; font-weight: 700; margin-bottom: 18px; }

.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 420px;
  margin: 0 auto 8px;
  width: 100%;
}

.cal-title { font-size: 15px; font-weight: 400; }

.cal-nav { display: flex; gap: 6px; }

.cal-nav button {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: none;
  background: none;
  color: var(--brand);
  font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.12s;
}

.cal-nav button:hover:not(:disabled) { background: var(--brand-soft); }
.cal-nav button:disabled { color: var(--border); cursor: default; }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  max-width: 420px;
  margin: 0 auto;
  width: 100%;
}

.cal-dow {
  text-align: center;
  font-size: 12px;
  color: var(--text-soft);
  text-transform: uppercase;
  padding: 10px 0 8px;
  font-weight: 500;
}

.cal-day {
  aspect-ratio: 1;
  border: none;
  background: none;
  border-radius: 50%;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-soft);
  cursor: default;
  position: relative;
  display: flex; align-items: center; justify-content: center;
  font-family: inherit;
}

.cal-day.avail {
  background: var(--brand-soft);
  color: var(--brand);
  cursor: pointer;
  transition: background 0.12s;
}

.cal-day.avail:hover { background: rgba(0, 105, 255, 0.18); }

.cal-day.selected { background: var(--brand); color: #fff; }

.cal-day.today::after {
  content: '';
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px; height: 4px;
  border-radius: 50%;
  background: currentColor;
}

.tz-row {
  margin-top: auto;
  padding-top: 20px;
  max-width: 420px;
  margin-left: auto; margin-right: auto;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.tz-row label { font-weight: 700; font-size: 14px; flex-shrink: 0; }

.tz-row select {
  border: none;
  background: none;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  max-width: 260px;
  cursor: pointer;
  padding: 4px;
}

/* -------------------------------- Zeit-Slots --------------------------------- */

.times-panel {
  padding: 24px 20px 24px 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.times-panel h3 { font-size: 15px; font-weight: 400; margin-bottom: 14px; padding-left: 4px; }

.times-list { overflow-y: auto; max-height: 480px; padding: 2px 4px; display: flex; flex-direction: column; gap: 10px; }

.slot-row { display: flex; gap: 8px; }

.slot-btn {
  flex: 1;
  padding: 13px 8px;
  border: 1px solid var(--brand);
  border-radius: 4px;
  background: none;
  color: var(--brand);
  font-weight: 700;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}

.slot-btn:hover { border-width: 2px; padding: 12px 7px; }

.slot-row.picked .slot-btn {
  background: rgba(26, 26, 26, 0.6);
  border-color: transparent;
  color: #fff;
  cursor: default;
}

.confirm-btn {
  flex: 1;
  padding: 13px 8px;
  border: none;
  border-radius: 4px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
}

.confirm-btn:hover { filter: brightness(1.08); }

.no-slots { color: var(--text-soft); font-size: 14px; padding: 8px 4px; }

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

.form-panel { padding: 24px 30px; max-width: 480px; }

.form-panel h2 { font-size: 19px; font-weight: 700; margin-bottom: 20px; }

.field { margin-bottom: 18px; }

.field label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 7px; }

.field input, .field textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid rgba(26, 26, 26, 0.3);
  border-radius: 6px;
  font: inherit;
  font-size: 15px;
  color: var(--text);
}

.field input:focus, .field textarea:focus {
  outline: 2px solid var(--brand);
  outline-offset: -1px;
  border-color: transparent;
}

.field textarea { min-height: 96px; resize: vertical; }

.field-hint { color: var(--text-soft); font-size: 13px; margin: 6px 0 18px; }

/* Ortswahl (Telefonat / Zoom) */
.loc-options { display: flex; gap: 10px; flex-wrap: wrap; }

.loc-option {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(15, 23, 42, 0.25);
  border-radius: 8px;
  padding: 11px 16px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  transition: border-color 0.12s, background 0.12s;
}

/* natives Radio visuell verstecken, Karte selbst zeigt den Zustand */
.loc-option { position: relative; }
.loc-option input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.loc-option:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }

.loc-option.active {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
  outline: 1px solid var(--brand);
}

.zoom-link { color: var(--brand); font-weight: 700; }
.zoom-pass { color: var(--text-soft); }

.submit-btn {
  padding: 13px 28px;
  border: none;
  border-radius: 40px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
}

.submit-btn:hover { filter: brightness(1.08); }
.submit-btn:disabled { opacity: 0.6; cursor: default; }

.form-error {
  background: #fdecea;
  color: #b3261e;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 14px;
  margin-bottom: 16px;
  display: none;
}

.form-error.show { display: block; }

/* ------------------------------- Bestätigung -------------------------------- */

.confirmation {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 56px 24px;
}

.check-circle {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--ok);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
}

.confirmation h1 { font-size: 22px; margin-bottom: 8px; }

.confirmation .sub { color: var(--text-soft); margin-bottom: 28px; max-width: 420px; }

.conf-box {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 26px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 420px;
  width: 100%;
  margin-bottom: 28px;
}

.conf-box .row { display: flex; align-items: flex-start; gap: 10px; font-weight: 600; font-size: 15px; }
.conf-box .row.soft { color: var(--text-soft); font-weight: 500; }

.conf-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-bottom: 20px; }

.conf-actions a {
  text-decoration: none;
  padding: 11px 22px;
  border-radius: 40px;
  font-weight: 700;
  font-size: 14px;
}

.conf-actions .primary { background: var(--brand); color: #fff; }
.conf-actions .secondary { border: 1px solid var(--brand); color: var(--brand); }

.cancel-link { color: var(--text-soft); font-size: 13px; }
.cancel-link a { color: var(--brand); }

/* --------------------------------- Footer ----------------------------------- */

.powered {
  text-align: center;
  padding: 14px;
  font-size: 12px;
  color: var(--text-soft);
}

/* -------------------------------- Responsive -------------------------------- */

@media (max-width: 920px) {
  .booking, .booking.with-times { grid-template-columns: 1fr; }
  .info-panel { border-right: none; border-bottom: 1px solid var(--border); }
  .cal-panel { border-bottom: 1px solid var(--border); }
  .times-panel { padding: 20px 20px 24px; }
  .times-panel h3 { position: sticky; top: 0; background: var(--card); padding: 4px; z-index: 1; }
  /* Zeiten kompakt im Raster auf Mobil; jede Zeile = eine Rasterzelle */
  .times-list { max-height: none; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .slot-row.picked { grid-column: 1 / -1; }
  .page { padding: 12px 8px 40px; }
  .form-panel { padding: 20px; }
  .landing { padding: 32px 20px; }
}

@media (max-width: 420px) {
  .times-list { grid-template-columns: 1fr 1fr 1fr; }
}
