/*
 * Live-Demos.
 *
 * Alles hier baut auf den Farbtoken des Themes auf (--card, --stroke,
 * --cyan …), damit die vier Module in allen neun Themes mitgehen, den
 * hellen wie den dunklen. Zwei Ausnahmen mit festen Farben: das
 * Rechnungsblatt (das ist Papier, es bleibt weiss) und der Demo-Streifen.
 *
 * Der 3D-Schriftschatten des Themes vererbt sich. Auf dunklem Text und
 * auf hellen Pillen ergibt das schwarze Schrift mit schwarzem Hof, also
 * wird er dort ausdruecklich abgeschaltet.
 */

/* ---------- Demo-Streifen ---------- */

.demo-bar {
  border-bottom: 1px solid var(--stroke);
  background: var(--icon-bg);
  padding: 0.6rem 0;
  font-size: 0.86rem;
}
.demo-bar-text { color: var(--muted); max-width: 62ch; }
.demo-chip {
  text-shadow: none;
  background: var(--cyan);
  color: var(--btn-ink, #041018);
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.demo-bar .btn { white-space: nowrap; }

/* ---------- Wechsel zwischen den Modulen ---------- */

.demo-tabs {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding: 0.2rem 0 0.9rem;
  scrollbar-width: thin;
}
.demo-tab {
  text-shadow: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-size: 0.86rem;
  color: var(--text);
  text-decoration: none;
  background: var(--card-2, transparent);
}
.demo-tab:hover { border-color: var(--cyan); color: var(--cyan); }
.demo-tab.active {
  background: var(--cyan);
  border-color: var(--cyan);
  color: var(--btn-ink, #041018);
  font-weight: 600;
}

/* ---------- Uebersichtsseite ---------- */

.demo-card { padding: 1.4rem 1.5rem; }
.demo-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--icon-bg);
  border: 1px solid var(--stroke);
  color: var(--cyan);
  font-size: 1.35rem;
}
.demo-flow { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.demo-flow li { display: flex; align-items: flex-start; gap: 0.75rem; }
.demo-flow-nr {
  text-shadow: none;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--cyan);
  color: var(--btn-ink, #041018);
  font-weight: 700;
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.demo-firm {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0.6rem 0 0;
}
.demo-firm i { color: var(--cyan); }

/* ---------- Preisrechner ---------- */

.demo-pkg select { margin-top: 0.6rem; }
.demo-pkg-none { padding: 0.85rem 1rem !important; }
.demo-sum { z-index: 2; }

/* ---------- Bestaetigungen ---------- */

.demo-done-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: var(--icon-bg);
  border: 1px solid var(--stroke-strong);
  color: var(--ok, #5cffc5);
  font-size: 1.5rem;
}
.demo-nr { font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.demo-dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.4rem 1.2rem; margin: 0; }
.demo-dl dt { color: var(--muted); font-weight: 500; }
.demo-dl dd { margin: 0; }

/* ---------- Terminanfrage ---------- */

.demo-svc {
  display: block;
  text-decoration: none;
  color: var(--text);
  border-radius: var(--radius);
}
.demo-svc:hover { border-color: var(--cyan); }
.demo-svc.active { border-color: var(--cyan); box-shadow: 0 0 0 1px var(--cyan) inset; }
.demo-svc-meta { display: block; color: var(--muted); font-size: 0.8rem; }

.demo-week {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.6rem;
}
.demo-day {
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: var(--card);
  padding: 0.6rem 0.5rem;
  min-height: 120px;
}
.demo-day.is-today { border-color: var(--cyan); }
.demo-day-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.3rem;
  padding-bottom: 0.5rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--stroke);
}
.demo-day-wd { font-weight: 600; font-size: 0.85rem; }
.demo-day-nr { color: var(--muted); font-size: 0.78rem; }
.demo-day-none { color: var(--muted); font-size: 0.78rem; margin: 0; }

.demo-slot {
  text-shadow: none;
  display: block;
  text-align: center;
  border: 1px solid var(--stroke);
  border-radius: 9px;
  padding: 0.3rem 0.2rem;
  margin-bottom: 0.35rem;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.demo-slot input { position: absolute; opacity: 0; width: 0; height: 0; }
.demo-slot:hover { border-color: var(--cyan); color: var(--cyan); }
.demo-slot.is-taken {
  cursor: not-allowed;
  color: var(--muted);
  border-style: dashed;
  opacity: 0.55;
  text-decoration: line-through;
}
.demo-slot.is-taken:hover { border-color: var(--stroke); color: var(--muted); }
.demo-slot:has(input:checked) {
  background: var(--cyan);
  border-color: var(--cyan);
  color: var(--btn-ink, #041018);
  font-weight: 700;
}
/* Ohne :has() (aeltere Browser) bleibt wenigstens der Fokusrahmen. */
.demo-slot input:focus-visible + span { outline: 2px solid var(--cyan); outline-offset: 3px; }

@media (max-width: 720px) {
  .demo-week { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 420px) {
  .demo-week { grid-template-columns: 1fr; }
  .demo-day { min-height: 0; }
}

/* ---------- Kundenbereich ---------- */

.demo-login { max-width: 520px; }
.demo-avatar {
  text-shadow: none;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: var(--cyan);
  color: var(--btn-ink, #041018);
  font-weight: 700;
  font-size: 1.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.stat-small { font-size: 1.15rem !important; }

.demo-list { list-style: none; margin: 0; padding: 0; }
.demo-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--stroke);
}
.demo-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.demo-list-main { flex: 1 1 auto; min-width: 0; }
.demo-file-icon { color: var(--cyan); font-size: 1.3rem; }

.demo-badge {
  text-shadow: none;
  display: inline-block;
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  font-size: 0.74rem;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid currentColor;
}
.demo-badge.is-ok { color: var(--ok, #5cffc5); }
.demo-badge.is-bad { color: var(--danger, #ff6b8a); }
.demo-badge.is-wait { color: var(--muted); }

.demo-thread {
  display: grid;
  gap: 0.6rem;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 0.3rem;
}
.demo-msg {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 0.6rem 0.75rem;
  background: var(--card-2, transparent);
  max-width: 92%;
}
.demo-msg.is-me { margin-left: auto; border-color: var(--stroke-strong); }
.demo-msg-who {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  margin-bottom: 0.2rem;
}

/* ---------- Tabellen ---------- */

.demo-table { font-size: 0.92rem; }
.demo-table td, .demo-table th { vertical-align: middle; }
.demo-table thead th { color: var(--muted); font-weight: 500; font-size: 0.8rem; }
.demo-table tfoot td { border-bottom: 0; padding-top: 0.5rem; }
.demo-table .demo-total td { font-weight: 700; font-size: 1.05rem; }
.demo-table form { display: inline-block; }

/* ---------- Rechnungsblatt ----------
   Das ist Papier. Feste Farben, kein Glas, kein Schatten - so sieht es
   auf dem Bildschirm aus wie das, was hinten aus dem Drucker kommt. */

.demo-sheet {
  --ink: #14181d;
  --ink-soft: #5b666f;
  --rule: #d8dee4;
  background: #fff;
  color: var(--ink);
  border-radius: 10px;
  padding: 2.4rem 2.6rem 2rem;
  max-width: 820px;
  margin: 0 auto;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  font-family: var(--font, system-ui, sans-serif);
  font-size: 0.92rem;
  line-height: 1.5;
}
.demo-sheet *, .demo-sheet h1 { text-shadow: none !important; filter: none !important; }
.demo-sheet a { color: var(--ink); }

.demo-sheet-head {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--ink);
}
.demo-sheet-firm { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em; }
.demo-sheet-claim { color: var(--ink-soft); font-size: 0.82rem; }
.demo-sheet-firm-meta { text-align: right; color: var(--ink-soft); font-size: 0.8rem; }

.demo-sheet-cols {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  margin: 2rem 0 1.6rem;
}
.demo-sheet-sender {
  font-size: 0.68rem;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.2rem;
  margin-bottom: 0.7rem;
}
.demo-sheet-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-soft); }
.demo-sheet-addr { font-style: normal; margin: 0.3rem 0 0; }
.demo-sheet-meta { font-size: 0.84rem; align-self: flex-start; }
.demo-sheet-meta th { text-align: left; color: var(--ink-soft); font-weight: 500; padding: 0.1rem 1rem 0.1rem 0; }
.demo-sheet-meta td { text-align: right; font-variant-numeric: tabular-nums; }

.demo-sheet-title { font-size: 1.35rem; margin: 0 0 0.2rem; color: var(--ink); }
.demo-sheet-subject { color: var(--ink-soft); margin: 0 0 1.4rem; }

.demo-sheet-items { width: 100%; border-collapse: collapse; }
.demo-sheet-items th {
  text-align: left;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--ink);
  padding: 0 0.5rem 0.4rem 0;
}
.demo-sheet-items td { padding: 0.55rem 0.5rem 0.55rem 0; border-bottom: 1px solid var(--rule); }
.demo-sheet-items .c-pos { width: 2.4rem; color: var(--ink-soft); }
.demo-sheet-items .c-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

.demo-sheet-sum { margin: 1.1rem 0 0 auto; font-variant-numeric: tabular-nums; }
.demo-sheet-sum th { text-align: left; font-weight: 500; color: var(--ink-soft); padding: 0.2rem 2rem 0.2rem 0; }
.demo-sheet-sum td { text-align: right; white-space: nowrap; }
.demo-sheet-sum .is-total th { color: var(--ink); font-weight: 700; }
.demo-sheet-sum .is-total td { font-weight: 700; font-size: 1.05rem; border-top: 2px solid var(--ink); }

.demo-sheet-terms { margin: 1.6rem 0 0; color: var(--ink-soft); font-size: 0.84rem; max-width: 58ch; }
.demo-sheet-paid {
  margin: 1.6rem 0 0;
  display: inline-block;
  border: 2px solid #1f7a4d;
  color: #1f7a4d;
  border-radius: 6px;
  padding: 0.2rem 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transform: rotate(-2deg);
}
.demo-sheet-foot {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  margin-top: 2.4rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--rule);
  color: var(--ink-soft);
  font-size: 0.76rem;
}

@media (max-width: 620px) {
  .demo-sheet { padding: 1.4rem 1.2rem; }
  .demo-sheet-head, .demo-sheet-cols, .demo-sheet-foot { flex-direction: column; gap: 1rem; }
  .demo-sheet-firm-meta { text-align: left; }
  .demo-sheet-sum { margin-left: 0; width: 100%; }
}

/* ---------- Druck ----------
   Gedruckt wird das Blatt, sonst nichts: Menue, Fusszeile, Demo-Streifen
   und alle Knoepfe verschwinden. */

@media print {
  .site-nav, .site-footer, .demo-bar, .demo-tabs, .demo-noprint,
  .back-to-top, .lang-hint, .bg-orbs, .alert-ok, .alert-bad { display: none !important; }
  body { background: #fff !important; color: #14181d !important; }
  .section { padding: 0 !important; }
  .container { max-width: none !important; padding: 0 !important; }
  .demo-sheet {
    box-shadow: none;
    border-radius: 0;
    max-width: none;
    padding: 0;
    font-size: 10.5pt;
  }
  @page { margin: 18mm 16mm; }
}
