/* app.css – qCollect im Design der qFamily (seit 16.11.2026).
   Grundlage wie qteach.de/qpicdoc/qpicdoc.css (qPicdoc, qHandout, qFeedback): Kopf in Navy mit Symbol,
   hellgrauer Grund, weiße Karten, Überschriften Didact Gothic 400, Text Arial.
   Akzent Orange aus dem Symbol; die vier Felder des Symbols sind die Farben der Antworten A–D.
   Die Klassennamen der Seiten (card, btn, form-control …) sind geblieben, nur ihr Aussehen ist neu.
   Farben nur hier ändern – es gibt keine Schulfarben mehr. */
:root {
  --navy:          #1e3a5f;
  --akzent:        #fb923c;
  --akzent-hell:   #fdba74;
  --akzent-dunkel: #c2410c;
  --akzent-flaeche:#fff7ed;
  --grund:         #f4f6f9;
  --karte:         #fff;
  --text:          #1f2937;
  --leise:         #64748b;
  --linie:         #dbe2ea;
  --feldrand:      #c7d0db;
  --gut:           #15803d;
  --gut-flaeche:   #f0fdf4;
  --rot:           #b91c1c;
  --rot-flaeche:   #fef2f2;
  --info:          #1d4ed8;
  --antwort-a:     #fb923c;
  --antwort-b:     #facc15;
  --antwort-c:     #4ade80;
  --antwort-d:     #60a5fa;
  --schrift:       Arial, Helvetica, sans-serif;
  --schrift-titel: 'Didact Gothic', Arial, sans-serif;

  /* alte Namen, die noch in Inline-Stilen der Seiten stehen */
  --header-bg:  var(--navy);
  --accent:     var(--akzent);
  --bg:         var(--grund);
  --border:     var(--linie);
  --text-muted: var(--leise);
  --success:    var(--gut);
  --danger:     var(--rot);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

body {
  font-family: var(--schrift);
  background: var(--grund);
  color: var(--text);
  line-height: 1.45;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--navy); }
code { font-family: ui-monospace, Consolas, monospace; }

/* ── Kopf ─────────────────────────────────────── */
.kopf {
  display: flex; align-items: center; gap: 14px;
  background: var(--navy); color: #fff;
  padding: 14px 20px;
}
.kopf-start { display: block; line-height: 0; flex: none; }
.kopf .marke { width: 46px; height: 46px; border-radius: 11px; box-shadow: 0 0 0 2px rgba(255,255,255,.25); }
.kopf h1 { margin: 0; font-family: var(--schrift-titel); font-weight: 400; font-size: 1.7rem; line-height: 1.1; }
.kopf h1 b { font-weight: 400; color: var(--akzent); }
.kopf p { margin: 2px 0 0; opacity: .85; font-size: .95rem; }
.kopf-rechts { margin-left: auto; display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; font-size: .92rem; }
.kopf-rechts a { color: #fff; opacity: .85; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.kopf-rechts a:hover, .kopf-rechts a.aktiv { opacity: 1; text-decoration: underline; }
.kopf-rechts a.aktiv { text-underline-offset: 4px; }
@media (max-width: 640px) {
  .kopf { flex-wrap: wrap; }
  .kopf-rechts { margin-left: 0; width: 100%; }
}

/* ── Rahmen ───────────────────────────────────── */
.main-content { flex: 1; width: 100%; max-width: 1280px; margin: 0 auto; padding: 16px; }
.app-footer, .fuss { text-align: center; font-size: .82rem; color: var(--leise); padding: 20px 16px 28px; }
.app-footer a, .fuss a { color: inherit; }

.page-header {
  margin: 4px 0 16px;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.page-header h1 { font-family: var(--schrift-titel); font-weight: 400; font-size: 1.7rem; line-height: 1.2; color: var(--navy); }
.page-header p { color: var(--leise); font-size: .92rem; margin-top: 4px; }
.zurueck { color: var(--leise); font-size: .9rem; text-decoration: none; }
.zurueck:hover { text-decoration: underline; }

/* ── Karten ───────────────────────────────────── */
.card { background: var(--karte); border: 1px solid var(--linie); border-radius: 12px; overflow: hidden; }
.card-header {
  padding: 12px 18px; border-bottom: 1px solid var(--linie);
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
.card-header h2 { font-family: var(--schrift-titel); font-weight: 400; font-size: 1.3rem; color: var(--navy); }
.card-body { padding: 16px 18px; }
h2 small, .card-header small { font-family: var(--schrift); font-size: .85rem; color: var(--leise); }

/* ── Raster ───────────────────────────────────── */
.grid   { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
/* Zwei Spalten ab 960 px, darunter untereinander (wie qFeedback) */
.raster { display: grid; gap: 16px; align-items: start; }
.raster > * { min-width: 0; }
@media (min-width: 960px) {
  .raster.dash   { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
  .raster.detail { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
  .klebt { position: sticky; top: 16px; }
}
@media (max-width: 959px) {
  .raster.detail .start-karte { order: -1; }   /* Handy/Tablet: Code zuerst */
}

/* Kennzahlen (Admin-Seiten) */
.stat-card { background: var(--karte); border: 1px solid var(--linie); border-radius: 12px; padding: 16px 18px; }
.stat-value { font-family: var(--schrift-titel); font-size: 2rem; line-height: 1; margin: 6px 0 4px; color: var(--navy); }
.stat-label { color: var(--leise); font-size: .88rem; }

/* ── Knöpfe (wie .knopf / .knopf.zweit der qFamily) ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45em;
  padding: 9px 16px; border-radius: 10px; border: 2px solid transparent;
  font: inherit; font-size: .95rem; font-weight: bold; line-height: 1.25;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  background: #fff; color: var(--navy);
}
.btn:focus-visible { outline: 3px solid #2563eb; outline-offset: 2px; }
.btn:disabled { opacity: .45; cursor: default; }
.btn-primary  { background: var(--akzent); color: var(--text); border-color: var(--akzent); }
.btn-primary:hover { background: var(--akzent-hell); border-color: var(--akzent-hell); }
.btn-success  { background: var(--gut); color: #fff; border-color: var(--gut); }
.btn-success:hover { background: #166534; border-color: #166534; }
/* Live-Quiz (Übergabe an qSolve): eigene Farbe, Symbol einfarbig weiß wie die Schrift. */
.btn-live     { background: #ab2617; color: #fff; border-color: #ab2617; }
.btn-live:hover { background: #8c1f13; border-color: #8c1f13; }
.btn-live .qi { color: #fff; }
.btn-outline, .btn-secondary, .btn-warning { background: #fff; color: var(--navy); border-color: var(--navy); }
.btn-outline:hover, .btn-secondary:hover, .btn-warning:hover { background: #eef3f9; }
.btn-danger   { background: #fff; color: var(--rot); border-color: #fecaca; }
.btn-danger:hover { background: var(--rot-flaeche); border-color: var(--rot); }
.btn-ghost    { background: transparent; color: #fff; border-color: rgba(255,255,255,.45); }
.btn-sm  { padding: 5px 10px; font-size: .85rem; border-width: 1.5px; border-radius: 8px; }
.btn-lg  { padding: 12px 22px; font-size: 1.05rem; }
.btn-group-mobile { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Formulare ────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-weight: bold; font-size: .92rem; margin-bottom: 6px; color: var(--text); }
.form-label .required { color: var(--akzent-dunkel); margin-left: .2rem; }
.form-control {
  display: block; width: 100%; font: inherit; font-size: 1rem; color: var(--text);
  padding: 8px 10px; border: 1px solid var(--feldrand); border-radius: 6px; background: #fff;
}
.form-control:focus { outline: 2px solid var(--navy); outline-offset: 0; border-color: var(--navy); }
.form-control::placeholder { color: #94a3b8; }
textarea.form-control { resize: vertical; min-height: 70px; }
.form-hint { font-size: .85rem; color: var(--leise); margin-top: 4px; display: block; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }

.check-group { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 6px; cursor: pointer; }
.check-group:hover { background: var(--grund); }
.check-group input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; accent-color: var(--navy); }
.check-group label { cursor: pointer; }

/* ── Tabellen ─────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th {
  background: var(--grund); padding: 8px 14px; text-align: left;
  font-size: .85rem; font-weight: bold; color: var(--leise); border-bottom: 1px solid var(--linie);
}
td { padding: 10px 14px; border-bottom: 1px solid var(--linie); vertical-align: middle; }
tr:last-child td { border-bottom: none; }

/* ── Marken (Badges) ──────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: .3em;
  padding: 2px 9px; border-radius: 999px; font-size: .8rem; font-weight: bold; white-space: nowrap;
}
.badge-green  { background: var(--gut-flaeche); color: #166534; }
.badge-red    { background: var(--rot-flaeche); color: #991b1b; }
.badge-blue   { background: #eef3f9; color: var(--navy); }
.badge-yellow { background: #fef9c3; color: #854d0e; }
.badge-gray   { background: #eef2f6; color: #475569; }
.badge-purple { background: #eef3f9; color: var(--navy); }

/* ── Meldungen ────────────────────────────────── */
.alert { border: 1px solid; border-radius: 8px; padding: 8px 12px; margin-bottom: 14px; font-size: .95rem; transition: opacity .4s; }
.alert-success { background: var(--gut-flaeche); border-color: #bbf7d0; color: #166534; }
.alert-error   { background: var(--rot-flaeche); border-color: #fecaca; color: #991b1b; }
.alert-info    { background: #eef3f9; border-color: #c7d6e8; color: var(--navy); }
.alert-warning { background: var(--akzent-flaeche); border-color: #fed7aa; color: #9a3412; }

/* ── Antwort-Buchstaben A–D (Farben aus dem Symbol) ── */
.answer-label {
  width: 26px; height: 26px; border-radius: 6px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: bold; color: var(--text);
}
.answer-a { background: color-mix(in srgb, var(--antwort-a) 35%, #fff); }
.answer-b { background: color-mix(in srgb, var(--antwort-b) 40%, #fff); }
.answer-c { background: color-mix(in srgb, var(--antwort-c) 35%, #fff); }
.answer-d { background: color-mix(in srgb, var(--antwort-d) 35%, #fff); }

/* ── Fragen prüfen (Lehrkraft) ────────────────── */
.q-review-card { border: 1px solid var(--linie); border-radius: 10px; overflow: hidden; margin-bottom: 12px; background: #fff; }
.q-review-header {
  padding: 8px 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap;
  border-bottom: 1px solid var(--linie); background: var(--grund);
}
.q-review-body { padding: 12px 14px; }
.q-review-body > p:first-child { font-weight: bold; font-size: 1.02rem; margin-bottom: 8px; }
.q-review-answers { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
.q-answer-pill {
  padding: 6px 10px; border-radius: 8px; display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--feldrand); background: #fff;
}
.q-answer-pill.correct { border: 2px solid var(--gut); background: var(--gut-flaeche); font-weight: bold; }
.q-answer-pill.correct .qi { color: var(--gut); }
.edit-correct-cb { accent-color: var(--gut) !important; }
.q-answer-pill.wrong { color: #334155; }
.q-review-card[data-approved="1"] { border-color: #bbf7d0; }

/* ── Startkarte: Code und QR für die Klasse (wie qFeedback) ── */
.start-karte .card-body { display: grid; gap: 14px; }
.ausgabe { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.ausgabe .qr { width: 190px; aspect-ratio: 1; flex: none; background: #fff; }
.ausgabe .qr svg { display: block; width: 100%; height: 100%; }
.code-text p { margin: 0; }
.code-text .klein { font-size: .9rem; color: var(--leise); }
.code-text .adresse { font-family: var(--schrift-titel); font-size: 1.6rem; color: var(--navy); line-height: 1.2; }
.code-gross {
  font-family: ui-monospace, Consolas, monospace; font-size: 2.6rem; font-weight: 800; letter-spacing: .08em;
  line-height: 1.15; color: var(--navy); background: none; border: 0; padding: 0; cursor: copy;
}
.code-gross:hover { text-decoration: underline dotted; text-underline-offset: 6px; }
.start-karte.aus .qr, .start-karte.aus .code-gross { opacity: .3; }
.start-link { font-size: .85rem; color: var(--leise); overflow-wrap: anywhere; }
.start-karte .knoepfe { display: flex; gap: 8px; flex-wrap: wrap; }
.kopiert { color: var(--gut); font-weight: bold; font-size: .9rem; }

/* ── Session-Liste (Dashboard) ────────────────── */
.sitzungen { list-style: none; }
.sitzung { padding: 12px 18px; border-bottom: 1px solid var(--linie); display: grid; gap: 6px; }
.sitzung:last-child { border-bottom: 0; }
.sitzung-titel { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sitzung-titel a { font-weight: bold; font-size: 1.02rem; color: var(--navy); text-decoration: none; }
.sitzung-titel a:hover { text-decoration: underline; }
.sitzung-daten { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .88rem; color: var(--leise); }
.sitzung-daten code { color: var(--text); font-weight: bold; letter-spacing: .04em; }
.sitzung-knoepfe { display: flex; gap: 6px; flex-wrap: wrap; }
.sitzung-knoepfe form { display: contents; }
.leer-hinweis { padding: 14px 18px; color: var(--leise); font-size: .92rem; }

/* ── Dialoge ──────────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 1000;
  background: rgba(15,23,42,.45); align-items: center; justify-content: center; padding: 16px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: #fff; border-radius: 12px; padding: 18px 20px; width: 100%; max-width: 640px;
  max-height: 90vh; overflow-y: auto; border: 1px solid var(--linie); box-shadow: 0 20px 60px rgba(15,23,42,.2);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.modal-header h3 { font-family: var(--schrift-titel); font-weight: 400; font-size: 1.3rem; color: var(--navy); }
.modal-close { background: none; border: 0; cursor: pointer; padding: 4px; border-radius: 6px; color: var(--leise); font: inherit; }
.modal-close:hover { background: var(--grund); }
.modal .knoepfe-rechts { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }

/* ── Leerer Zustand ───────────────────────────── */
.empty-state { text-align: center; padding: 36px 18px; color: var(--leise); }
.empty-state .empty-icon { font-size: 2.2rem; margin-bottom: 10px; color: var(--navy); }
.empty-state h3 { font-family: var(--schrift-titel); font-weight: 400; font-size: 1.25rem; margin-bottom: 6px; color: var(--navy); }

/* ── Reiter (Admin) ───────────────────────────── */
.tabs { display: flex; border-bottom: 1px solid var(--linie); margin-bottom: 16px; }
.tab { padding: 8px 14px; font-weight: bold; text-decoration: none; color: var(--leise); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--navy); border-bottom-color: var(--akzent); }

/* ── Dashboard ────────────────────────────────── */
.dash-neu { border: 2px solid var(--akzent); }
.dash-neu-felder { display: grid; grid-template-columns: 2fr 1fr; gap: 0 14px; }
.dash-neu-felder .form-group:only-child { grid-column: 1 / -1; }
.dash-statistik {
  display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 4px; padding: 10px 2px 0;
  font-size: .85rem; color: var(--leise);
}
.dash-statistik strong { color: var(--text); }

/* ── Hilfsklassen ─────────────────────────────── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.text-sm { font-size: .88rem; }
.text-muted { color: var(--leise); }
.text-center { text-align: center; }
.w-full { width: 100%; }
.font-bold { font-weight: bold; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 768px) {
  .form-row, .dash-neu-felder, .q-review-answers { grid-template-columns: 1fr; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; }
  .code-gross { font-size: 2.1rem; }
}

/* ================================================================== */
/*  Startseite index.php (bis 16.11.2026 Inline-CSS in login.php)      */
/* ================================================================== */
.start { display: grid; gap: 16px; align-items: start; }
@media (min-width: 900px) { .start { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); } }
.start > * { min-width: 0; }

.code-karte .card-body { padding: 22px; }
.code-karte h2 { font-family: var(--schrift-titel); font-weight: 400; font-size: 1.9rem; color: var(--navy); margin-bottom: 4px; }
.code-karte .unter { color: var(--leise); margin-bottom: 16px; }
.code-join-row { display: flex; gap: 10px; }
.code-input {
  flex: 1; min-width: 0; padding: 12px; text-align: center; letter-spacing: .3em;
  font-family: ui-monospace, Consolas, monospace; font-size: 2.2rem; font-weight: bold; color: var(--navy);
  border: 2px solid var(--feldrand); border-radius: 10px; background: #fff;
}
.code-input::placeholder { color: #cbd5e1; }
.code-input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(30,58,95,.2); }
.code-btn { font-size: 1.4rem; padding: 0 24px; }
.code-karte .klein { margin-top: 10px; font-size: .9rem; color: var(--leise); }

/* Links – bewusst ohne Symbole */
.lp-links { list-style: none; }
.lp-links li + li { border-top: 1px solid var(--linie); }
.lp-ext-link { display: flex; align-items: center; gap: 12px; padding: 12px 18px; text-decoration: none; color: var(--text); }
.lp-ext-link:hover { background: var(--grund); }
.link-label { font-weight: bold; color: var(--navy); }
.link-sub { font-size: .88rem; color: var(--leise); }
.link-pfeil { margin-left: auto; color: var(--leise); }
.lp-ext-link.lehrkraft .link-label { color: var(--akzent-dunkel); }

/* Einblick mit unscharfen Bildschirmfotos */
.einblicke { display: grid; gap: 14px; list-style: none; }
/* Festes Seitenverhältnis statt fester Höhe: Der Ausschnitt ist dann bei jeder Breite derselbe Teil des Bildes. */
.einblick-bild { aspect-ratio: 700 / 220; border-radius: 10px; overflow: hidden; border: 1px solid var(--linie); background: var(--grund); }
.einblick-bild img {
  display: block; width: 100%; height: 100%; object-fit: cover; object-position: center top;
  /* Nur ein Eindruck, nichts zum Lesen: unscharf und etwas vergrößert,
     damit am Rand kein heller Weichzeichner-Saum entsteht. */
  filter: blur(3.5px) saturate(.9); transform: scale(1.08);
}
.einblick-bild img.mitte { object-position: center 70%; }
/* Lobby: die Spielerliste zeigen, nicht den großen Code – der würde sonst
   trotz Unschärfe gelesen und hier eingetippt. */
.einblick-bild img.unten { object-position: center 100%; }
.einblick figcaption { display: flex; align-items: baseline; gap: 8px; margin-top: 6px; font-size: .92rem; }
.einblick-nr {
  flex-shrink: 0; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--navy); color: #fff;
  font-size: .8rem; font-weight: bold; display: inline-grid; place-items: center;
}
.einblick figcaption strong { color: var(--navy); }
.einblick-app { color: var(--leise); font-size: .85rem; }
@media (min-width: 560px) and (max-width: 899px) { .einblicke { grid-template-columns: repeat(3, 1fr); } }
