/* ==========================================================================
   Onboarding-Checkliste – Gestaltung nach dem Johanniter-Markenhandbuch
   Farbwerte, Schriftschnitte und Formsprache stammen aus dem Handbuch
   (Markenfarben S. 25/30, Typografie S. 35–37, Stoerer S. 49, Icons S. 73).
   ========================================================================== */

/* --- Markenschrift: Maven Johanniter, lokal ausgeliefert ------------------ */
@font-face {
  font-family: "Maven Johanniter";
  src: url("fonts/MavenJohanniter-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Maven Johanniter";
  src: url("fonts/MavenJohanniter-Medium.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Maven Johanniter";
  src: url("fonts/MavenJohanniter-SemiBold.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Maven Johanniter";
  src: url("fonts/MavenJohanniter-Bold.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}

:root {
  /* Markenfarben */
  --rot:        #eb003c;   /* Markenrot */
  --rot-80:     #ff606e;
  --rot-60:     #ff9ea7;
  --rot-30:     #ffccd8;
  --blau:       #000548;   /* Markenblau – Standardfarbe fuer Text */
  --blau-70:    #6084bf;
  --blau-45:    #a2bfe0;
  --blau-15:    #deeefc;
  --gelb:       #deff00;   /* Signalgelb – ausschliesslich fuer Call-to-Action */
  --weiss:      #ffffff;
  --grau:       #f0f0f0;

  /* Abgeleitete Rollen */
  --text:       var(--blau);
  --text-leise: #4a5075;
  --linie:      #d4d9e6;
  --flaeche:    var(--grau);

  --radius-flaeche: 8px;
  --schatten: 0 1px 2px rgba(0, 5, 72, .06), 0 8px 24px rgba(0, 5, 72, .07);

  --schrift: "Maven Johanniter", "Maven Pro", -apple-system, BlinkMacSystemFont,
             "Segoe UI", Roboto, Arial, sans-serif;
}

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

body {
  margin: 0;
  font-family: var(--schrift);
  font-size: 16px;
  /* Handbuch: ZAB 120 %. Im Fliesstext auf 145 % geoeffnet, weil enge
     Zeilen am Bildschirm die Lesbarkeit und Barrierefreiheit verschlechtern. */
  line-height: 1.45;
  color: var(--text);
  background: var(--flaeche);
  text-align: left;          /* Handbuch: linksbuendiger Flattersatz */
}

a { color: var(--rot); }
a:hover { color: #c40033; }

h1, h2, h3 { line-height: 1.1; margin: 0 0 .4em; font-weight: 700; }
h1 { font-size: 1.75rem; letter-spacing: -.01em; }
h2 { font-size: 1.2rem; font-weight: 600; }
h3 { font-size: 1rem; font-weight: 600; }

.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px 110px; }
.wrap-wide { max-width: 1060px; margin: 0 auto; padding: 0 16px 64px; }

.muted { color: var(--text-leise); }
.small { font-size: .85rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.center { text-align: center; }
.stack > * + * { margin-top: 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.spread { display: flex; gap: 12px; justify-content: space-between;
  align-items: center; flex-wrap: wrap; }

/* --- Kopfbereich Verwaltung ---------------------------------------------- */
.topbar {
  background: var(--weiss);
  border-bottom: 2px solid var(--blau);
  position: sticky; top: 0; z-index: 20;
}
.topbar .inner {
  max-width: 1060px; margin: 0 auto; padding: 12px 16px;
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { height: 34px; width: auto; display: block; }
.brand .titel {
  font-weight: 600; color: var(--blau); font-size: .95rem;
  padding-left: 12px; border-left: 1px solid var(--linie);
}
.topbar nav { display: flex; gap: 2px; flex-wrap: wrap; margin-left: auto;
  align-items: center; }
.topbar nav a {
  padding: 8px 14px; text-decoration: none; color: var(--text-leise);
  font-weight: 500; font-size: .93rem; border-bottom: 3px solid transparent;
}
.topbar nav a:hover { color: var(--blau); }
.topbar nav a.active { color: var(--blau); font-weight: 600;
  border-bottom-color: var(--rot); }

/* --- Kopfbereich Nutzerseite --------------------------------------------- */
.hero { background: var(--blau); color: var(--weiss); padding: 22px 16px 30px; }
.hero .inner { max-width: 720px; margin: 0 auto; }
.hero .logo { height: 40px; width: auto; display: block; margin-bottom: 22px; }
.hero h1 { color: var(--weiss); margin-bottom: 6px; }
.hero p { margin: 0; color: var(--blau-45); max-width: 54ch; }

.progress-wrap { margin-top: 22px; }
.progress-label { font-size: .9rem; margin-bottom: 7px; font-weight: 600;
  color: var(--weiss); }
.progress-label b { color: var(--gelb); }
.progress-bar { height: 10px; border-radius: 5px; background: rgba(255,255,255,.18);
  overflow: hidden; }
.progress-bar > span { display: block; height: 100%; border-radius: 5px;
  background: var(--gelb); transition: width .35s ease; }
.progress-bar.on-light { background: var(--linie); }
.progress-bar.on-light > span { background: var(--blau); }

/* --- Flaechen ------------------------------------------------------------ */
.card {
  background: var(--weiss); border: 1px solid var(--linie);
  border-radius: var(--radius-flaeche); padding: 20px; box-shadow: var(--schatten);
}
.card + .card { margin-top: 14px; }
.card h2 { margin-top: 0; }

.section-title { margin: 26px 0 10px; font-size: .78rem; text-transform: uppercase;
  letter-spacing: .09em; color: var(--text-leise); font-weight: 700; }

/* --- Checklistenpunkte --------------------------------------------------- */
.checklist { list-style: none; padding: 0; margin: 22px 0 0; }
.checklist li { margin-bottom: 12px; }

.task {
  display: flex; gap: 16px; align-items: flex-start;
  background: var(--weiss); border: 1px solid var(--linie);
  border-radius: var(--radius-flaeche); padding: 18px; box-shadow: var(--schatten);
  transition: background .2s, border-color .2s;
}
.task.done { background: var(--blau-15); border-color: var(--blau-45); }
.task .num {
  flex: 0 0 30px; height: 30px; border-radius: 50%; background: var(--grau);
  color: var(--text-leise); font-weight: 700; font-size: .9rem;
  display: flex; align-items: center; justify-content: center; margin-top: 1px;
}
.task.done .num { background: var(--blau); color: var(--weiss); }
.task .body { flex: 1 1 auto; min-width: 0; }
.task .title { font-weight: 600; font-size: 1.08rem; line-height: 1.25; }
.task .desc { color: var(--text-leise); margin-top: 4px; font-size: .95rem; }
.task .stamp { font-size: .8rem; color: var(--blau); margin-top: 8px; font-weight: 600; }
.task .stamp:not(:empty)::before { content: "• "; color: var(--rot); }

.linkbtn {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 12px;
  padding: 9px 16px; border-radius: 17px;   /* 1/3 der Hoehe, wie beim Stoerer */
  background: var(--weiss); border: 1.5px solid var(--blau);
  text-decoration: none; color: var(--blau); font-weight: 600; font-size: .9rem;
}
.linkbtn:hover { background: var(--blau); color: var(--weiss); }

/* Grosse, gut treffbare Schaltflaeche zum Abhaken */
.toggle { flex: 0 0 auto; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle .box {
  display: flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 16px;  /* 1/3 der Hoehe */
  border: 2px solid var(--blau-45); background: var(--weiss); cursor: pointer;
  transition: all .18s ease;
}
.toggle .box svg { width: 26px; height: 26px; opacity: 0; transform: scale(.6);
  transition: all .18s ease; }
.toggle .box:hover { border-color: var(--blau); }
.toggle input:checked + .box { background: var(--blau); border-color: var(--blau); }
.toggle input:checked + .box svg { opacity: 1; transform: scale(1); }
.toggle input:focus-visible + .box { outline: 3px solid var(--rot); outline-offset: 2px; }

/* --- Abschlussleiste (Call-to-Action, Signalgelb) ------------------------- */
.finishbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: var(--weiss); border-top: 1px solid var(--linie);
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 24px rgba(0,5,72,.12);
  transform: translateY(130%); transition: transform .3s ease;
}
.finishbar.show { transform: translateY(0); }
.finishbar .inner { max-width: 720px; margin: 0 auto; display: flex; gap: 14px;
  align-items: center; justify-content: space-between; flex-wrap: wrap; }

/* --- Schaltflaechen ------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 24px; border: 1.5px solid var(--blau); border-radius: 24px;
  font-family: var(--schrift); font-size: 1rem; font-weight: 600; cursor: pointer;
  text-decoration: none; background: var(--blau); color: var(--weiss);
  transition: background .15s, color .15s, border-color .15s;
}
.btn:hover { background: #001073; border-color: #001073; color: var(--weiss); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* Call-to-Action: Signalgelb auf Markenblau – die Stoerer-Kombination */
.btn.cta { background: var(--gelb); border-color: var(--gelb); color: var(--blau); }
.btn.cta:hover { background: #cbe900; border-color: #cbe900; color: var(--blau); }

.btn.ghost { background: var(--weiss); color: var(--blau); border-color: var(--blau-45); }
.btn.ghost:hover { background: var(--blau-15); border-color: var(--blau); color: var(--blau); }
.btn.danger { background: var(--rot); border-color: var(--rot); }
.btn.danger:hover { background: #c40033; border-color: #c40033; }
.btn.small { padding: 8px 16px; font-size: .88rem; border-radius: 17px; }
.btn.block { width: 100%; }

/* --- Dialog -------------------------------------------------------------- */
.overlay {
  position: fixed; inset: 0; background: rgba(0, 5, 72, .6); z-index: 60;
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.overlay.show { display: flex; }
.dialog {
  background: var(--weiss); border-radius: 12px; padding: 30px 26px;
  max-width: 430px; width: 100%; box-shadow: 0 24px 70px rgba(0,5,72,.4);
  text-align: center;
}
.dialog .kreuz { width: 54px; height: auto; margin-bottom: 6px; }
.dialog h2 { margin: 10px 0 8px; font-size: 1.3rem; font-weight: 700; }
.dialog p { color: var(--text-leise); margin: 0 0 22px; }
.dialog .actions { display: flex; flex-direction: column; gap: 10px; }

/* --- Formulare ----------------------------------------------------------- */
label.field { display: block; margin-bottom: 16px; }
label.field > span { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
label.field .hint { font-weight: 400; color: var(--text-leise); font-size: .82rem; }
input[type=text], input[type=email], input[type=url], input[type=password],
input[type=number], textarea, select {
  width: 100%; padding: 11px 13px; border: 1px solid var(--blau-45);
  border-radius: 6px; font-size: 1rem; font-family: var(--schrift);
  background: var(--weiss); color: var(--text);
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--blau); box-shadow: 0 0 0 3px rgba(0,5,72,.12);
}
textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.check { display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
  font-weight: 600; }
.check input { width: 18px; height: 18px; accent-color: var(--blau); }
fieldset { border: 1px solid var(--linie); border-radius: var(--radius-flaeche);
  padding: 18px; margin: 0 0 16px; background: var(--weiss); }
legend { font-weight: 700; padding: 0 8px; font-size: .95rem; color: var(--blau); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }

/* --- Tabellen ------------------------------------------------------------ */
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th { text-align: left; font-size: .76rem; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-leise); padding: 10px;
  border-bottom: 2px solid var(--blau); font-weight: 600; }
td { padding: 12px 10px; border-bottom: 1px solid var(--linie); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafbfe; }
.table-card { background: var(--weiss); border: 1px solid var(--linie);
  border-radius: var(--radius-flaeche); box-shadow: var(--schatten); overflow-x: auto; }

.badge { display: inline-block; padding: 4px 11px; border-radius: 11px;
  font-size: .78rem; font-weight: 600; }
.badge.aktiv  { background: var(--blau-15); color: var(--blau); }
.badge.fertig { background: var(--blau); color: var(--weiss); }
.badge.archiv { background: var(--grau); color: var(--text-leise); }
.badge.offen  { background: var(--weiss); color: var(--text-leise);
  box-shadow: inset 0 0 0 1px var(--blau-45); }
.badge.ok     { background: var(--blau-15); color: var(--blau); }
.badge.fehler { background: var(--rot-30); color: #a3002a; }

.minibar { width: 110px; height: 8px; border-radius: 4px; background: var(--linie);
  overflow: hidden; display: inline-block; vertical-align: middle; }
.minibar > span { display: block; height: 100%; background: var(--blau); }
.minibar.voll > span { background: var(--rot); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
  margin-bottom: 20px; }
.stat { background: var(--weiss); border: 1px solid var(--linie);
  border-radius: var(--radius-flaeche); padding: 16px 18px; box-shadow: var(--schatten);
  border-top: 3px solid var(--rot); }
.stat .n { font-size: 1.9rem; font-weight: 700; line-height: 1.05; color: var(--blau); }
.stat .l { color: var(--text-leise); font-size: .85rem; margin-top: 2px; }

.flash { padding: 13px 16px; border-radius: 6px; margin-bottom: 16px; font-weight: 600;
  border-left: 4px solid; }
.flash.ok { background: var(--blau-15); color: var(--blau); border-color: var(--blau); }
.flash.error { background: var(--rot-30); color: #a3002a; border-color: var(--rot); }

.qrbox { background: var(--weiss); border: 1px solid var(--linie);
  border-radius: var(--radius-flaeche); padding: 20px; text-align: center; }
.qrbox img { width: 100%; max-width: 240px; height: auto; image-rendering: pixelated; }

.tokenline { background: var(--grau); border-radius: 6px; padding: 11px 13px;
  word-break: break-all; font-size: .85rem; color: var(--text-leise); }

.placeholders { font-size: .85rem; color: var(--text-leise); }
.placeholders code { background: var(--blau-15); padding: 2px 7px; border-radius: 4px;
  color: var(--blau); font-weight: 600; }

/* Vorschaufenster fuer die Willkommensmail */
.mailpreview { width: 100%; height: 620px; border: 1px solid var(--linie);
  border-radius: var(--radius-flaeche); background: var(--grau); }

@media print {
  .topbar, .no-print { display: none !important; }
  body { background: var(--weiss); }
  .card { box-shadow: none; }
}
