/* QuartierWatt landing, Luftbild (/DESIGN.md; behaviour in the landing surface brief).
   Same tokens as the SPA (frontend/src/styles/qw.css); dark mode follows the OS
   because this page has no settings and CSP forbids an inline theme script. */

:root {
  --paper: #E2EAF6; --paper-2: #E6EDF8; --card: #F6F8FC; --field-bg: #FFFFFF;
  --ink: #0B1F44; --ink-2: #3A4C6E; --ink-3: #55668A; --ink-rgb: 11,31,68; --on-ink: #FFFFFF;
  --solar: #FFB020; --solar-ink: #1D1400; --solar-glow: rgba(255,176,32,.20);
  --line: rgba(11,31,68,.14); --line-strong: rgba(11,31,68,.38);
  --ok: #1F8A57; --danger: #C0392B;
  --pv: #FFC400;
  --font: "Figtree", -apple-system, "Segoe UI", sans-serif;
  --r-sm: 10px; --r: 14px; --r-lg: 20px;
  --shadow: 0 1px 2px rgba(5,10,14,.06), 0 6px 18px -8px rgba(5,10,14,.18);
  --shadow-float: 0 18px 40px -12px rgba(5,10,14,.45), 0 2px 6px rgba(5,10,14,.18);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0B1424; --paper-2: #1A2742; --card: #121D33; --field-bg: #0E182C;
    --ink: #EAF0FA; --ink-2: #B4C0D6; --ink-3: #8D9BB6; --ink-rgb: 234,240,250; --on-ink: #0B1424;
    --solar-glow: rgba(255,176,32,.18);
    --line: rgba(234,240,250,.12); --line-strong: rgba(234,240,250,.32);
    --ok: #3FBF84; --danger: #F0756A;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 22px -10px rgba(0,0,0,.6);
    --shadow-float: 0 18px 40px -12px rgba(0,0,0,.7), 0 2px 6px rgba(0,0,0,.4);
    color-scheme: dark;
  }
  /* the controls' icons are dark SVG backgrounds: flip them */
  .maplibregl-ctrl-group button .maplibregl-ctrl-icon, .maplibregl-ctrl-attrib-button { filter: invert(1); }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--paper); line-height: 1.5; font-feature-settings: "tnum" 1; -webkit-font-smoothing: antialiased; }
::selection { background: var(--solar); color: var(--solar-ink); }
:focus-visible { outline: 3px solid var(--solar); outline-offset: 3px; border-radius: 8px; }
input, button { font: inherit; color: inherit; }
a { color: inherit; }

/* —— map stage —— */
.stage { position: relative; height: 100vh; min-height: 640px; background: #1b1e1c; overflow: hidden; }
#map { position: absolute; inset: 0; }
#map .maplibregl-canvas { cursor: pointer; }
/* map controls follow the theme like the Luftbild | Karte switch (maplibre ships them white) */
.maplibregl-ctrl-attrib { font: 11px var(--font); background: var(--card) !important; border-radius: 8px !important; color: var(--ink-2); }
.maplibregl-ctrl-attrib a { color: inherit; }
.maplibregl-ctrl-group { background: var(--paper-2) !important; }
.maplibregl-ctrl-group button + button { border-top: 1px solid var(--line) !important; }
.maplibregl-ctrl-group button:not(:disabled):hover { background-color: var(--card) !important; }
.maplibregl-ctrl-top-right { top: 78px; right: 14px; }
.maplibregl-ctrl-group { border-radius: 12px !important; overflow: hidden; box-shadow: var(--shadow) !important; }

.top { position: absolute; z-index: 3; top: 18px; left: 22px; right: 22px; display: flex; justify-content: space-between; align-items: center; pointer-events: none; }
.top > * { pointer-events: auto; }
.brand { display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px 8px 10px; background: var(--card); color: var(--ink); border-radius: 999px; box-shadow: var(--shadow); text-decoration: none; font-weight: 800; font-size: 20px; letter-spacing: -.025em; }
.brand svg { width: 30px; height: 30px; flex: none; }
.navpill { display: flex; gap: 2px; padding: 5px; background: var(--card); border-radius: 999px; box-shadow: var(--shadow); }
.navpill a { padding: 9px 15px; text-decoration: none; font-weight: 600; font-size: 15px; border-radius: 999px; }
.navpill a:hover { background: var(--paper-2); }

.panel { position: absolute; z-index: 2; left: 22px; top: 86px; width: 452px; max-height: calc(100% - 108px); overflow: auto; padding: 28px 26px 22px; background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow-float); scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.panel h1 { margin: 0; font-size: clamp(32px, 3.2vw, 44px); font-weight: 800; letter-spacing: -.025em; line-height: 1.02; text-wrap: balance; }
.panel h1 em { font-style: normal; }
.lede { font-size: 17px; margin: 14px 0 0; color: var(--ink-2); max-width: 38ch; }
.widget { position: relative; margin-top: 22px; }
.widget label { display: block; margin-bottom: 8px; font-weight: 650; font-size: 14px; }
.field { display: flex; align-items: center; gap: 6px; padding: 6px; border: 1.5px solid var(--line-strong); border-radius: var(--r); background: var(--field-bg); }
.field:focus-within { border-color: var(--solar); box-shadow: 0 0 0 4px var(--solar-glow); }
.field input { flex: 1; min-width: 0; border: 0; padding: 0 10px; min-height: 48px; font-size: 17px; background: transparent; outline: none; }
.field input::placeholder { color: var(--ink-3); }
.btn-check { appearance: none; border: 0; background: var(--solar); color: var(--solar-ink); font-weight: 750; padding: 0 18px; min-height: 48px; border-radius: var(--r-sm); cursor: pointer; white-space: nowrap; transition: transform .15s var(--ease-out), filter .15s; }
.btn-check:hover { filter: brightness(.95); }
.btn-check:active { transform: translateY(1px); }
.btn-check[disabled] { background: var(--paper-2); color: var(--ink-3); cursor: not-allowed; filter: none; }
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 6; padding: 6px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-float); display: none; }
.suggest.show { display: block; }
.suggest button { display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left; padding: 10px 12px; border: 0; background: transparent; border-radius: var(--r-sm); cursor: pointer; font-size: 15.5px; }
.suggest button:hover, .suggest button:focus-visible { background: var(--solar-glow); }
.suggest .pin { width: 9px; height: 9px; margin-top: 7px; border-radius: 50%; background: var(--solar); flex: none; }
.suggest small { display: block; font-size: 13px; color: var(--ink-3); }
.microcopy { margin: 10px 0 0; font-size: 13.5px; color: var(--ink-2); }
.hint { display: flex; align-items: center; gap: 8px; margin: 6px 0 0; font-size: 14px; color: var(--ink-2); }
.hint svg { width: 17px; height: 17px; flex: none; }
.status { min-height: 0; margin-top: 8px; font-size: 14px; color: var(--ink-2); display: flex; gap: 8px; align-items: center; }
.status:empty { display: none; }
.status.err { color: var(--danger); font-weight: 600; }
.spin { width: 14px; height: 14px; border: 2px solid var(--ink-2); border-right-color: transparent; border-radius: 50%; animation: sp .8s linear infinite; }
@keyframes sp { to { transform: rotate(1turn); } }

.nearby { margin-top: 16px; padding: 16px 16px 8px; border-radius: var(--r); background: var(--paper-2); }
.nearby[hidden] { display: none; }
.nearby h2 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.nearby p { margin: 6px 0 4px; font-size: 15px; color: var(--ink-2); }
.ranked-h { display: flex; justify-content: space-between; align-items: baseline; margin-top: 12px; font-size: 14px; font-weight: 700; }
.ranked-h span { font-size: 12px; font-weight: 500; color: var(--ink-3); }
.ranked { margin: 6px 0 0; padding: 0; list-style: none; }
.ranked li { display: grid; grid-template-columns: 50px 1fr auto; gap: 10px; align-items: center; padding: 9px 8px; border-radius: var(--r-sm); font-size: 14.5px; }
.ranked li + li { border-top: 1px solid var(--line); }
.ranked li:hover, .ranked li:focus-visible { background: var(--card); border-top-color: transparent; }
.ranked li.own { background: var(--solar-glow); }
.ranked .d { font-weight: 700; }
.ranked .k { font-weight: 650; color: var(--ink-2); font-size: 14px; }

.legend { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }
.legend i { display: inline-block; vertical-align: -2px; margin-right: 6px; }
.lg-pv { width: 12px; height: 12px; border-radius: 50%; background: var(--pv); box-shadow: 0 0 0 2px #111 inset; }
.lg-own { width: 18px; height: 13px; border-radius: 4px; border: 2.5px solid var(--solar); }
.lg-house { width: 18px; height: 13px; border-radius: 4px; border: 2px solid var(--ink-2); }
.lg-flow { width: 24px; height: 4px; border-radius: 2px; background: var(--solar); box-shadow: 0 0 6px 1px var(--solar); vertical-align: 2px !important; }
.credit { font-size: 11.5px; color: var(--ink-3); margin: 10px 0 0; }

/* houses on the map are line layers (outer boundary, rounded); only the tag and kWp pills are DOM */
.house-tag { white-space: nowrap; background: var(--solar); color: var(--solar-ink); font-weight: 700; font-size: 13.5px; padding: 5px 11px; border-radius: 999px; box-shadow: var(--shadow); }
/* Luftbild | Karte: the app's tab grammar (tinted track, raised active chip); no gold, gold means "you" */
.map-seg { position: absolute; z-index: 3; right: 14px; bottom: 44px; display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--paper-2); box-shadow: 0 0 0 1px var(--line), 0 10px 24px -10px rgba(5,10,20,.5); }
.map-seg button { appearance: none; border: 0; background: transparent; font: inherit; font-size: 14px; font-weight: 650; color: var(--ink-2); cursor: pointer; border-radius: 9px; padding: 8px 14px 8px 11px; min-height: 38px; display: inline-flex; align-items: center; gap: 7px; }
.map-seg button:hover { color: var(--ink); }
.map-seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(var(--ink-rgb), .2); }
.map-seg svg { width: 17px; height: 17px; flex: none; }
.pvlabel { background: var(--card); color: var(--ink); font-size: 12.5px; font-weight: 650; padding: 3px 9px; border-radius: 999px; white-space: nowrap; box-shadow: 0 2px 8px rgba(0,0,0,.35); pointer-events: none; }

/* —— content below the map (SEO sections) —— */
.content { max-width: 1040px; margin: 0 auto; padding: 40px 24px 0; }
.msection { padding: 34px 0; }
.msection h2 { margin: 0 0 16px; font-size: clamp(26px, 3.4vw, 38px); font-weight: 800; letter-spacing: -.025em; line-height: 1.08; text-wrap: balance; }
.msection h3 { margin: 22px 0 8px; font-size: 20px; font-weight: 700; }
.msection p { margin: 0 0 14px; font-size: 16.5px; line-height: 1.65; color: var(--ink-2); max-width: 68ch; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 20px; }
.step { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 22px; }
.step .n { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--solar-glow); font-weight: 800; font-size: 15px; }
.step h3 { margin: 12px 0 6px; font-size: 19px; }
.step p { font-size: 15px; margin: 0; }
.faq { display: grid; gap: 10px; margin-top: 18px; max-width: 760px; }
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 18px; }
.faq summary { font-weight: 700; font-size: 16px; cursor: pointer; }
.faq details p { margin: 10px 0 2px; font-size: 15px; }
.mfooter { border-top: 1px solid var(--line); margin-top: 40px; padding: 26px 0 44px; display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; align-items: center; font-size: 14px; color: var(--ink-3); }
.mfooter div { display: flex; gap: 18px; }
.langnav { display: flex; gap: 6px; }
.langnav a { padding: 5px 10px; border-radius: 999px; text-decoration: none; font-weight: 650; color: var(--ink-2); }
.langnav a[aria-current="true"] { background: var(--solar-glow); color: var(--ink); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* —— phone scale (DESIGN.md, Typography): denser so the result fits one screen —— */
@media (max-width: 760px) {
  body { font-size: 15px; }
  .stage { height: auto; min-height: 0; overflow: visible; background: none; }
  #map { position: relative; height: 58vh; inset: auto; }
  /* the panel overlaps the map by 18px: keep the credit (i) clear of it */
  .maplibregl-ctrl-bottom-right { margin-bottom: 26px; }
  .top { left: 12px; right: 12px; top: 12px; }
  .brand { padding: 6px 12px 6px 8px; gap: 7px; font-size: 16px; }
  .brand svg { width: 22px; height: 22px; }
  .navpill a { padding: 7px 12px; font-size: 14px; }
  .maplibregl-ctrl-top-right { top: 62px; right: 10px; }
  .map-seg { top: 62px; left: 12px; right: auto; bottom: auto; }
  .map-seg button { padding: 6px 10px; min-height: 34px; min-width: 40px; justify-content: center; font-size: 13px; }
  .map-seg-text { display: none; }
  .panel { position: relative; left: auto; top: -18px; width: auto; max-height: none; overflow: visible; border-radius: 18px 18px 0 0; padding: 18px 16px 8px; box-shadow: none; }
  .panel h1 { font-size: 26px; }
  .lede { font-size: 14.5px; margin-top: 8px; }
  .widget { margin-top: 14px; }
  .widget label { font-size: 13px; margin-bottom: 6px; }
  .field { padding: 4px; border-radius: 12px; }
  .field input { min-height: 42px; font-size: 16px; padding: 0 8px; }
  .btn-check { min-height: 42px; padding: 0 14px; font-size: 15px; }
  .hint, .microcopy { font-size: 13px; }
  .nearby { padding: 14px 12px 6px; }
  .nearby h2 { font-size: 18px; }
  .nearby p { font-size: 14px; }
  .ranked li { grid-template-columns: 44px 1fr auto; gap: 8px; padding: 8px 6px; font-size: 13px; }
  .ranked .k { font-size: 13px; }
  .legend { font-size: 12px; gap: 8px 14px; }
  .credit { font-size: 10.5px; }
  .house-tag { font-size: 12px; padding: 4px 9px; }
  .pvlabel { font-size: 11px; padding: 2px 7px; }
  .content { padding: 8px 16px 0; }
  .msection { padding: 24px 0; }
  .msection p { font-size: 15px; }
  .steps { grid-template-columns: 1fr; gap: 12px; }
}
