/* =================================================================
   Feedback-Webanwendung – Stylesheet
   Farben kommen als CSS-Variablen aus den Admin-Einstellungen
   (in <html style="--brand:…"> via PHP gesetzt).
   ================================================================= */

/* ----- Lokale Schriften -------------------------------------------
   Standard: System-Schriften (kein externer Ladevorgang, DSGVO-freundlich).
   Eigene Schrift gewünscht? .woff2 nach assets/fonts/ legen und den
   folgenden Block aktivieren – sonst greift der System-Stack unten.

@font-face {
  font-family: "AppSans";
  src: url("fonts/app-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
------------------------------------------------------------------- */

:root {
  --brand:    #5B4B8A;
  --positive: #1F9E8A;
  --negative: #E26D5A;
  --accent:   #E9B949;

  --ink:      #1f2430;
  --ink-soft: #5b6472;
  --line:     #e7e3da;
  --paper:    #fbfaf7;
  --surface:  #ffffff;
  --shadow:   0 1px 2px rgba(31,36,48,.06), 0 8px 24px rgba(31,36,48,.06);
  --radius:   16px;

  --font: "AppSans", system-ui, -apple-system, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --brand-ink: #fff;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  font-size: 16px;
}

h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.5rem, 4vw, 2.1rem); font-weight: 800; }
h2 { font-size: clamp(1.2rem, 3vw, 1.5rem); font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 700; }
p  { margin: 0 0 1rem; }
a  { color: var(--brand); }

/* ----- Layout ---------------------------------------------------- */
.topbar {
  display: flex; align-items: center; gap: .75rem;
  padding: .7rem 1.1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topbar .brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; color: var(--ink); text-decoration: none; }
.topbar .brand img { height: 34px; width: auto; display: block; }
.topbar .brand .dot {
  height: 30px; width: 30px; border-radius: 9px;
  background: var(--brand); display: grid; place-items: center;
  color: var(--brand-ink); font-weight: 800;
}
.topbar .spacer { flex: 1; }
.topbar .who { color: var(--ink-soft); font-size: .9rem; }

.wrap { max-width: 960px; margin: 0 auto; padding: 1.5rem 1.1rem 4rem; }
.wrap.narrow { max-width: 560px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.4rem;
  margin-bottom: 1.1rem;
}
.muted { color: var(--ink-soft); }
.small { font-size: .88rem; }
.center { text-align: center; }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }
.grid { display: grid; gap: 1rem; }
@media (min-width: 640px) { .grid.cols-2 { grid-template-columns: 1fr 1fr; } }

/* ----- Formulare ------------------------------------------------- */
label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: .3rem; }
.field { margin-bottom: 1rem; }
.hint { font-weight: 400; color: var(--ink-soft); font-size: .85rem; margin: .2rem 0 0; }
input[type=text], input[type=email], input[type=password], input[type=number],
select, textarea {
  width: 100%;
  font: inherit; color: var(--ink);
  padding: .65rem .75rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 11px;
}
textarea { min-height: 64px; resize: vertical; }
input:focus, select:focus, textarea:focus,
button:focus-visible, a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 35%, transparent);
  outline-offset: 1px;
  border-color: var(--brand);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  font: inherit; font-weight: 600; cursor: pointer;
  padding: .65rem 1.1rem; border-radius: 11px;
  background: var(--brand); color: var(--brand-ink);
  border: 1px solid transparent; text-decoration: none;
}
.btn:hover { filter: brightness(.96); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.ghost { background: transparent; color: var(--brand); }
.btn.danger { background: var(--negative); }
.btn.block { width: 100%; }
.btn.lg { padding: .85rem 1.3rem; font-size: 1.05rem; }

/* ----- Tabellen -------------------------------------------------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .6rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); }
.table-wrap { overflow-x: auto; }

/* ----- Badges / Pills ------------------------------------------- */
.pill { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; font-weight: 600;
        padding: .2rem .6rem; border-radius: 999px; background: #f0eef9; color: var(--brand); }
.pill.ok { background: color-mix(in srgb, var(--positive) 16%, #fff); color: var(--positive); }
.pill.wait { background: #f3f1ec; color: var(--ink-soft); }
.code-badge { font-size: clamp(1.8rem, 9vw, 2.6rem); font-weight: 800; letter-spacing: .25em;
              font-variant-numeric: tabular-nums; color: var(--brand); }

.tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.tabs a { padding: .45rem .9rem; border-radius: 999px; text-decoration: none; color: var(--ink-soft); font-weight: 600; }
.tabs a.active { background: var(--brand); color: var(--brand-ink); }

.notice { padding: .8rem 1rem; border-radius: 11px; margin-bottom: 1rem; font-size: .95rem; }
.notice.err { background: color-mix(in srgb, var(--negative) 12%, #fff); color: #8a2f22; border: 1px solid color-mix(in srgb, var(--negative) 40%, #fff); }
.notice.ok  { background: color-mix(in srgb, var(--positive) 12%, #fff); color: #0f5d51; border: 1px solid color-mix(in srgb, var(--positive) 40%, #fff); }

/* ----- Feedback-Wolken (Runde 2 & 3) ---------------------------- */
.cloud-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 620px) { .cloud-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 980px) { .cloud-grid { grid-template-columns: 1fr 1fr 1fr; } }

.cloud {
  position: relative;
  border-radius: 22px;
  padding: 1rem 1.1rem 1rem;
  border: 1.5px solid;
  background: #fff;
  animation: pop .35s ease both;
}
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.cloud.positive { border-color: var(--positive); background: color-mix(in srgb, var(--positive) 8%, #fff); }
.cloud.negative { border-color: var(--negative); background: color-mix(in srgb, var(--negative) 8%, #fff); }
.cloud .tag { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.cloud.positive .tag { color: var(--positive); }
.cloud.negative .tag { color: var(--negative); }
.cloud .body { margin: .35rem 0 .8rem; white-space: pre-wrap; word-break: break-word; }

.cloud-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.vote {
  display: inline-flex; align-items: center; gap: .35rem;
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: .35rem .7rem; font: inherit; font-weight: 600; cursor: pointer; color: var(--ink-soft);
}
.vote.active.up   { background: color-mix(in srgb, var(--positive) 18%, #fff); border-color: var(--positive); color: var(--positive); }
.vote.active.down { background: color-mix(in srgb, var(--negative) 18%, #fff); border-color: var(--negative); color: var(--negative); }
.cloud select { margin-top: .6rem; }

.cloud .author { font-weight: 700; }
.cloud .likecount { display: inline-flex; gap: .8rem; font-weight: 600; }
.cloud .likecount .up { color: var(--positive); }
.cloud .likecount .down { color: var(--negative); }
.guess-line { margin-top: .5rem; font-size: .9rem; }
.guess-line .right { color: var(--positive); font-weight: 700; }
.guess-line .wrong { color: var(--negative); font-weight: 700; }

/* ----- Status / Polling ----------------------------------------- */
.statusbar { display: flex; flex-wrap: wrap; gap: .6rem 1.2rem; align-items: center; }
.big-num { font-size: 1.6rem; font-weight: 800; line-height: 1; }
.dotpulse { width: 9px; height: 9px; border-radius: 50%; background: var(--positive); display: inline-block;
            animation: pulse 1.4s infinite; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .25 } }

/* ----- Druck / PDF ---------------------------------------------- */
@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
  .wrap { padding: 0; max-width: none; }
  .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .cloud { break-inside: avoid; }
  .cloud-grid { grid-template-columns: 1fr 1fr; }
  a { color: inherit; text-decoration: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
