/* ==========================================================================
   Grundlagen: Schriften, Farben, Typografie, Buttons, Formulare, Ampel
   Wird von der öffentlichen Website und vom Portal gemeinsam genutzt.
   ========================================================================== */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/inter/inter-latin-wght-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('/fonts/jakarta/plus-jakarta-sans-latin-wght-normal.woff2') format('woff2');
}

:root {
  --ink: #0b1f33;
  --ink-2: #12304b;
  --ink-3: #1c4263;
  --text: #1f2a3a;
  --muted: #5a6a7e;
  --faint: #8c99ab;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --line: #e3e8ef;
  --line-strong: #cdd5df;

  --brand: #0e7c66;
  --brand-600: #0b6a57;
  --brand-700: #085545;
  --brand-50: #e9f6f2;
  --brand-100: #cfece4;
  --brand-glow: rgba(14, 124, 102, 0.28);
  --mint: #5eead4;
  --accent: #f5b301;

  --green: #15a34a;
  --green-text: #0f7a37;
  --green-bg: #e8f7ed;
  --yellow: #f59e0b;
  --yellow-text: #a15c07;
  --yellow-bg: #fff5dc;
  --red: #dc2626;
  --red-text: #b91c1c;
  --red-bg: #fdecec;
  --grey: #94a3b8;
  --grey-bg: #eef2f6;
  --blue-bg: #e8f1fd;
  --blue-text: #1d4ed8;

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --shadow-xs: 0 1px 2px rgba(11, 31, 51, 0.06);
  --shadow-sm: 0 1px 3px rgba(11, 31, 51, 0.07), 0 1px 2px rgba(11, 31, 51, 0.04);
  --shadow: 0 6px 20px -6px rgba(11, 31, 51, 0.12), 0 2px 6px rgba(11, 31, 51, 0.05);
  --shadow-lg: 0 24px 48px -16px rgba(11, 31, 51, 0.22), 0 6px 16px rgba(11, 31, 51, 0.06);

  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-display: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(0.22, 0.8, 0.26, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
  font-weight: 700;
}

p { margin: 0 0 1em; }
a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { max-width: 100%; }
strong { font-weight: 650; }
hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }

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

.icon {
  width: 1.25em;
  height: 1.25em;
  flex: none;
  vertical-align: -0.22em;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Das hidden-Attribut soll immer gewinnen, auch gegen display:flex von Buttons und Hinweisen */
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- Logo */

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.18rem;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-decoration: none !important;
}
.logo-mark { flex: none; border-radius: 9px; }
.logo span em { font-style: normal; color: var(--brand); }
.logo.on-dark { color: #fff; }
.logo.on-dark span em { color: var(--mint); }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none !important;
  white-space: nowrap;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), background-color 0.18s, border-color 0.18s, color 0.18s;
}
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(8, 85, 69, 0.3), 0 6px 16px -6px var(--brand-glow); }
.btn-primary:hover { background: var(--brand-600); transform: translateY(-1px); box-shadow: 0 2px 4px rgba(8, 85, 69, 0.3), 0 12px 24px -8px var(--brand-glow); }

.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: var(--ink-2); transform: translateY(-1px); }

.btn-light { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.btn-light:hover { transform: translateY(-1px); box-shadow: var(--shadow); }

.btn-outline { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-outline:hover { border-color: var(--ink-3); background: #fafbfc; }

.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--grey-bg); color: var(--ink); }

.btn-ghost-light { background: rgba(255, 255, 255, 0.08); color: #fff; border-color: rgba(255, 255, 255, 0.22); }
.btn-ghost-light:hover { background: rgba(255, 255, 255, 0.16); }

.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-danger-outline { background: var(--surface); color: var(--red-text); border-color: #f3c4c4; }
.btn-danger-outline:hover { background: var(--red-bg); }

.btn-sm { padding: 7px 12px; font-size: 0.86rem; border-radius: 8px; gap: 6px; }
.btn-lg { padding: 15px 28px; font-size: 1.02rem; border-radius: 12px; }
.btn-block { width: 100%; }
.btn-icon { padding: 8px; }

/* ---------------------------------------------------------------- Cookie-Hinweis */

.cookie-notice {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 150;
  display: flex;
  align-items: center;
  gap: 20px;
  width: min(760px, calc(100vw - 28px));
  padding: 18px 20px;
  border-radius: var(--radius);
  background: var(--ink);
  color: #c4d2e1;
  box-shadow: 0 18px 50px -12px rgba(11, 31, 51, 0.55);
  font-size: 0.92rem;
  line-height: 1.5;
}
.cookie-notice strong { display: block; color: #fff; font-size: 1rem; margin-bottom: 2px; }
.cookie-notice p { margin: 0; }
.cookie-notice a { color: var(--mint); text-decoration: underline; }
.cookie-notice .btn { flex: none; }
@media (max-width: 600px) {
  .cookie-notice { flex-direction: column; align-items: stretch; bottom: 12px; padding: 16px; gap: 14px; }
}
@media print {
  .cookie-notice { display: none; }
}

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

.field { margin-bottom: 18px; }
.field > label:not(.check), .label {
  display: block;
  font-weight: 600;
  font-size: 0.89rem;
  color: var(--ink);
  margin-bottom: 6px;
}
.label-opt { font-weight: 400; color: var(--faint); font-size: 0.84rem; }

.input, .select, .textarea {
  width: 100%;
  padding: 11px 14px;
  font: inherit;
  font-size: 0.97rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:hover, .select:hover, .textarea:hover { border-color: #b3bdca; }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-glow);
}
.textarea { min-height: 130px; resize: vertical; line-height: 1.55; }
.select {
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235a6a7e' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.input.has-error, .textarea.has-error, .select.has-error { border-color: var(--red); box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.12); }
.input-mono { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; letter-spacing: 0.02em; }

.hint { font-size: 0.84rem; color: var(--muted); margin-top: 6px; }
.error-text { font-size: 0.85rem; color: var(--red-text); margin-top: 6px; font-weight: 500; }

.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 18px; }
@media (max-width: 640px) {
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
}

.input-group { display: flex; gap: 8px; }
.input-group .input { flex: 1; min-width: 0; }

.check {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  font-size: 0.93rem;
  line-height: 1.5;
  cursor: pointer;
}
.check input {
  appearance: none;
  flex: none;
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  border: 1.5px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface) center / 14px no-repeat;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.check input[type='radio'] { border-radius: 50%; }
.check input:hover { border-color: var(--brand); }
.check input:checked {
  background-color: var(--brand);
  border-color: var(--brand);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
}
.check input[type='radio']:checked {
  background-image: none;
  box-shadow: inset 0 0 0 4px #fff;
}
.check input:focus-visible { outline: 3px solid var(--brand-glow); outline-offset: 2px; }

/* ---------------------------------------------------------------- Hinweise */

.alert {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.94rem;
  line-height: 1.5;
  border: 1px solid transparent;
  margin-bottom: 20px;
}
.alert .icon { margin-top: 1px; width: 20px; height: 20px; }
.alert p:last-child { margin-bottom: 0; }
.alert-success { background: var(--green-bg); color: #0c5c2b; border-color: #bfe8cc; }
.alert-error { background: var(--red-bg); color: #8f1717; border-color: #f6c9c9; }
.alert-warning { background: var(--yellow-bg); color: #7a4504; border-color: #f7dfa3; }
.alert-info { background: var(--blue-bg); color: #1e3a8a; border-color: #c5dbfa; }
.alert-neutral { background: var(--grey-bg); color: var(--text); border-color: var(--line); }

/* ---------------------------------------------------------------- Ampel */

.light {
  display: inline-block;
  flex: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--grey);
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.2);
}
.light-green { background: var(--green); box-shadow: 0 0 0 3px rgba(21, 163, 74, 0.18); }
.light-yellow { background: var(--yellow); box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2); }
.light-red { background: var(--red); box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.18); }
.light-lg { width: 16px; height: 16px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 11px 4px 9px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  background: var(--grey-bg);
  color: #475569;
}
.badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.85;
}
.badge.no-dot { padding-left: 11px; }
.badge.no-dot::before { display: none; }
.badge-green, .badge-success { background: var(--green-bg); color: var(--green-text); }
.badge-yellow, .badge-warning { background: var(--yellow-bg); color: var(--yellow-text); }
.badge-red, .badge-danger { background: var(--red-bg); color: var(--red-text); }
.badge-grey, .badge-neutral { background: var(--grey-bg); color: #475569; }
.badge-brand { background: var(--brand-50); color: var(--brand-700); }
.badge-info { background: var(--blue-bg); color: var(--blue-text); }

/* Senkrechte Ampel als Schmuckelement */
.traffic {
  display: inline-flex;
  flex-direction: column;
  gap: 5px;
  padding: 7px;
  border-radius: 999px;
  background: var(--ink);
}
.traffic i { width: 12px; height: 12px; border-radius: 50%; background: rgba(255, 255, 255, 0.14); transition: background-color 0.3s, box-shadow 0.3s; }
.traffic.is-green i:nth-child(3) { background: #4ade80; box-shadow: 0 0 12px rgba(74, 222, 128, 0.8); }
.traffic.is-yellow i:nth-child(2) { background: #fbbf24; box-shadow: 0 0 12px rgba(251, 191, 36, 0.8); }
.traffic.is-red i:nth-child(1) { background: #f87171; box-shadow: 0 0 12px rgba(248, 113, 113, 0.8); }
.traffic.is-grey i { background: rgba(255, 255, 255, 0.14); }

/* ---------------------------------------------------------------- Lesetext (Unterweisungsinhalte, Rechtstexte) */

.prose { font-size: 1.04rem; line-height: 1.75; color: #27344a; }
.prose h2 { font-size: 1.5rem; margin: 2.1em 0 0.6em; padding-top: 0.2em; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 1.16rem; margin: 1.7em 0 0.5em; }
.prose h4 { font-size: 1.02rem; margin: 1.4em 0 0.4em; }
.prose p { margin: 0 0 1.1em; }
.prose ul, .prose ol { margin: 0 0 1.2em; padding-left: 1.35em; }
.prose li { margin-bottom: 0.45em; padding-left: 0.2em; }
.prose li::marker { color: var(--brand); font-weight: 700; }
.prose blockquote {
  margin: 1.6em 0;
  padding: 16px 20px;
  background: var(--brand-50);
  border-left: 4px solid var(--brand);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: #124438;
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose blockquote > :first-child strong:first-child { font-family: var(--font-display); }
.prose blockquote ul { margin: 0.4em 0 0; }
/* Hinweiskästen: Praxistipp (grün), Achtung (gelb), Merke (blau) */
.prose blockquote.tip { background: var(--brand-50); border-left-color: var(--brand); color: #124438; }
.prose blockquote.warn { background: var(--yellow-bg); border-left-color: var(--yellow); color: #6b3d04; }
.prose blockquote.note { background: var(--blue-bg); border-left-color: #3b82f6; color: #1e3a8a; }

/* Bilder im Text */
.prose p.figure { margin: 1.8em 0; text-align: center; }
.prose img {
  display: inline-block;
  max-width: min(100%, 620px);
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  background: #fff;
}

/* Liste mit Häkchen („Das Wichtigste auf einen Blick“) */
.prose li.tick {
  list-style: none;
  position: relative;
  margin-left: -1.35em;
  padding: 0.5em 0.9em 0.5em 2.6em;
  margin-bottom: 0.5em;
  background: var(--green-bg);
  border-radius: var(--radius-sm);
  color: #0c5c2b;
  font-weight: 500;
}
.prose li.tick::before {
  content: '';
  position: absolute;
  left: 0.8em;
  top: 0.72em;
  width: 1.15em;
  height: 1.15em;
  border-radius: 50%;
  background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 68% no-repeat;
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.4em 0;
  font-size: 0.95rem;
  display: block;
  overflow-x: auto;
}
.prose th, .prose td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { background: var(--bg); font-weight: 650; color: var(--ink); white-space: nowrap; }
.prose code { background: var(--grey-bg); padding: 0.1em 0.4em; border-radius: 5px; font-size: 0.92em; }

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
