/* infra-struktur – Dokumenten-Download (docs.infra-struktur.de/download/<uuid>)
   Corporate Design 2026 wie neu.infra-struktur.de (Primär #004994, Akzent #26a69a, Verlauf, Hintergrund #f5f6fb).
   Ersetzt css/style.css der Download-Seite; Bootstrap wird nicht mehr gebraucht. Die Klassen, die js/download.js
   schaltet (d-none, invisible, disabled, is-invalid), sind hier definiert.
   Alle Pfade absolut ab /, weil die Seite unter /download/<uuid> ausgeliefert wird.
   Schrift: Lato (SIL OFL 1.1), lokal in /fonts/. Icons: Font Awesome Free 6 (CC BY 4.0), Sprite in der HTML-Datei. */

@font-face { font-family: "Lato"; src: url("/fonts/lato-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Lato"; src: url("/fonts/lato-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Lato"; src: url("/fonts/lato-latin-900-normal.woff2") format("woff2"); font-weight: 900; font-style: normal; font-display: swap; }

:root {
  /* Corporate Design */
  --primary: #004994;
  --primary-700: #003c7a;
  --accent: #26a69a;
  --accent-hover: #1d8a80; /* Hover der türkisen Buttons wie auf neu */
  --bg: #f5f6fb;
  --tile: #ffffff;
  --tile-2: #dfe8f7;
  --ink: #000000;
  --lavender: #8e9aca;
  --gradient: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);

  /* Ableitungen */
  --text: #1a1f2b;
  --muted: #4b5568;
  --line: #e3e8f2;
  --field-line: #aebbd4;
  --field-line-hover: #7c8aa6;
  --error: #c62828;
  --error-ink: #8e1c1c;
  --error-bg: #fdecea;
  --white: #fff;

  --radius: 16px;
  --shadow-s: 0 1px 2px rgba(0, 38, 80, .06), 0 4px 14px -6px rgba(0, 38, 80, .14);
  --shadow: 0 2px 6px rgba(0, 38, 80, .05), 0 22px 44px -22px rgba(0, 38, 80, .32);
  --ease: cubic-bezier(.2, .7, .2, 1);

  --container: 1200px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --pad: clamp(1.25rem, 3.4vw, 2.25rem); /* Innenabstand von Kopfleiste und Download-Kachel: Kanten bündig */
}

/* ---------- Basis ---------- */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

/* Zustände aus js/download.js (vorher Bootstrap) */
.d-none { display: none !important; }
.invisible { visibility: hidden !important; }

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

body {
  display: flex; flex-direction: column;
  min-height: 100vh; min-height: 100dvh;
  margin: 0;
  font-family: "Lato", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 1.0625rem; line-height: 1.7;
  color: var(--text);
  background: var(--bg) linear-gradient(160deg, #fdfdff 0%, #f3f6fc 40%, #e4ebf7 100%) no-repeat;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

h1, h2 { margin: 0; color: var(--ink); line-height: 1.15; letter-spacing: .01em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: var(--primary); }
ul { margin: 0; padding: 0; list-style: none; }

.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.icon { width: 1.15em; height: 1.15em; flex: none; fill: currentColor; }
.nb { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Fokusring in Primärblau, auf dem Verlauf weiß */
:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
:is(.site-header__bar, .site-footer) :focus-visible { outline-color: var(--white); }

/* Subheadline laut CD: fett, Versalien, gesperrt, Primärfarbe */
.eyebrow {
  color: var(--primary);
  font-size: .8125rem; font-weight: 900; letter-spacing: .12em; line-height: 1.4;
  text-transform: uppercase;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6em;
  min-height: 48px; padding: 0 1.4em;
  border: 1.5px solid transparent; border-radius: 8px;
  font: inherit; font-size: 1rem; font-weight: 700; line-height: 1.1;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), background-color .2s, border-color .2s, color .2s, opacity .2s;
}
.btn .icon { width: 1em; height: 1em; transition: transform .2s var(--ease); }
/* „infra-struktur“ in span.nb fließt im Flex-Button als Text mit (kein eigener Abstand) */
.btn .nb { display: contents; }
.btn--lg { min-height: 54px; padding: 0 1.6em; font-size: 1.0625rem; }

/* Download: Primärblau (Hauptaufgabe der Seite) */
.btn--primary { background: var(--primary); color: var(--white); box-shadow: 0 12px 24px -14px rgba(0, 73, 148, .9); }
.btn--primary:hover { background: var(--primary-700); transform: translateY(-1px); box-shadow: 0 16px 28px -14px rgba(0, 73, 148, .95); }
.btn--primary:hover .icon { transform: translateY(2px); }

/* Werbung für infra-struktur: türkis wie auf neu */
.btn--cta { background: var(--accent); color: var(--white); box-shadow: 0 10px 22px -12px rgba(38, 166, 154, .9); }
.btn--cta:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 14px 26px -12px rgba(38, 166, 154, .95); }
.btn--cta:hover .icon { transform: translateX(3px); }

.btn--ghost { background: var(--white); border-color: var(--line); color: var(--primary); box-shadow: var(--shadow-s); }
.btn--ghost:hover { border-color: var(--primary); transform: translateY(-1px); }

.btn:active { transform: none; }

/* Gesperrt (js/download.js: Klasse disabled + aria-disabled), solange der Link geprüft wird oder das Passwort fehlt */
.btn.disabled {
  pointer-events: none; cursor: default;
  opacity: .42; box-shadow: none; transform: none;
}

/* ---------- Kopfleiste: Verlauf, so breit wie der Inhalt ---------- */

.site-header { padding-top: 10px; }
.site-header__bar {
  display: flex; flex-direction: column; align-items: flex-start; gap: .55rem;
  padding: 1rem var(--pad) 1.05rem;
  border-radius: 14px;
  background: var(--gradient);
  color: var(--white);
  box-shadow: 0 10px 30px -18px rgba(0, 38, 80, .8);
}
/* Logo-Link: Tippfläche unsichtbar auf mind. 44 px Höhe vergrößert */
.brand { position: relative; display: inline-flex; flex: none; border-radius: 6px; }
.brand::after { content: ""; position: absolute; inset: -10px -6px; }
.logo { display: block; width: auto; height: 24px; --logo-a: var(--primary); --logo-b: var(--lavender); }
.logo--white { --logo-a: #fff; --logo-b: rgba(255, 255, 255, .55); }
.site-header__title { color: var(--white); font-size: clamp(1.3125rem, 1.15rem + .7vw, 1.625rem); font-weight: 900; line-height: 1.2; }
.site-header__sub { margin-top: .15rem; color: rgba(255, 255, 255, .9); font-size: .9375rem; line-height: 1.4; }

@media (min-width: 640px) {
  .site-header__bar { flex-direction: row; align-items: center; gap: 1.5rem; padding-block: 1.05rem 1.1rem; }
  /* Logo | Titel: feine Trennlinie zwischen Marke und Seitentitel */
  .site-header__text { padding-left: 1.5rem; border-left: 1px solid rgba(255, 255, 255, .35); }
  .logo { height: 26px; }
}

/* ---------- Hauptbereich ---------- */

.main {
  position: relative; isolation: isolate;
  flex: 1 0 auto;
  display: flex; flex-direction: column; justify-content: center;
  padding: clamp(1.75rem, 5vw, 3.5rem) 0 clamp(3rem, 7vw, 5rem);
}
/* „Gedöns“: Netzwerk-Grafik immer vollständig (contain), unten rechts, läuft nach links transparent aus */
.main::before {
  content: ""; position: absolute; z-index: -1; right: 0; bottom: 0;
  width: min(1040px, 100%); aspect-ratio: 1625 / 500;
  background: url("/images/deco-netz.webp") center / contain no-repeat;
  opacity: .13;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 55%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 55%);
  pointer-events: none;
}

.main__grid { display: grid; gap: clamp(2.75rem, 7vw, 4rem); }

/* ---------- Download-Kachel ---------- */

.dl-card {
  display: flex; flex-direction: column;
  min-width: 0;
  padding: var(--pad);
  border-radius: var(--radius);
  background: var(--tile);
  box-shadow: var(--shadow);
}

/* Prüfen: Spinner und Text mittig; Mindesthöhe etwa wie das Ergebnis, damit die Kachel beim Wechsel kaum springt */
.dl-status {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: .8rem;
  min-height: clamp(12rem, 9rem + 9vw, 15.75rem);
  color: var(--muted); font-weight: 700; text-align: center;
}
.spinner {
  width: 26px; height: 26px; flex: none;
  border: 3px solid var(--tile-2); border-top-color: var(--primary); border-radius: 50%;
  animation: drehen .9s linear infinite;
}
@keyframes drehen { to { transform: rotate(360deg); } }

.dl-result { flex: 1; display: flex; flex-direction: column; }

/* Datei: Icon oben, darunter Name über die volle Breite (lange Namen brechen seltener um) */
.dl-file { display: grid; justify-items: start; }
.dl-file__icon {
  display: grid; place-items: center;
  width: 52px; height: 52px; margin-bottom: 1.1rem; border-radius: 12px;
  background: var(--tile-2); color: var(--primary);
}
.dl-file__icon .icon { width: 22px; height: 22px; }
/* Dateinamen sind oft lang und technisch (Unterstriche, Versionen): Lato 700 statt 900, damit mehr in eine Zeile passt */
.dl-file__name {
  max-width: 100%; margin-top: .3rem;
  font-size: clamp(1.1875rem, 1.06rem + .5vw, 1.375rem); font-weight: 700; line-height: 1.35;
  overflow-wrap: anywhere; /* lange Dateinamen ohne Leerzeichen umbrechen */
  text-wrap: pretty;
}

.badge {
  display: inline-flex; align-items: center; gap: .45rem;
  margin-top: .75rem; padding: .3rem .8rem;
  border-radius: 99px; background: var(--tile-2); color: var(--primary);
  font-size: .8125rem; font-weight: 700; line-height: 1.35;
}
.badge .icon { width: .85rem; height: .85rem; }

/* Passwort */
.dl-pw { margin-top: 1.75rem; }
.dl-pw__label { display: block; margin-bottom: .4rem; color: var(--ink); font-size: .9375rem; font-weight: 700; }
.pw-field { position: relative; display: flex; align-items: center; max-width: 32rem; }
.pw-field__input {
  width: 100%; min-height: 52px; padding: 0 5.5rem 0 1rem;
  border: 1.5px solid var(--field-line); border-radius: 8px;
  background: var(--bg); color: var(--ink);
  font: inherit; font-size: 1rem;
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}
.pw-field__input::placeholder { color: #6b7488; opacity: 1; }
.pw-field__input:hover { border-color: var(--field-line-hover); }
.pw-field__input:focus { outline: none; border-color: var(--primary); background: var(--white); box-shadow: 0 0 0 4px rgba(0, 73, 148, .14); }
.pw-field__input.is-invalid { border-color: var(--error); box-shadow: 0 0 0 4px rgba(198, 40, 40, .12); }

/* Anzeigen/Ausblenden: Icon folgt dem Typ des Feldes, den js/download.js umschaltet */
.pw-field__toggle {
  position: absolute; right: 4px; top: 50%; translate: 0 -50%;
  display: grid; place-items: center;
  width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 6px;
  background: transparent; color: var(--primary); cursor: pointer;
  transition: background-color .2s;
}
.pw-field__toggle:hover { background: var(--tile-2); }
.pw-field__toggle:focus-visible { outline-offset: -3px; }
.pw-field__toggle .icon { width: 20px; height: 20px; }
.pw-field__eye-slash { display: none; }
.pw-field__input[type="text"] ~ .pw-field__toggle .pw-field__eye { display: none; }
.pw-field__input[type="text"] ~ .pw-field__toggle .pw-field__eye-slash { display: block; }

/* Rechts im Feld, links vom Auge: Prüfen (js/download.js) und, wo :has() greift, Haken bei richtigem Passwort */
.pw-field__spinner {
  position: absolute; right: 56px;
  width: 20px; height: 20px;
  border: 2.5px solid var(--tile-2); border-top-color: var(--primary); border-radius: 50%;
  animation: drehen .8s linear infinite;
}
.pw-field__ok {
  position: absolute; right: 55px;
  display: none; place-items: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: var(--white);
}
.pw-field__ok .icon { width: 11px; height: 11px; }
.dl-result:has(#downloadBtn:not(.disabled)) .pw-field__ok { display: grid; }
.dl-result:has(#downloadBtn:not(.disabled)) .pw-field__input:not(:focus) { border-color: var(--accent); }

.dl-pw__error { margin-top: .55rem; color: var(--error); font-size: .875rem; font-weight: 700; line-height: 1.45; }
.dl-pw__hint { margin-top: .5rem; color: var(--muted); font-size: .875rem; line-height: 1.5; }

.dl-actions { margin-top: 1.75rem; }
/* Feld und Button gleich breit: in der Kachel volle Breite, in sehr breiten Kacheln (Tablet) begrenzt */
.dl-actions .btn { width: 100%; max-width: 32rem; }

/* Hinweis unten in der Kachel, führt zu „Was ist infra-struktur?“ */
.dl-note {
  display: flex; align-items: center; gap: .55rem;
  margin-top: auto; padding-top: 1.75rem;
  color: var(--muted); font-size: .875rem; line-height: 1.45;
}
.dl-note .icon { width: 1.05rem; height: 1.05rem; color: var(--accent); }
.dl-note a { color: var(--primary); font-weight: 700; text-decoration: underline; text-decoration-color: rgba(0, 73, 148, .35); text-underline-offset: 3px; }
.dl-note a:hover { text-decoration-color: currentColor; }

/* Fehler */
.dl-error { display: grid; gap: 1.1rem; justify-items: start; }
.dl-alert {
  display: flex; align-items: flex-start; gap: .85rem;
  width: 100%; padding: 1rem 1.15rem;
  border-radius: 10px; background: var(--error-bg); color: var(--error-ink);
}
.dl-alert__icon { width: 1.35rem; height: 1.35rem; margin-top: .15rem; color: var(--error); }
.dl-alert__title { color: var(--error-ink); font-size: 1.0625rem; font-weight: 900; line-height: 1.4; }
/* Meldungen aus js/download.js können eine lange URL enthalten */
.dl-alert__text { margin-top: .2rem; font-size: .9375rem; line-height: 1.5; overflow-wrap: anywhere; }
.dl-error__hint { color: var(--muted); font-size: .9375rem; line-height: 1.55; }

.dl-noscript { margin-top: 1rem; padding: .9rem 1rem; border-radius: 10px; background: var(--error-bg); color: var(--error-ink); font-size: .9375rem; font-weight: 700; line-height: 1.5; }

/* ---------- Was ist infra-struktur? ---------- */

.teaser { min-width: 0; }
/* Balken mit Farbverlauf (CD) über der Subheadline */
.teaser::before { content: ""; display: block; width: 64px; height: 6px; margin-bottom: 1.1rem; border-radius: 99px; background: var(--gradient); }
.teaser__title { margin-top: .6rem; font-size: clamp(1.75rem, 1.35rem + 1.5vw, 2.375rem); font-weight: 900; }
.teaser__lead { max-width: 34rem; margin-top: 1rem; font-size: clamp(1.0625rem, 1rem + .3vw, 1.1875rem); }

/* Listenpunkte laut CD: türkiser Kreis, weißer Haken */
.checklist { display: grid; gap: .8rem; max-width: 34rem; margin-top: 1.5rem; line-height: 1.55; }
.checklist li { display: flex; align-items: flex-start; gap: .75rem; text-wrap: pretty; }
.checklist__mark { display: grid; place-items: center; width: 26px; height: 26px; flex: none; margin-top: -.05em; border-radius: 50%; background: var(--accent); color: var(--white); }
.checklist__mark .icon { width: 13px; height: 13px; }

/* Buttons füllen die Textbreite; passen sie nicht nebeneinander, steht jeder in voller Breite darunter */
.teaser__actions { display: flex; flex-wrap: wrap; gap: .75rem; max-width: 34rem; margin-top: 2rem; }
.teaser__actions .btn { flex: 1 1 auto; }

/* ---------- Footer: Verlauf, schlank ---------- */

.site-footer {
  position: relative; isolation: isolate; overflow: hidden;
  flex-shrink: 0;
  padding: clamp(2rem, 5vw, 2.75rem) 0 1.5rem;
  background: var(--gradient);
  color: rgba(255, 255, 255, .88); font-size: .9375rem; line-height: 1.6;
}
/* Netzwerk-Grafik weiß, vollständig, unten rechts */
.site-footer::after {
  content: ""; position: absolute; z-index: -1; right: 0; bottom: 0;
  width: min(820px, 100%); height: 100%;
  background: url("/images/deco-netz-weiss.webp") right bottom / contain no-repeat;
  opacity: .08;
  pointer-events: none;
}
.site-footer__top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.25rem 2rem; }
.site-footer__brand { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem 1rem; color: var(--white); font-weight: 700; }
.site-footer__brand .logo { height: 28px; }

/* Social Media wie im Footer von neu: runde Icon-Knöpfe, 44 px Tippfläche */
.site-footer__social { display: flex; flex-wrap: wrap; gap: .6rem; }
.site-footer__social-link {
  display: grid; place-items: center; width: 44px; height: 44px;
  border: 1px solid rgba(255, 255, 255, .35); border-radius: 50%;
  background: rgba(255, 255, 255, .08); color: var(--white);
  transition: background-color .3s, border-color .3s, transform .2s var(--ease);
}
.site-footer__social-link:hover, .site-footer__social-link:focus-visible { border-color: var(--white); background: rgba(255, 255, 255, .24); transform: translateY(-2px); }
.site-footer__social-link .icon { width: 18px; height: 18px; }

.site-footer__bottom {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 2rem;
  margin-top: 1.5rem; padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, .22);
}
.site-footer__copy { color: rgba(255, 255, 255, .8); font-size: .875rem; }
.site-footer__legal { display: flex; flex-wrap: wrap; margin-inline: -.75rem; }

/* Links auf dem Verlauf (wiki/design.md): Text #dfe8f7 → weiß, dahinter blendet eine helle Fläche ein */
.on-gradient-link {
  position: relative; isolation: isolate;
  display: inline-flex; align-items: center;
  min-height: 44px; padding: .45rem .75rem; border-radius: 7px;
  color: var(--tile-2); font-size: .875rem; font-weight: 700; text-decoration: none;
  transition: color .4s;
}
.on-gradient-link::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  border-radius: inherit; background: rgba(255, 255, 255, .24);
  opacity: 0; transition: opacity .4s;
}
.on-gradient-link:hover, .on-gradient-link:focus-visible { color: var(--white); }
.on-gradient-link:hover::before, .on-gradient-link:focus-visible::before { opacity: 1; }

/* ---------- Breiten ---------- */

@media (min-width: 1024px) {
  /* Download links, Werbung rechts, oben bündig: Die Kachel wächst je nach Zustand nur nach unten, nichts springt */
  .main__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: clamp(3rem, 5vw, 5rem); }
  /* Grafik nur in der rechten Hälfte, damit die Kachel sie nicht verdeckt */
  .main::before { width: min(900px, 50%); }
}

/* ---------- Bewegung ---------- */

@media (prefers-reduced-motion: reduce) {
  /* Der Spinner zeigt, dass noch geprüft wird: bleibt, dreht aber langsam */
  .spinner, .pw-field__spinner { animation-duration: 2.4s; }
  .btn, .btn .icon, .site-footer__social-link { transition: none; }
  .btn:hover, .btn:hover .icon, .site-footer__social-link:hover { transform: none; }
}
