/* Schlicht, funktional, für den Desktop. Farben als Variablen, hell und dunkel. */

:root {
  --hintergrund: #f4f5f7;
  --flaeche: #ffffff;
  --text: #1d2330;
  --leise: #5d6576;
  --rand: #d9dde4;
  --akzent: #1f5fbf;
  --akzent-text: #ffffff;
  --erfolg: #1e7a46;
  --erfolg-flaeche: #e7f4ec;
  --hinweis: #8a5a00;
  --hinweis-flaeche: #fdf3df;
  --fehler: #b42318;
  --fehler-flaeche: #fdecea;
  --laeuft: #1f5fbf;
  --laeuft-flaeche: #e6eefa;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --hintergrund: #14171d;
    --flaeche: #1d2129;
    --text: #e6e8ec;
    --leise: #9aa2b1;
    --rand: #323844;
    --akzent: #5b93e6;
    --akzent-text: #0d1117;
    --erfolg: #6cc58f;
    --erfolg-flaeche: #17301f;
    --hinweis: #e7b350;
    --hinweis-flaeche: #33280f;
    --fehler: #f08a80;
    --fehler-flaeche: #3a1a17;
    --laeuft: #8ab4f0;
    --laeuft-flaeche: #1a2a44;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--hintergrund);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

h1 { font-size: 1.25rem; margin: 0; }
h2 { font-size: 1.1rem; margin: 0 0 1rem; }

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
  display: grid;
  gap: 1.5rem;
}

.kopf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.5rem;
  background: var(--flaeche);
  border-bottom: 1px solid var(--rand);
}

.kopf-rechts { display: flex; align-items: center; gap: 1rem; }

.karte {
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
}

.leise { color: var(--leise); }
.zaehler { color: var(--leise); font-variant-numeric: tabular-nums; }

/* Formular */

.felder { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.feld { display: grid; gap: 0.35rem; }
label { font-weight: 600; font-size: 0.9rem; }

input[type="text"], input[type="password"], input[type="file"] {
  font: inherit;
  color: inherit;
  background: var(--hintergrund);
  border: 1px solid var(--rand);
  border-radius: 6px;
  padding: 0.45rem 0.6rem;
  width: 100%;
}

input:focus-visible, button:focus-visible, .knopf:focus-visible {
  outline: 2px solid var(--akzent);
  outline-offset: 2px;
}

/* Knöpfe */

button, .knopf {
  font: inherit;
  font-weight: 600;
  border-radius: 6px;
  padding: 0.45rem 0.95rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  border: 1px solid var(--rand);
}

.primaer { background: var(--akzent); color: var(--akzent-text); border-color: var(--akzent); }
.schlicht { background: transparent; color: var(--text); }
button:disabled { opacity: 0.6; cursor: wait; }

.aktionen { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.9rem; }

/* Meldungen */

.meldung { border-radius: 6px; padding: 0.6rem 0.8rem; margin: 0.9rem 0 0; }
.meldung p { margin: 0.25rem 0; }
.meldung ul { margin: 0.25rem 0; padding-left: 1.2rem; }
.erfolg { background: var(--erfolg-flaeche); color: var(--erfolg); }
.hinweis { background: var(--hinweis-flaeche); color: var(--hinweis); }
.fehler { background: var(--fehler-flaeche); color: var(--fehler); }

/* Laufliste */

.abschnittskopf { display: flex; justify-content: space-between; align-items: baseline; }

.laufliste { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.9rem; }

.lauf {
  border: 1px solid var(--rand);
  border-left-width: 4px;
  border-radius: 6px;
  padding: 0.9rem 1rem;
}
.lauf[data-zustand="laeuft"] { border-left-color: var(--laeuft); }
.lauf[data-zustand="eingereiht"] { border-left-color: var(--leise); }
.lauf[data-zustand="abgeschlossen"] { border-left-color: var(--erfolg); }
.lauf[data-zustand="fehlgeschlagen"] { border-left-color: var(--fehler); }
.lauf[data-zustand="abgebrochen"] { border-left-color: var(--hinweis); }

.lauf-kopf { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.lauf-datei { font-weight: 600; }
.lauf-zusatz { margin-left: 0.5rem; }

.zustand {
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.1rem 0.65rem;
  white-space: nowrap;
}
.zustand[data-zustand="laeuft"] { background: var(--laeuft-flaeche); color: var(--laeuft); }
.zustand[data-zustand="eingereiht"] { background: var(--hintergrund); color: var(--leise); }
.zustand[data-zustand="abgeschlossen"] { background: var(--erfolg-flaeche); color: var(--erfolg); }
.zustand[data-zustand="fehlgeschlagen"] { background: var(--fehler-flaeche); color: var(--fehler); }
.zustand[data-zustand="abgebrochen"] { background: var(--hinweis-flaeche); color: var(--hinweis); }

.lauf-fortschritt { display: grid; gap: 0.3rem; margin-top: 0.7rem; }
progress { width: 100%; height: 0.6rem; accent-color: var(--laeuft); }
.fortschritt-text { font-size: 0.9rem; font-variant-numeric: tabular-nums; }

.lauf-meldung:not(.meldung) { margin: 0.6rem 0 0; }
.lauf-verweis { margin: 0.5rem 0 0; font-size: 0.9rem; }

.lauf-angaben {
  display: grid;
  grid-template-columns: repeat(3, auto) 1fr;
  gap: 0.2rem 1.5rem;
  margin: 0.7rem 0 0;
  font-size: 0.85rem;
}
.lauf-angaben div { display: grid; }
.lauf-angaben dt { color: var(--leise); }
.lauf-angaben dd { margin: 0; font-variant-numeric: tabular-nums; }
.lauf-angaben div:last-child { grid-column: 1 / -1; }
.lauf-id { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.8rem; }

/* Anmeldung */

body.anmeldung { display: grid; place-items: center; min-height: 100vh; }
.anmeldekarte { width: min(360px, calc(100% - 2rem)); }
.anmeldekarte h1 { margin-bottom: 1.25rem; }
.anmeldekarte form { display: grid; gap: 0.6rem; }
.anmeldekarte button { margin-top: 0.4rem; }
