/* ==========================================================================
   Juri Belyayev Photovoltaik & Solartechnik – Design System
   ========================================================================== */

:root {
  /* Farben: dunkles Anthrazit/Marineblau als Basis,
     Sonnengelb/Orange + Solargrün als Akzente */
  --color-bg: #0f1720;
  --color-bg-alt: #16212e;
  --color-surface: #1c2836;
  --color-surface-light: #24354657;
  --color-border: #2c3b4c;

  --color-text: #eef2f6;
  --color-text-muted: #c7d3de;

  --color-accent: #f5a623;      /* Sonnengelb/Orange */
  --color-accent-dark: #d9890f;
  --color-accent-2: #2fbf71;    /* Solargrün */
  --color-accent-2-dark: #24a05c;

  --color-white: #ffffff;

  --font-base: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;

  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.35);

  --container-width: 1160px;
  --header-height: 76px;
}

/* -------------------------------------------------------------------------
   Reset & Grundlagen
   ------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-base);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

h1, h2, h3, h4 {
  line-height: 1.2;
  margin: 0 0 0.5em;
  font-weight: 700;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; }

.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: 72px 0;
}

.section-alt {
  background: var(--color-bg-alt);
}

.section-header {
  max-width: 640px;
  margin: 0 0 40px;
}

.section-header.center {
  margin-inline: auto;
  text-align: center;
}

.eyebrow {
  display: inline-block;
  color: var(--color-accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  margin-bottom: 12px;
}

.text-muted { color: var(--color-text-muted); }

/* -------------------------------------------------------------------------
   Buttons
   ------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 1rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--color-accent);
  color: #1a1305;
}

.btn-primary:hover {
  background: var(--color-accent-dark);
}

.btn-secondary {
  background: transparent;
  border-color: var(--color-border);
  color: var(--color-text);
}

.btn-secondary:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.btn-block { width: 100%; }

/* -------------------------------------------------------------------------
   Header / Navigation
   ------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  display: flex;
  align-items: center;
  background: rgba(15, 23, 32, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.15;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo span {
  color: var(--color-accent);
}

.logo small {
  font-weight: 400;
  font-size: 0.7rem;
  color: var(--color-text-muted);
  letter-spacing: 0.03em;
}

.logo-badge {
  flex: none;
  display: inline-flex;
  align-items: center;
  height: 60px;
}

.logo-badge img {
  height: 100%;
  width: auto;
  object-fit: contain;
}

.footer-logo-badge {
  height: 56px;
  margin-bottom: 16px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text-muted);
  transition: color 0.15s ease;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--color-white);
}

/* Header-CTA „Kostenlose Beratung" prominenter hervorheben */
.nav-links .btn-primary {
  font-size: 1.08rem;
  font-weight: 700;
  padding: 14px 30px;
  box-shadow: 0 6px 18px rgba(245, 166, 35, 0.35);
}

.nav-links .btn-primary:hover {
  box-shadow: 0 8px 22px rgba(245, 166, 35, 0.45);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }

  .nav-links {
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--color-bg-alt);
    border-bottom: 1px solid var(--color-border);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }

  .nav-links.open {
    max-height: 480px;
  }

  .nav-links a {
    padding: 16px 24px;
    border-top: 1px solid var(--color-border);
  }

  .nav-links .btn {
    margin: 16px 24px;
  }
}

/* -------------------------------------------------------------------------
   Hero
   ------------------------------------------------------------------------- */
.hero {
  position: relative;
  padding: 100px 0 80px;
  background:
    radial-gradient(circle at 15% 20%, rgba(245, 166, 35, 0.12), transparent 45%),
    radial-gradient(circle at 85% 0%, rgba(47, 191, 113, 0.12), transparent 40%),
    linear-gradient(180deg, var(--color-bg) 0%, var(--color-bg-alt) 100%);
  overflow: hidden;
}

.hero-home {
  padding: 140px 0 100px;
  background:
    linear-gradient(180deg, rgba(15, 23, 32, 0.55) 0%, rgba(15, 23, 32, 0.94) 100%),
    linear-gradient(90deg, rgba(15, 23, 32, 0.88) 0%, rgba(15, 23, 32, 0.35) 65%),
    url("../images/projekt-drohne-flachdach.jpg");
  background-size: cover;
  background-position: center;
}

@media (max-width: 900px) {
  .hero-home { padding: 110px 0 72px; }
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: center;
}

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 32px;
}

.map-embed {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg);
}

.map-embed iframe {
  width: 100%;
  display: block;
}

.hero-visual {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(245, 166, 35, 0.25), rgba(47, 191, 113, 0.25)),
    repeating-linear-gradient(135deg, #24354e 0 22px, #1c2b3e 22px 44px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg);
  padding: 24px;
  overflow: hidden;
}

.hero-visual.has-photo {
  padding: 0;
  display: block;
  background: none;
}

.hero-visual.has-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.placeholder-label {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  background: rgba(15, 23, 32, 0.65);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--color-border);
}

/* -------------------------------------------------------------------------
   Stat bar (Kennzahlen)
   ------------------------------------------------------------------------- */
.stat-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  padding: 40px 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

@media (max-width: 760px) {
  .stat-bar { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .stat-bar { grid-template-columns: 1fr; }
}

.stat {
  text-align: center;
}

.stat-value {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  color: var(--color-accent);
}

.stat-label {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-top: 4px;
}

/* -------------------------------------------------------------------------
   Card Grids
   ------------------------------------------------------------------------- */
.grid {
  display: grid;
  gap: 24px;
}

.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

/* Leistungen-Übersicht: Anzahl der Karten ist nicht immer durch 3 teilbar –
   Flexbox statt Grid, damit eine unvollständige letzte Zeile zentriert wird
   statt eine leere Lücke zu lassen. */
#services-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
}

#services-grid .card {
  flex: 1 1 calc(33.333% - 16px);
  max-width: calc(33.333% - 16px);
}

@media (max-width: 900px) {
  #services-grid .card {
    flex-basis: calc(50% - 12px);
    max-width: calc(50% - 12px);
  }
}

@media (max-width: 640px) {
  #services-grid .card {
    flex-basis: 100%;
    max-width: 100%;
  }
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 28px;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

@media (hover: hover) {
  .card:hover {
    transform: translateY(-4px);
  }
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: rgba(245, 166, 35, 0.12);
  color: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.card-icon svg {
  width: 24px;
  height: 24px;
}

/* Vorteile-Grid (Check-Liste) */
.advantage {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 20px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.advantage .check {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(47, 191, 113, 0.15);
  color: var(--color-accent-2);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* -------------------------------------------------------------------------
   Reviews
   ------------------------------------------------------------------------- */
.review-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 28px;
}

.review-stars {
  color: var(--color-accent);
  letter-spacing: 2px;
  margin-bottom: 12px;
}

.review-meta {
  margin-top: 16px;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.reviews-empty {
  text-align: center;
  padding: 48px 24px;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
}

/* -------------------------------------------------------------------------
   Project Gallery (realisierte Projekte)
   ------------------------------------------------------------------------- */
.project-card {
  margin: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  background: var(--color-surface);
}

.project-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.project-card figcaption {
  padding: 12px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  color: var(--color-text);
}

/* -------------------------------------------------------------------------
   Scroll reveal
   ------------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal-visible {
  opacity: 1;
  transform: translateY(0);
}

/* -------------------------------------------------------------------------
   Service Area / Cities
   ------------------------------------------------------------------------- */
.city-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.city-chip {
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  font-size: 0.9rem;
}

/* -------------------------------------------------------------------------
   FAQ Accordion
   ------------------------------------------------------------------------- */
.faq-item {
  border-bottom: 1px solid var(--color-border);
}

.faq-question {
  width: 100%;
  background: none;
  border: none;
  color: var(--color-text);
  text-align: left;
  font-size: 1.05rem;
  font-weight: 600;
  padding: 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
}

.faq-question .icon {
  flex: none;
  transition: transform 0.2s ease;
  color: var(--color-accent);
}

.faq-item.open .faq-question .icon {
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
  color: var(--color-text-muted);
}

.faq-item.open .faq-answer {
  max-height: 320px;
}

.faq-answer-inner {
  padding-bottom: 20px;
}

/* -------------------------------------------------------------------------
   Forms
   ------------------------------------------------------------------------- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-field.full {
  grid-column: 1 / -1;
}

label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

input, select, textarea {
  font-family: inherit;
  font-size: 1rem;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-bg-alt);
  color: var(--color-text);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--color-accent);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

.form-status {
  margin-top: 16px;
  font-size: 0.95rem;
}

.form-status.success { color: var(--color-accent-2); }
.form-status.error { color: #e5484d; }

.form-note {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: 12px;
}

/* -------------------------------------------------------------------------
   Contact info blocks
   ------------------------------------------------------------------------- */
.info-block {
  display: flex;
  gap: 14px;
  margin-bottom: 20px;
}

.info-block .icon {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: rgba(245, 166, 35, 0.12);
  color: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* -------------------------------------------------------------------------
   CTA band
   ------------------------------------------------------------------------- */
.cta-band {
  background: linear-gradient(120deg, rgba(245, 166, 35, 0.14), rgba(47, 191, 113, 0.14));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 56px;
  text-align: center;
}

@media (max-width: 640px) {
  .cta-band { padding: 36px 24px; }
}

/* -------------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------------- */
.site-footer {
  background: var(--color-bg-alt);
  border-top: 1px solid var(--color-border);
  padding: 56px 0 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr; }
}

.footer-grid h4 {
  color: var(--color-text);
  font-size: 0.95rem;
  margin-bottom: 16px;
}

.footer-grid ul li {
  margin-bottom: 10px;
}

.footer-grid a {
  color: var(--color-text-muted);
}

.footer-grid a:hover {
  color: var(--color-accent);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.footer-bottom a:hover {
  color: var(--color-accent);
}

/* -------------------------------------------------------------------------
   Chat widget slot
   ------------------------------------------------------------------------- */
#chatbot-root {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
}

.chat-fab {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-radius: 999px;
  background: var(--color-accent);
  color: #1a1305;
  font-weight: 700;
  box-shadow: var(--shadow-md);
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.chat-fab:hover {
  transform: translateY(-2px);
}

@media (max-width: 480px) {
  .chat-fab span { display: none; }
  .chat-fab { padding: 16px; }
}

.chat-backdrop {
  display: none;
}

.chat-panel {
  position: absolute;
  bottom: 76px;
  right: 0;
  width: 360px;
  max-width: calc(100vw - 48px);
  height: 480px;
  max-height: 70vh;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 201;
}

.chat-panel[hidden],
.chat-backdrop[hidden] {
  display: none !important;
}

.chat-fab {
  position: relative;
  z-index: 201;
}

.chat-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 16px;
  background: var(--color-bg-alt);
  border-bottom: 1px solid var(--color-border);
  font-weight: 600;
  font-size: 0.95rem;
}

.chat-panel-header span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-close {
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: -10px;
}

.chat-close:hover {
  color: var(--color-text);
}

.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.chat-body .form-field label {
  font-size: 0.8rem;
}

.chat-body input,
.chat-body textarea {
  padding: 9px 12px;
  font-size: 0.9rem;
}

.chat-alt-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chat-alt-btn {
  padding: 8px 12px;
  font-size: 0.85rem;
}

@media (max-width: 480px) {
  .chat-panel {
    width: calc(100vw - 32px);
    right: -8px;
  }

  .chat-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 32, 0.6);
    z-index: 199;
  }
}

/* -------------------------------------------------------------------------
   Legal pages
   ------------------------------------------------------------------------- */
.legal-content h2 {
  margin-top: 1.6em;
}

.legal-content ul {
  list-style: disc;
  padding-left: 1.4em;
  margin-bottom: 1em;
}

.todo-banner {
  background: rgba(245, 166, 35, 0.12);
  border: 1px dashed var(--color-accent);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 0.9rem;
  margin-bottom: 24px;
}

/* -------------------------------------------------------------------------
   Utility
   ------------------------------------------------------------------------- */
.mt-0 { margin-top: 0; }
.text-center { text-align: center; }

/* Honeypot-Feld gegen Spam-Bots: für Menschen unsichtbar, nicht fokussierbar */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* -------------------------------------------------------------------------
   Accessibility: Skip-Link, sichtbarer Tastatur-Fokus, Reduced Motion
   ------------------------------------------------------------------------- */
.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 1000;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--color-accent);
  color: #1a1200;
  font-weight: 600;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 12px;
}

/* Sichtbarer Fokusring für Tastaturnutzer (Maus-Klicks bleiben unverändert) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}
