/* KlickAgent Loyalty – Design-Tokens nach Vesena (siehe docs/DESIGN.md).
   Alle Komponenten nutzen ausschließlich diese Variablen. */

@font-face { font-family: "Mona Sans"; src: url(/static/fonts/mona-sans-latin.woff2) format("woff2"); font-weight: 200 900; font-display: swap; }
@font-face { font-family: "Inter"; src: url(/static/fonts/inter-latin.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --la-buehne: #ECEDF1;      /* Seitengrund (kühles Grau) */
  --la-platte: #FFFFFF;      /* Fläche mit Inhalt */
  --la-tinte: #0A0A0D;       /* Schrift, Primärknopf */
  --la-tinte-2: #5A5B66;     /* Sekundärtext */
  --la-tinte-3: #63646F;     /* Hinweise */
  --la-linie: #DCDDE4;
  --la-akzent: #5B4EE0;
  --la-licht-1: #5CC8D6;
  --la-licht-2: #8B97F5;
  --la-licht-3: #B48CF2;
  --la-licht: linear-gradient(100deg, var(--la-licht-1), var(--la-licht-2) 50%, var(--la-licht-3));
  --la-nacht: #050506;
  --la-erfolg: #1F7A4D;      /* Ergänzung (Kasse): Erfolg */
  --la-erfolg-grund: #E6F4EC;
  --la-fehler: #B3261E;      /* aus Vesena-Formularen */
  --la-fehler-grund: #FBEAE9;
  --la-warnung-grund: #FFF5DB;

  --la-r-platte: 28px;
  --la-r-innen: 18px;
  --la-r-feld: 14px;
  --la-r-pille: 999px;
  --la-schatten: 0 1px 0 rgba(10,10,13,.04), 0 24px 60px -28px rgba(10,10,13,.28);
  --la-ring: 0 0 0 5px rgba(139,151,245,.35);
  --la-raus: cubic-bezier(.16,1,.3,1);

  --la-kopf: "Mona Sans", "Inter", system-ui, sans-serif;
  --la-text: "Inter", system-ui, sans-serif;

  --la-rand: clamp(12px, 4vw, 40px);
  --la-luft-1: 6px;
  --la-luft-2: 12px;
  --la-luft-3: 18px;
  --la-luft-4: 28px;
  --la-luft-5: 44px;

  --la-knopf-h: 54px;
  --la-knopf-kasse-h: 64px;  /* Kasse: größere Touch-Ziele */
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--la-buehne); color: var(--la-tinte);
  font: 400 17px/1.55 var(--la-text); -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--la-kopf); letter-spacing: -.02em; line-height: 1.1; margin: 0 0 var(--la-luft-2); }
h1 { font-size: clamp(1.7rem, 5vw, 2.6rem); font-weight: 720; }
h2 { font-size: 1.3rem; font-weight: 680; }
h3 { font-size: 1.05rem; font-weight: 650; }
p { margin: 0 0 var(--la-luft-2); }
a { color: inherit; }
img, svg { display: block; max-width: 100%; }
.sprung { position: absolute; left: -999px; top: 8px; background: var(--la-tinte); color: #fff; padding: 8px 14px; border-radius: var(--la-r-pille); z-index: 100; }
.sprung:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--la-akzent); outline-offset: 3px; }

/* ── Kopf: schwebende Pille ── */
.kopf {
  position: sticky; top: 10px; z-index: 50; margin: 10px auto 0; width: min(1100px, calc(100% - 20px));
  display: flex; align-items: center; gap: var(--la-luft-3); min-height: 60px; padding: 6px 10px 6px 20px;
  border-radius: var(--la-r-pille); background: rgba(255,255,255,.78);
  backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: var(--la-schatten);
}
.kopf-marke { display: flex; align-items: center; gap: 9px; font: 680 18px/1 var(--la-kopf); letter-spacing: -.02em; text-decoration: none; white-space: nowrap; }
.kopf-marke i { width: 22px; height: 22px; border-radius: 7px; background: var(--la-licht); display: inline-block; }
.kopf-nav { display: flex; gap: var(--la-luft-3); flex-wrap: wrap; margin-left: var(--la-luft-2); }
.kopf-nav a { text-decoration: none; opacity: .72; font-weight: 500; font-size: 15px; }
.kopf-nav a:hover, .kopf-nav a[aria-current] { opacity: 1; }
.kopf-nav a[aria-current] { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }
.kopf-rechts { margin-left: auto; display: flex; align-items: center; gap: var(--la-luft-2); }
.kopf-wer { font-size: 14px; color: var(--la-tinte-2); }

/* ── Seite ── */
.seite { width: min(1100px, 100%); margin: 0 auto; padding: var(--la-luft-4) var(--la-rand) var(--la-luft-5); }
.seite.schmal { width: min(560px, 100%); }
.platte { background: var(--la-platte); border-radius: var(--la-r-platte); box-shadow: var(--la-schatten); padding: clamp(18px, 4vw, 32px); margin-bottom: var(--la-luft-3); }
.platte.flach { box-shadow: none; border: 1px solid var(--la-linie); }
.innen { background: var(--la-buehne); border-radius: var(--la-r-innen); padding: var(--la-luft-3); }
.raster { display: grid; gap: var(--la-luft-3); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.zeile { display: flex; gap: var(--la-luft-2); align-items: center; flex-wrap: wrap; }
.zeile.ende { justify-content: flex-end; }
.leise { color: var(--la-tinte-2); }
.klein { font-size: 14px; }
.mitte { text-align: center; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em; }

/* ── Knöpfe ── */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--la-knopf-h); padding: 0 28px; border: 0; border-radius: var(--la-r-pille);
  background: var(--la-tinte); color: #fff; font: 600 16px/1 var(--la-text); letter-spacing: -.01em;
  text-decoration: none; cursor: pointer; transition: box-shadow .3s, background .2s, opacity .2s;
}
.knopf:hover { box-shadow: var(--la-ring); }
.knopf:focus-visible { outline: none; box-shadow: var(--la-ring); }
.knopf[disabled], .knopf[aria-busy="true"] { opacity: .55; cursor: progress; }
.knopf-leise { background: transparent; color: var(--la-tinte); box-shadow: inset 0 0 0 1.5px var(--la-tinte); }
.knopf-leise:hover { background: var(--la-platte); box-shadow: inset 0 0 0 1.5px var(--la-tinte), var(--la-ring); }
.knopf-klein { height: 40px; padding: 0 18px; font-size: 14px; }
.knopf-akzent { background: var(--la-akzent); }
.knopf-gefahr { background: var(--la-fehler); }
.knopf-breit { width: 100%; }
.knopf-kasse { height: var(--la-knopf-kasse-h); font-size: 18px; width: 100%; }

/* ── Formulare ── */
label { display: block; font-weight: 600; font-size: 15px; margin: 0 0 6px; }
.feld, input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], select, textarea {
  width: 100%; padding: 13px 16px; border: 0; border-radius: var(--la-r-feld); background: #fff;
  box-shadow: inset 0 0 0 1px rgb(10 10 13 / .2); font: inherit; font-size: 16px; color: var(--la-tinte);
  min-height: 50px;
}
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--la-akzent), 0 0 0 4px rgb(91 78 224 / .18); }
[aria-invalid=true] { box-shadow: inset 0 0 0 2px var(--la-fehler) !important; }
.feldgruppe { margin-bottom: var(--la-luft-3); }
.feldhinweis { margin: 6px 0 0; font-size: 13.5px; color: var(--la-tinte-3); }
.haken { display: flex; gap: 12px; align-items: flex-start; font-weight: 400; font-size: 15px; line-height: 1.45; }
.haken input { width: 24px; height: 24px; margin: 2px 0 0; flex: none; accent-color: var(--la-akzent); }
.betrag { font-size: 28px; font-weight: 650; text-align: right; letter-spacing: -.01em; min-height: 64px; }
.honig { position: absolute; left: -5000px; width: 1px; height: 1px; overflow: hidden; }

/* ── Meldungen (immer Symbol + Text, nicht nur Farbe) ── */
.meldung { display: flex; gap: 12px; align-items: flex-start; border-radius: var(--la-r-innen); padding: 14px 18px; margin-bottom: var(--la-luft-3); font-weight: 500; }
.meldung::before { font-weight: 800; flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 14px; }
.meldung-erfolg { background: var(--la-erfolg-grund); color: #0F4D2F; }
.meldung-erfolg::before { content: "✓"; background: var(--la-erfolg); }
.meldung-fehler { background: var(--la-fehler-grund); color: #7A1A14; }
.meldung-fehler::before { content: "!"; background: var(--la-fehler); }
.meldung-info { background: var(--la-warnung-grund); color: #5C4400; }
.meldung-info::before { content: "i"; background: #8A6A00; }
.meldung strong { display: block; font-size: 1.1rem; }

/* ── Karte (Kunde) ── */
.bonuskarte { position: relative; overflow: hidden; border-radius: var(--la-r-platte); background: var(--la-nacht); color: #fff; padding: clamp(20px, 5vw, 30px); box-shadow: var(--la-schatten); margin-bottom: var(--la-luft-3); }
.bonuskarte::after { content: ""; position: absolute; inset: auto -20% -60% -20%; height: 120%; background: var(--la-licht); opacity: .28; filter: blur(50px); pointer-events: none; }
.bonuskarte > * { position: relative; z-index: 1; }
.bonuskarte h1 { font-size: clamp(1.4rem, 6vw, 2rem); margin-bottom: 4px; }
.bonuskarte .leise { color: #B9BAC6; }
.qr { background: #fff; border-radius: var(--la-r-innen); padding: 14px; width: min(260px, 100%); margin: var(--la-luft-3) auto var(--la-luft-2); }
.qr svg { width: 100%; height: auto; }
.kennung { text-align: center; font: 600 20px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; }

.fortschritt { height: 12px; border-radius: var(--la-r-pille); background: var(--la-linie); overflow: hidden; margin: 8px 0; }
.fortschritt > span { display: block; height: 100%; background: var(--la-licht); border-radius: inherit; }
.stempel { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 10px 0; max-width: 320px; }
.stempel span { aspect-ratio: 1; border-radius: 50%; border: 2px dashed var(--la-linie); display: grid; place-items: center; font-size: 13px; color: var(--la-tinte-3); }
.stempel span.voll { border: 0; background: var(--la-licht); color: var(--la-tinte); font-weight: 700; }

.liste { list-style: none; margin: 0; padding: 0; }
.liste li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--la-linie); align-items: center; }
.liste li:last-child { border-bottom: 0; }
.marke { display: inline-block; padding: 3px 10px; border-radius: var(--la-r-pille); font-size: 13px; font-weight: 600; background: var(--la-buehne); color: var(--la-tinte-2); white-space: nowrap; }
.marke-ok { background: var(--la-erfolg-grund); color: #0F4D2F; }
.marke-aus { background: var(--la-fehler-grund); color: #7A1A14; }
.marke-akzent { background: #ECEAFD; color: #3A2FB0; }
.plus { color: var(--la-erfolg); font-weight: 700; }
.minus { color: var(--la-fehler); font-weight: 700; }
.durch { text-decoration: line-through; opacity: .6; }

/* ── Kennzahlen ── */
.zahl { font: 720 2.2rem/1 var(--la-kopf); letter-spacing: -.03em; margin: 6px 0; }

/* ── Tabellen ── */
.tabelle-huelle { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { text-align: left; font-weight: 600; color: var(--la-tinte-2); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; padding: 10px 12px; border-bottom: 1px solid var(--la-linie); }
td { padding: 12px; border-bottom: 1px solid var(--la-linie); vertical-align: top; }
tr:last-child td { border-bottom: 0; }

details > summary { cursor: pointer; font-weight: 600; padding: 6px 0; }

/* ── Kasse ── */
.kasse-kopf { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: var(--la-luft-3); }
.kasse-saldo { font: 720 2.6rem/1 var(--la-kopf); letter-spacing: -.03em; }
.kamera { width: 100%; border-radius: var(--la-r-innen); background: #000; aspect-ratio: 4/3; object-fit: cover; margin-bottom: var(--la-luft-2); }
.praemie-knopf { display: flex; justify-content: space-between; align-items: center; width: 100%; min-height: 64px; padding: 10px 20px; border: 0; border-radius: var(--la-r-innen); background: var(--la-buehne); font: 600 16px var(--la-text); color: var(--la-tinte); cursor: pointer; text-align: left; margin-bottom: 8px; }
.praemie-knopf.bereit { background: #ECEAFD; box-shadow: inset 0 0 0 2px var(--la-akzent); }
.praemie-knopf[disabled] { cursor: not-allowed; opacity: .7; }

/* ── Aufsteller (Druck) ── */
.aufsteller { background: #fff; width: min(148mm, 100%); margin: 0 auto; padding: 14mm 12mm; border-radius: var(--la-r-platte); text-align: center; box-shadow: var(--la-schatten); }
.aufsteller h1 { font-size: 30px; }
.aufsteller .qr { width: 70mm; box-shadow: inset 0 0 0 1px var(--la-linie); }
@media print {
  body { background: #fff; }
  .kopf, .nicht-drucken { display: none !important; }
  .aufsteller { box-shadow: none; }
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  .kopf { padding: 6px 7px 6px 16px; flex-wrap: wrap; border-radius: 26px; }
  .kopf-nav { order: 3; width: 100%; margin: 0; gap: 14px; overflow-x: auto; flex-wrap: nowrap; padding: 4px 4px 6px; }
  .kopf-nav a { white-space: nowrap; }
  .kopf-wer { display: none; }
  .seite { padding-top: var(--la-luft-3); }
}
@media (max-width: 400px) {
  .knopf { padding: 0 20px; }
  .stempel { gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Kasse: Schnellknöpfe im Raster dürfen schmaler werden als normale Knöpfe. */
.raster > .knopf-kasse { padding: 0 8px; min-width: 0; }
