/* ─────────────────────────────────────────────────────────────────────────
   Showlofts Frage-KI – Design
   Vom Gruender festgelegt: modern, uebersichtlich, minimalistisch.
   Nur das Logo bleibt; Akzentfarbe Petrol (aus dem Logo), Bordeaux fuer
   "Nur fuer uns". Hell + Dunkel umschaltbar, tablet-first (grosse Flaechen).
   ───────────────────────────────────────────────────────────────────────── */

:root {
  --akzent: #006d7a;          /* Petrol aus dem Logo */
  --akzent-hell: #e3f2f4;
  --intern: #5c0020;          /* Bordeaux aus dem Logo */
  --intern-bg: #fbeef2;
  --bg: #f7f8f9;
  --karte: #ffffff;
  --text: #1c2528;
  --text-2: #5c6a70;
  --rand: #e3e8ea;
  --schatten: 0 1px 3px rgba(20, 40, 45, .08);
  --ok: #1a7f4e;
}

[data-theme="dark"] {
  --akzent: #35b6c6;
  --akzent-hell: #0d3238;
  --intern: #e8a0b4;
  --intern-bg: #3a1220;
  --bg: #10181a;
  --karte: #1a2427;
  --text: #e8eef0;
  --text-2: #93a3a9;
  --rand: #2a373b;
  --schatten: 0 1px 3px rgba(0, 0, 0, .4);
  --ok: #4fca8c;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 17px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: var(--text); }
a { color: var(--akzent); }

/* ── Kopfleiste ── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: .8rem;
  padding: .6rem 1rem;
  background: var(--karte);
  border-bottom: 1px solid var(--rand);
}
.logo-chip {
  background: #fff; border-radius: 10px; padding: .3rem .6rem;
  display: flex; align-items: center;
  border: 1px solid var(--rand);
}
.logo-chip img { height: 30px; display: block; }
.topbar nav { display: flex; gap: .3rem; margin-left: .5rem; flex: 1; }
.nav-btn {
  border: none; background: none; color: var(--text-2);
  padding: .55rem .9rem; border-radius: 10px; font-weight: 600;
  position: relative;
}
.nav-btn.aktiv { background: var(--akzent-hell); color: var(--akzent); }
.badge {
  position: absolute; top: 2px; right: 2px;
  background: #d23b3b; color: #fff; font-size: .65rem; font-weight: 700;
  border-radius: 999px; min-width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}
.icon-btn {
  border: 1px solid var(--rand); background: var(--karte); color: var(--text-2);
  width: 42px; height: 42px; border-radius: 10px; font-size: 1.15rem;
  display: flex; align-items: center; justify-content: center;
}
.icon-btn.aktiv { background: var(--intern-bg); color: var(--intern); border-color: var(--intern); }

/* ── Warnleiste "Interne Infos sichtbar" ──
   Sichtbar im Normalzustand. In der Kundenansicht verschwindet sie, damit
   die App fuer den Kunden wie eine ganz normale App aussieht.            */
.intern-banner {
  display: flex; align-items: center; justify-content: center; gap: .8rem;
  flex-wrap: wrap;
  background: var(--intern); color: #fff;
  padding: .45rem 1rem; text-align: center; font-weight: 600; font-size: .92rem;
}
.intern-banner button {
  background: rgba(255,255,255,.22); color: #fff; border: 1px solid rgba(255,255,255,.35);
  border-radius: 8px; padding: .3rem .8rem; font-weight: 600;
}
.intern-banner button:active { background: rgba(255,255,255,.35); }

body.kundenansicht .intern-banner { display: none; }
body.kundenansicht .intern,
body.kundenansicht .nur-mitarbeiter { display: none !important; }
/* Der Umschalt-Knopf faellt in der Kundenansicht nicht auf */
body.kundenansicht #ansichtBtn { opacity: .35; }

/* ── Inhalt ── */
main { max-width: 880px; margin: 0 auto; padding: 1.2rem 1rem 4rem; }
.hidden { display: none !important; }
h1 { font-size: 1.35rem; margin-bottom: 1rem; }
h2 { font-size: 1.1rem; margin: 1.4rem 0 .6rem; }
.hinweis { color: var(--text-2); font-size: .9rem; }

.karte {
  background: var(--karte); border: 1px solid var(--rand);
  border-radius: 16px; padding: 1.1rem 1.2rem; box-shadow: var(--schatten);
}

/* ── Frage-Feld ── */
.frage-box { display: flex; gap: .6rem; align-items: flex-end; }
.frage-box textarea {
  flex: 1; min-height: 76px; resize: vertical;
  background: var(--karte); border: 2px solid var(--rand); border-radius: 16px;
  padding: .9rem 1rem; font-size: 1.05rem;
}
.frage-box textarea:focus { outline: none; border-color: var(--akzent); }
.rund-btn {
  width: 54px; height: 54px; border-radius: 50%;
  border: none; font-size: 1.3rem; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.btn-mikro { background: var(--akzent-hell); color: var(--akzent); }
.btn-mikro.aufnahme { background: #d23b3b; color: #fff; animation: puls 1.2s infinite; }
@keyframes puls { 50% { transform: scale(1.08); } }
.btn-senden { background: var(--akzent); color: #fff; }
.btn-senden:disabled { opacity: .5; cursor: wait; }

/* ── Antwortkarte ── */
.antwort { margin-top: 1rem; }
/* Kernaussage: bewusst gross - muss in einer Sekunde erfassbar sein */
.antwort .kern { font-size: 1.75rem; font-weight: 700; line-height: 1.25; letter-spacing: -.01em; }
.antwort ul { margin: .7rem 0 0 1.2rem; line-height: 1.6; }
.quelle { margin-top: .8rem; font-size: .85rem; color: var(--text-2); }
.intern-kasten {
  margin-top: .9rem; border: 1.5px solid var(--intern); background: var(--intern-bg);
  color: var(--intern); border-radius: 12px; padding: .7rem .9rem; font-size: .95rem;
}
.intern-kasten .titel { font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
.live-btn {
  display: inline-block; margin-top: .8rem;
  background: var(--akzent); color: #fff; text-decoration: none;
  padding: .6rem 1rem; border-radius: 10px; font-weight: 600;
}

/* ── Knoepfe allgemein ── */
.btn {
  background: var(--akzent); color: #fff; border: none;
  padding: .65rem 1.1rem; border-radius: 10px; font-weight: 600;
}
.btn.zweitrangig { background: var(--akzent-hell); color: var(--akzent); }
.btn.gefahr { background: #d23b3b; }
.btn.ok { background: var(--ok); }
.btn:disabled { opacity: .5; }

/* ── News ── */
.news-eintrag {
  display: flex; gap: .7rem; align-items: flex-start;
  padding: .7rem 0; border-bottom: 1px solid var(--rand);
}
.news-eintrag:last-child { border-bottom: none; }
.news-pin { flex-shrink: 0; }
.news-meta { font-size: .78rem; color: var(--text-2); margin-top: .15rem; }
.news-neu { display: flex; gap: .5rem; margin-top: .8rem; }
.news-neu input { flex: 1; border: 1.5px solid var(--rand); border-radius: 10px; padding: .55rem .8rem; background: var(--karte); }

/* ── Wiki ── */
.filter-leiste { display: flex; gap: .5rem; margin: 1rem 0; flex-wrap: wrap; }
.chip {
  border: 1.5px solid var(--rand); background: var(--karte); color: var(--text-2);
  padding: .45rem .9rem; border-radius: 999px; font-weight: 600; font-size: .9rem;
}
.chip.aktiv { background: var(--akzent); border-color: var(--akzent); color: #fff; }
.suchfeld {
  width: 100%; border: 2px solid var(--rand); border-radius: 12px;
  padding: .75rem 1rem; background: var(--karte); font-size: 1rem;
}
.suchfeld:focus { outline: none; border-color: var(--akzent); }
.shop-gitter {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: .8rem; margin-top: .5rem;
}
.shop-karte {
  background: var(--karte); border: 1px solid var(--rand); border-radius: 14px;
  padding: 1rem; text-align: left; box-shadow: var(--schatten);
  display: flex; flex-direction: column; gap: .35rem;
}
.shop-karte:active { transform: scale(.98); }
.shop-karte .name { font-weight: 700; font-size: 1.05rem; color: var(--text); }
.shop-karte .kurz { font-size: .85rem; color: var(--text-2); line-height: 1.4; }
.ort-badges { display: flex; gap: .35rem; margin-top: .3rem; }
.ort-badge {
  font-size: .72rem; font-weight: 700; padding: .15rem .5rem; border-radius: 6px;
  background: var(--akzent-hell); color: var(--akzent);
}

/* ── Shop-Seite ── */
.zurueck { background: none; border: none; color: var(--akzent); font-weight: 600; padding: .4rem 0; margin-bottom: .4rem; }
.stand-stempel { font-size: .8rem; color: var(--text-2); }
.link-leiste { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .5rem; }
.link-leiste a {
  background: var(--akzent-hell); color: var(--akzent); text-decoration: none;
  padding: .55rem .9rem; border-radius: 10px; font-weight: 600; font-size: .92rem;
}
.eintrag {
  padding: .7rem 0; border-bottom: 1px solid var(--rand); line-height: 1.5;
}
.eintrag:last-child { border-bottom: none; }
.eintrag .meta { font-size: .78rem; color: var(--text-2); margin-top: .25rem; }
.faq-frage { font-weight: 600; }
.intern-marke {
  display: inline-block; font-size: .7rem; font-weight: 700; text-transform: uppercase;
  background: var(--intern-bg); color: var(--intern); border: 1px solid var(--intern);
  padding: .1rem .45rem; border-radius: 6px; margin-left: .4rem; vertical-align: middle;
}

/* ── Formulare ── */
.feld { margin-bottom: .9rem; }
.feld label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: .3rem; }
.feld input[type="text"], .feld input[type="url"], .feld textarea, .feld select {
  width: 100%; border: 1.5px solid var(--rand); border-radius: 10px;
  padding: .6rem .8rem; background: var(--karte);
}
.feld textarea { min-height: 70px; resize: vertical; }
.feld .erklaerung { font-size: .8rem; color: var(--text-2); margin-top: .2rem; }
.check-zeile { display: flex; align-items: center; gap: .5rem; font-size: .95rem; }
.check-zeile input { width: 20px; height: 20px; }
.knopf-zeile { display: flex; gap: .6rem; margin-top: 1rem; flex-wrap: wrap; }

/* ── Pruefkorb ── */
.vorschlag-karte { margin-bottom: 1rem; }
.vorschlag-karte .meta { font-size: .8rem; color: var(--text-2); margin-bottom: .6rem; }

/* ── Überlagerung (Modal) ── */
.overlay {
  position: fixed; inset: 0; background: rgba(10, 20, 22, .55);
  display: flex; align-items: center; justify-content: center; z-index: 50; padding: 1rem;
}
.overlay .karte { max-width: 560px; width: 100%; max-height: 88vh; overflow-y: auto; }

/* ── Sperrbildschirm ──
   Deckt die gesamte App ab. Bewusst schlicht: nur Logo und Ziffernblock,
   damit ein Kunde nichts vom Inhalt sieht.                              */
.sperre {
  position: fixed; inset: 0; z-index: 200;
  background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1.1rem; padding: 1.5rem;
}
.sperre-logo {
  height: 46px; background: #fff; border-radius: 12px;
  padding: .5rem .9rem; border: 1px solid var(--rand);
}
.sperre-text { color: var(--text-2); font-weight: 600; }

/* Ausgefuellte Punkte statt sichtbarer Ziffern */
.sperre-punkte { display: flex; gap: .9rem; height: 20px; align-items: center; }
.sperre-punkte span {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid var(--text-2); transition: background .15s, transform .15s;
}
.sperre-punkte span.voll { background: var(--akzent); border-color: var(--akzent); transform: scale(1.12); }
.sperre-fehler { color: #d23b3b; font-weight: 600; min-height: 1.4rem; text-align: center; }
.sperre.falsch { animation: wackeln .4s; }
@keyframes wackeln {
  25% { transform: translateX(-9px); } 50% { transform: translateX(9px); }
  75% { transform: translateX(-5px); }
}

.ziffernblock {
  display: grid; grid-template-columns: repeat(3, 82px); gap: .75rem;
}
.ziffernblock button {
  height: 72px; border-radius: 50%; font-size: 1.6rem; font-weight: 600;
  border: 1.5px solid var(--rand); background: var(--karte); color: var(--text);
}
.ziffernblock button:active { background: var(--akzent-hell); border-color: var(--akzent); }
.ziffernblock button.leer { border: none; background: none; }
.ziffernblock button:disabled { opacity: .35; }

/* Solange gesperrt: nichts von der App durchscheinen lassen */
body.gesperrt .topbar,
body.gesperrt main,
body.gesperrt .intern-banner,
body.gesperrt .overlay { visibility: hidden; }

/* ── Meldungen ── */
.toast {
  position: fixed; bottom: 1.2rem; left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: .7rem 1.2rem;
  border-radius: 12px; font-weight: 600; z-index: 99; box-shadow: var(--schatten);
}

@media (max-width: 600px) {
  html { font-size: 16px; }
  .topbar { flex-wrap: wrap; }
  .topbar nav { order: 3; width: 100%; justify-content: space-around; margin-left: 0; }
}
