/* ============================================
   OptiHeiz – Design-Tokens
   ============================================ */
:root {
  --ink: #15171c;
  --ink-soft: #3c3f47;
  --paper: #f2f3f5;
  --paper-deep: #e6e8eb;
  --white: #ffffff;
  --slate: #6b7280;
  --border: #e2e4e8;

  /* Marke: von optiheiz.de übernommen (Logo-Farben) */
  --flame: #f29400;
  --flame-dark: #c97900;
  --flame-tint: #fdecd1;
  --navy: #216c86;

  /* Ampel-Status (Anlagenzustand) */
  --state-ok: #2e9e4f;
  --state-warn: #e0a91f;
  --state-error: #d43b2f;

  --font-display: system-ui, -apple-system, "Segoe UI", Verdana, Arial, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Verdana, Arial, sans-serif;

  --radius-s: 4px;
  --radius-m: 8px;
  --radius-l: 16px;

  --maxw: 1400px;
}

/* ============================================
   Reset & Base
   ============================================ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--white);
  line-height: 1.6;
}

h1, h2, h3, h4, h5 { font-family: var(--font-display); line-height: 1.2; margin: 0 0 0.5em; }
p { margin: 0 0 1em; }
a { color: var(--flame-dark); }
img { max-width: 100%; display: block; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: var(--white);
  padding: 10px 16px; z-index: 1000;
}
.skip-link:focus { left: 12px; top: 12px; }

:focus-visible { outline: 2px solid var(--flame); outline-offset: 2px; }

/* ============================================
   Header / Navigation
   ============================================ */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--white);
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; padding: 16px 24px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 1.15rem; }
.brand__logo { height: 44px; width: auto; }

.nav ul { list-style: none; display: flex; gap: 28px; margin: 0; padding: 0; }
.nav a { text-decoration: none; color: var(--ink-soft); font-weight: 500; }
.nav a:hover { color: var(--flame-dark); }
.nav .submenu { position: relative; }
.nav .submenu > ul {
  display: none; position: absolute; top: 100%; left: 0;
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-s);
  padding: 8px 0; min-width: 180px; flex-direction: column; gap: 0;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}
.nav .submenu:hover > ul, .nav .submenu:focus-within > ul { display: flex; }
.nav .submenu > ul a { display: block; padding: 8px 16px; }

.nav-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 40px; height: 40px; background: none; border: none; cursor: pointer;
}
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--ink); }

@media (max-width: 860px) {
  .nav { position: fixed; inset: 0 0 0 30%; background: var(--white); transform: translateX(100%); transition: transform 0.25s ease; padding: 88px 24px 24px; }
  .nav.is-open { transform: translateX(0); box-shadow: -8px 0 24px rgba(0,0,0,0.1); }
  .nav ul { flex-direction: column; gap: 4px; }
  .nav .submenu > ul { display: flex; position: static; border: none; box-shadow: none; padding-left: 12px; }
  .nav-toggle { display: flex; }
  body.nav-open { overflow: hidden; }
}

/* ============================================
   Page hero (Rechtstexte etc.)
   ============================================ */
.page-hero { background: var(--paper); padding: 56px 0 40px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; color: var(--flame-dark); font-weight: 700; margin: 0 0 12px; }
.eyebrow__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--flame); }
.page-hero__title { font-size: 2.2rem; margin: 0; }
.page-hero__lead { max-width: 60ch; color: var(--slate); margin-top: 12px; }

/* ============================================
   Content
   ============================================ */
.section { padding: 48px 0; }
.prose { max-width: 74ch; }
.prose h2 { margin-top: 2em; font-size: 1.3rem; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 1.05rem; }
.prose ul { padding-left: 1.2em; }

/* ============================================
   Footer
   ============================================ */
.site-footer { background: var(--navy); color: var(--paper); padding: 40px 0 16px; margin-top: 48px; }
.site-footer__inner { display: flex; flex-wrap: wrap; gap: 32px; justify-content: space-between; align-items: flex-start; }
.brand--footer { color: var(--white); }
.brand__logo--footer { filter: brightness(0) invert(1); }
.footer-nav { display: flex; flex-wrap: wrap; gap: 16px 24px; }
.footer-nav a, .footer-legal a { color: var(--paper); text-decoration: none; opacity: 0.85; }
.footer-nav a:hover, .footer-legal a:hover { opacity: 1; }
.footer-legal { display: flex; gap: 16px; }
.site-footer__copy { text-align: center; margin-top: 32px; opacity: 0.6; font-size: 0.85rem; }

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 24px; border-radius: var(--radius-s); border: 1px solid transparent;
  font-weight: 600; text-decoration: none; cursor: pointer; font-size: 1rem;
}
.btn--primary { background: var(--flame); color: var(--white); }
.btn--primary:hover { background: var(--flame-dark); }

/* ============================================
   Login-Box
   ============================================ */
.login-box {
  max-width: 420px; padding: 32px; border: 1px solid var(--border);
  border-radius: var(--radius-m); background: var(--paper);
}
.login-box h2 { margin-top: 0; }
.login-box p.lead { color: var(--slate); font-size: 0.9rem; margin-top: -4px; }
.login-form .field { margin-bottom: 16px; display: flex; flex-direction: column; gap: 6px; }
.login-form .field--checkbox { flex-direction: row; align-items: center; gap: 8px; }
.login-form label { font-weight: 600; font-size: 0.9rem; }
.login-form .hint { font-weight: 400; color: var(--slate); font-size: 0.85rem; }
.login-form input[type="text"],
.login-form input[type="email"],
.login-form input[type="tel"],
.login-form input[type="password"] {
  padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-s);
  font-size: 1rem; font-family: var(--font-body);
}
.login-form input:focus-visible { outline: 2px solid var(--flame); outline-offset: 1px; }
.login-form .btn { width: 100%; margin-top: 8px; }
.login-links { display: flex; flex-direction: column; gap: 6px; margin-top: 16px; font-size: 0.9rem; }

/* Honeypot: für Menschen unsichtbar, Bots füllen es trotzdem aus */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-message {
  padding: 12px 16px; border-radius: var(--radius-s); margin-bottom: 20px; font-size: 0.9rem;
}
.form-message--error { background: #fbeae7; color: var(--state-error); border: 1px solid var(--state-error); }
.form-message--info { background: var(--flame-tint); color: var(--flame-dark); border: 1px solid var(--flame); }
.form-message--success { background: #e6f6ea; color: var(--state-ok); border: 1px solid var(--state-ok); }
.form-message[hidden] { display: none; }

.back-to-top {
  position: fixed; right: 20px; bottom: 20px; width: 44px; height: 44px;
  border-radius: 50%; background: var(--ink); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  text-decoration: none; box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.back-to-top svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; }
