/* NEXUSINFRA Portal – Entwurf (Gestaltungsvorschlag 1.1, Designsystem 1.2) */
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("fonts/Inter-Regular.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("fonts/Inter-Medium.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("fonts/Inter-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700; font-display: swap; src: url("fonts/Inter-Bold.woff2") format("woff2"); }

:root {
  color-scheme: light;
  --marke: #0E5570;
  --marke-dunkel: #0A3F53;
  --dekor: #2FA8BA;
  --grund: #F4F7FA;
  --flaeche: #FFFFFF;
  --text: #173042;
  --text-leise: #4A5D6E;
  --linie: #DDE5EC;
  --feldlinie: #7A8C9C;
  --auf-dunkel: #DCE9EF;
  --auf-dunkel-leise: #CFE3EA;
  --ziel: 24px;
}
@media (pointer: coarse) {
  :root { --ziel: 44px; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; }
body {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: linear-gradient(160deg, #F4F7FA 0%, #E8EEF4 100%) fixed;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
:focus-visible { outline: 3px solid var(--marke); outline-offset: 2px; }

/* ---------- Kopf und Fuss ---------- */
.kopf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 24px 8px;
}
.kopf img { display: block; height: 56px; width: auto; }
.inhalt { max-width: 1200px; margin: 0 auto; padding: 16px 24px 48px; }
.titel { margin: 8px 0 4px; font-size: 28px; font-weight: 700; letter-spacing: -0.01em; }
.untertitel { margin: 0 0 24px; font-size: 16px; color: var(--text-leise); }
.fuss {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 24px 32px;
  border-top: 1px solid var(--linie);
  font-size: 13px;
  color: var(--text-leise);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  align-items: center;
}
.fuss a { display: inline-flex; align-items: center; min-height: var(--ziel); color: var(--marke); }

/* ---------- Kacheln ---------- */
.raster {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.kachel { position: relative; }
.kachel-link {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 96px;
  padding: 16px 52px 16px 20px;
  border: 1px solid var(--linie);
  border-left: 5px solid var(--app);
  border-radius: 14px;
  background: var(--flaeche);
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(23, 48, 66, 0.05);
  transition: box-shadow 0.15s, transform 0.15s;
}
.kachel-link:hover { box-shadow: 0 8px 24px rgba(23, 48, 66, 0.12); transform: translateY(-1px); }
.kachel-symbol { flex: none; width: 56px; height: 56px; border-radius: 13px; }
.kachel-text { min-width: 0; overflow-wrap: anywhere; hyphens: manual; }
.kachel-name { display: block; font-size: 18px; font-weight: 600; line-height: 1.3; }
.kachel-zusatz { display: block; margin-top: 2px; font-size: 14px; color: var(--text-leise); }
.kachel-hinweis { display: inline-block; margin-top: 6px; padding: 1px 8px; border-radius: 999px; background: #EEF2F6; font-size: 12px; font-weight: 600; color: var(--text-leise); }
.kachel--geplant .kachel-link { cursor: default; background: #FAFBFC; }
.kachel--geplant .kachel-link:hover { box-shadow: 0 1px 2px rgba(23, 48, 66, 0.05); transform: none; }
.info-knopf {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max(32px, var(--ziel));
  height: max(32px, var(--ziel));
  border: 1px solid var(--linie);
  border-radius: 50%;
  background: var(--flaeche);
  color: var(--text-leise);
  font: 600 15px/1 "Inter", system-ui, sans-serif;
  cursor: pointer;
}
.info-knopf:hover, .kachel.offen .info-knopf { border-color: var(--app); color: var(--app); }

/* ---------- Info-Karte (wie der linke Teil der heutigen Anmeldung) ---------- */
.info {
  display: none;
  width: 360px;
  padding: 24px 24px 20px;
  border-top: 4px solid var(--app);
  border-radius: 14px;
  background: linear-gradient(165deg, var(--marke) 0%, var(--marke-dunkel) 100%);
  color: var(--auf-dunkel);
  box-shadow: 0 16px 40px rgba(10, 63, 83, 0.28);
}
.info-marke { display: flex; align-items: center; gap: 14px; }
.info-marke > div { min-width: 0; overflow-wrap: anywhere; }
.info-marke img { width: 52px; height: 52px; flex: none; border-radius: 12px; }
.info-familie { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; color: var(--auf-dunkel-leise); }
.info-name { margin: 0; font-size: 22px; font-weight: 700; line-height: 1.2; color: #fff; }
.info-zusatz { margin: 0; font-size: 15px; color: var(--auf-dunkel); }
.info-label { margin: 20px 0 10px; font-size: 12px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--auf-dunkel-leise); }
.info-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.info-liste li { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; line-height: 1.45; }
.info-liste li::before { content: ""; flex: none; width: 8px; height: 8px; margin-top: 7px; border-radius: 50%; background: var(--dekor); }
.info-liste strong { color: #fff; font-weight: 600; }
.info-fuss { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, 0.18); font-size: 13px; color: var(--auf-dunkel-leise); }

/* Breite Bildschirme: Info erscheint neben der Kachel (Maus, Tastatur oder «i») */
@media (min-width: 1024px) {
  .info { position: absolute; top: -8px; left: calc(100% + 12px); z-index: 20; }
  .info::before { content: ""; position: absolute; top: 0; bottom: 0; left: -14px; width: 14px; }
  .kachel:nth-child(3n) .info { left: auto; right: calc(100% + 12px); }
  .kachel:nth-child(3n) .info::before { left: auto; right: -14px; }
  .kachel:hover .info, .kachel-link:focus-visible ~ .info, .kachel.offen .info { display: block; }
  .kachel:hover, .kachel:focus-within, .kachel.offen { z-index: 10; }
}
@media (min-width: 1024px) and (max-width: 1279px) {
  .info { width: 320px; }
}
/* Schmale Bildschirme: Info klappt mit «i» unter der Kachel auf */
@media (max-width: 1023px) {
  .kachel.offen .info { display: block; width: auto; margin-top: 8px; }
}
.kachel.still .info { display: none !important; }
@media (max-width: 1023px) {
  .raster { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .kopf { padding: 16px 16px 4px; }
  .kopf img { height: 44px; }
  .inhalt { padding: 12px 12px 32px; }
  .titel { font-size: 23px; }
  .raster { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .kachel-link { min-height: 84px; padding: 14px 56px 14px 16px; }
  .kachel-symbol { width: 48px; height: 48px; border-radius: 11px; }
  .fuss { padding: 16px 16px 24px; }
}

/* ---------- Lizenz & Rechtliches ---------- */
.kopf > a:first-child { display: block; border-radius: 6px; }
.kopf-zurueck { display: inline-flex; align-items: center; min-height: var(--ziel); font-size: 15px; color: var(--marke); }
.recht { max-width: 860px; }
.recht-inhalt {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 -8px 16px;
  padding: 8px;
  border-radius: 0 0 12px 12px;
  background: rgba(240, 244, 248, 0.94);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.recht-inhalt a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: max(36px, var(--ziel));
  padding: 0 14px;
  border: 1px solid var(--linie);
  border-radius: 999px;
  background: var(--flaeche);
  font-size: 14px;
  font-weight: 600;
  color: var(--marke);
  text-decoration: none;
}
.recht-inhalt a:hover { border-color: var(--marke); }
.recht-inhalt a[aria-current="true"] { border-color: var(--marke); background: var(--marke); color: #fff; }
.recht-karte {
  margin: 0 0 16px;
  padding: 24px 28px;
  border: 1px solid var(--linie);
  border-radius: 14px;
  background: var(--flaeche);
  scroll-margin-top: 140px;
}
.recht-karte.reiter-aus { display: none; }
.recht-karte h2 { margin: 0 0 12px; font-size: 21px; font-weight: 700; color: var(--marke); }
.recht-karte h3 { margin: 22px 0 6px; font-size: 17px; font-weight: 600; }
.recht-karte p, .recht-karte li { font-size: 16px; line-height: 1.6; }
.recht-karte p { margin: 0 0 10px; }
.recht-karte ul { margin: 0 0 10px; padding-left: 22px; }
.recht-karte li { margin-bottom: 6px; }
.recht-karte a { display: inline-flex; align-items: center; min-height: var(--ziel); vertical-align: middle; color: var(--marke); }
.recht-adresse { margin: 0 0 12px; padding: 12px 16px; border-left: 4px solid var(--dekor); background: var(--grund); font-style: normal; line-height: 1.7; }
.recht-stand { margin: 8px 0 0; font-size: 13px; color: var(--text-leise); }
.recht-titelzeile { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 0 16px; }
.recht-drucken {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: max(40px, var(--ziel));
  margin: 8px 0 24px;
  padding: 0 16px;
  border: 1px solid var(--marke);
  border-radius: 10px;
  background: var(--flaeche);
  color: var(--marke);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.recht-drucken:hover { background: var(--grund); }
.nur-druck { display: none; }
@media (max-width: 640px) {
  .kopf-zurueck { font-size: 14px; }
  .recht-karte { padding: 18px 16px; border-radius: 12px; }
  .recht-karte h2 { font-size: 19px; }
  .recht-drucken { margin: 0 0 20px; }
  .recht-inhalt { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media print {
  @page { size: A4; margin: 16mm 16mm 18mm; }
  html, body { background: #fff !important; }
  body { font-size: 10.5pt; color: #000; }
  .kopf { max-width: none; padding: 0 0 6mm; }
  .kopf img { height: 12mm; }
  .kopf-zurueck, .recht-drucken, .recht-inhalt, .fuss { display: none !important; }
  .inhalt.recht { max-width: none; padding: 0; }
  .nur-druck { display: block; }
  .titel { margin: 0 0 2pt; font-size: 18pt; }
  .untertitel { margin: 0; font-size: 10.5pt; }
  .recht-quelle { margin: 2pt 0 8mm; font-size: 9pt; color: #4A5D6E; }
  .recht-karte, .recht-karte.reiter-aus { display: block; margin: 0 0 7mm; padding: 0; border: 0; border-radius: 0; background: none; }
  .recht-karte h2 { margin: 0 0 3mm; font-size: 13.5pt; break-after: avoid; }
  .recht-karte h3 { margin: 4mm 0 1.5mm; font-size: 11pt; break-after: avoid; }
  .recht-karte p, .recht-karte li { font-size: 10.5pt; line-height: 1.5; orphans: 3; widows: 3; }
  .recht-karte li { break-inside: avoid; }
  .recht-karte a { display: inline; min-height: 0; vertical-align: baseline; color: inherit; text-decoration: none; }
  .recht-karte p:has(+ ul) { break-after: avoid; }
  .recht-adresse { padding: 1mm 0 1mm 4mm; background: none; break-inside: avoid; }
  .recht-stand { font-size: 9pt; }
}

/* ---------- Schlanke Anmeldung ---------- */
.anmeldung-seite {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
}
.anmeldung-karte {
  width: min(440px, 100%);
  padding: 36px 40px 28px;
  border: 1px solid var(--linie);
  border-top: 4px solid var(--app);
  border-radius: 16px;
  background: var(--flaeche);
  box-shadow: 0 1px 2px rgba(23, 48, 66, 0.06), 0 12px 32px rgba(23, 48, 66, 0.10);
}
.anmeldung-marke { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.anmeldung-marke img { width: 52px; height: 52px; flex: none; border-radius: 12px; }
.anmeldung-familie { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; color: var(--text-leise); }
.anmeldung-app { margin: 0; font-size: 22px; font-weight: 700; line-height: 1.2; }
.anmeldung-karte h1 { margin: 0 0 4px; font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
.anmeldung-karte .einleitung { margin: 0 0 24px; color: var(--text-leise); }
.feld { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.feld label { font-size: 14px; font-weight: 600; }
.feld input {
  width: 100%;
  min-height: 48px;
  padding: 11px 12px;
  border: 1px solid var(--feldlinie);
  border-radius: 10px;
  font: inherit;
  font-size: 16px;
  color: var(--text);
  background: var(--flaeche);
  outline: none;
}
.feld input:focus { border-color: var(--app); box-shadow: 0 0 0 3px var(--app-hell); }
.knopf {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 10px;
  background: var(--app);
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
.link-mitte { display: flex; justify-content: center; margin-top: 12px; }
.link-mitte a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; font-size: 14px; color: var(--app); }
.anmeldung-unten { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 20px; font-size: 13px; color: var(--text-leise); }
.anmeldung-unten a { display: inline-flex; align-items: center; min-height: var(--ziel); color: var(--marke); }
.zurueck { font-weight: 600; text-decoration: none; }
@media (max-width: 640px) {
  .anmeldung-seite { justify-content: flex-start; padding: 16px 8px; }
  .anmeldung-karte { padding: 24px 18px 20px; border-radius: 12px; }
}
