/* Anonyme Fragen — lokales Stylesheet. Nur System-Fonts, keine externen
   Fonts/CDN (DSGVO). Signatur: das Fragezeichen als großes, blasses Motiv
   und ein Akzentverlauf Indigo → Türkis. */

:root {
  --ink:      #15191f;
  --ink-soft: #5a626e;
  --line:     #e2e5ea;
  --paper:    #f6f7f9;
  --card:     #ffffff;

  --akzent:      #4b56d2;
  --akzent-2:    #21a3a3;
  --akzent-weich: #eef0fd;
  --gut:      #2e9e6b;
  --warn:     #d99500;
  --gefahr:   #d1442c;

  --radius: 12px;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

/* Signatur: dünner Akzentstreifen ganz oben. */
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 4px;
  z-index: 10;
  background: linear-gradient(to right, var(--akzent), var(--akzent-2));
}

main {
  max-width: 860px;
  margin: 0 auto;
  padding: 3.25rem 1.25rem 5rem;
}
main.schmal { max-width: 620px; }
main.zentrum { text-align: center; }

h1 { font-size: 1.65rem; line-height: 1.25; margin: 0 0 .35rem; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; margin: 0 0 .5rem; }

/* Fragezeichen-Motiv hinter der Überschrift der öffentlichen Seite. */
body.oeffentlich main { position: relative; }
body.oeffentlich main::before {
  content: "?";
  position: absolute;
  top: -1.6rem;
  right: .5rem;
  font-size: 9rem;
  line-height: 1;
  font-weight: 700;
  color: var(--akzent);
  opacity: .07;
  pointer-events: none;
}

.tag {
  margin: 0 0 1.25rem;
  color: var(--ink-soft);
  font-size: .95rem;
}

.intro {
  background: var(--akzent-weich);
  border-left: 3px solid var(--akzent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: .85rem 1rem;
  margin: 0 0 1.5rem;
  font-size: .95rem;
}

.eyebrow {
  display: block;
  font-size: .72rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 600;
  margin-bottom: .3rem;
}

/* ---------- Formulare ---------- */

.feld { display: block; margin: 0 0 1.1rem; }

textarea, input[type="text"], input[type="password"] {
  width: 100%;
  font: inherit;
  color: inherit;
  padding: .65rem .75rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
textarea { resize: vertical; min-height: 5.5rem; }
textarea:focus, input:focus {
  outline: 2px solid var(--akzent);
  outline-offset: 1px;
  border-color: var(--akzent);
}

button {
  font: inherit;
  cursor: pointer;
  border: 0;
  border-radius: var(--radius);
  padding: .6rem 1.15rem;
  background: var(--akzent);
  color: #fff;
  font-weight: 600;
}
button:hover { filter: brightness(1.08); }
button[disabled] { opacity: .55; cursor: progress; }

button.link {
  background: none;
  color: var(--akzent);
  padding: .15rem .2rem;
  font-weight: 500;
  text-decoration: underline;
}
button.link.gefahr { color: var(--gefahr); }
button.knopf-klein { padding: .35rem .8rem; font-size: .88rem; }

.aktionsleiste {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.zaehler { color: var(--ink-soft); font-size: .82rem; font-variant-numeric: tabular-nums; }

/* Honeypot: für Menschen unsichtbar. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

form.inline { display: inline; }
form.neu { display: flex; gap: .75rem; align-items: flex-end; margin-bottom: 2rem; }
form.neu .feld { flex: 1; margin: 0; }

/* ---------- Hinweise ---------- */

.fehler, .ok {
  border-radius: var(--radius);
  padding: .6rem .8rem;
  margin: 0 0 1rem;
  font-size: .95rem;
}
.fehler { background: #fdecea; border-left: 3px solid var(--gefahr); }
.ok     { background: #e9f7f0; border-left: 3px solid var(--gut); }
.leer-hinweis { color: var(--ink-soft); }
.leer-hinweis.gross { font-size: 1.4rem; }

/* ---------- Eigene Fragen (Schüleransicht) ---------- */

.eigene { margin: 0 0 1.5rem; }
.eigene ul { list-style: none; margin: 0; padding: 0; }
.eigene li {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--akzent-2);
  border-radius: var(--radius);
  padding: .6rem .8rem;
  margin-bottom: .5rem;
}

/* ---------- Admin: Kopf, Tabelle ---------- */

.kopf { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.zurueck { display: inline-block; margin-bottom: 1rem; color: var(--ink-soft); text-decoration: none; }
.zurueck:hover { color: var(--akzent); }
.meta { color: var(--ink-soft); font-size: .92rem; margin: .25rem 0 1.5rem; }
a { color: var(--akzent); }

table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: .6rem .5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
td.aktionen { white-space: nowrap; }

.status {
  display: inline-block;
  font-size: .75rem;
  font-weight: 600;
  padding: .1rem .5rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.status.offen { background: #e9f7f0; color: var(--gut); }
.status.geschlossen { background: #f1f2f5; color: var(--ink-soft); }

.linkzelle { display: flex; align-items: center; gap: .3rem; }
.linkfeld { font-family: var(--mono); font-size: .78rem; padding: .3rem .4rem; min-width: 12rem; }
button.icon {
  background: none;
  color: var(--ink-soft);
  padding: .3rem;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}
button.icon:hover { color: var(--akzent); }
button.icon.kopiert { color: var(--gut); }
button.icon.mit-text { font-size: .88rem; }

.qr-dialog { border: 0; border-radius: var(--radius); padding: 1.25rem; box-shadow: 0 10px 40px rgb(0 0 0 / .25); }
.qr-dialog::backdrop { background: rgb(0 0 0 / .35); }
.qr-wrap { width: 240px; margin: 0 auto; }
.qr-wrap svg { width: 100%; height: auto; display: block; }
.qr-link { font-family: var(--mono); font-size: .72rem; text-align: center; color: var(--ink-soft); word-break: break-all; }
.qr-actions { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
button.schliessen { background: var(--ink); }

/* ---------- Admin: Fragenliste mit Live-Refresh ---------- */

.live {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  color: var(--gut);
  font-size: .82rem;
  font-weight: 600;
}
.live::before {
  content: "";
  width: .5rem;
  height: .5rem;
  border-radius: 50%;
  background: currentColor;
  animation: puls 2s ease-in-out infinite;
}
.live.gestoert { color: var(--warn); }
@keyframes puls { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) {
  .live::before { animation: none; }
}

.bulk { display: flex; gap: 1.25rem; margin-bottom: 1rem; font-size: .9rem; }

ul.fragen { list-style: none; margin: 0; padding: 0; }
li.frage {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--akzent);
  border-radius: var(--radius);
  padding: .8rem 1rem .5rem;
  margin-bottom: .75rem;
}
li.frage .text {
  margin: 0 0 .4rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 1.05rem;
}
li.frage .fusszeile {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: .82rem;
  color: var(--ink-soft);
}
li.frage .datum { font-variant-numeric: tabular-nums; }
li.frage.versteckt { opacity: .55; border-left-color: var(--line); }
li.frage.versteckt .text { text-decoration: line-through; text-decoration-color: var(--line); }
li.frage.neu { animation: eingang 1.6s ease-out; }
@keyframes eingang {
  from { background: var(--akzent-weich); transform: translateY(-4px); }
  to   { background: var(--card); transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  li.frage.neu { animation: none; }
}

/* ---------- Beamer-Ansicht ---------- */

body.beamer {
  background: #10131a;
  color: #f4f5f7;
}
body.beamer main { max-width: 1100px; min-height: 100vh; display: flex; flex-direction: column; }
body.beamer .zurueck { color: #7d8798; }
body.beamer .zurueck:hover { color: #fff; }

.beamer-text {
  flex: 1;
  display: flex;
  align-items: center;
  margin: 0;
  font-size: clamp(1.8rem, 5vw, 3.4rem);
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -.015em;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.beamer-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding: 1rem 0 .25rem;
}
.beamer-nav .pfeil {
  font-size: 2rem;
  line-height: 1;
  text-decoration: none;
  color: #f4f5f7;
  padding: .25rem .9rem;
  border: 1px solid #2b313d;
  border-radius: var(--radius);
}
.beamer-nav .pfeil:hover { background: #1b202b; }
.beamer-nav .pfeil.aus { opacity: .25; pointer-events: none; }
.beamer-nav .zaehler { color: #7d8798; font-size: 1rem; }
.beamer-hinweis { text-align: center; color: #5c6577; font-size: .85rem; margin: 0; }

/* ---------- Klein ---------- */

@media (max-width: 640px) {
  form.neu { flex-direction: column; align-items: stretch; }
  .linkzelle { flex-wrap: wrap; }
  .linkfeld { min-width: 8rem; }
  table, thead, tbody, tr, th, td { display: block; }
  thead { display: none; }
  tr { border-bottom: 1px solid var(--line); padding: .5rem 0; }
  td { border: 0; padding: .25rem 0; }
}
