/* ============================================
   SonnenWatt Energie – Design System
   ============================================ */

:root {
  /* Colors */
  --color-primary: #0d5c2e;
  --color-primary-dark: #0a4723;
  --color-primary-light: #1a7a3e;
  --color-accent: #e8b923;
  --color-accent-dark: #c9a01e;
  --color-text: #1a1a1a;
  --color-text-muted: #4a4a4a;
  --color-bg: #ffffff;
  --color-bg-alt: #f5f7f6;
  --color-bg-dark: #0d2b1a;
  --color-border: #e0e5e2;
  --color-error: #c53030;
  --color-success: #276749;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Georgia', 'Times New Roman', serif;
  --text-base: 1rem;
  --text-sm: 0.875rem;
  --text-xs: 0.75rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 2rem;
  --text-4xl: 2.5rem;
  --text-5xl: 3rem;
  --line-tight: 1.25;
  --line-normal: 1.5;
  --line-relaxed: 1.65;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Layout */
  --max-width: 1200px;
  --max-width-narrow: 720px;
  --header-height: 72px;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
  --transition: 0.2s ease;
}

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--line-normal);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4, h5, h6 { margin: 0 0 var(--space-4); line-height: var(--line-tight); font-weight: 700; }
h1 { font-size: clamp(var(--text-3xl), 5vw, var(--text-5xl)); }
h2 { font-size: clamp(var(--text-2xl), 4vw, var(--text-4xl)); }
h3 { font-size: var(--text-xl); }
p { margin: 0 0 var(--space-4); }
ul, ol { margin: 0 0 var(--space-4); padding-left: var(--space-6); }

/* Utility row above header */
.util-row {
  background: var(--color-bg-dark);
  color: rgba(255,255,255,0.9);
  font-size: var(--text-sm);
  padding: var(--space-2) var(--space-4);
}
.util-row a { color: inherit; }
.util-row-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
  justify-content: space-between;
  align-items: center;
}
.util-row .phone::before { content: "📞 "; }
.util-row .email::before { content: "✉ "; }

/* Site header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--color-bg);
  box-shadow: var(--shadow-sm);
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
}
.logo {
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--color-primary);
}
.logo span { color: var(--color-accent); }
.nav-primary { display: flex; align-items: center; gap: var(--space-1); flex-wrap: wrap; }
.nav-primary a {
  padding: var(--space-2) var(--space-3);
  color: var(--color-text);
  font-weight: 500;
  border-radius: var(--radius-sm);
}
.nav-primary a:hover { background: var(--color-bg-alt); color: var(--color-primary); text-decoration: none; }
.nav-cta {
  display: inline-flex;
  align-items: center;
  padding: var(--space-3) var(--space-5);
  background: var(--color-primary);
  color: white !important;
  border-radius: var(--radius);
  font-weight: 600;
  white-space: nowrap;
}
.nav-cta:hover { background: var(--color-primary-dark); text-decoration: none !important; }

/* Dropdown / Mega menu */
.nav-item-with-dropdown { position: relative; }
.nav-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 280px;
  background: var(--color-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: var(--space-4);
  margin-top: var(--space-2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
  z-index: 100;
}
.nav-item-with-dropdown:hover .nav-dropdown,
.nav-item-with-dropdown[aria-expanded="true"] .nav-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.nav-dropdown a {
  display: block;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
}
.nav-dropdown a:last-child { border-bottom: none; }

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  padding: var(--space-2);
  cursor: pointer;
  font-size: 1.5rem;
  color: var(--color-text);
  aria-label: "Menü öffnen";
}

/* Hero */
.hero {
  padding: var(--space-12) var(--space-4) var(--space-16);
  background: linear-gradient(135deg, var(--color-bg-alt) 0%, #e8f0ec 100%);
}
.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
  align-items: center;
}
.hero-content h1 { margin-bottom: var(--space-4); }
.hero-content .subheadline {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
  line-height: var(--line-relaxed);
}
.hero-trust { font-size: var(--text-sm); color: var(--color-text-muted); margin-bottom: var(--space-6); }
.hero-buttons { display: flex; flex-wrap: wrap; gap: var(--space-4); }
.hero-image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.hero-image img { width: 100%; object-fit: cover; min-height: 320px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-base);
  font-weight: 600;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
  text-decoration: none;
}
.btn-primary { background: var(--color-primary); color: white; }
.btn-primary:hover { background: var(--color-primary-dark); text-decoration: none; }
.btn-secondary { background: white; color: var(--color-primary); border: 2px solid var(--color-primary); }
.btn-secondary:hover { background: var(--color-bg-alt); text-decoration: none; }
.btn-accent { background: var(--color-accent); color: var(--color-text); }
.btn-accent:hover { background: var(--color-accent-dark); text-decoration: none; }

/* Prominent survey/check CTA – stands out in hero and cta-band */
.btn-cta-survey {
  background: var(--color-accent);
  color: var(--color-text);
  font-weight: 700;
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-lg);
  box-shadow: var(--shadow-lg), 0 0 0 3px rgba(232, 185, 35, 0.4);
  border: none;
}
.btn-cta-survey:hover {
  background: var(--color-accent-dark);
  color: var(--color-text);
  text-decoration: none;
  box-shadow: var(--shadow-lg), 0 0 0 3px rgba(232, 185, 35, 0.6);
  transform: translateY(-2px);
}
@media (prefers-reduced-motion: no-preference) {
  .btn-cta-survey { transition: transform 0.2s ease, box-shadow 0.2s ease; }
}
.cta-band .btn-cta-survey {
  background: var(--color-accent);
  color: var(--color-text);
  margin-left: var(--space-4);
}
.cta-band .btn-cta-survey:hover {
  background: var(--color-accent-dark);
  color: var(--color-text);
}

/* Container & Sections */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 var(--space-4); }
.section { padding: var(--space-16) 0; }
.section-alt { background: var(--color-bg-alt); }
.section-title { text-align: center; margin-bottom: var(--space-12); }
.section-title h2 { margin-bottom: var(--space-4); }
.section-title p { max-width: var(--max-width-narrow); margin-left: auto; margin-right: auto; color: var(--color-text-muted); }

/* Stepper (3 steps) */
.stepper {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-8);
  counter-reset: step;
}
.step {
  position: relative;
  padding: var(--space-8);
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  counter-increment: step;
}
.step::before {
  content: counter(step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--color-primary);
  color: white;
  font-weight: 700;
  font-size: var(--text-xl);
  border-radius: 50%;
  margin-bottom: var(--space-4);
}
.step h3 { margin-bottom: var(--space-2); }
.step p { margin: 0; font-size: var(--text-sm); color: var(--color-text-muted); }

/* Feature grid */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-8);
}
.feature-card {
  padding: var(--space-6);
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.feature-card h3 { margin-bottom: var(--space-2); font-size: var(--text-lg); }
.feature-card p { margin: 0; font-size: var(--text-sm); color: var(--color-text-muted); }

/* Trust stats */
.trust-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-8);
  text-align: center;
  padding: var(--space-8) 0;
}
.trust-stat strong { display: block; font-size: var(--text-3xl); color: var(--color-primary); margin-bottom: var(--space-2); }
.trust-stat span { font-size: var(--text-sm); color: var(--color-text-muted); }

/* Testimonial cards */
.testimonials { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: var(--space-8); }
.testimonial-card {
  padding: var(--space-6);
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border-left: 4px solid var(--color-primary);
}
.testimonial-card blockquote { margin: 0 0 var(--space-4); font-style: italic; color: var(--color-text-muted); }
.testimonial-card cite { font-size: var(--text-sm); font-style: normal; }

/* FAQ accordion */
.faq-list { max-width: var(--max-width-narrow); margin: 0 auto; }
.faq-item { border-bottom: 1px solid var(--color-border); }
.faq-item:first-child { border-top: 1px solid var(--color-border); }
.faq-question {
  width: 100%;
  padding: var(--space-5) var(--space-4);
  background: none;
  border: none;
  font-size: var(--text-lg);
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  color: var(--color-text);
  transition: background var(--transition);
}
.faq-question:hover { background: var(--color-bg-alt); }
.faq-question::after { content: "+"; font-size: 1.5rem; color: var(--color-primary); flex-shrink: 0; }
.faq-item[aria-expanded="true"] .faq-question::after { content: "−"; }
.faq-answer {
  padding: 0 var(--space-4) var(--space-5);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.faq-answer-inner { padding-top: 0; }
.faq-item[aria-expanded="true"] .faq-answer { max-height: 500px; }

/* CTA band */
.cta-band {
  background: var(--color-primary);
  color: white;
  padding: var(--space-16) var(--space-4);
  text-align: center;
}
.cta-band h2 { color: inherit; margin-bottom: var(--space-4); }
.cta-band p { margin-bottom: var(--space-6); opacity: 0.95; }
.cta-band .btn { background: white; color: var(--color-primary); }
.cta-band .btn:hover { background: var(--color-bg-alt); text-decoration: none; }

/* Footer */
.site-footer {
  background: var(--color-bg-dark);
  color: rgba(255,255,255,0.9);
  padding: var(--space-16) var(--space-4) var(--space-8);
}
.footer-inner { max-width: var(--max-width); margin: 0 auto; }
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-12);
  margin-bottom: var(--space-12);
}
.footer-col h4 { color: white; margin-bottom: var(--space-4); font-size: var(--text-base); }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col a { color: rgba(255,255,255,0.85); }
.footer-col a:hover { color: white; text-decoration: none; }
.footer-col li { margin-bottom: var(--space-2); }
.footer-bottom {
  padding-top: var(--space-8);
  border-top: 1px solid rgba(255,255,255,0.2);
  font-size: var(--text-sm);
  opacity: 0.8;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  justify-content: space-between;
}
.footer-bottom a { color: inherit; }

/* Cookie banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--color-bg-dark);
  color: white;
  padding: var(--space-6) var(--space-4);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.2);
  z-index: 9999;
  display: none;
}
.cookie-banner.show { display: block; }
.cookie-banner-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}
.cookie-banner p { margin: 0; font-size: var(--text-sm); flex: 1 1 300px; }
.cookie-banner .btn { background: var(--color-accent); color: var(--color-text); margin-left: var(--space-2); }

/* Forms */
.form-group { margin-bottom: var(--space-5); }
.form-group label { display: block; margin-bottom: var(--space-2); font-weight: 600; }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: var(--text-base);
}
.form-group input:focus,
.form-group textarea:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(13,92,46,0.15); }
.form-group .error { border-color: var(--color-error); }
.form-group .error-msg { font-size: var(--text-sm); color: var(--color-error); margin-top: var(--space-1); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
textarea { min-height: 140px; resize: vertical; }

/* Page-specific: content width */
.page-content .container { max-width: var(--max-width-narrow); }
.page-content .lead { font-size: var(--text-lg); color: var(--color-text-muted); margin-bottom: var(--space-8); }

/* City grid (service area) */
.city-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--space-4); }
.city-card {
  padding: var(--space-4);
  background: var(--color-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.city-card strong { display: block; margin-bottom: var(--space-2); }

/* Legal pages */
.legal-content { padding: var(--space-12) 0; }
.legal-content h2 { margin-top: var(--space-10); }
.legal-content h3 { margin-top: var(--space-8); }
.legal-content ul { margin-bottom: var(--space-4); }

/* Thank-you page */
.danke-hero { text-align: center; padding: var(--space-16) var(--space-4); }
.danke-hero h1 { margin-bottom: var(--space-4); }
.danke-hero .btn { margin-top: var(--space-6); }

/* Ref cards */
.ref-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: var(--space-8); }
.ref-card {
  padding: var(--space-6);
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.ref-card h3 { margin-bottom: var(--space-2); }
.ref-card .meta { font-size: var(--text-sm); color: var(--color-text-muted); margin-bottom: var(--space-4); }

/* Price disclaimer */
.price-disclaimer {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-top: var(--space-6);
  padding: var(--space-4);
  background: var(--color-bg-alt);
  border-radius: var(--radius);
}

/* Skip link (a11y) */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  padding: var(--space-2) var(--space-4);
  background: var(--color-primary);
  color: white;
  z-index: 10001;
  border-radius: var(--radius);
  transition: top 0.2s;
}
.skip-link:focus { top: var(--space-4); }

/* Responsive */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-image { order: -1; max-height: 280px; }
  .hero-buttons { justify-content: center; }
  .stepper { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .util-row { display: none; }
  .menu-toggle { display: block; }
  .nav-primary {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 280px;
    background: var(--color-bg);
    flex-direction: column;
    align-items: stretch;
    padding: var(--space-8);
    box-shadow: -4px 0 20px rgba(0,0,0,0.1);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 1001;
  }
  .nav-primary.open { transform: translateX(0); }
  .nav-primary a { padding: var(--space-4); border-bottom: 1px solid var(--color-border); }
  .nav-dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    margin: 0;
    padding: var(--space-2) 0 var(--space-2) var(--space-4);
    max-height: 0;
    overflow: hidden;
  }
  .nav-item-with-dropdown[aria-expanded="true"] .nav-dropdown { max-height: 400px; }
  .nav-cta { justify-content: center; margin-top: var(--space-4); }
  .overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
  }
  .overlay.show { opacity: 1; visibility: visible; }
}

/* Print */
@media print {
  .util-row, .site-header, .cookie-banner, .cta-band, .btn { display: none !important; }
}
