/* Jobjournal Web: Design wie die App (Tiefblau, ruhig, Systemschrift).
   Abstände nur aus dem 4er-Raster (4, 8, 12, 16, 24, 32, 48); Schriftgrössen 12/16/20/24/32. */
:root {
  color-scheme: dark;
  --grund: #0e2841;
  --grund-unten: #040a1e;
  --karte: #122352;
  --feld: #0e1d47;
  --rand: rgba(180, 200, 255, 0.16);
  --text: #e4eaf5;
  --text-leise: #b9cce6;
  --akzent: #7fa2ee;
  --akzent-hell: #bbd0fa;
  --auf-akzent: #071433;
  --warnung: #f2b38a;
  --fehler: #f09a92;
  --ok: #9ad6ae;
  --radius: 16px;
  --radius-feld: 12px;
  --system: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  font: 16px/24px var(--system);
  color: var(--text);
  background: var(--grund-unten) linear-gradient(180deg, var(--grund) 0%, var(--grund-unten) 70%) fixed;
  overflow-wrap: anywhere;
}

[hidden] { display: none !important; }

h1, h2, h3, p, dl, dd, ul { margin: 0; padding: 0; }
ul { list-style: none; }
h1 { font-size: 20px; line-height: 24px; font-weight: 700; }
h2 { font-size: 24px; line-height: 32px; font-weight: 700; }
h3 { font-size: 16px; line-height: 24px; font-weight: 600; }
a { color: var(--akzent-hell); text-underline-offset: 4px; }
a:hover { color: #fff; }
.leise { color: var(--text-leise); }
.klein { font-size: 12px; line-height: 16px; }

:focus-visible {
  outline: 3px solid var(--akzent-hell);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Hinweisband Demo */
.demo-band {
  padding: 8px 16px;
  text-align: center;
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  color: var(--auf-akzent);
  background: var(--warnung);
}

/* Kopfzeile */
.kopf {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(14, 40, 65, 0.94);
  border-bottom: 1px solid var(--rand);
}
.kopf-innen, .inhalt {
  max-width: 960px;
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}
.kopf-innen {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding-top: 12px;
  padding-bottom: 12px;
}
.marke { display: flex; align-items: center; gap: 8px; }
.marke-punkt {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--akzent);
}
.nav { display: flex; gap: 4px; flex: 1 1 100%; order: 3; }
.nav a {
  flex: 1 1 0;
  min-height: 48px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 12px;
  border-radius: var(--radius-feld);
  color: var(--text-leise);
  text-decoration: none;
  font-weight: 600;
}
.nav a:hover { background: var(--feld); color: var(--text); }
.nav a[aria-current="page"] { background: var(--karte); color: var(--text); box-shadow: inset 0 -3px 0 var(--akzent); }

.inhalt { padding-top: 24px; padding-bottom: 48px; }
.abschnitt { display: flex; flex-direction: column; gap: 16px; }
.abschnitt + .abschnitt { margin-top: 32px; }

/* Karten und Listen */
.karte {
  background: var(--karte);
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  padding: 16px;
}
.liste { display: flex; flex-direction: column; gap: 8px; }
.zeile {
  display: flex; flex-direction: column; gap: 4px;
  min-height: 48px;
  padding: 12px 16px;
  color: var(--text);
  text-decoration: none;
  background: var(--karte);
  border: 1px solid var(--rand);
  border-radius: var(--radius);
}
a.zeile:hover { border-color: var(--akzent); }
.zeile-kopf { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.zeile-titel { font-weight: 600; }

.abzeichen {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; line-height: 16px; font-weight: 600;
  color: var(--text-leise);
}
.abzeichen::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--punkt, var(--text-leise));
}
.phase-idee { --punkt: #b6c2dc; }
.phase-vorbereitung { --punkt: #c3bceb; }
.phase-eingereicht { --punkt: #9fc3f2; }
.phase-gespraeche { --punkt: #7fd3d8; }
.phase-angebot { --punkt: #9ad6ae; }
.phase-abgeschlossen { --punkt: #8a97b5; }
.ueberfaellig { color: var(--warnung); font-weight: 600; }

/* Übersicht */
.raster { display: grid; gap: 16px; grid-template-columns: 1fr; }
.phasenband { display: flex; height: 12px; overflow: hidden; border-radius: 6px; background: var(--feld); }
.phasenband > span { background: var(--punkt); min-width: 4px; }
.phasen-zeile { display: flex; justify-content: space-between; align-items: center; min-height: 48px; gap: 12px; }
.phasen-zeile + .phasen-zeile { border-top: 1px solid var(--rand); }
.zahl { font-variant-numeric: tabular-nums; font-weight: 600; }

/* Formulare */
.feld { display: flex; flex-direction: column; gap: 4px; }
label { font-size: 12px; line-height: 16px; font-weight: 600; color: var(--text-leise); }
input, select, textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  font: inherit;
  color: var(--text);
  background: var(--feld);
  border: 1px solid var(--rand);
  border-radius: var(--radius-feld);
}
textarea { min-height: 160px; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: var(--akzent); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 0; border-color: var(--akzent-hell); }
input[aria-invalid="true"] { border-color: var(--fehler); }
.feld-fehler { color: var(--fehler); font-size: 12px; line-height: 16px; }
.formular { display: flex; flex-direction: column; gap: 16px; }
.formular-raster { display: grid; gap: 16px; grid-template-columns: 1fr; }

/* Knöpfe: Default, Hover, Pressed, Focus, Disabled, Loading */
.knopf {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  font: inherit; font-weight: 600;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--rand);
  border-radius: var(--radius-feld);
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.12s, transform 0.12s;
}
.knopf:hover { background: var(--feld); border-color: var(--akzent); color: var(--text); }
.knopf:active { transform: scale(0.98); }
.knopf-primaer { color: var(--auf-akzent); background: var(--akzent); border-color: var(--akzent); }
.knopf-primaer:hover { color: var(--auf-akzent); background: var(--akzent-hell); border-color: var(--akzent-hell); }
.knopf:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.knopf[aria-busy="true"] { cursor: progress; }
.knopf[aria-busy="true"]::after {
  content: ""; width: 16px; height: 16px; margin-left: 8px;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: dreh 0.8s linear infinite;
}
@keyframes dreh { to { transform: rotate(360deg); } }
.aktionen { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Meldungen */
.meldungen { max-width: 960px; margin: 0 auto; padding: 16px 16px 0; display: flex; flex-direction: column; gap: 8px; }
.meldungen:empty { display: none; }
.meldung { padding: 12px 16px; border-radius: var(--radius-feld); border: 1px solid var(--rand); background: var(--karte); }
.meldung-ok { border-color: var(--ok); }
.meldung-fehler { border-color: var(--fehler); }

/* Startseite und Leerzustände */
.start { display: flex; flex-direction: column; gap: 24px; padding-top: 32px; max-width: 640px; }
.start h2 { font-size: 32px; line-height: 40px; }
.start-liste { display: flex; flex-direction: column; gap: 8px; padding-left: 24px; list-style: disc; }
#apple-sign-in-button, #apple-sign-out-button { min-height: 48px; display: inline-block; }
.leer { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 24px 16px; }

/* Detail */
.fakten { display: grid; grid-template-columns: 1fr; gap: 12px 24px; }
.fakten dt { font-size: 12px; line-height: 16px; font-weight: 600; color: var(--text-leise); }
.fakten dd { font-size: 16px; line-height: 24px; }
.vorlage-text {
  white-space: pre-wrap;
  padding: 16px;
  background: var(--feld);
  border-radius: var(--radius-feld);
}
details.karte > summary { cursor: pointer; min-height: 48px; display: flex; align-items: center; font-weight: 600; }

@media (min-width: 720px) {
  .kopf-innen, .inhalt, .meldungen { padding-left: 24px; padding-right: 24px; }
  .nav { flex: 0 1 auto; order: 0; }
  .nav a { flex: 0 0 auto; padding: 0 16px; }
  .raster { grid-template-columns: 1fr 1fr; }
  .formular-raster { grid-template-columns: 1fr 1fr; }
  .fakten { grid-template-columns: 1fr 1fr; }
}

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