/* DW-Portal – Deichwacht Wilhelmsburg
   Farben aus dem Wappen: Deichblau, Sonnengelb, Deichgrün.
   Leitmotiv: die Pegellatte. Das Menü steht an einer Latte, der Wasserstand zeigt, wo du bist. */

:root {
  --nacht: #201F5C;
  --blau: #34338F;
  --gelb: #F9D916;
  --gelb-hell: #FFF6BF;
  --gruen: #00A65A;
  --gruen-tief: #00703D;
  --gruen-hell: #E1F5EA;
  --papier: #EEEFF5;
  --flaeche: #FFFFFF;
  --tinte: #1E1D3B;
  --schlick: #595A75;
  --linie: #D5D6E5;
  --feld: #B4B5CC;
  --rot: #B42318;
  --rot-hell: #FDECEA;
  --wasser: rgba(132, 186, 255, 0.24);
  --wasser-latte: rgba(150, 200, 255, 0.42);

  --schrift: "Bahnschrift", "DIN Alternate", "D-DIN", "Barlow", "Roboto", "Segoe UI", system-ui, sans-serif;
  --schrift-eng: "Bahnschrift SemiCondensed", "Bahnschrift", "Barlow Semi Condensed", "Roboto Condensed", "Arial Narrow", sans-serif;

  --radius: 6px;
  --latte: 1.9rem;
}

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

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

body {
  margin: 0;
  font-family: var(--schrift);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--tinte);
  background: var(--papier);
  font-variant-numeric: tabular-nums;
}

h1, h2, h3, legend { font-family: var(--schrift-eng); line-height: 1.15; }
h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3rem); font-weight: 700; letter-spacing: -0.012em; margin: 0; color: var(--nacht); }
h2 { font-size: 1.32rem; font-weight: 600; color: var(--blau); margin: 0 0 .8rem; padding-bottom: .35rem; border-bottom: 1px solid var(--linie); }
h3 { font-size: 1.12rem; font-weight: 600; margin: 0 0 .8rem; color: var(--nacht); }

a { color: var(--blau); text-underline-offset: .18em; }
a:hover { color: var(--nacht); }

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

code { font-family: Consolas, "Cascadia Mono", monospace; font-size: .92em; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: .5rem; z-index: 99; background: var(--gelb); color: var(--nacht); padding: .5rem 1rem; }
.skip:focus { left: .5rem; }

/* ---------- Rahmen und Pegel ---------- */

.rahmen { display: grid; grid-template-columns: 17.5rem minmax(0, 1fr); min-height: 100vh; }

.pegel {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  background: var(--nacht); color: #fff;
  padding: 1.5rem calc(var(--latte) + .5rem) 1.25rem 0;
  overflow: hidden;
}

.pegel-kopf { display: flex; align-items: center; gap: .8rem; padding: 0 1.25rem 1.75rem; }
.pegel-kopf img { flex: none; }
.pegel-kopf strong { display: block; font-family: var(--schrift-eng); font-size: 1.3rem; line-height: 1.05; }
.pegel-kopf span { display: block; color: #C9C9EE; font-size: .95rem; }
.menu-knopf { display: none; }

.pegel nav { flex: 1; }
.pegel ul { list-style: none; margin: 0; padding: 0; }
.pegel nav a {
  position: relative; display: block;
  padding: .72rem 1.25rem;
  font-family: var(--schrift-eng); font-size: 1.14rem;
  color: #DCDCF5; text-decoration: none;
}
.pegel nav a:hover { color: var(--gelb); }
.pegel nav a[aria-current="page"] { color: #fff; font-weight: 600; background: rgba(255, 255, 255, .07); }
/* Wasserlinie vom aktiven Punkt bis zur Latte */
.pegel nav a[aria-current="page"]::after {
  content: ""; position: absolute; top: 50%; left: 100%;
  width: calc(var(--latte) + .5rem); height: 3px; margin-top: -1.5px;
  background: var(--gelb);
}

.wer { padding: 1rem 1.25rem 0; border-top: 1px solid rgba(255, 255, 255, .12); font-size: .95rem; }
.wer-name { display: block; font-weight: 600; }
.wer-rang { display: block; color: #C9C9EE; margin-bottom: .35rem; }
.wer .link-knopf { color: #fff; }
.wer .link-knopf:hover { color: var(--gelb); }
.install-knopf { margin-top: .75rem; }

.latte {
  position: absolute; top: 0; right: 0; bottom: 0; width: var(--latte);
  background:
    repeating-linear-gradient(to top, var(--gelb) 0 3px, transparent 3px 60px) left / 100% 100% no-repeat,
    repeating-linear-gradient(to top, rgba(249, 217, 22, .55) 0 1px, transparent 1px 12px) left / 45% 100% no-repeat,
    var(--blau);
  border-left: 1px solid rgba(255, 255, 255, .15);
}
.wasser {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 0;
  background: var(--wasser-latte);
  border-top: 3px solid var(--gelb);
}
.pegel.bereit .wasser { height: var(--stand, 0px); transition: height .9s cubic-bezier(.2, .7, .2, 1); }
.pegel.ruhig .wasser { transition: none; }

/* ---------- Inhalt ---------- */

main { padding: clamp(1.25rem, 3vw + .5rem, 3.25rem); max-width: 76rem; width: 100%; outline: none; }
.seitenkopf { margin-bottom: 1rem; }

.lead { font-size: 1.2rem; line-height: 1.5; max-width: 62ch; margin: 0 0 1.75rem; }
.still { color: var(--schlick); }
.klein { font-size: .92rem; color: var(--schlick); }
.notiz { max-width: 65ch; white-space: normal; }

.block { margin: 0 0 2.5rem; }
.spalten { display: grid; grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); gap: 0 2.75rem; }

.liste { list-style: none; margin: 0; padding: 0; }
.liste li {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .75rem;
  padding: .55rem 0; border-bottom: 1px dashed var(--linie);
}
.liste li .still { margin-left: auto; font-size: .94rem; }
.jahre {
  display: inline-block; min-width: 2.5rem; padding: .05rem .4rem;
  font-family: var(--schrift-eng); font-weight: 700; text-align: center;
  background: var(--gelb); color: var(--nacht); border-radius: 3px;
}

.daten { margin: 0; }
.daten > div { display: grid; grid-template-columns: minmax(8rem, 40%) 1fr; gap: .75rem; padding: .5rem 0; border-bottom: 1px dashed var(--linie); }
.daten dt { color: var(--schlick); }
.daten dd { margin: 0; overflow-wrap: anywhere; }

.werkzeug { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem 1rem; margin-bottom: 1.25rem; }
.werkzeug:has(> .knopf.zweit:first-child) { justify-content: flex-start; }
.suche { display: flex; gap: .5rem; flex: 1 1 22rem; max-width: 34rem; }
.suche input { flex: 1; }

.reiter { display: flex; flex-wrap: wrap; gap: .25rem; border-bottom: 2px solid var(--linie); margin-bottom: 1.25rem; }
.reiter a {
  padding: .5rem .9rem; margin-bottom: -2px;
  color: var(--schlick); text-decoration: none; font-family: var(--schrift-eng); font-size: 1.05rem;
  border-bottom: 4px solid transparent;
}
.reiter a:hover { color: var(--nacht); }
.reiter a[aria-current] { color: var(--nacht); font-weight: 600; border-bottom-color: var(--gelb); }

.leer { padding: 2.5rem 1.5rem; text-align: center; background: var(--flaeche); border: 2px dashed var(--feld); border-radius: 10px; max-width: 46rem; }
.leer p { margin: 0 0 1rem; }

/* ---------- Tabellen ---------- */

.tabelle-rahmen { position: relative; overflow-x: auto; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 10px; margin-bottom: .75rem; }
.tabelle { width: 100%; border-collapse: collapse; }
.tabelle th {
  text-align: left; vertical-align: bottom;
  padding: .7rem .9rem; font-family: var(--schrift-eng); font-weight: 600; color: var(--schlick);
  background: #F6F6FA; border-bottom: 2px solid var(--linie); white-space: nowrap;
}
.tabelle td { padding: .7rem .9rem; border-top: 1px solid var(--linie); vertical-align: top; }
.tabelle tbody tr:first-child td { border-top: 0; }
.tabelle tbody tr:hover { background: #FFFCE6; }
.tabelle .zahl { text-align: right; width: 1%; white-space: nowrap; color: var(--schlick); }
.tabelle .rechts { text-align: right; white-space: nowrap; }
.tabelle .mitte { text-align: center; }
.tabelle .nowrap { white-space: nowrap; }
.tabelle .raus td { color: var(--schlick); }
.tabelle .raus .zeilenlink { color: var(--schlick); font-weight: 400; }
.tabelle select { min-width: 10rem; padding: .4rem .5rem; }
.tabelle .rechts > * + * { margin-left: .75rem; }
.zeilenlink { font-weight: 600; color: var(--nacht); text-decoration: none; }
.zeilenlink:hover { text-decoration: underline; }
.rechte td:first-child { min-width: 16rem; }
.ja { color: var(--gruen-tief); }
.nein { color: var(--feld); }

.marke {
  display: inline-block; padding: .05rem .6rem; border-radius: 999px;
  font-size: .88rem; border: 1px solid var(--linie); color: var(--schlick); background: #fff; white-space: nowrap;
}
.marke.ok { background: var(--gruen-hell); color: var(--gruen-tief); border-color: transparent; }
.marke.offen { background: var(--gelb-hell); color: #5E4D00; border-color: #E6C600; }

/* ---------- Aktionen (Dokument erstellen) ---------- */

.aktionen { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr)); gap: .75rem; }
.aktionen a {
  display: block; height: 100%; padding: .9rem 1rem 1rem;
  background: var(--flaeche); color: var(--tinte); text-decoration: none;
  border: 1.5px solid var(--linie); border-left: 5px solid var(--gruen); border-radius: var(--radius);
}
.aktionen a:hover { border-color: var(--blau); border-left-color: var(--gruen); }
.aktion-name { display: block; font-family: var(--schrift-eng); font-size: 1.15rem; font-weight: 600; color: var(--blau); margin-bottom: .2rem; }
.aktion-text { display: block; font-size: .93rem; color: var(--schlick); line-height: 1.4; }

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

.formular { max-width: 54rem; }
fieldset { border: 0; margin: 0 0 1.75rem; padding: 0; min-width: 0; }
legend { font-size: 1.25rem; font-weight: 600; color: var(--blau); padding: 0; margin-bottom: .75rem; }
.feldgruppe { margin-bottom: 1rem; min-width: 0; }
label { display: block; margin-bottom: .3rem; font-size: .96rem; }
input, select, textarea {
  width: 100%; font: inherit; color: var(--tinte);
  padding: .62rem .75rem; background: #fff;
  border: 1.5px solid var(--feld); border-radius: var(--radius);
}
input[type="file"] { padding: .5rem; background: #F6F6FA; }
input:focus, select:focus, textarea:focus { border-color: var(--blau); outline: 3px solid rgba(52, 51, 143, .22); outline-offset: 0; }
[aria-invalid="true"] { border-color: var(--rot); }
.feldfehler { color: var(--rot); margin: .3rem 0 0; font-size: .94rem; }
.zeile { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
.zeile.drei { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.zeile.strasse { grid-template-columns: 3fr 1fr; }
.zeile-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1rem; }
.zeile-form .feldgruppe { margin: 0; }
.knopfleiste { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.25rem 0 .75rem; }
.haken { display: flex; align-items: center; gap: .6rem; margin: .5rem 0 1rem; }
.haken input { width: 1.25rem; height: 1.25rem; accent-color: var(--blau); }
form.inline { display: inline; }

.hochladen { margin-top: 1.5rem; padding: 1.25rem 1.25rem .5rem; background: #F6F6FA; border: 1px solid var(--linie); border-radius: 10px; }

/* ---------- Knöpfe ---------- */

.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .62rem 1.2rem; min-height: 2.75rem;
  font: 600 1.05rem/1.2 var(--schrift-eng); text-decoration: none; cursor: pointer;
  color: var(--nacht); background: var(--gelb);
  border: 2px solid var(--gelb); border-radius: var(--radius);
}
.knopf:hover { background: #FFE341; border-color: #FFE341; color: var(--nacht); }
.knopf.zweit { background: transparent; border-color: var(--blau); color: var(--blau); }
.knopf.zweit:hover { background: #E7E7F5; }
.knopf.breit { width: 100%; }
.knopf.gefahr-knopf { background: var(--rot); border-color: var(--rot); color: #fff; }
.knopf.gefahr-knopf:hover { background: #8F1C13; }
.klein-knopf { min-height: 0; padding: .32rem .75rem; font-size: .96rem; }

.link-knopf { background: none; border: 0; padding: 0; font: inherit; color: var(--blau); text-decoration: underline; text-underline-offset: .18em; cursor: pointer; }
.link-knopf.gefahr { color: var(--rot); }

/* ---------- Meldungen ---------- */

.meldung { max-width: 62rem; padding: .85rem 1.1rem; margin-bottom: 1.5rem; border-radius: var(--radius); border-left: 6px solid; background: #fff; }
.meldung-ok { background: var(--gruen-hell); border-color: var(--gruen); }
.meldung-fehler { background: var(--rot-hell); border-color: var(--rot); }
.meldung-info { background: var(--gelb-hell); border-color: #E6C600; }
.meldung a { margin-left: .25rem; }
.pw { font-size: 1.15rem; background: #fff; padding: .1rem .45rem; border-radius: 4px; user-select: all; }

/* ---------- Anmeldung ---------- */

.anmeldung { display: grid; grid-template-columns: minmax(16rem, 2fr) 3fr; min-height: 100vh; background: var(--flaeche); }
.anmeldung-pegel { position: relative; background: var(--nacht); overflow: hidden; }
.anmeldung-pegel::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 41%;
  background: var(--wasser); border-top: 3px solid var(--gelb);
  animation: steigen 1.4s cubic-bezier(.2, .7, .2, 1) both;
}
.latte.gross { left: 50%; right: auto; width: 4.5rem; margin-left: -2.25rem; border: 0;
  background:
    repeating-linear-gradient(to top, var(--gelb) 0 5px, transparent 5px 80px) left / 100% 100% no-repeat,
    repeating-linear-gradient(to top, rgba(249, 217, 22, .55) 0 2px, transparent 2px 16px) left / 40% 100% no-repeat,
    var(--blau);
}
.latte.gross .wasser { display: none; }
@keyframes steigen { from { height: 0; } }

.anmeldung-inhalt { display: flex; flex-direction: column; justify-content: center; padding: 3rem clamp(1.5rem, 6vw, 6rem); max-width: 40rem; }
.anmeldung-marke { display: flex; align-items: center; gap: 1.25rem; margin-bottom: 2.25rem; }
.anmeldung-marke p { margin: 0; }
.anmeldung-marke div { min-width: 0; }
.anmeldung-titel { font-family: var(--schrift-eng); font-size: 2.6rem; font-weight: 700; color: var(--nacht); line-height: 1; white-space: nowrap; }
.anmeldung-unter { color: var(--schlick); font-size: 1.15rem; }
.anmeldung-form { max-width: 24rem; }

/* ---------- Einzelseiten (Installation, offline) ---------- */

.einzel { padding: 1rem; }
.einzel-box { max-width: 34rem; margin: 7vh auto; padding: 2.25rem; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 12px; }
.einzel-box.breit { max-width: 48rem; }
.einzel-box h1 { margin: 1rem 0 .75rem; font-size: 2.1rem; }
.code { background: #F3F3F8; padding: 1rem; overflow: auto; border-radius: var(--radius); }

/* ---------- Handy und Tablet ---------- */

@media (max-width: 900px) {
  .rahmen { grid-template-columns: minmax(0, 1fr); align-content: start; }
  .suche { flex-basis: 100%; max-width: none; }
  .suche input { min-width: 0; }
  .pegel { position: sticky; z-index: 20; height: auto; padding: .75rem 0 calc(.75rem + .55rem); overflow: visible; }
  .pegel-kopf { padding: 0 1rem; }
  .pegel-kopf img { width: 40px; height: 40px; }
  .menu-knopf {
    display: inline-flex; margin-left: auto; padding: .45rem .9rem;
    font: 600 1rem var(--schrift-eng); color: var(--nacht); background: var(--gelb);
    border: 0; border-radius: var(--radius); cursor: pointer;
  }
  .pegel nav, .pegel .wer { display: none; }
  .pegel.offen nav, .pegel.offen .wer { display: block; }
  .pegel.offen nav { margin-top: .75rem; }
  .pegel.offen .wer { padding-bottom: .5rem; }
  .pegel nav a[aria-current="page"]::after { display: none; }
  .pegel nav a[aria-current="page"] { box-shadow: inset 5px 0 0 var(--gelb); }
  .latte { top: auto; left: 0; width: auto; height: .55rem; border: 0;
    background:
      repeating-linear-gradient(to right, var(--gelb) 0 3px, transparent 3px 60px) top / 100% 100% no-repeat,
      repeating-linear-gradient(to right, rgba(249, 217, 22, .55) 0 1px, transparent 1px 12px) top / 100% 50% no-repeat,
      var(--blau);
  }
  .wasser { display: none; }
  .zeile, .zeile.drei, .zeile.strasse { grid-template-columns: 1fr; }
  .anmeldung { grid-template-columns: 1fr; grid-template-rows: 7rem auto; }
  .latte.gross { left: 0; right: 0; width: auto; height: 100%; margin: 0;
    background:
      repeating-linear-gradient(to right, var(--gelb) 0 4px, transparent 4px 70px) bottom / 100% 40% no-repeat,
      repeating-linear-gradient(to right, rgba(249, 217, 22, .5) 0 2px, transparent 2px 14px) bottom / 100% 20% no-repeat,
      var(--nacht);
  }
  .anmeldung-marke img { width: 84px; height: 84px; }
  .tabelle th, .tabelle td { padding: .6rem .65rem; }
}

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

@media print {
  .pegel, .werkzeug, .knopfleiste, .hochladen, form { display: none !important; }
  .rahmen { display: block; }
  body { background: #fff; }
}
