/*
 * synvitus – Website-Stylesheet
 *
 * Farben und Typografie folgen der Anwendung selbst: Open Sans, die
 * Orangetöne aus dem Logo (#f60/#f90/#cc7a00) und die Grauabstufungen, die
 * dort über Tailwind (gray-50 … gray-900) im Einsatz sind. Hell/Dunkel
 * richtet sich – wie in der App (darkMode: 'media') – nach der
 * Systemeinstellung des Besuchers.
 *
 * Bewusst handgeschriebenes CSS ohne Build-Schritt: auf Shared Hosting soll
 * ein FTP-Upload genügen, ohne Node/Tailwind-Toolchain.
 */

/* ---------------------------------------------------------------- Tokens */

:root {
  color-scheme: light dark;

  --brand: #ff6600;
  --brand-strong: #e65c00;
  --brand-light: #ff9900;
  --brand-dark: #cc7a00;
  --brand-pale: #ffd699;

  --accent: #2563eb;          /* wie die Primärbuttons in der Anwendung */

  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  --bg: var(--gray-100);
  --surface: #ffffff;
  --surface-2: var(--gray-50);
  --ink: var(--gray-900);
  --ink-soft: var(--gray-600);
  --ink-muted: var(--gray-500);
  --line: var(--gray-200);
  --line-strong: var(--gray-300);

  --success-bg: #f0fdf4;
  --success-line: #86efac;
  --success-ink: #166534;
  --error-bg: #fef2f2;
  --error-line: #fca5a5;
  --error-ink: #991b1b;
  --warn-bg: #fffbeb;
  --warn-line: #fcd34d;
  --warn-ink: #92400e;

  --radius: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgb(17 24 39 / 6%), 0 1px 3px rgb(17 24 39 / 8%);
  --shadow-md: 0 4px 6px -1px rgb(17 24 39 / 8%), 0 10px 20px -5px rgb(17 24 39 / 10%);
  --shadow-lg: 0 20px 40px -12px rgb(17 24 39 / 22%);

  --container: 76rem;
  --header-h: 4rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--gray-800);
    --surface: var(--gray-900);
    --surface-2: #18212f;
    --ink: var(--gray-50);
    --ink-soft: var(--gray-300);
    --ink-muted: var(--gray-400);
    --line: var(--gray-700);
    --line-strong: var(--gray-600);

    --success-bg: rgb(20 83 45 / 40%);
    --success-line: #15803d;
    --success-ink: #bbf7d0;
    --error-bg: rgb(127 29 29 / 40%);
    --error-line: #b91c1c;
    --error-ink: #fecaca;
    --warn-bg: rgb(120 53 15 / 40%);
    --warn-line: #b45309;
    --warn-ink: #fde68a;

    --shadow-sm: 0 1px 2px rgb(0 0 0 / 30%);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 40%), 0 10px 20px -5px rgb(0 0 0 / 30%);
    --shadow-lg: 0 20px 40px -12px rgb(0 0 0 / 55%);
  }
}

/* ------------------------------------------------------------- Grundlagen */

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

html {
  scroll-behavior: smooth;
  /* Anker nicht unter der fixierten Kopfzeile verstecken. */
  scroll-padding-top: calc(var(--header-h) + 1rem);
  -webkit-text-size-adjust: 100%;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Open Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  margin: 0 0 .6em;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1 { font-size: clamp(2rem, 1.35rem + 3.1vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 1.25rem + 1.7vw, 2.4rem); }
h3 { font-size: clamp(1.15rem, 1.05rem + .5vw, 1.4rem); }
h4 { font-size: 1.05rem; }

p { margin: 0 0 1.1rem; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--brand-strong); }

img, svg { max-width: 100%; height: auto; }

ul, ol { margin: 0 0 1.1rem; padding-left: 1.3rem; }
li { margin-bottom: .4rem; }

strong { font-weight: 700; }

code {
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
  font-size: .9em;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: .1em .4em;
}

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

::selection { background: var(--brand-pale); color: var(--gray-900); }

.skip-link {
  position: absolute;
  left: .75rem;
  top: -4rem;
  z-index: 200;
  background: var(--brand);
  color: #fff;
  padding: .7rem 1.1rem;
  border-radius: 0 0 var(--radius) var(--radius);
  font-weight: 700;
  transition: top .15s ease;
}
.skip-link:focus { top: 0; color: #fff; }

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

/* --------------------------------------------------------------- Layout */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.section { padding: clamp(3rem, 2rem + 5vw, 6rem) 0; }
.section--tight { padding: clamp(2rem, 1.5rem + 2.5vw, 3.5rem) 0; }
.section--alt { background: var(--surface); border-block: 1px solid var(--line); }

.section-head { max-width: 44rem; margin-bottom: 2.5rem; }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head p { color: var(--ink-soft); font-size: 1.075rem; margin-bottom: 0; }

.grid { display: grid; gap: 1.25rem; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }

.stack > * + * { margin-top: 1rem; }

.lead { font-size: clamp(1.05rem, 1rem + .4vw, 1.25rem); color: var(--ink-soft); }

.eyebrow {
  display: inline-block;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--brand-dark);
  margin-bottom: .75rem;
}

@media (prefers-color-scheme: dark) {
  .eyebrow { color: var(--brand-light); }
}

/* ------------------------------------------------------------ Kopfzeile */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-header .container {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex: none;
}

/* Das Logo selbst (voller Schriftzug + Symbol als ein SVG) ist reines
   Orange/Sandton ohne dunkle Elemente - dieselbe Datei liest sich auf hellem
   wie auf dunklem Grund, ein Theme-Wechsel des Bildes ist daher nicht nötig. */
.logo img {
  display: block;
  height: 1.9rem;
  width: auto;
}

.nav { margin-left: auto; }

.nav-list {
  display: flex;
  align-items: center;
  gap: .25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-list a {
  display: block;
  padding: .5rem .8rem;
  border-radius: 8px;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: .95rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color .15s ease, color .15s ease;
}
.nav-list a:hover { background: var(--surface-2); color: var(--ink); }
.nav-list a[aria-current='page'] { color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, transparent); }

.nav-toggle {
  display: none;
  margin-left: auto;
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink);
  padding: .45rem .6rem;
  cursor: pointer;
  line-height: 0;
}

@media (max-width: 63rem) {
  .nav-toggle { display: block; }

  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    margin: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    max-height: calc(100dvh - var(--header-h));
    overflow-y: auto;
    display: none;
  }

  .nav[data-open='true'] { display: block; }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: .5rem 1.25rem 1.25rem;
  }

  .nav-list a {
    padding: .9rem .75rem;
    font-size: 1.05rem;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
  }

  .nav-list li:last-child a { border-bottom: 0; }
  .nav-list .btn { margin-top: .75rem; text-align: center; border-bottom: 0; }
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .8rem 1.4rem;
  border: 1px solid transparent;
  border-radius: 10px;
  font: inherit;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .1s ease;
  /* Touch-Ziel nach WCAG 2.2 */
  min-height: 44px;
}

.btn:active { transform: translateY(1px); }

.btn--primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); color: #fff; }

.btn--secondary { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn--secondary:hover { background: var(--surface-2); border-color: var(--brand); color: var(--ink); }

.btn--ghost { background: transparent; border-color: transparent; color: var(--brand); padding-inline: .5rem; }
.btn--ghost:hover { color: var(--brand-strong); text-decoration: underline; }

.btn--danger { background: #dc2626; border-color: #dc2626; color: #fff; }
.btn--danger:hover { background: #b91c1c; border-color: #b91c1c; color: #fff; }

.btn--sm { padding: .45rem .8rem; font-size: .875rem; min-height: 36px; }
.btn--block { width: 100%; }

.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; }

/* ----------------------------------------------------------------- Hero */

.hero {
  position: relative;
  padding: clamp(3rem, 2rem + 6vw, 6.5rem) 0 clamp(2.5rem, 2rem + 4vw, 5rem);
  overflow: hidden;
}

/* Weicher Farbverlauf in Markenfarbe statt eines Bildes – kostet kein
   zusätzliches Byte und bleibt in beiden Farbschemata ruhig. */
.hero::before {
  content: '';
  position: absolute;
  inset: -30% -10% auto -10%;
  height: 70%;
  background:
    radial-gradient(60% 60% at 20% 40%, color-mix(in srgb, var(--brand) 22%, transparent), transparent 70%),
    radial-gradient(50% 50% at 80% 20%, color-mix(in srgb, var(--brand-light) 18%, transparent), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.hero > .container { position: relative; z-index: 1; }

.hero-grid {
  display: grid;
  gap: clamp(2rem, 1rem + 4vw, 3.5rem);
  align-items: center;
}

@media (min-width: 60rem) {
  .hero-grid { grid-template-columns: 1.15fr .85fr; }
}

.hero h1 { margin-bottom: 1rem; }
.hero h1 .brand-mark { color: var(--brand); }
.hero .lead { margin-bottom: 1.75rem; max-width: 38rem; }

.hero-points { list-style: none; padding: 0; margin: 1.75rem 0 0; display: grid; gap: .6rem; }
.hero-points li { display: flex; gap: .6rem; align-items: flex-start; color: var(--ink-soft); margin: 0; }
.hero-points svg { flex: none; margin-top: .25rem; color: var(--brand); }

/* Modul-Vorschau neben dem Hero */
.hero-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 1.5rem;
}

.hero-card h2 { font-size: 1.05rem; margin-bottom: 1rem; color: var(--ink-muted); font-weight: 600; letter-spacing: 0; }

.hero-card ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; }

.hero-card li {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .7rem .85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  margin: 0;
}

.hero-card .dot { width: .6rem; height: .6rem; border-radius: 50%; flex: none; background: var(--brand); }
.hero-card .dot--2 { background: var(--brand-light); }
.hero-card .dot--3 { background: var(--brand-dark); }
.hero-card .dot--4 { background: var(--brand-pale); }
.hero-card .dot--5 { background: var(--accent); }
.hero-card strong { font-size: .95rem; }
.hero-card small { display: block; color: var(--ink-muted); font-size: .8rem; line-height: 1.4; }

/* --------------------------------------------------------------- Badges */

.badge {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .35rem .8rem;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .01em;
  border: 1px solid;
}

.badge--dev { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-ink); }
.badge--beta { background: color-mix(in srgb, var(--brand) 12%, transparent); border-color: var(--brand); color: var(--brand-dark); }
.badge--soon { background: var(--surface-2); border-color: var(--line-strong); color: var(--ink-muted); }
.badge--ok { background: var(--success-bg); border-color: var(--success-line); color: var(--success-ink); }
.badge--pending { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-ink); }
.badge--off { background: var(--surface-2); border-color: var(--line-strong); color: var(--ink-muted); }

@media (prefers-color-scheme: dark) {
  .badge--beta { color: var(--brand-light); }
}

.badge .pulse {
  width: .5rem; height: .5rem; border-radius: 50%;
  background: currentColor;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* --------------------------------------------------------------- Karten */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.card--link { text-decoration: none; color: inherit; display: block; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.card--link:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--brand); color: inherit; }

.card h3 { margin-bottom: .5rem; }
.card p { color: var(--ink-soft); margin-bottom: 0; font-size: .95rem; }

.card-icon {
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: color-mix(in srgb, var(--brand) 12%, transparent);
  color: var(--brand);
  margin-bottom: 1rem;
}

.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: .75rem; }
.card-head h3 { margin: 0; }

.feature-list { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: .5rem; }
.feature-list li { display: flex; gap: .6rem; align-items: flex-start; font-size: .93rem; color: var(--ink-soft); margin: 0; }
.feature-list svg { flex: none; margin-top: .3rem; color: var(--brand); }

/* Modulseiten: Kopfbereich */
.module-hero { padding: clamp(2.5rem, 2rem + 3vw, 4rem) 0 1.5rem; }
.module-hero .lead { max-width: 46rem; }

.module-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding: 1.25rem 0 0;
  margin-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.module-meta div { min-width: 8rem; }
.module-meta dt { font-size: .8rem; color: var(--ink-muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.module-meta dd { margin: .2rem 0 0; font-size: 1.05rem; font-weight: 700; }

/* --------------------------------------------------------------- Tabelle */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  -webkit-overflow-scrolling: touch;
}

table { width: 100%; border-collapse: collapse; font-size: .95rem; }

th, td { padding: .8rem 1rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }

thead th {
  background: var(--surface-2);
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ink-muted);
  white-space: nowrap;
}

tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--surface-2); }

td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-total { font-weight: 700; background: var(--surface-2); }

.table-note { font-size: .85rem; color: var(--ink-muted); margin-top: .75rem; }

/* --------------------------------------------------------------- Preise */

.price-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }

.price-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
}

.price-card--highlight { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand), var(--shadow-md); }

.price-card h3 { margin-bottom: .35rem; font-size: 1.2rem; }
.price-card .tagline { color: var(--ink-muted); font-size: .875rem; margin-bottom: 1.25rem; }

.price {
  display: flex;
  align-items: baseline;
  gap: .35rem;
  margin-bottom: .35rem;
}

.price .amount { font-size: 2.4rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.price .unit { color: var(--ink-muted); font-size: .95rem; }

.price-sub { font-size: .875rem; color: var(--ink-soft); margin-bottom: 1.25rem; }

.price-steps { list-style: none; padding: 0; margin: auto 0 0; border-top: 1px solid var(--line); padding-top: 1rem; }
.price-steps li { display: flex; justify-content: space-between; gap: 1rem; font-size: .875rem; margin-bottom: .4rem; }
.price-steps li span:last-child { font-weight: 700; white-space: nowrap; }

/* Preisrechner */
.calc {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 1rem + 1.5vw, 2rem);
  box-shadow: var(--shadow-md);
}

.calc-controls { display: grid; gap: 1.25rem; margin-bottom: 1.75rem; }

@media (min-width: 48rem) {
  .calc-controls { grid-template-columns: 1fr auto; align-items: end; }
}

.calc-members output {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.calc-members .hint { color: var(--ink-muted); font-size: .85rem; }

input[type='range'] {
  width: 100%;
  margin: .75rem 0 0;
  accent-color: var(--brand);
  height: 1.75rem;
}

.calc-modules { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); }

.calc-toggle {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  padding: .85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease;
}

.calc-toggle:hover { border-color: var(--brand); }
.calc-toggle:has(input:checked) { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, transparent); }
.calc-toggle input { margin: .25rem 0 0; accent-color: var(--brand); width: 1.1rem; height: 1.1rem; flex: none; }
.calc-toggle strong { display: block; font-size: .95rem; }
.calc-toggle small { color: var(--ink-muted); font-size: .8rem; font-variant-numeric: tabular-nums; }

/* synvitusPlan im Rechner: immer angehakt und nicht abwählbar (Pflichtmodul) -
   eigener Cursor statt Checkbox-Zeigefinger signalisiert, dass hier nichts zu
   klicken ist. */
.calc-toggle--required { cursor: default; }
.calc-toggle--required input { cursor: default; }
.calc-required-badge { font-size: .7rem; padding: .15rem .5rem; margin-left: .35rem; vertical-align: middle; }

.calc-result {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 2px solid var(--line);
}

.calc-result .total { font-size: clamp(2.2rem, 1.8rem + 2vw, 3rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.calc-result .total-label { color: var(--ink-muted); font-size: .9rem; }
.calc-result .yearly { color: var(--ink-soft); font-size: .95rem; }

/* -------------------------------------------------------------- Timeline */

.timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; }

.timeline li {
  position: relative;
  padding: 0 0 2rem 2.25rem;
  margin: 0;
  border-left: 2px solid var(--line);
}

.timeline li:last-child { padding-bottom: 0; border-left-color: transparent; }

.timeline li::before {
  content: '';
  position: absolute;
  left: -.55rem;
  top: .3rem;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--line-strong);
}

.timeline li[data-state='done']::before { background: var(--brand); border-color: var(--brand); }
.timeline li[data-state='current']::before { background: var(--surface); border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 20%, transparent); }

.timeline h3 { font-size: 1.1rem; margin-bottom: .25rem; }
.timeline p { color: var(--ink-soft); font-size: .95rem; margin: 0; }

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

.form { display: grid; gap: 1.25rem; }

.field label,
.form-label {
  display: block;
  font-weight: 600;
  font-size: .95rem;
  margin-bottom: .4rem;
}

.field .hint { display: block; font-weight: 400; font-size: .85rem; color: var(--ink-muted); margin-top: .3rem; }

input[type='text'],
input[type='email'],
input[type='number'],
input[type='password'],
input[type='search'],
input[type='url'],
select,
textarea {
  width: 100%;
  padding: .75rem .9rem;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  /* 16px verhindert den Auto-Zoom in iOS Safari beim Fokus. */
  font-size: 1rem;
  transition: border-color .15s ease, box-shadow .15s ease;
  min-height: 44px;
}

textarea { min-height: 8rem; resize: vertical; line-height: 1.6; }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent);
}

input[aria-invalid='true'], textarea[aria-invalid='true'] { border-color: #dc2626; }

select {
  appearance: none;
  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='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .9rem center;
  padding-right: 2.5rem;
}

.checkbox {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  font-size: .95rem;
  cursor: pointer;
}

.checkbox input { width: 1.15rem; height: 1.15rem; margin: .22rem 0 0; flex: none; accent-color: var(--brand); }
.checkbox span { color: var(--ink-soft); }
.checkbox a { font-weight: 600; }

.checkbox-grid { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); }

.field-error { color: #dc2626; font-size: .875rem; margin-top: .35rem; font-weight: 600; }

/* Honeypot: für Menschen unsichtbar, für viele Bots ein Pflichtfeld. */
.hp-field {
  position: absolute !important;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.form-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 1rem + 1.5vw, 2.25rem);
  box-shadow: var(--shadow-md);
}

/* Formular + Randspalte: erst ab Tablet nebeneinander, darunter gestapelt.
   minmax(0, …) statt 1fr, damit lange Wörter die Spalte nicht aufblähen. */
.form-layout { display: grid; gap: 2rem; align-items: start; }

@media (min-width: 56rem) {
  .form-layout { grid-template-columns: minmax(0, 1.35fr) minmax(0, .65fr); }
}

fieldset { border: 0; padding: 0; margin: 0; }
legend { font-weight: 600; font-size: .95rem; padding: 0; margin-bottom: .5rem; }

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

.alert {
  border: 1px solid;
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  font-size: .95rem;
  display: flex;
  gap: .75rem;
  align-items: flex-start;
}

.alert svg { flex: none; margin-top: .15rem; }
.alert p { margin-bottom: .5rem; }
.alert > div > :last-child { margin-bottom: 0; }

.alert--info { background: var(--surface-2); border-color: var(--line-strong); color: var(--ink-soft); }
.alert--success { background: var(--success-bg); border-color: var(--success-line); color: var(--success-ink); }
.alert--error { background: var(--error-bg); border-color: var(--error-line); color: var(--error-ink); }
.alert--warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-ink); }

/* Entwicklungshinweis über der Seite */
.dev-banner {
  background: var(--gray-900);
  color: var(--gray-50);
  font-size: .875rem;
  text-align: center;
  padding: .55rem 1rem;
  line-height: 1.4;
}

.dev-banner a { color: var(--brand-light); font-weight: 700; }
.dev-banner strong { color: #fff; }

/* ------------------------------------------------------------------- CTA */

.cta {
  background: var(--gray-900);
  color: var(--gray-50);
  border-radius: var(--radius-lg);
  padding: clamp(2rem, 1.5rem + 3vw, 3.5rem);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta::before {
  content: '';
  position: absolute;
  inset: auto -20% -60% -20%;
  height: 100%;
  background: radial-gradient(50% 60% at 50% 50%, color-mix(in srgb, var(--brand) 35%, transparent), transparent 70%);
}

.cta > * { position: relative; }
.cta h2 { color: #fff; }
.cta p { color: var(--gray-300); max-width: 38rem; margin-inline: auto; }
.cta .btn-row { justify-content: center; margin-top: 1.75rem; }
.cta .btn--secondary { background: transparent; border-color: var(--gray-600); color: var(--gray-100); }
.cta .btn--secondary:hover { background: var(--gray-800); border-color: var(--gray-500); color: #fff; }

/* -------------------------------------------------------------- FAQ/Prosa */

.faq { display: grid; gap: .75rem; }

.faq details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 1.25rem;
}

.faq summary {
  cursor: pointer;
  font-weight: 700;
  padding: 1.1rem 0;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  min-height: 44px;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: '';
  width: .6rem; height: .6rem;
  border-right: 2px solid var(--brand);
  border-bottom: 2px solid var(--brand);
  transform: rotate(45deg);
  transition: transform .2s ease;
  flex: none;
  margin-right: .2rem;
}

.faq details[open] summary::after { transform: rotate(-135deg); }
.faq details > div { padding-bottom: 1.25rem; color: var(--ink-soft); }
.faq details > div > :last-child { margin-bottom: 0; }

/* Rechtstexte. Lange E-Mail-Adressen, URLs und Komposita wie
   „Auftragsverarbeitungsvertrag“ müssen umbrechen dürfen, sonst schieben sie
   das Layout auf schmalen Displays seitlich heraus. */
.prose { max-width: 48rem; overflow-wrap: break-word; }
.prose code { overflow-wrap: anywhere; }
.prose h2 { font-size: 1.4rem; margin-top: 2.5rem; }
.prose h3 { font-size: 1.1rem; margin-top: 1.75rem; }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose li { color: var(--ink-soft); }
.prose address { font-style: normal; margin-bottom: 1.1rem; }

/* ------------------------------------------------------------- Fusszeile */

.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 3rem 0 2rem;
  margin-top: auto;
  font-size: .925rem;
}

.footer-grid { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); }
.footer-grid h2 { font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-muted); margin-bottom: .9rem; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: .5rem; }
.footer-grid a { color: var(--ink-soft); text-decoration: none; }
.footer-grid a:hover { color: var(--brand); text-decoration: underline; }
.footer-grid p { color: var(--ink-muted); font-size: .875rem; }

.footer-bottom {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1.5rem;
  justify-content: space-between;
  align-items: center;
  color: var(--ink-muted);
  font-size: .85rem;
}

.footer-bottom nav { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.footer-bottom a { color: var(--ink-muted); text-decoration: none; }
.footer-bottom a:hover { color: var(--brand); }

/* E-Mail-Adressen werden erst per JavaScript zu Links (Crawler-Schutz). */
.mailto { color: var(--brand); cursor: pointer; overflow-wrap: anywhere; }
.mailto:hover { color: var(--brand-strong); text-decoration: underline; }

body { display: flex; flex-direction: column; min-height: 100dvh; }
main { flex: 1 0 auto; }

/* ------------------------------------------------------------ Adminbereich */

.admin-body { background: var(--bg); }

.admin-header {
  background: var(--gray-900);
  color: var(--gray-100);
  border-bottom: 1px solid var(--gray-700);
}

.admin-header .container { display: flex; align-items: center; gap: 1rem; min-height: var(--header-h); flex-wrap: wrap; }
.admin-header .logo img { height: 1.6rem; }

.admin-nav { display: flex; flex-wrap: wrap; gap: .25rem; margin-left: auto; align-items: center; }

.admin-nav a, .admin-nav button {
  padding: .5rem .8rem;
  border-radius: 8px;
  color: var(--gray-300);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 600;
  background: none;
  border: 0;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.admin-nav a:hover, .admin-nav button:hover { background: var(--gray-800); color: #fff; }
.admin-nav a[aria-current='page'] { background: var(--brand); color: #fff; }

.admin-main { padding: 2rem 0 4rem; }

.stat-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); margin-bottom: 2rem; }

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
}

.stat .value { font-size: 2rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .label { color: var(--ink-muted); font-size: .85rem; }

.toolbar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: end; margin-bottom: 1.25rem; }
.toolbar .grow { flex: 1 1 14rem; }
.toolbar label { font-size: .85rem; font-weight: 600; display: block; margin-bottom: .3rem; }

.admin-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.5rem; }
.admin-card h2 { font-size: 1.25rem; }
.admin-card > p:first-of-type { color: var(--ink-soft); }

.login-shell { display: grid; place-items: center; min-height: 100dvh; padding: 2rem 1.25rem; }
.login-card { width: 100%; max-width: 24rem; }

.progress {
  height: .6rem;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
  margin: .75rem 0;
}

.progress > div { height: 100%; background: var(--brand); width: 0; transition: width .3s ease; }

.log {
  background: var(--gray-900);
  color: var(--gray-100);
  border-radius: 8px;
  padding: .9rem 1rem;
  font-family: ui-monospace, Consolas, monospace;
  font-size: .8rem;
  max-height: 14rem;
  overflow-y: auto;
  white-space: pre-wrap;
  line-height: 1.5;
}

/* Auf schmalen Displays werden Tabellenzeilen zu Karten – Warteliste und
   Mailings haben sonst zu viele Spalten fürs Handy. */
@media (max-width: 47.99rem) {
  .table--stack thead { display: none; }
  .table--stack tbody tr {
    display: block;
    border: 1px solid var(--line);
    border-radius: 10px;
    margin: .75rem;
    padding: .35rem .25rem;
  }
  .table--stack tbody td {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 0;
    padding: .4rem .75rem;
    text-align: right;
  }
  .table--stack tbody td::before {
    content: attr(data-label);
    font-weight: 700;
    font-size: .8rem;
    color: var(--ink-muted);
    text-align: left;
  }
  .table-wrap:has(.table--stack) { border: 0; background: transparent; }
}

/* --------------------------------------------------------------- Drucken */

@media print {
  .site-header, .site-footer, .dev-banner, .btn, .nav-toggle, .cta { display: none !important; }
  body { background: #fff; color: #000; }
  .card, .form-card { box-shadow: none; border-color: #999; }
  a[href^='http']::after { content: ' (' attr(href) ')'; font-size: .8em; }
}
