/*!
 * softwelop - Dark Mode (handgepflegte Ergänzungen)
 * Die generischen Farb-Overrides stehen in css/dark-auto.css
 * (erzeugt via tools/build-dark-css.py). Alle Farben leiten sich aus der
 * Markenpalette ab: Deep Trust #21264E als Basis, Bright Code #A3C7EB für
 * Links, Signal Orange #F18557 / Soft Spark #F7AE67 als Akzente,
 * #F6E9DF (Creme) als Textfarbe.
 */

html[data-theme="dark"] {
  color-scheme: dark;
  --dk-bg: #11142a;          /* abgedunkeltes Deep Trust */
  --dk-surface: #1a1e3d;     /* Karten, Navigation */
  --dk-surface-2: #21264e;   /* Deep Trust */
  --dk-border: rgba(163, 199, 235, .16);
  --dk-text: #f6e9df;        /* Creme aus der Palette */
  --dk-text-muted: rgba(246, 233, 223, .72);
  --dk-link: #a3c7eb;        /* Bright Code */

  --sw-navy: #f6e9df;        /* Textfarbe in modern.css-Komponenten */
  --sw-ink-soft: rgba(246, 233, 223, .8);
  --sw-surface: var(--dk-surface);
  --sw-surface-2: var(--dk-bg);
  --sw-cream: rgba(247, 174, 103, .16);
  --sw-shadow-s: 0 4px 16px -6px rgba(0, 0, 0, .5);
  --sw-shadow: 0 20px 44px -18px rgba(0, 0, 0, .7);
}

html[data-theme="dark"] body {
  background-color: var(--dk-bg);
  color: var(--dk-text);
}

/* Weiche Überblendung beim Umschalten */
html.sw-theme-anim,
html.sw-theme-anim *,
html.sw-theme-anim *::before,
html.sw-theme-anim *::after {
  transition: background-color .45s ease, color .45s ease, border-color .45s ease, fill .45s ease !important;
}

/* ------------------------------------------------------------------ */
/* Navigation                                                          */
/* ------------------------------------------------------------------ */
html[data-theme="dark"] .navigation { background-color: var(--dk-bg); }
html[data-theme="dark"] .navigation.is-scrolled {
  background-color: rgba(17, 20, 42, .8);
  box-shadow: 0 10px 30px -14px rgba(0, 0, 0, .8);
}
html[data-theme="dark"] .navigation-item,
html[data-theme="dark"] .dropdown-toggle,
html[data-theme="dark"] .text-block-11 { color: var(--dk-text); }
html[data-theme="dark"] .navigation-item.w--current { color: #fff; }
html[data-theme="dark"] .w-dropdown-list { background: var(--dk-surface); }
html[data-theme="dark"] .menu-icon { filter: invert(93%) sepia(9%) saturate(300%) hue-rotate(330deg); }
@media (max-width: 991px) {
  html[data-theme="dark"] .navigation-items,
  html[data-theme="dark"] .w-nav-menu { background-color: var(--dk-bg); }
}
html[data-theme="dark"] .breadcrumb-bar { background: var(--dk-surface); border-color: var(--dk-border); }
html[data-theme="dark"] .breadcrumb-list li,
html[data-theme="dark"] .breadcrumb-list a { color: var(--dk-text-muted); }
html[data-theme="dark"] .breadcrumb-list li[aria-current] { color: var(--dk-text); }

/* ------------------------------------------------------------------ */
/* Typografie & Links                                                  */
/* ------------------------------------------------------------------ */
html[data-theme="dark"] h1, html[data-theme="dark"] h2, html[data-theme="dark"] h3,
html[data-theme="dark"] h4, html[data-theme="dark"] h5, html[data-theme="dark"] h6,
html[data-theme="dark"] p, html[data-theme="dark"] li, html[data-theme="dark"] label,
html[data-theme="dark"] summary, html[data-theme="dark"] td, html[data-theme="dark"] th { color: inherit; }
html[data-theme="dark"] .legal-p a,
html[data-theme="dark"] .sw-faq .sw-faq-body a,
html[data-theme="dark"] .paragraph-light a:not(.primary-button) { color: var(--dk-link); }
html[data-theme="dark"] .links-right { color: var(--dk-text); }

/* Gradient-Headline: auf Dunkel heller Verlauf (Orange -> Creme) */
html[data-theme="dark"] .sw-gradient-text {
  background-image: linear-gradient(100deg, #f18557 0%, #f7ae67 50%, #f6e9df 100%);
}

/* ------------------------------------------------------------------ */
/* Icons: Line-Art-Icons (Deep Trust) hell darstellen                  */
/* ------------------------------------------------------------------ */
html[data-theme="dark"] .cls-1[style*="21264e"],
html[data-theme="dark"] .header-card .cls-1,
html[data-theme="dark"] svg .cls-1 { fill: var(--dk-text); }
html[data-theme="dark"] .service-icon,
html[data-theme="dark"] img[src*="icon-"]:not([src*="icon-google"]) {
  filter: invert(93%) sepia(9%) saturate(300%) hue-rotate(330deg);
}
html[data-theme="dark"] .arrow-embed { color: var(--dk-text); }
html[data-theme="dark"] .code-embed-9 svg path { fill: var(--dk-text); }

/* Deko-Blobs etwas zurücknehmen */
html[data-theme="dark"] .header-budsen { opacity: .35; }

/* ------------------------------------------------------------------ */
/* Karten & Flächen                                                    */
/* ------------------------------------------------------------------ */
html[data-theme="dark"] .header-card,
html[data-theme="dark"] .review-card,
html[data-theme="dark"] .google-review-badge,
html[data-theme="dark"] .sw-step,
html[data-theme="dark"] .sw-faq details,
html[data-theme="dark"] .pricing-card {
  background-color: var(--dk-surface) !important;
  border-color: var(--dk-border) !important;
  color: var(--dk-text);
}
html[data-theme="dark"] .div-block-2, html[data-theme="dark"] .div-block-3,
html[data-theme="dark"] .div-block-4, html[data-theme="dark"] .div-block-5 {
  background: rgba(26, 30, 61, .82);
  border-color: var(--dk-border);
}
html[data-theme="dark"] .average-rating,
html[data-theme="dark"] .review-author-name { color: var(--dk-text) !important; }
html[data-theme="dark"] .total-ratings { color: var(--dk-text-muted) !important; }
html[data-theme="dark"] .sw-section.is-tinted {
  background: linear-gradient(180deg, rgba(33, 38, 78, .55) 0%, rgba(25, 64, 147, .18) 100%);
}
html[data-theme="dark"] .sw-step-num {
  background: linear-gradient(135deg, #21264e, #194093);
  color: #f6e9df;
  box-shadow: 0 0 0 8px var(--dk-bg), 0 14px 30px -12px rgba(0, 0, 0, .8);
}
html[data-theme="dark"] .sw-faq summary::after {
  background-color: var(--dk-surface-2);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f6e9df' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E");
}
html[data-theme="dark"] .sw-chip { color: #f7ae67; }
html[data-theme="dark"] .image-3,
html[data-theme="dark"] .image-4,
html[data-theme="dark"] .image-5 { box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .9); }

/* Formulare */
html[data-theme="dark"] .text-field,
html[data-theme="dark"] .w-input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="email"] {
  background-color: var(--dk-surface);
  color: var(--dk-text);
  border-color: var(--dk-border);
}
html[data-theme="dark"] .text-field::placeholder,
html[data-theme="dark"] textarea::placeholder { color: var(--dk-text-muted); }

/* Buttons */
html[data-theme="dark"] .primary-button { box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .9); }
html[data-theme="dark"] .sw-btn-ghost { border-color: rgba(246, 233, 223, .7); color: var(--dk-text); }
html[data-theme="dark"] .sw-btn-ghost:hover { background: #f6e9df; color: #21264e; }
html[data-theme="dark"] .secondary-button { color: var(--dk-text); border-color: var(--dk-text); background: transparent; }

/* ------------------------------------------------------------------ */
/* Farbige Bänder (Verlaufsbilder) behalten dunkle Schrift (Kontrast)   */
/* ------------------------------------------------------------------ */
html[data-theme="dark"] .section-3,
html[data-theme="dark"] .section-3 h3,
html[data-theme="dark"] .section.cc-cta,
html[data-theme="dark"] .section.cc-cta h2,
html[data-theme="dark"] .section.cc-cta .heading-jumbo-small,
html[data-theme="dark"] .section.cc-cta p,
html[data-theme="dark"] .hero.error-page,
html[data-theme="dark"] .hero.error-page * { color: #21264e; }
html[data-theme="dark"] .section.cc-cta { --sw-navy: #21264e; }
html[data-theme="dark"] .section.cc-cta .sw-btn-ghost {
  border-color: #21264e;
  color: #21264e;
  background: rgba(255, 255, 255, .7);
}
html[data-theme="dark"] .section.cc-cta .sw-btn-ghost:hover { background: #21264e; color: #f6e9df; }
html[data-theme="dark"] .section-3 .primary-button,
html[data-theme="dark"] .section.cc-cta .primary-button { color: #fff; }

/* Footer & Cookie-Dialog */
html[data-theme="dark"] .footer-wrap { background-color: var(--dk-bg); border-top: 1px solid var(--dk-border); }
html[data-theme="dark"] .text-block-5 { color: var(--dk-text); }
html[data-theme="dark"] .cookie-dialog { background: var(--dk-surface); color: var(--dk-text); }
html[data-theme="dark"] .cookie-settings-link { color: var(--dk-text-muted); }

/* ------------------------------------------------------------------ */
/* Umschalter                                                          */
/* ------------------------------------------------------------------ */
.sw-theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin: 0 8px;
  padding: 0;
  border: 1px solid rgba(33, 38, 78, .15);
  border-radius: 50%;
  background: transparent;
  color: #21264e;
  cursor: pointer;
  flex: none;
  transition: background-color .3s ease, border-color .3s ease, transform .5s cubic-bezier(.22, 1, .36, 1);
}
.sw-theme-toggle:hover { background: rgba(241, 133, 87, .12); border-color: #f18557; transform: rotate(-18deg); }
.sw-theme-toggle svg { width: 20px; height: 20px; grid-area: 1 / 1; transition: transform .6s cubic-bezier(.22, 1, .36, 1), opacity .4s ease; }
.sw-theme-toggle .sw-icon-sun { opacity: 0; transform: rotate(-90deg) scale(.4); }
html[data-theme="dark"] .sw-theme-toggle { color: #f7ae67; border-color: rgba(247, 174, 103, .4); }
html[data-theme="dark"] .sw-theme-toggle .sw-icon-moon { opacity: 0; transform: rotate(90deg) scale(.4); }
html[data-theme="dark"] .sw-theme-toggle .sw-icon-sun { opacity: 1; transform: none; }
@media (max-width: 991px) {
  .menu { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-left: auto; }
  .sw-theme-toggle { width: 38px; height: 38px; margin-right: 4px; }
}

/* ------------------------------------------------------------------ */
/* Footer, Kontakt-Kacheln, Mobile-Menü                                */
/* ------------------------------------------------------------------ */
html[data-theme="dark"] .sw-footer {
  background: linear-gradient(180deg, var(--dk-bg) 0%, var(--dk-surface) 100%);
  border-top-color: var(--dk-border);
}
html[data-theme="dark"] .sw-footer-social a { border-color: var(--dk-border); }
html[data-theme="dark"] .sw-footer-social a:hover { background: #f6e9df; border-color: #f6e9df; color: #21264e; }
html[data-theme="dark"] .sw-footer-ways { border-top-color: var(--dk-border); }
html[data-theme="dark"] .sw-footer-ways li { background: var(--dk-surface-2); border-color: var(--dk-border); }
html[data-theme="dark"] .sw-footer-contact a:hover,
html[data-theme="dark"] .sw-footer-col a:hover { color: var(--dk-link); }

html[data-theme="dark"] .sw-way { background: var(--dk-surface); border-color: var(--dk-border); }
html[data-theme="dark"] .sw-ways-note { background: rgba(163, 199, 235, .1); }
html[data-theme="dark"] .sw-ways-note svg { color: var(--dk-link); }

@media (max-width: 991px) {
  html[data-theme="dark"] .navigation.w-nav .w-nav-menu.navigation-items { background: rgba(17, 20, 42, .97); }
  html[data-theme="dark"] .navigation .w-nav-menu > .navigation-item,
  html[data-theme="dark"] .navigation .w-nav-menu .dropdown-toggle,
  html[data-theme="dark"] .navigation .w-nav-menu .sw-nav-extra { border-color: var(--dk-border); }
  html[data-theme="dark"] .menu-button.w-nav-button { background: rgba(246, 233, 223, .08); }
  html[data-theme="dark"] .menu-button.w-nav-button.w--open { background: var(--sw-orange); color: #21264e; }
  html[data-theme="dark"] .navigation .w-nav-menu > .navigation-item.w--current,
  html[data-theme="dark"] .navigation .w-nav-menu .dropdown:has(a.w--current) .dropdown-toggle,
  html[data-theme="dark"] .navigation .w-nav-menu .dropdown:has(a.w--current) .dropdown-toggle .text-block-11 { color: var(--dk-text) !important; }
}
@media (max-width: 991px) {
  html[data-theme="dark"] .navigation.is-scrolled { background-color: var(--dk-bg); }
}
