:root {
  --accent: #5aa9e6;
  --bg: #ffffff;
  --text: #111111;
  --card: #f5f5f5;
  --highlight: #f7c37a;
  --on-accent: #ffffff;
  --background: #ffffff;
  font-size: 17px;
}

[data-theme="dark"] {
  --accent: #72d0e8;
  --bg: #1e1e2f;
  --text: #f5f5f5;
  --card: #2b2b3d;
  --highlight: #f8d58c;
  --on-accent: #ffffff;
  --background: #121212;
}

body {
  margin: 0;
  font-family: system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* Basis-Header-Layout: gilt für beide Themes gleich (Fix: gleiche Breite/Padding in light & dark) */
header {
  padding: 1rem 2rem;
  color: var(--on-accent);
}

/* Flex-Container für Header-Inhalt */
header .header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

/* PATCH 1: Logo stabilisieren */
.logo {
  width: 180px;
  display: block; /* stabiler im Flex-Layout */
}
.logo img {
  display: block;
  width: 100%;
  height: auto;
}

/* PATCH 2: Theme-Icon reserviert Breite, damit 🌞/🌙 nicht umbricht */
#theme-icon {
  font-size: 1.4rem;
  line-height: 1;
  display: inline-block;
  min-width: 1.4em;
  text-align: center;
}

main {
  padding: 2rem;
}
section {
  margin-bottom: 2rem;
}

footer {
  text-align: center;
  padding: 1rem;
  color: var(--on-accent);
  /* Hintergrund kommt je Theme weiter unten */
}

/* Theme Switch */
.theme-switch {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.theme-switch input {
  display: none;
}
.theme-switch .slider {
  width: 48px;
  height: 24px;
  background: #ccc;
  display: inline-block;
  border-radius: 24px;
  position: relative;
  cursor: pointer;
}
.theme-switch .slider::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  top: 2px;
  left: 2px;
  transition: 0.3s;
}
.theme-switch input:checked + .slider::before {
  transform: translateX(24px);
}
.theme-switch input:checked + .slider {
  background: var(--highlight);
}

/* Navigation Button (Hamburger) */
#nav-toggle {
  font-size: 1.5rem;
  background: none;
  border: none;
  color: var(--on-accent);
  display: none;
}

/* Navigation Links Container */
#main-nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* MENU LINKS STABIL (Fix gegen Springen beim Theme-Wechsel) */
header nav a {
  font-size: 1.05rem;
  margin: 0 0.75rem;
  font-weight: 600;        /* immer gleich -> kein Breitenwechsel zwischen light/dark */
  text-decoration: none;
  white-space: nowrap;     /* verhindert Umbruch von z.B. "Geschäftskunden" */
}

/* Theme-spezifische Link-Farben */
[data-theme="light"] header nav a,
[data-theme="light"] #main-nav a,
[data-theme="light"] header a {
  color: var(--on-accent);
}

[data-theme="dark"] header nav a,
[data-theme="dark"] #main-nav a,
[data-theme="dark"] header a {
  color: #f0f0f0;
}

@media (max-width: 768px) {
  #nav-toggle {
    display: block;
  }

  #main-nav {
    display: none;
    flex-direction: column;
    background: var(--accent);
    padding: 1rem;
    width: 100%;
  }

  #main-nav.open {
    display: flex;
  }

  #main-nav a {
    color: var(--on-accent);
    padding: 0.5rem 0.25rem;
  }

  #main-nav a:hover,
  #main-nav a:focus-visible {
    background: rgba(255, 255, 255, 0.14);
    border-radius: 6px;
  }

  [data-theme="dark"] #main-nav {
    background: #0f0f12;
  }
}

/* Card / Hero / Feature / Trust / CTA */
.card {
  background: var(--card);
  border-radius: 8px;
  padding: 2rem;
  margin: 2rem auto;
  max-width: 800px;
  text-align: left;
  font-size: 1.25rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  border: 1px solid #e0e0e0;
}
.card h2,
.card h1 {
  text-align: center;
  margin-top: 0;
}
.card h2 {
  margin-bottom: 1rem;
}
.card h1 {
  margin-bottom: 1.5rem;
  font-size: 2rem;
  color: var(--highlight);
  letter-spacing: 0.5px;
}

.hero {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  padding: 3rem 2rem;
  margin: 2rem auto;
  max-width: 1100px;
  text-align: center;
  background: linear-gradient(135deg, rgba(247, 195, 122, 0.08), rgba(90, 169, 230, 0.12));
  border: 1px solid #ddd;
  box-shadow: 0 6px 18px rgba(0,0,0,0.1);
}
.hero h1 {
  margin: 0 0 0.5rem 0;
  font-size: 2rem;
  line-height: 1.2;
}
@media (min-width: 768px) {
  .hero h1 { font-size: 2.4rem; }
}
.hero p.sub {
  margin: 0.25rem 0 1rem 0;
  font-size: 1.125rem;
  opacity: 0.95;
}
.hero .cta-row {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.features {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  max-width: 1200px;
  margin: 2rem auto;
}
.feature {
  flex: 1;
  min-width: 250px;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 1.5rem;
  background: var(--card);
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  box-shadow: none;
}
.feature .emoji,
.feature-icon {
  font-size: 1.6rem;
  display: block;
  margin-bottom: 0.5rem;
  line-height: 1;
  filter: saturate(1.1);
  color: var(--accent);
}
.feature-icon {
  font-size: 2rem;
}

.trust {
  max-width: 1100px;
  margin: 0 auto 2rem;
  padding: 1.5rem;
  background: var(--card);
  border-radius: 12px;
  border: 2px dashed var(--accent);
  text-align: center;
}
.trust p {
  margin: 0.25rem 0;
  font-style: italic;
}

.cta-wide {
  max-width: 1100px;
  margin: 2rem auto;
  padding: 1.5rem;
  border-radius: 14px;
  text-align: center;
  border: 2px solid var(--accent);
  background: linear-gradient(45deg, rgba(90,169,230,0.12), rgba(247,195,122,0.12));
}
.cta-wide h3 {
  margin-top: 0;
}
.cta-row-center {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Headings global */
main > h1 {
  text-align: center;
}
h1 {
  font-size: 2.2rem;
}
h2 {
  font-size: 1.6rem;
}
h3 {
  font-size: 1.3rem;
}

/* Price section */
.price-section {
  width: 100%;
  background: #f8f9fa;
  padding: 2rem 1rem;
  margin: 2rem 0;
}
.price-section h2 {
  text-align: center;
  margin-bottom: 1.5rem;
}
.price-section .price-list {
  max-width: 1200px;
  margin: 0 auto;
}
.price-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1rem;
  max-width: 1200px;
}
@media (min-width: 768px) {
  .price-list {
    grid-template-columns: 1fr 1fr;
  }
}
@media (min-width: 1200px) {
  .price-list {
    grid-template-columns: 1fr 1fr 1fr;
  }
}
.price-item {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 1rem;
  background: var(--card);
}
.price-info strong {
  display: block;
  font-size: 1.05rem;
  margin-bottom: 0.25rem;
}
.price-info p {
  margin: 0;
  font-size: 0.95rem;
  color: #444;
}
.price-tag {
  align-self: flex-end;
  margin-top: 0.5rem;
  text-align: right;
  font-weight: bold;
  color: var(--accent);
}
.price-tag small {
  display: block;
  font-weight: normal;
  font-size: 0.85rem;
  color: #666;
}

/* Dark mode tweaks for content blocks */
[data-theme="dark"] .hero {
  background: linear-gradient(135deg, #2a2a2a, #1a1a1a);
  border: 1px solid #333;
}
[data-theme="dark"] .price-section {
  background: #1e1e1e;
  border-top: 1px solid #333;
  border-bottom: 1px solid #333;
}
[data-theme="dark"] .price-item {
  background: #2a2a2a;
  border: 1px solid #444;
}
[data-theme="dark"] .price-info p {
  color: #ccc;
}
[data-theme="dark"] .price-tag {
  color: #f8d58c;
}

/* Header/Footer Farben je Theme (Fix: gleiche Geometrie, nur Farbe wechselt) */
[data-theme="light"] header {
  background-color: #0d47a1;
  color: var(--on-accent);
  text-align: center;
  /* KEIN padding override -> verhindert Breiten-Schrumpfen */
}

[data-theme="dark"] header {
  background-color: #1e1e1e;
  color: var(--on-accent);
  text-align: center;
  /* auch hier kein anderes padding */
}

/* Footer Farben je Theme */
[data-theme="light"] footer {
  background-color: #0d47a1;
  color: var(--on-accent);
  text-align: center;
  padding: 1rem;
}
[data-theme="dark"] footer {
  background-color: #1e1e1e;
  color: var(--on-accent);
  text-align: center;
  padding: 1rem;
}

/* Footer Links */
footer a {
  font-size: 1rem;
}
[data-theme="dark"] footer a {
  color: #4fc3f7;
  font-weight: 500;
}
footer nav a {
  margin: 0 0.5rem;
  color: inherit;
}

/* About hero */
.about-hero {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  text-align: left;
}
.about-hero .hero-content {
  flex: 2;
  min-width: 250px;
}
.about-hero .hero-image img {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent);
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* Smooth theme transition / theming vars */
html,
[data-theme="dark"],
[data-theme="light"] {
  transition: background-color 0.4s ease, color 0.4s ease;
}

[data-theme="light"] {
  --background: #ffffff;
  --text: #000000;
  --card: #f5f5f5;
  --accent: #5aa9e6;
}

[data-theme="dark"] {
  --background: #121212;
  --text: #e0e0e0;
  --card: #1e1e1e;
  --accent: #72d0e8;
}

/* Grundlegende Flächen nehmen Theme-Hintergrund */
body,
header,
footer,
.card {
  background-color: var(--background);
  color: var(--text);
  transition: background-color 0.4s ease, color 0.4s ease;
}

a {
  color: var(--accent);
  transition: color 0.4s ease;
}

/* Dark gradients for body/cards (Desktop / allgemein) */
[data-theme="dark"] body {
  background: linear-gradient(to bottom left, #0d1b2a, #1b0d1a);
}
[data-theme="dark"] .card {
  background: linear-gradient(to bottom right, #1a1a1a, #0f1a14);
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.6);
}

/* Utility */
.hidden {
  display: none !important;
}

/* News headings */
.news-page .hero h1,
.news-page .hero h2 {
  text-align: center;
}
.news-page .hero div,
.news-page .hero p {
  text-align: left;
}

/* Contact form fields */
form input,
form select,
form textarea {
  font-size: 1.1rem;
  padding: 0.9rem;
  border-radius: 8px;
  width: 100%;
  box-sizing: border-box;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--accent);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
form input:focus,
form select:focus,
form textarea:focus {
  border-color: var(--highlight);
  box-shadow: 0 0 8px var(--highlight);
  outline: none;
}
input[type="checkbox"] {
  width: 18px;
  height: 18px;
  transform: scale(1.5);
  accent-color: #0078d7;
}

/* Global buttons / CTAs */
button,
input[type="submit"],
.cta-button,
.cta-submit {
  display: inline-block;
  margin: 1.2rem auto;
  text-align: center;
  padding: 0.9rem 2rem;
  border: none;
  border-radius: 50px;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  color: var(--on-accent);
  background: var(--accent);
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  transition:
    box-shadow 0.2s ease,
    filter 0.2s ease;
}

button:hover,
input[type="submit"]:hover,
.cta-button:hover,
.cta-submit:hover,
button:focus-visible,
.cta-button:focus-visible {
  box-shadow: 0 3px 10px rgba(0,0,0,0.4);
  filter: brightness(1.04);
  outline: none;
  transform: none;
}

button:focus-visible,
.cta-button:focus-visible {
  outline: 2px solid var(--highlight);
  outline-offset: 3px;
}

/* Contact actions group (mehrere Buttons nebeneinander) */
.contact-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}
.contact-actions .cta-button {
  display: inline-block;
  margin: 0;
}
@media (max-width: 600px) {
  .contact-actions {
    flex-direction: column;
    align-items: center;
  }
  .contact-actions .cta-button {
    margin-bottom: 1rem;
  }
}

/* Darkmode Buttons */
[data-theme="dark"] button,
[data-theme="dark"] input[type="submit"],
[data-theme="dark"] .cta-button,
[data-theme="dark"] .cta-submit {
  background: #275f8f;
  color: var(--on-accent);
  box-shadow: 0 2px 8px rgba(0,0,0,0.7);
}

[data-theme="dark"] button:hover,
[data-theme="dark"] input[type="submit"]:hover,
[data-theme="dark"] .cta-button:hover,
[data-theme="dark"] .cta-submit:hover {
  filter: brightness(1.04);
  box-shadow: 0 3px 12px rgba(0,0,0,0.8);
  transform: none;
}

/* Kontaktformular: Button mittig */
#contact-form {
  text-align: center;
}
#contact-form button,
#contact-form input[type="submit"] {
  display: inline-block;
  margin: 1.2rem auto;
  text-align: center;
}

/* Privat/Geschäftlich Cards: Button mittig */
#privat,
#geschaeftlich {
  text-align: center;
}
#privat .cta-button,
#geschaeftlich .cta-button {
  display: inline-block;
  margin: 1rem auto;
  text-align: center;
}

/* === MOBILE DARK OPTIMIERUNG FÜR PERFORMANCE === */
@media (max-width: 768px) {

  #main-nav {
    min-height: 0;
    will-change: auto;
    background: var(--accent);
  }
  [data-theme="dark"] #main-nav {
    background: #1a1a1a;
  }

  /* Body: kein teurer Verlauf in Dark Mode auf schwachem Handy */
  [data-theme="dark"] body {
    background: #0f0f12;
  }

  /* Cards: kein schwerer Verlauf */
  [data-theme="dark"] .card {
    background: #1a1a1a;
    box-shadow: 0 0 8px rgba(0,0,0,0.7);
  }

  /* Buttons: weniger Glow, keine Lift-Animation */
  [data-theme="dark"] button,
  [data-theme="dark"] input[type="submit"],
  [data-theme="dark"] .cta-button,
  [data-theme="dark"] .cta-submit {
    background: #275f8f;
    box-shadow: 0 2px 8px rgba(0,0,0,0.7);
    transform: none;
    filter: none;
  }
}

/* === PATCH: Lightmode Button-Kontrast-Fix (Lighthouse Kontrastprüfung) === */
[data-theme="light"] button,
[data-theme="light"] input[type="submit"],
[data-theme="light"] .cta-button,
[data-theme="light"] .cta-submit,
html[data-theme="light"] button,
html[data-theme="light"] input[type="submit"],
html[data-theme="light"] .cta-button,
html[data-theme="light"] .cta-submit {
  background: #275f8f;   /* dunkleres Blau für mehr Kontrast */
  color: #ffffff;        /* hoher Kontrast */
}

/* === Kontrast-Fixes Kontaktseite === */

/* 1. H1 in Cards (z. B. "Kontakt") besser lesbar */
.card h1 {
  color: #000000; /* starker Kontrast im Light Mode */
}
[data-theme="dark"] .card h1 {
  color: #ffffff; /* klar lesbar im Dark Mode */
}

/* 2. Link "Datenschutzerklärung" in der Checkbox-Zeile lesbarer machen */
[data-theme="light"] .card .checkbox-label a {
  color: #0d47a1;          /* dunkles, seriöses Blau (passt zu deinem Header) */
  font-weight: 600;
  text-decoration: underline;
}

[data-theme="dark"] .card .checkbox-label a {
  color: #72d0e8;          /* deine Akzentfarbe im Dark-Theme */
  font-weight: 600;
  text-decoration: underline;
}

a.cta-kontakt { display:block; width:max-content; margin:1rem auto 0; }
