/* Aufgaben: Farben, Kopfzeile, Formulare, Dialoge. Die Listen stehen in aufgaben.css.
   Gleiche Farbwelt wie das Lager (dunkel); wer sein Geraet auf hell stellt, bekommt hell. */

:root {
  --grund: #14161a;
  --flaeche: #1b1e24;
  --erhoben: #232730;
  --rand: #2f343f;
  --rand-hell: #3d4351;
  --text: #e7e9ee;
  --gedaempft: #939aa8;
  --akzent: #6aa3ff;
  --auf-akzent: #0d1017;
  --gut: #57d193;
  --gut-flaeche: #15281f;
  --warn: #ff7a6b;
  --warn-flaeche: #2c1b19;
  --pick: #e8b23a;
  --pick-flaeche: #2a2415;
  --abdunkeln: rgba(0, 0, 0, .62);
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --grund: #f2f3f6;
    --flaeche: #ffffff;
    --erhoben: #eef0f5;
    --rand: #dcdfe7;
    --rand-hell: #c2c7d3;
    --text: #1a1e26;
    --gedaempft: #5d6575;
    --akzent: #2358c9;
    --auf-akzent: #ffffff;
    --gut: #137445;
    --gut-flaeche: #e4f5eb;
    --warn: #c23a2a;
    --warn-flaeche: #fdeceb;
    --pick: #8f6200;
    --pick-flaeche: #fbf2da;
    --abdunkeln: rgba(20, 24, 33, .45);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--grund);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.25; }
a { color: var(--akzent); }
:focus-visible { outline: 2px solid var(--akzent); outline-offset: 1px; }

/* ---------- Kopfzeile ---------- */

.kopf {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem 1.1rem;
  padding: .65rem 1.2rem;
  background: var(--flaeche);
  border-bottom: 1px solid var(--rand);
}
.marke { font-weight: 700; letter-spacing: .02em; color: var(--text); text-decoration: none; }
.haupt { display: flex; gap: .2rem; }
.haupt a {
  padding: .3rem .6rem;
  color: var(--gedaempft);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.haupt a:hover { color: var(--text); }
.haupt a.aktiv { color: var(--text); border-bottom-color: var(--akzent); }
.abstand { flex: 1; }
.nutzer { display: flex; align-items: center; gap: .6rem; color: var(--gedaempft); font-size: .9rem; }

.schnell { display: flex; align-items: center; gap: .4rem; }
.schnell input { width: min(20rem, 34vw); }
.schnell select { max-width: 8rem; }

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

input, select, textarea, button { font: inherit; }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea {
  min-width: 0;
  padding: .42rem .6rem;
  border: 1px solid var(--rand-hell);
  border-radius: 5px;
  background: var(--erhoben);
  color: var(--text);
}
textarea { width: 100%; min-height: 4.2rem; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--gedaempft); opacity: .8; }

.feld { display: grid; gap: .25rem; }
.feld > span { font-size: .82rem; color: var(--gedaempft); }
.feld input:not([type=checkbox]), .feld select, .feld textarea { width: 100%; }
.haken-feld { display: flex; align-items: center; gap: .5rem; }
.haken-feld input { width: 1.1rem; height: 1.1rem; accent-color: var(--akzent); }
.zeile { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.zwei { display: grid; gap: .6rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }

button, .knopf {
  display: inline-block;
  padding: .45rem .85rem;
  border: 1px solid transparent;
  border-radius: 5px;
  background: var(--akzent);
  color: var(--auf-akzent);
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
button:hover, .knopf:hover { filter: brightness(1.08); }
button:disabled { opacity: .5; cursor: default; filter: none; }
button.leise, .knopf.leise {
  background: var(--erhoben);
  color: var(--text);
  border-color: var(--rand-hell);
  font-weight: 600;
}
button.gut { background: var(--gut); color: var(--auf-akzent); }
button.warn { background: transparent; color: var(--warn); border-color: var(--warn); }
button.klein, .knopf.klein { padding: .25rem .6rem; font-size: .85rem; }

/* ---------- Bausteine ---------- */

.karte {
  padding: .9rem 1rem;
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: 8px;
}
.hinweis { color: var(--gedaempft); font-size: .85rem; }
.fehlerzeile { color: var(--warn); font-size: .9rem; min-height: 1.2em; }
.pille {
  display: inline-block;
  padding: .02rem .5rem;
  border: 1px solid var(--rand-hell);
  border-radius: 999px;
  color: var(--gedaempft);
  font-size: .75rem;
  font-weight: 600;
  white-space: nowrap;
}
.pille.akzent { color: var(--akzent); border-color: var(--akzent); }
.pille.gut { color: var(--gut); border-color: var(--gut); }
.pille.warn { color: var(--warn); border-color: var(--warn); }
.pille.pick { color: var(--pick); border-color: var(--pick); }
.datei {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  max-width: 100%;
  padding: .2rem .6rem;
  border: 1px solid var(--rand-hell);
  border-radius: 999px;
  color: var(--text);
  font-size: .85rem;
  text-decoration: none;
}
.datei:hover { border-color: var(--akzent); }
.datei .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.datei .typ { color: var(--gedaempft); font-size: .7rem; font-weight: 700; text-transform: uppercase; }

/* ---------- Dialoge und Meldungen ---------- */

dialog {
  width: min(34rem, calc(100vw - 1.5rem));
  max-height: calc(100vh - 2rem);
  padding: 1.1rem 1.2rem;
  background: var(--flaeche);
  color: var(--text);
  border: 1px solid var(--rand-hell);
  border-radius: 10px;
  overflow-y: auto;
}
dialog::backdrop { background: var(--abdunkeln); }
dialog form { display: grid; gap: .8rem; }
dialog h2 { font-size: 1.1rem; overflow-wrap: anywhere; }
.dialog-knoepfe { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; }

.chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.chip { position: relative; }
.chip input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.chip span {
  display: inline-block;
  padding: .3rem .7rem;
  border: 1px solid var(--rand-hell);
  border-radius: 999px;
  background: var(--erhoben);
  font-size: .9rem;
}
.chip input:checked + span { background: var(--akzent); border-color: var(--akzent); color: var(--auf-akzent); font-weight: 700; }
.chip input:focus-visible + span { outline: 2px solid var(--akzent); outline-offset: 2px; }

.meldungen {
  position: fixed;
  inset: auto 0 1rem;
  z-index: 50;
  display: grid;
  justify-items: center;
  gap: .5rem;
  padding: 0 1rem;
  pointer-events: none;
}
.meldung {
  max-width: 36rem;
  padding: .6rem .9rem;
  background: var(--erhoben);
  border: 1px solid var(--rand-hell);
  border-radius: 8px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .35);
  pointer-events: auto;
}
.meldung.fehler { background: var(--warn-flaeche); border-color: var(--warn); }
.meldung.gut { border-color: var(--gut); }

/* ---------- Anmeldung und Partnerseite ---------- */

.anmeldung { display: grid; gap: .9rem; max-width: 22rem; margin: 14vh auto 0; padding: 0 1.2rem; }
.anmeldung h1 { font-size: 1.4rem; }
.partner-seite { display: grid; gap: 1.1rem; max-width: 46rem; margin: 0 auto; padding: 1.4rem 1.2rem 4rem; }
.partner-seite h1 { font-size: 1.4rem; }

@media (max-width: 760px) {
  .kopf { padding: .55rem .8rem; }
  .abstand { display: none; }
  .nutzer { margin-left: auto; }
  .schnell { order: 5; flex: 1 1 100%; }
  .schnell input { flex: 1; width: auto; }
  .zwei { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
