/* =========================================================
   PENDA KLG – Stylesheet
   Farben, Abstände und Schriften zentral als Variablen.
   ========================================================= */

:root {
  /* Gold aus dem Logo + abgeleitete Töne */
  --gold: #E2BF80;
  --gold-strong: #C9A15A;
  --gold-text: #86662C;      /* Gold für Text: genug Kontrast auf Weiss */
  --gold-soft: #F4EAD6;
  --gold-tint: #FBF7EF;

  /* Neutrale Töne */
  --ink: #171A20;
  --ink-2: #393C41;
  --muted: #5C5E62;
  --line: #E8E4DB;
  --bg: #FFFFFF;
  --bg-alt: #F8F6F2;

  --radius: 8px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(23,26,32,.04), 0 12px 32px rgba(23,26,32,.06);
  --maxw: 1200px;
  --header-h: 72px;

  --font: "Segoe UI Variable Display", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.2,.7,.2,1);
}

/* ---------- Basis ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { line-height: 1.12; letter-spacing: -0.02em; margin: 0 0 .5em; font-weight: 600; }
h1 { font-size: clamp(2rem, 4vw, 3.2rem); letter-spacing: -0.025em; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); letter-spacing: -0.02em; }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
ul { padding-left: 1.2em; }
:focus-visible { outline: 2px solid var(--gold-strong); outline-offset: 3px; border-radius: 4px; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 820px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 100; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: .8rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--gold-text); margin-bottom: 18px;
}
.lead { font-size: clamp(1.08rem, 1.6vw, 1.3rem); color: var(--muted); max-width: 640px; }
.muted { color: var(--muted); }
.gold { color: var(--gold-text); }
.center { text-align: center; }
.center .lead { margin-left: auto; margin-right: auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 22px;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  font: inherit; font-size: .95rem; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: background .2s, border-color .2s;
}
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #2a2e36; }
.btn-light { background: #fff; color: var(--ink); border-color: #CFCBC2; }
.btn-light:hover { border-color: var(--ink); }
.btn-sm { min-height: 38px; padding: 0 16px; font-size: .9rem; }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: rgba(255,255,255,.82);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, box-shadow .3s;
}
.site-header.scrolled { border-bottom-color: var(--line); }
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }

.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand img { width: 30px; height: auto; }
.brand-name { font-size: 1.05rem; font-weight: 600; letter-spacing: .42em; margin-right: -.42em; }

.nav { display: flex; align-items: center; gap: 6px; }
.nav a:not(.btn) {
  text-decoration: none; font-size: .95rem; font-weight: 500; color: var(--ink-2);
  padding: 8px 14px; border-radius: 8px; transition: background .2s;
}
.nav a:not(.btn):hover { background: var(--bg-alt); }
.nav a[aria-current="page"] { color: var(--gold-text); }
.nav .btn { margin-left: 10px; }

.nav-toggle { display: none; background: none; border: 0; width: 44px; height: 44px; cursor: pointer; position: relative; }
.nav-toggle span { position: absolute; left: 11px; width: 22px; height: 2px; background: var(--ink); transition: transform .3s var(--ease), top .3s var(--ease); }
.nav-toggle span:first-child { top: 17px; }
.nav-toggle span:last-child { top: 25px; }
.nav-open .nav-toggle span:first-child { top: 21px; transform: rotate(45deg); }
.nav-open .nav-toggle span:last-child { top: 21px; transform: rotate(-45deg); }

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav {
    position: fixed; inset: var(--header-h) 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 4px;
    padding: 16px 24px 28px; background: #fff; border-bottom: 1px solid var(--line);
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity .25s, transform .25s var(--ease), visibility .25s;
  }
  .nav-open .nav { transform: none; opacity: 1; visibility: visible; }
  .nav a:not(.btn) { padding: 14px 8px; font-size: 1.1rem; border-bottom: 1px solid var(--line); border-radius: 0; }
  .nav .btn { margin: 16px 0 0; }
}

/* ---------- Hero ---------- */
.hero { padding: clamp(56px, 8vw, 96px) 0; background: var(--bg-alt); border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: clamp(32px, 6vw, 80px); align-items: center; }
.hero h1 { max-width: 20ch; }
.hero .lead { margin-bottom: 32px; }

/* Eckdaten: Preis und Bearbeitungszeit */
.keyfacts { margin: 0; background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--gold); border-radius: var(--radius); }
.keyfacts div { padding: 24px 28px; }
.keyfacts div + div { border-top: 1px solid var(--line); }
.keyfacts dt { font-size: .78rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-text); }
.keyfacts dd { margin: 6px 0 0; font-size: 2rem; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }
.keyfacts small { display: block; margin-top: 6px; font-size: .9rem; font-weight: 400; letter-spacing: 0; line-height: 1.4; color: var(--muted); }

/* Unterseiten-Hero */
.page-hero { padding: clamp(48px, 6vw, 72px) 0; background: var(--bg-alt); border-bottom: 1px solid var(--line); }
.page-hero .lead { margin-bottom: 0; }

/* Hintergrundlinien (Heizkreise) */
.hero, .page-hero { position: relative; overflow: hidden; }
.hero > .container, .page-hero > .container { position: relative; }
.hero-bg {
  position: absolute; top: 50%; left: 50%;
  width: min(1400px, 140vw); transform: translate(-50%, -50%);
  pointer-events: none; opacity: .5;
  -webkit-mask-image: radial-gradient(closest-side, #000 30%, transparent 100%);
          mask-image: radial-gradient(closest-side, #000 30%, transparent 100%);
}
.hero-bg img { width: 100%; }
.page-hero .hero-bg { left: auto; right: -20%; width: 900px; transform: translateY(-50%); opacity: .45; }

/* ---------- Sektionen ---------- */
.section { padding: clamp(56px, 7vw, 96px) 0; }
.section-alt { background: var(--bg-alt); }
.section-dark { background: var(--ink); color: #fff; }
.section-dark .lead, .section-dark .muted { color: #B9BBC0; }
.section-head { margin-bottom: clamp(36px, 5vw, 64px); }
.section-head.center { max-width: 760px; margin-left: auto; margin-right: auto; }

/* Karten */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 32px;
}
.card h3 { margin-top: 20px; }
.card p:last-child { margin-bottom: 0; }
.card .tag {
  display: inline-block; font-size: .75rem; font-weight: 600; letter-spacing: .06em;
  padding: 4px 10px; border-radius: 999px; background: var(--gold-soft); color: var(--gold-text);
}
.card-title { font-size: 1.3rem; margin: 20px 0 20px; }

/* Ablauf */
.steps { counter-reset: step; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.step { position: relative; padding-top: 28px; border-top: 2px solid var(--line); }
.step::before {
  counter-increment: step; content: "0" counter(step);
  display: block; font-size: .9rem; font-weight: 600; color: var(--gold-text); margin-bottom: 14px;
}
.step::after { content: ""; position: absolute; top: -2px; left: 0; width: 48px; height: 2px; background: var(--gold); }
.step h3 { font-size: 1.15rem; }
.step p { color: var(--muted); font-size: .97rem; }

/* Zielgruppen */
.audience { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.audience div { background: #fff; padding: 28px 24px; }
.audience strong { display: block; font-size: 1.05rem; margin-bottom: 4px; }
.audience span { color: var(--muted); font-size: .93rem; }

/* Checkliste */
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.checklist li { position: relative; padding-left: 34px; }
.checklist li::before {
  content: ""; position: absolute; left: 0; top: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--gold-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2386662C' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 13px no-repeat;
}
.checklist.cols-2 { grid-template-columns: 1fr 1fr; gap: 12px 32px; }
.checklist small { display: block; color: var(--muted); font-size: .88rem; }

/* ---------- Preisrechner ---------- */
.calc {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(24px, 3vw, 36px);
}
.calc label { display: block; font-weight: 600; margin-bottom: 10px; }
.calc-input { display: flex; align-items: center; border: 1.5px solid var(--line); border-radius: var(--radius); padding: 0 18px; transition: border-color .2s; }
.calc-input:focus-within { border-color: var(--gold-strong); }
.calc-input input[type="number"], .calc-input input[type="number"]:focus {
  flex: 1; min-width: 0; border: 0; outline: 0; box-shadow: none; background: transparent; padding-left: 0;
  font: inherit; font-size: 1.5rem; font-weight: 600; padding: 10px 0; color: var(--ink);
}
.calc-input span { font-size: 1.2rem; color: var(--muted); font-weight: 500; }
.calc input[type="range"] { width: 100%; margin: 22px 0 6px; accent-color: var(--gold-strong); }
.range-labels { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); }
.calc-result {
  margin-top: 28px; padding: 24px; border-radius: var(--radius);
  background: var(--gold-tint);
}
.calc-result .label { font-size: .85rem; color: var(--gold-text); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.calc-result output { display: block; font-size: clamp(2.4rem, 5vw, 3.2rem); font-weight: 600; letter-spacing: -.03em; line-height: 1.15; margin: 4px 0; }
.calc-result small { color: var(--muted); }
.delivery {
  display: flex; gap: 12px; align-items: flex-start; margin: 20px 0 24px;
  font-size: .95rem; color: var(--ink-2);
}
.delivery svg { flex: none; width: 22px; height: 22px; stroke: var(--gold-text); fill: none; stroke-width: 1.8; margin-top: 2px; }

/* Preis-Tabelle */
.table { width: 100%; border-collapse: collapse; font-size: 1rem; }
.table th, .table td { text-align: left; padding: 16px 0; border-bottom: 1px solid var(--line); }
.table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.table td:last-child, .table th:last-child { text-align: right; }
.table td:last-child { font-weight: 600; }

/* ---------- FAQ ---------- */
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; padding: 24px 48px 24px 0; position: relative;
  font-size: 1.12rem; font-weight: 600;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 6px; top: 50%; width: 14px; height: 14px; margin-top: -10px;
  border-right: 2px solid var(--gold-text); border-bottom: 2px solid var(--gold-text);
  transform: rotate(45deg); transition: transform .3s var(--ease), margin .3s;
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -3px; }
.faq .answer { padding: 0 48px 24px 0; color: var(--ink-2); }
.faq-group { margin-bottom: 56px; }
.faq-group h2 { font-size: 1.5rem; margin-bottom: 16px; }

/* ---------- Formular ---------- */
.order-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 40px; align-items: start; }
.order-aside { position: sticky; top: calc(var(--header-h) + 24px); }
.form-section {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(24px, 4vw, 40px); margin-bottom: 20px;
}
.form-section h2 { font-size: 1.35rem; display: flex; align-items: center; gap: 14px; }
.form-section h2 .num {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--gold-soft); color: var(--gold-text); font-size: .9rem;
}
.form-section > p { color: var(--muted); font-size: .95rem; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; margin-top: 20px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: .9rem; font-weight: 600; }
.field label .opt { font-weight: 400; color: var(--muted); }
.field .hint { font-size: .82rem; color: var(--muted); }
.input-wrap { position: relative; }
.input-wrap .unit { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .9rem; pointer-events: none; }
.input-wrap input { padding-right: 64px; }
input[type="text"], input[type="email"], input[type="tel"], input[type="number"], textarea, select {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink);
  background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 14px; transition: border-color .2s, box-shadow .2s;
}
textarea { min-height: 120px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 0; border-color: var(--gold-strong); box-shadow: 0 0 0 4px rgba(226,191,128,.25); }
input:user-invalid, textarea:user-invalid { border-color: #C2483A; }

.upload {
  position: relative; display: flex; flex-direction: row; align-items: center; gap: 16px;
  border: 1.5px dashed #DCCDAF; border-radius: var(--radius); padding: 16px 18px;
  background: var(--gold-tint); cursor: pointer; transition: border-color .2s, background .2s;
}
.upload:hover, .upload.dragover { border-color: var(--gold-strong); background: var(--gold-soft); }
.upload input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.upload svg { flex: none; width: 26px; height: 26px; stroke: var(--gold-text); fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.upload-text strong { display: block; font-size: .95rem; }
.upload-text span { font-size: .82rem; color: var(--muted); }
.upload.has-file { border-style: solid; background: #fff; }
.upload.has-file .upload-text span { color: var(--gold-text); font-weight: 600; }
.req { color: var(--gold-text); }
.upload-group { display: grid; gap: 12px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-error { margin: 0 0 16px; padding: 14px 16px; border-radius: var(--radius-sm); background: #FBECEA; color: #8E2A1F; font-size: .95rem; }
.btn:disabled { opacity: .7; cursor: progress; }

/* Auswahlfelder (Verlegeform, Ja/Nein) */
fieldset.field { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.field legend { font-size: .9rem; font-weight: 600; padding: 0; margin-bottom: 6px; }
.segmented { display: inline-flex; flex: none; align-self: flex-start; border: 1.5px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: #fff; }
.segmented label { position: relative; cursor: pointer; }
.segmented label + label { border-left: 1.5px solid var(--line); }
.segmented input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.segmented span { display: block; min-width: 64px; padding: 8px 16px; text-align: center; font-size: .93rem; font-weight: 600; color: var(--ink-2); }
.segmented input:checked + span { background: var(--ink); color: #fff; }
.segmented input:focus-visible + span { outline: 2px solid var(--gold-strong); outline-offset: -3px; }
.choice-list { border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
.choice-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 8px 8px 14px; }
.choice-row + .choice-row { border-top: 1px solid var(--line); }

.consent { display: flex; gap: 12px; align-items: flex-start; font-size: .93rem; color: var(--ink-2); margin: 8px 0 24px; }
.consent input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--gold-strong); flex: none; }

.summary { background: var(--ink); color: #fff; border-radius: var(--radius); padding: 32px; }
.summary h3 { font-size: 1rem; text-transform: uppercase; letter-spacing: .1em; color: var(--gold); margin-bottom: 20px; }
.summary dl { margin: 0; display: grid; gap: 14px; }
.summary dl div { display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px solid rgba(255,255,255,.1); padding-bottom: 14px; }
.summary dt { color: #B9BBC0; }
.summary dd { margin: 0; font-weight: 600; text-align: right; }
.summary .total { font-size: 2.2rem; font-weight: 600; letter-spacing: -.03em; color: var(--gold); margin: 20px 0 4px; }
.summary small { color: #B9BBC0; display: block; }
.summary .btn { margin-top: 24px; }

.form-success {
  text-align: center; padding: 64px 32px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
}

/* ---------- Abschluss-Band ---------- */
.closing {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: clamp(24px, 4vw, 40px); background: var(--bg-alt);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.closing h2 { font-size: 1.4rem; margin: 0 0 4px; }
.closing p { margin: 0; }
.closing .btn { flex: none; }

/* ---------- Text-Seiten (Impressum etc.) ---------- */
.prose h2 { font-size: 1.5rem; margin-top: 2em; }
.prose h3 { font-size: 1.15rem; margin-top: 1.6em; }
.prose p, .prose li { color: var(--ink-2); }
.prose a { color: var(--gold-text); }

/* ---------- Footer ---------- */
.site-footer { background: var(--bg-alt); border-top: 1px solid var(--line); padding: 72px 0 32px; margin-top: 0; font-size: .95rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; }
.footer-grid p { color: var(--muted); max-width: 300px; margin-top: 16px; }
.site-footer h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 16px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.site-footer a, .link-btn { color: var(--ink-2); text-decoration: none; }
.site-footer a:hover, .link-btn:hover { color: var(--gold-text); }
.link-btn { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.site-footer address { font-style: normal; color: var(--ink-2); line-height: 1.8; }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }

/* ---------- Cookie-Banner ---------- */
.cookie {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 60;
  max-width: 520px; margin-left: auto;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 20px 60px rgba(23,26,32,.18);
  padding: 24px;
}
.cookie h2 { font-size: 1.05rem; margin-bottom: 6px; letter-spacing: -.01em; }
.cookie p { font-size: .9rem; color: var(--muted); margin-bottom: 16px; }
.cookie a { color: var(--gold-text); }
.cookie .btn-row { gap: 10px; }
.cookie .btn { flex: 1; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .grid-4, .steps, .audience { grid-template-columns: 1fr 1fr; }
  .order-layout { grid-template-columns: 1fr; }
  .order-aside { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .container { padding: 0 16px; }
  .grid-3, .grid-2, .fields, .checklist.cols-2 { grid-template-columns: 1fr; }
  .closing { flex-direction: column; align-items: stretch; }
  .btn-row .btn { flex: 1 1 auto; }
}
@media (max-width: 520px) {
  .steps, .audience, .grid-4, .footer-grid { grid-template-columns: 1fr; }
}
