/*
 * Dark mode v1.0
 *
 * Kept separate from main.css so the theme can be tested or removed without
 * touching the existing light-mode design history.
 */

:root {
  /* These two semantic aliases are already used by newer components. */
  --color-text-muted: var(--color-muted);
  --color-accent-dark: var(--color-accent-hv);
}

html {
  color-scheme: light;
}

/* Theme control */

.theme-toggle {
  display: inline-grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.10);
  box-shadow: 0 10px 24px rgba(6, 25, 44, 0.18);
  color: #ffffff;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.theme-toggle:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.46);
  background: rgba(255, 255, 255, 0.17);
  box-shadow: 0 14px 30px rgba(6, 25, 44, 0.24);
}

.theme-toggle:focus-visible {
  outline: 3px solid rgba(251, 123, 33, 0.72);
  outline-offset: 4px;
}

.theme-toggle-icon {
  display: block;
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-toggle-icon--sun {
  display: none;
}

@media (max-width: 720px) {
  .header-actions {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
  }

  .theme-toggle {
    width: 46px;
    height: 46px;
    flex-basis: 46px;
  }
}

/* Anthracite and slate palette */

html[data-theme="dark"] {
  color-scheme: dark;
  --color-surface: #181a1d;
  --color-surface-alt: #202327;
  --color-text: #e5e9ed;
  --color-heading: #f4f6f8;
  --color-muted: #b9c0c8;
  --color-muted-soft: #949da7;
  --color-text-muted: #b9c0c8;
  --color-accent: #fb7b21;
  --color-accent-hv: #ffad73;
  --color-accent-dark: #ff9a55;
  --color-header: #1b1d20;
  --color-border: #3b4148;
  --shadow-soft: 0 18px 48px rgba(0, 0, 0, 0.30);
  --shadow-hover: 0 24px 64px rgba(0, 0, 0, 0.42);
  --shadow-accent: 0 18px 42px rgba(251, 123, 33, 0.24);
}

html[data-theme="dark"] body {
  background-color: #181a1d;
  background-image:
    radial-gradient(ellipse at 9% 8%, rgba(255, 255, 255, 0.035), transparent 30rem),
    radial-gradient(ellipse at 88% 18%, rgba(64, 82, 101, 0.10), transparent 34rem),
    repeating-linear-gradient(166deg, transparent 0 13px, rgba(255, 255, 255, 0.010) 14px, transparent 16px),
    linear-gradient(135deg, #17191c, #1c1f23);
  color: var(--color-text);
}

html[data-theme="dark"] main section,
html[data-theme="dark"] .section-main,
html[data-theme="dark"] .section-additional {
  background-color: #181a1d;
  background-image:
    linear-gradient(118deg, rgba(255, 255, 255, 0.016), transparent 26%, rgba(0, 0, 0, 0.025) 68%, transparent),
    repeating-linear-gradient(168deg, transparent 0 17px, rgba(255, 255, 255, 0.009) 18px, transparent 20px);
}

html[data-theme="dark"] main section.bg-alt,
html[data-theme="dark"] .section-legal,
html[data-theme="dark"] .section-notice {
  background-color: #202327;
  background-image:
    radial-gradient(circle at 88% 12%, rgba(251, 123, 33, 0.035), transparent 24rem),
    repeating-linear-gradient(166deg, transparent 0 18px, rgba(255, 255, 255, 0.010) 19px, transparent 21px);
}

html[data-theme="dark"] .section-contact-choice,
html[data-theme="dark"] .section-related {
  background:
    radial-gradient(circle at 88% 5%, rgba(251, 123, 33, 0.075), transparent 21rem),
    linear-gradient(128deg, rgba(255, 255, 255, 0.020), transparent 30%),
    repeating-linear-gradient(168deg, transparent 0 17px, rgba(255, 255, 255, 0.010) 18px, transparent 20px),
    #1d2024;
}

html[data-theme="dark"] .section-main::before,
html[data-theme="dark"] .section-related::before {
  background: linear-gradient(135deg, rgba(251, 123, 33, 0.12), rgba(116, 134, 151, 0.08));
}

/* Header and navigation */

html[data-theme="dark"] .site-header,
html[data-theme="dark"] .site-header.is-scrolled {
  background:
    linear-gradient(118deg, rgba(255, 255, 255, 0.025), transparent 32%),
    rgba(24, 26, 29, 0.97) !important;
  border-bottom-color: rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.34) !important;
}

html[data-theme="dark"] .nav-panel {
  background: #202327;
  border-color: rgba(255, 255, 255, 0.13);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.42);
}

html[data-theme="dark"] .site-header .header-logo,
html[data-theme="dark"] .site-header.is-scrolled .header-logo {
  background: rgba(247, 248, 249, 0.96) !important;
  border-color: rgba(255, 255, 255, 0.72) !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.30) !important;
}

html[data-theme="dark"] .theme-toggle {
  border-color: rgba(251, 123, 33, 0.42);
  background: rgba(251, 123, 33, 0.11);
  color: #ffb17b;
}

html[data-theme="dark"] .theme-toggle:hover {
  border-color: rgba(251, 123, 33, 0.72);
  background: rgba(251, 123, 33, 0.18);
}

html[data-theme="dark"] .theme-toggle-icon--moon {
  display: none;
}

html[data-theme="dark"] .theme-toggle-icon--sun {
  display: block;
}

/* Hero surfaces: darker slate instead of a second blue theme */

html[data-theme="dark"] .hero,
html[data-theme="dark"] .page-hero,
html[data-theme="dark"] .imprint-hero-section {
  background:
    radial-gradient(circle at 82% 15%, rgba(251, 123, 33, 0.22), transparent 19rem),
    radial-gradient(circle at 10% 8%, rgba(102, 125, 149, 0.11), transparent 23rem),
    repeating-linear-gradient(166deg, transparent 0 16px, rgba(255, 255, 255, 0.013) 17px, transparent 19px),
    linear-gradient(135deg, #141619 0%, #1d2126 52%, #252d35 100%);
}

html[data-theme="dark"] .hero::after,
html[data-theme="dark"] .page-hero::after,
html[data-theme="dark"] .imprint-hero-section::after {
  background-image:
    linear-gradient(116deg, transparent 0 34%, rgba(255, 255, 255, 0.025) 35%, transparent 36% 70%, rgba(255, 255, 255, 0.018) 71%, transparent 72%),
    repeating-linear-gradient(168deg, transparent 0 23px, rgba(255, 255, 255, 0.012) 24px, transparent 26px);
  background-size: 360px 240px, auto;
}

html[data-theme="dark"] .hero-panel,
html[data-theme="dark"] .page-hero .hero-panel,
html[data-theme="dark"] .imprint-hero-section .hero-panel,
html[data-theme="dark"] .hero-panel--detail {
  background:
    radial-gradient(circle at 92% 8%, rgba(251, 123, 33, 0.10), transparent 8rem),
    linear-gradient(145deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.025));
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

html[data-theme="dark"] .hero-floating-card {
  background: rgba(36, 40, 45, 0.94);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 22px 46px rgba(0, 0, 0, 0.34);
  color: var(--color-text);
}

html[data-theme="dark"] .hero-floating-card strong {
  color: var(--color-heading);
}

/* Clean content surfaces */

html[data-theme="dark"] .card,
html[data-theme="dark"] .highlight-card,
html[data-theme="dark"] .contact-card,
html[data-theme="dark"] .info-card,
html[data-theme="dark"] .related-card,
html[data-theme="dark"] .news-teaser-card,
html[data-theme="dark"] .news-overview-section .news-teaser-card,
html[data-theme="dark"] .enquiry-note,
html[data-theme="dark"] .contact-form,
html[data-theme="dark"] .enquiry-panel,
html[data-theme="dark"] .notice-box,
html[data-theme="dark"] details.faq-item,
html[data-theme="dark"] .contact-choice-card,
html[data-theme="dark"] .contact-choice-card--primary,
html[data-theme="dark"] .service-overview-card,
html[data-theme="dark"] .fee-model-card,
html[data-theme="dark"] .faq-topic-card,
html[data-theme="dark"] .client-card,
html[data-theme="dark"] .client-check-card,
html[data-theme="dark"] .legal-modern-card,
html[data-theme="dark"] .privacy-modern-card,
html[data-theme="dark"] .service-detail-grid .info-card,
html[data-theme="dark"] .service-detail-grid .contact-card,
html[data-theme="dark"] .news-hub-card,
html[data-theme="dark"] .process-item,
html[data-theme="dark"] .step-list li,
html[data-theme="dark"] .step-list li:first-child {
  background: linear-gradient(145deg, #272b30 0%, #22262a 72%, rgba(251, 123, 33, 0.035) 100%) !important;
  border-color: #3c4249 !important;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.25) !important;
  color: var(--color-text) !important;
}

html[data-theme="dark"] .contact-choice-card:hover,
html[data-theme="dark"] .contact-choice-card:focus,
html[data-theme="dark"] .service-overview-card:hover,
html[data-theme="dark"] .service-overview-card:focus-within,
html[data-theme="dark"] .fee-model-card:hover,
html[data-theme="dark"] .fee-model-card:focus-within,
html[data-theme="dark"] .faq-topic-card:hover,
html[data-theme="dark"] .faq-topic-card:focus,
html[data-theme="dark"] .client-card:hover,
html[data-theme="dark"] .client-card:focus-within,
html[data-theme="dark"] .service-detail-grid .info-card:hover,
html[data-theme="dark"] .service-detail-grid .info-card:focus-within,
html[data-theme="dark"] .service-detail-grid .contact-card:hover,
html[data-theme="dark"] .service-detail-grid .contact-card:focus-within,
html[data-theme="dark"] .news-hub-card:hover,
html[data-theme="dark"] .news-hub-card:focus-within,
html[data-theme="dark"] .process-item:hover,
html[data-theme="dark"] .step-list li:hover,
html[data-theme="dark"] details.faq-item[open],
html[data-theme="dark"] details.faq-item:hover {
  background: linear-gradient(145deg, #2d3238, #272b30) !important;
  border-color: rgba(251, 123, 33, 0.38) !important;
  box-shadow: 0 22px 52px rgba(0, 0, 0, 0.34) !important;
}

html[data-theme="dark"] .section-related .container::before {
  border-color: rgba(255, 255, 255, 0.10);
  background: rgba(31, 35, 39, 0.82);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .contact-choice-card h3,
html[data-theme="dark"] .contact-choice-card--primary h3,
html[data-theme="dark"] .contact-choice-card--primary p,
html[data-theme="dark"] .contact-choice-card--primary strong {
  color: inherit !important;
}

html[data-theme="dark"] .contact-choice-card h3,
html[data-theme="dark"] .contact-choice-card--primary h3 {
  color: var(--color-heading) !important;
}

html[data-theme="dark"] .contact-choice-card p,
html[data-theme="dark"] .contact-choice-card--primary p,
html[data-theme="dark"] .news-overview-section .news-meta,
html[data-theme="dark"] .news-overview-section .news-teaser-card p:not(.news-meta) {
  color: var(--color-muted) !important;
}

html[data-theme="dark"] .contact-choice-card strong,
html[data-theme="dark"] .contact-choice-card--primary strong {
  color: var(--color-accent-dark) !important;
}

html[data-theme="dark"] .news-teaser-title,
html[data-theme="dark"] .news-teaser-title a,
html[data-theme="dark"] .news-teaser-title a:visited,
html[data-theme="dark"] .news-teaser-card .news-title-link,
html[data-theme="dark"] .news-teaser-card .news-title-link:visited,
html[data-theme="dark"] .news-overview-section .news-teaser-title,
html[data-theme="dark"] .news-overview-section .news-title-link,
html[data-theme="dark"] .news-overview-section .news-title-link:visited,
html[data-theme="dark"] .news-overview-section .news-title-link:hover,
html[data-theme="dark"] .news-overview-section .news-title-link:focus {
  color: var(--color-heading) !important;
}

/* Icons remain clean and legible without turning every card white. */

html[data-theme="dark"] .service-overview-icon,
html[data-theme="dark"] .fee-model-icon,
html[data-theme="dark"] .faq-topic-icon,
html[data-theme="dark"] .startup-type-icon,
html[data-theme="dark"] .news-hub-icon,
html[data-theme="dark"] .icon-label::before,
html[data-theme="dark"] .icon-badge::before {
  background: linear-gradient(180deg, #353a40, #2b3035) !important;
  border-color: rgba(255, 255, 255, 0.10) !important;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28), 0 0 0 6px rgba(255, 255, 255, 0.025) !important;
  color: var(--color-heading) !important;
}

html[data-theme="dark"] .icon-location::before,
html[data-theme="dark"] .icon-whatsapp::before,
html[data-theme="dark"] .footer-contact-row .icon-badge::before,
html[data-theme="dark"] .footer-social-link {
  background-color: #f1f3f5 !important;
  background-image: none;
  border-color: rgba(255, 255, 255, 0.24) !important;
  color: #192f52 !important;
}

html[data-theme="dark"] .icon-location::before {
  background: #f1f3f5 url("/assets/img/maps/google-maps-pin.png") center / 20px 20px no-repeat !important;
}

html[data-theme="dark"] .icon-whatsapp::before {
  background: #f1f3f5 url("/assets/img/social/whatsapp-glyph-green.svg") center / 18px 18px no-repeat !important;
}

html[data-theme="dark"] .footer-contact-row .icon-location::before {
  background-size: 19px 19px !important;
}

/* Forms, buttons and interactive states */

html[data-theme="dark"] .form-field input,
html[data-theme="dark"] .form-field select,
html[data-theme="dark"] .form-field textarea {
  background: #15171a;
  border-color: #454b53;
  color: var(--color-text);
  caret-color: var(--color-accent);
}

html[data-theme="dark"] .form-field input::placeholder,
html[data-theme="dark"] .form-field textarea::placeholder {
  color: #89939e;
  opacity: 1;
}

html[data-theme="dark"] .form-field input:focus,
html[data-theme="dark"] .form-field select:focus,
html[data-theme="dark"] .form-field textarea:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(251, 123, 33, 0.20);
}

html[data-theme="dark"] .btn,
html[data-theme="dark"] .header-contact,
html[data-theme="dark"] .notice-label,
html[data-theme="dark"] .process-number,
html[data-theme="dark"] .step-list li::before,
html[data-theme="dark"] .contact-choice-label,
html[data-theme="dark"] .contact-choice-card--primary .contact-choice-label,
html[data-theme="dark"] .skip-link {
  color: #17202a !important;
}

html[data-theme="dark"] .btn-secondary,
html[data-theme="dark"] .btn-outline-dark,
html[data-theme="dark"] .enquiry-secondary {
  border-color: #8e99a5;
  color: var(--color-heading) !important;
}

html[data-theme="dark"] .btn-secondary:hover,
html[data-theme="dark"] .btn-secondary:focus,
html[data-theme="dark"] .btn-outline-dark:hover,
html[data-theme="dark"] .btn-outline-dark:focus,
html[data-theme="dark"] .enquiry-secondary:hover,
html[data-theme="dark"] .enquiry-secondary:focus {
  border-color: #e7ebef;
  background: #e7ebef;
  color: #181a1d !important;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .btn-fee-info {
  border-color: #69737e;
  background: #272b30;
  color: var(--color-heading);
}

html[data-theme="dark"] .btn-fee-info:hover,
html[data-theme="dark"] .btn-fee-info:focus {
  border-color: var(--color-accent);
  background: #30353b;
  color: var(--color-heading);
}

html[data-theme="dark"] .map-consent {
  background: #202327;
  border-color: var(--color-border);
}

html[data-theme="dark"] .map-consent-content {
  background:
    radial-gradient(circle at 85% 14%, rgba(251, 123, 33, 0.16), transparent 18rem),
    repeating-linear-gradient(166deg, transparent 0 16px, rgba(255, 255, 255, 0.013) 17px, transparent 19px),
    linear-gradient(135deg, #181a1d, #292e34);
}

/* Footer */

html[data-theme="dark"] .site-footer {
  background:
    radial-gradient(circle at 86% 10%, rgba(251, 123, 33, 0.14), transparent 20rem),
    repeating-linear-gradient(166deg, transparent 0 18px, rgba(255, 255, 255, 0.011) 19px, transparent 21px),
    linear-gradient(135deg, #111315 0%, #1a1d20 60%, #14171a 100%);
  border-top-color: rgba(255, 255, 255, 0.12);
}

html[data-theme="dark"] .site-footer::before {
  background-image:
    linear-gradient(118deg, transparent 0 34%, rgba(255, 255, 255, 0.018) 35%, transparent 36% 70%, rgba(255, 255, 255, 0.013) 71%, transparent 72%);
  background-size: 360px 240px;
}

html[data-theme="dark"] .site-footer .footer-brand-card {
  background: #f7f8f9 !important;
  border-color: rgba(255, 255, 255, 0.72) !important;
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.36) !important;
}

@media (max-width: 720px) {
  .theme-toggle:hover {
    transform: none;
  }

  html[data-theme="dark"] .site-header,
  html[data-theme="dark"] .site-header.is-scrolled {
    background: #1b1d20 !important;
    box-shadow: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .theme-toggle {
    transition: none;
  }
}
