/* ==========================================================================
   Energieausweis Ansbach – Andreas Daum
   Reines CSS3, keine externen Ressourcen, nur System-Schriften.
   ========================================================================== */

:root {
  --c-primary: #1f6f43;
  --c-primary-dark: #15532f;
  --c-primary-soft: #e6f2eb;
  --c-accent: #e3a018;
  --c-danger: #b4372b;
  --c-danger-soft: #fbeceb;
  --c-info: #1f5fa8;
  --c-info-soft: #e8f1fb;
  --c-warn: #e3a018;
  --c-warn-soft: #fff6dc;
  --c-text: #1d2422;
  --c-muted: #5b6662;
  --c-bg: #ffffff;
  --c-bg-alt: #f4f7f5;
  --c-border: #dbe3df;

  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 6px 24px rgba(16, 40, 28, .08);
  --container: 1140px;
  --header-h: 72px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--c-primary); }
a:hover { color: var(--c-primary-dark); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }

:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 2px; }

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

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--c-primary); color: #fff; padding: 10px 16px; border-radius: var(--radius-sm);
}
.skip-link:focus { top: 12px; color: #fff; }

.card { background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius); box-shadow: var(--shadow); }

.eyebrow {
  text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; font-weight: 700;
  color: var(--c-primary); margin-bottom: .4em;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: .8em 1.4em; border-radius: 999px; border: 2px solid transparent;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: background-color .2s, color .2s, transform .2s var(--ease), box-shadow .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--c-primary); color: #fff; box-shadow: 0 4px 14px rgba(31, 111, 67, .3); }
.btn-primary:hover { background: var(--c-primary-dark); color: #fff; }
.btn-ghost { border-color: var(--c-primary); color: var(--c-primary); background: transparent; }
.btn-ghost:hover { background: var(--c-primary-soft); }
.btn[disabled] { opacity: .6; cursor: wait; transform: none; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: rgba(255, 255, 255, .92); backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid transparent; transition: border-color .2s, box-shadow .2s;
}
.site-header.is-scrolled { border-color: var(--c-border); box-shadow: 0 2px 12px rgba(0, 0, 0, .05); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 100%; }
.brand img { height: 52px; width: auto; }

.site-nav ul { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.site-nav a {
  display: block; padding: .5em .9em; border-radius: 999px;
  text-decoration: none; color: var(--c-text); font-weight: 500;
}
.site-nav a:hover, .site-nav a.is-active { background: var(--c-primary-soft); color: var(--c-primary-dark); }
.site-nav a.nav-cta { background: var(--c-primary); color: #fff; }
.site-nav a.nav-cta:hover { background: var(--c-primary-dark); }

.nav-toggle { display: none; background: none; border: 0; width: 44px; height: 44px; cursor: pointer; position: relative; }
.nav-toggle-bar, .nav-toggle-bar::before, .nav-toggle-bar::after {
  position: absolute; left: 10px; width: 24px; height: 2px; background: var(--c-text);
  transition: transform .25s var(--ease), background-color .2s;
}
.nav-toggle-bar { top: 21px; }
.nav-toggle-bar::before, .nav-toggle-bar::after { content: ""; left: 0; }
.nav-toggle-bar::before { top: -7px; }
.nav-toggle-bar::after { top: 7px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::after { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .site-nav {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    background: #fff; border-bottom: 1px solid var(--c-border);
    max-height: 0; overflow: hidden; transition: max-height .3s var(--ease);
  }
  .site-nav.is-open { max-height: 320px; }
  .site-nav ul { flex-direction: column; padding: 12px 20px 20px; }
}

/* ---------- Hero ---------- */
.hero {
  /* Hintergrund: Energieausweis-Foto mit dunklem Verlauf für lesbaren Text */
  background:
    linear-gradient(100deg, rgba(10, 30, 20, .85) 0%, rgba(10, 30, 20, .6) 50%, rgba(10, 30, 20, .25) 100%),
    url("assets/hero-energieausweis.jpg") center / cover no-repeat;
  background-color: #13201a;
  color: #fff;
  padding: clamp(56px, 9vw, 112px) 0;
}
.hero .eyebrow { color: #9fd8b5; }
.hero .hero-sub { color: rgba(255, 255, 255, .85); }
.hero .btn-ghost { border-color: #fff; color: #fff; }
.hero .btn-ghost:hover { background: rgba(255, 255, 255, .12); }
.hero-inner { display: grid; grid-template-columns: 1.3fr 1fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(2.4rem, 6vw, 3.6rem); margin-bottom: .1em; }
.hero-sub { font-size: 1.3rem; font-weight: 500; }
.hero-lead { font-size: 1.15rem; max-width: 34em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.hero-portrait { margin: 0; justify-self: center; max-width: 340px; }
.hero-portrait img {
  border-radius: var(--radius); box-shadow: 0 20px 50px rgba(16, 40, 28, .18);
  aspect-ratio: 570 / 797; object-fit: cover; background: var(--c-border);
}
@media (max-width: 760px) {
  .hero { background-image: linear-gradient(rgba(10, 30, 20, .78), rgba(10, 30, 20, .78)), url("assets/hero-energieausweis.jpg"); }
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-actions { justify-content: center; }
  .hero-portrait { order: -1; max-width: 220px; }
}

/* ---------- Sections ---------- */
.section { padding: clamp(56px, 8vw, 96px) 0; }
.section-alt { background: var(--c-bg-alt); }
.section-head { max-width: 720px; margin: 0 auto 40px; text-align: center; }
.section-head p:last-child { color: var(--c-muted); }

.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
@media (max-width: 900px) { .about-grid { grid-template-columns: 1fr; } }
.prose .note {
  display: flex; gap: 12px; align-items: flex-start;
  border-left: 4px solid var(--c-info); background: var(--c-info-soft);
  padding: 14px 18px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--c-text);
}
.note-icon { flex: none; color: var(--c-info); margin-top: 3px; }

/* ---------- Wahl-Assistent ---------- */
.wizard { padding: 28px; position: sticky; top: calc(var(--header-h) + 16px); }
@media (max-width: 900px) { .wizard { position: static; } }
.wizard-head h3 { font-size: 1.35rem; }
.wizard-head p { color: var(--c-muted); font-size: .95rem; }

.wizard-progress { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 0 20px; }
.wizard-progress li { flex: 1; height: 4px; border-radius: 4px; background: var(--c-border); transition: background-color .3s; }
.wizard-progress li.is-done { background: var(--c-primary); }

.wizard-body { margin: 0; }

/* Folgeschritte klappen sanft auf (max-height + opacity + translate) */
.wz-step {
  border: 0; margin: 0; padding: 0; min-width: 0;
  max-height: 0; overflow: hidden; opacity: 0; transform: translateY(-6px);
  transition: max-height .45s var(--ease), opacity .35s var(--ease), transform .35s var(--ease), margin .45s var(--ease);
}
.wz-step.is-visible { max-height: 400px; opacity: 1; transform: none; margin-bottom: 18px; }
.wz-step[hidden] { display: none; }

.wz-step legend { font-weight: 600; padding: 0; margin-bottom: 10px; display: flex; gap: 10px; align-items: baseline; float: left; width: 100%; }
.wz-step legend + * { clear: both; }
.wz-num {
  flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px;
  border-radius: 50%; background: var(--c-primary); color: #fff; font-size: .85rem;
}
.wz-options { display: flex; gap: 10px; padding-left: 36px; }
.wz-opt { position: relative; cursor: pointer; }
.wz-opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.wz-opt span {
  display: inline-block; min-width: 88px; text-align: center; padding: .55em 1.2em;
  border: 2px solid var(--c-border); border-radius: 999px; font-weight: 600;
  transition: border-color .2s, background-color .2s, color .2s;
}
.wz-opt:hover span { border-color: var(--c-primary); }
.wz-opt input:checked + span { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.wz-opt input:focus-visible + span { outline: 3px solid var(--c-accent); outline-offset: 2px; }

.wz-result {
  border-radius: var(--radius-sm); padding: 18px 20px; margin-top: 4px;
  background: var(--c-bg-alt); border: 1px solid var(--c-border);
  opacity: 0; transform: translateY(8px) scale(.98);
  transition: opacity .35s var(--ease), transform .35s var(--ease);
}
.wz-result.is-visible { opacity: 1; transform: none; }
.wz-result[hidden] { display: none; }
/* Ampel: grün = kein Ausweis, gelb = Wahlfreiheit, rot = Pflicht Bedarfsausweis */
.wz-result.is-none { background: var(--c-primary-soft); border-color: #9fd0b2; border-left: 6px solid var(--c-primary); }
.wz-result.is-none strong { color: var(--c-primary-dark); }
.wz-result.is-choice { background: var(--c-warn-soft); border-color: #f0d58a; border-left: 6px solid var(--c-warn); }
.wz-result.is-choice strong { color: #8a5a00; }
.wz-result.is-required { background: var(--c-danger-soft); border-color: #efc4bf; border-left: 6px solid var(--c-danger); }
.wz-result.is-required strong { color: var(--c-danger); }
.wz-result-title { font-size: 1.15rem; margin-bottom: 12px; }
.wz-result .btn { font-size: .95rem; white-space: normal; text-align: center; }

/* Übernahme-Checkbox */
.wz-transfer {
  display: flex; gap: 12px; align-items: center; margin-top: 14px; padding: 12px 14px;
  border: 2px dashed var(--c-border); border-radius: var(--radius-sm); cursor: pointer; position: relative;
  opacity: 0; transform: translateY(8px);
  transition: opacity .35s var(--ease), transform .35s var(--ease), border-color .2s, background-color .2s;
}
.wz-transfer.is-visible { opacity: 1; transform: none; }
.wz-transfer[hidden] { display: none; }
.wz-transfer:hover { border-color: var(--c-primary); }
.wz-transfer input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.wz-transfer-box {
  flex: none; width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center;
  border: 2px solid var(--c-primary); color: #fff; background: #fff;
  transition: background-color .2s, transform .2s var(--ease);
}
.wz-transfer-box path { stroke-dasharray: 24; stroke-dashoffset: 24; transition: stroke-dashoffset .3s var(--ease) .05s; }
.wz-transfer input:checked + .wz-transfer-box { background: var(--c-primary); transform: scale(1.08); }
.wz-transfer input:checked + .wz-transfer-box path { stroke-dashoffset: 0; }
.wz-transfer input:focus-visible + .wz-transfer-box { outline: 3px solid var(--c-accent); outline-offset: 2px; }
.wz-transfer:has(input:checked) { border-style: solid; border-color: var(--c-primary); background: var(--c-primary-soft); }
.wz-transfer-text { display: flex; flex-direction: column; line-height: 1.35; }
.wz-transfer-text small { color: var(--c-muted); font-size: .85rem; }

/* Fliegendes Ergebnis-Ticket */
.wz-flyer {
  position: fixed; z-index: 200; pointer-events: none; box-sizing: border-box;
  display: flex; gap: 10px; align-items: center; padding: 12px 16px;
  background: #fff; border-radius: var(--radius-sm); font-weight: 600; font-size: .95rem;
  border-left: 6px solid var(--c-primary); box-shadow: 0 18px 40px rgba(16, 40, 28, .25);
  transform-origin: top left; animation: flyer-pop .35s var(--ease);
}
.wz-flyer.is-choice { border-left-color: var(--c-warn); }
.wz-flyer.is-demand { border-left-color: var(--c-danger); }
.wz-flyer-icon {
  flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--c-primary); color: #fff; font-size: .85rem;
}
@keyframes flyer-pop { from { transform: scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }

/* Ankunft im Formular */
.wz-summary-field.is-arrived textarea { animation: arrive 1.4s var(--ease); }
@keyframes arrive {
  0% { box-shadow: 0 0 0 0 rgba(31, 111, 67, .55); border-color: var(--c-primary); background: var(--c-primary-soft); }
  60% { box-shadow: 0 0 0 12px rgba(31, 111, 67, 0); border-color: var(--c-primary); }
  100% { box-shadow: 0 0 0 0 rgba(31, 111, 67, 0); }
}

.wz-reset {
  margin-top: 14px; background: none; border: 0; padding: 0; font: inherit;
  color: var(--c-muted); text-decoration: underline; cursor: pointer;
}
.wz-reset:hover { color: var(--c-text); }

/* ---------- Schritte ---------- */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; counter-reset: none; }
@media (max-width: 1000px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }
.step { padding: 28px 22px; position: relative; text-align: center; transition: transform .25s var(--ease), box-shadow .25s; }
.step:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(16, 40, 28, .12); }
.step-icon { width: 120px; height: 120px; object-fit: cover; border-radius: 50%; margin: 0 auto 16px; background: var(--c-border); }
.step-num {
  position: absolute; top: 16px; left: 16px; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; background: var(--c-accent); color: #fff; font-weight: 700;
}
.step-tag { color: var(--c-primary); font-weight: 600; font-size: .9rem; }
.step p:last-child { color: var(--c-muted); font-size: .95rem; margin: 0; }

/* ---------- Hero-Überschrift ---------- */
.hero h1 .eyebrow { display: block; font-size: .8rem; margin-bottom: .6em; }

/* ---------- Kontakt ---------- */
.contact-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 32px; align-items: start; }
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-form { padding: 28px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%; font: inherit; padding: .7em .9em; color: var(--c-text);
  border: 1.5px solid var(--c-border); border-radius: var(--radius-sm); background: #fff;
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 140px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(31, 111, 67, .18); }
.field.has-error input, .field.has-error textarea { border-color: var(--c-danger); }
.field-captcha input { max-width: 120px; }
.field-check { display: flex; gap: 10px; align-items: flex-start; }
.field-check input { width: 20px; height: 20px; flex: none; margin-top: 3px; accent-color: var(--c-primary); }
.field-check label { font-weight: 400; }
.field-check.has-error label { color: var(--c-danger); }
.form-hint { font-size: .85rem; color: var(--c-muted); }

/* Schreibgeschützte Zusammenfassung des Wahl-Assistenten + Hinweis bei Hover/Klick */
.wz-summary-field { position: relative; }
.wz-summary-field label { color: var(--c-muted); }
.wz-summary-field textarea,
.wz-summary-field textarea:focus {
  min-height: 0; resize: none; cursor: help;
  background: #f1f3f2; color: #6b7570; border-style: dashed; box-shadow: none;
}
.wz-summary-hint {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 5; margin: 6px 0 0;
  padding: 10px 14px; border-radius: var(--radius-sm); font-size: .88rem;
  background: var(--c-text); color: #fff; box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity .2s, transform .2s, visibility .2s;
}
.wz-summary-hint a { color: #9fd8b5; }
.wz-summary-field:hover .wz-summary-hint,
.wz-summary-field:focus-within .wz-summary-hint { opacity: 1; visibility: visible; transform: none; }
.form-status { margin: 14px 0 0; font-weight: 600; min-height: 1.5em; }
.form-status.is-ok { color: var(--c-primary); }
.form-status.is-error { color: var(--c-danger); }

/* Honeypot: für Menschen unsichtbar, für Bots sichtbar */
.hp { position: absolute !important; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

.contact-info { padding: 28px; }
.contact-info dl { margin: 0; display: grid; gap: 20px; }
.ci-item { display: flex; gap: 14px; align-items: flex-start; }
.ci-item > div { min-width: 0; }
.ci-badge {
  flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: var(--c-primary-soft); color: var(--c-primary);
  transition: background-color .25s, color .25s, transform .25s var(--ease);
}
.ci-item:hover .ci-badge { background: var(--c-primary); color: #fff; transform: scale(1.06) rotate(-4deg); }
.contact-info dt { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--c-muted); font-weight: 700; }
.contact-info dd { margin: 2px 0 0; word-break: break-word; }
.contact-info dd a { text-decoration: none; font-weight: 600; }
.contact-info dd a:hover { text-decoration: underline; }

/* ---------- Footer ---------- */
.site-footer { background: #13201a; color: #c9d3ce; padding: 36px 0; font-size: .92rem; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: center; justify-content: space-between; }
/* Logo farbig wie im Header; heller Hintergrund, da der schwarze Schriftzug sonst auf dunklem Grund verschwindet */
.footer-inner img { height: 56px; width: auto; background: #fff; padding: 6px 10px; border-radius: var(--radius-sm); box-sizing: content-box; }
.footer-inner nav { display: flex; gap: 10px; }
.site-footer a { color: #fff; }
.site-footer p { margin: 0; }

/* ---------- Views (Hash-Routing) ---------- */
.js .view:not(.is-active) { display: none; }

/* ---------- Rechtstexte (#impressum / #datenschutz) ---------- */
.legal { padding: clamp(40px, 6vw, 72px) 0; }
.legal .container { max-width: 820px; }
.legal h2 { font-size: 1.4rem; margin-top: 2em; }
.legal h2:first-of-type { font-size: clamp(2rem, 4vw, 2.6rem); margin-top: 0; }
.legal h3 { font-size: 1.25rem; margin-top: 2em; }
.legal h4 { font-size: 1.1rem; margin-top: 1.5em; }
.legal address { font-style: normal; margin-bottom: 1em; }
.legal .back { display: inline-block; margin-bottom: 24px; }
.site-footer .version { opacity: .6; font-size: .85em; white-space: nowrap; }
