/* =========================================================================
   "Stromkosten senken" (Strom-Sparcheck) — Endkunden-Funnel-Styles
   Mobile-first (max 560px zentriert), System-Font-Stack, KEINE externen
   Ressourcen (DSGVO). Design-Tokens laut SPEC.
   ========================================================================= */

:root {
    --sc-primary:      #16a34a;   /* Gruen (Marke) */
    --sc-primary-dark: #15803d;
    --sc-primary-soft: #f0fdf4;
    --sc-accent:       #facc15;   /* Blitz-Gelb */
    --sc-ink:          #0f172a;
    --sc-muted:        #64748b;
    --sc-bg:           #f8fafc;
    --sc-card:         #ffffff;
    --sc-danger:       #dc2626;
    --sc-border:       #cbd5e1;
    --sc-radius:       14px;
    --sc-radius-sm:    12px;
    --sc-shadow:       0 2px 14px rgba(15, 23, 42, 0.07);
    --sc-shadow-lg:    0 8px 28px rgba(15, 23, 42, 0.14);
    --safe-bottom:     env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--sc-bg);
    color: var(--sc-ink);
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Zentrale Spalte: Funnel laeuft v. a. am Handy (Google Ads) */
.shell {
    max-width: 560px;
    margin: 0 auto;
    padding: 0 16px calc(48px + var(--safe-bottom));
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}
.shell > main { flex: 1; }

/* ============================== Kopf/Logo ============================== */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0 10px;
}
.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--sc-ink);
}
.logo-mark { width: 40px; height: 40px; flex: none; display: block; }
.logo-wort {
    font-weight: 800;
    font-size: 17px;
    letter-spacing: -0.2px;
    line-height: 1.15;
}
.logo-wort em {
    font-style: normal;
    color: var(--sc-primary-dark);
}

/* ========================== Fortschrittsbalken ========================= */
.progress {
    height: 6px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
    margin: 4px 0 20px;
}
.progress__fill {
    height: 100%;
    width: 5%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--sc-primary), #22c55e);
    transition: width 0.4s ease;
}

/* =============================== Schritte ============================== */
section[data-step] { display: none; }
section[data-step].is-active { display: block; animation: scIn 0.25s ease; }
@keyframes scIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}

h1 {
    font-size: 27px;
    line-height: 1.2;
    letter-spacing: -0.4px;
    margin: 6px 0 10px;
    font-weight: 800;
}
h2 { font-size: 20px; margin: 0 0 8px; font-weight: 800; }
.untertitel { color: var(--sc-muted); margin: 0 0 18px; font-size: 15.5px; }
.kicker {
    display: inline-block;
    font-size: 12.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--sc-primary-dark);
    margin: 0 0 4px;
}

/* ================================ Karten ================================ */
.card {
    background: var(--sc-card);
    border: 1px solid #eef2f7;
    border-radius: var(--sc-radius);
    box-shadow: var(--sc-shadow);
    padding: 20px;
    margin-bottom: 16px;
}
.zentriert { text-align: center; }

/* =============================== Buttons =============================== */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 52px;
    padding: 12px 18px;
    border: 0;
    border-radius: var(--sc-radius-sm);
    font-family: inherit;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.06s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:active { transform: scale(0.985); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn--primary {
    background: var(--sc-primary);
    color: #fff;
    box-shadow: 0 4px 14px rgba(22, 163, 74, 0.32);
}
.btn--primary:not(:disabled):hover { background: var(--sc-primary-dark); }
.btn--ghost {
    background: #fff;
    color: var(--sc-ink);
    border: 1.5px solid var(--sc-border);
}
.btn--ghost:not(:disabled):hover { border-color: var(--sc-muted); }
.btn-reihe { display: flex; gap: 10px; margin-top: 14px; }
.btn-reihe .btn { flex: 1; }
.btn-abstand { margin-top: 14px; }

/* =============================== Formular ============================== */
.feld { margin-bottom: 14px; }
.feld label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 6px;
}
.input {
    width: 100%;
    min-height: 50px;
    padding: 12px 14px;
    border: 1.5px solid var(--sc-border);
    border-radius: var(--sc-radius-sm);
    background: #fff;
    font-family: inherit;
    font-size: 16px;
    color: var(--sc-ink);
}
.input:focus, .btn:focus-visible, .chip:focus-visible, .tab:focus-visible,
.zeit:focus-visible, .tag-chip:focus-visible {
    outline: 3px solid rgba(22, 163, 74, 0.35);
    outline-offset: 1px;
    border-color: var(--sc-primary);
}
.feld-hinweis { display: none; }

/* Rot markierte Pruef-Felder (Confidence < 0.75 oder Wert fehlt) */
.feld-pruefen .input {
    border-color: var(--sc-danger);
    background: #fef2f2;
}
.feld-pruefen label { color: var(--sc-danger); }
.feld-pruefen .feld-hinweis {
    display: block;
    color: var(--sc-danger);
    font-size: 12.5px;
    font-weight: 600;
    margin: 5px 2px 0;
}

/* ============================ Chips / Toggles =========================== */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    min-height: 48px;
    padding: 10px 16px;
    border-radius: 999px;
    border: 1.5px solid var(--sc-border);
    background: #fff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    color: var(--sc-ink);
    cursor: pointer;
}
.chip.is-active {
    border-color: var(--sc-primary);
    background: var(--sc-primary-soft);
    color: var(--sc-primary-dark);
    box-shadow: inset 0 0 0 1px var(--sc-primary);
}

/* Tabs (Fallback: Verbrauch / Schaetzung) */
.tabs {
    display: flex;
    gap: 4px;
    background: #e2e8f0;
    border-radius: var(--sc-radius-sm);
    padding: 4px;
    margin-bottom: 16px;
}
.tab {
    flex: 1;
    min-height: 46px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 700;
    color: var(--sc-muted);
    cursor: pointer;
}
.tab.is-active {
    background: #fff;
    color: var(--sc-ink);
    box-shadow: 0 1px 5px rgba(15, 23, 42, 0.14);
}

/* =============================== Bullets =============================== */
.bullets { list-style: none; margin: 0 0 18px; padding: 0; }
.bullets li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 7px 0;
    font-size: 15.5px;
}
.bullets .ic {
    width: 22px; height: 22px; flex: none;
    color: var(--sc-primary);
    margin-top: 1px;
}

/* ========================= Datei-Auswahl (Scan) ========================= */
.dateien {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
    gap: 10px;
    margin: 14px 0 4px;
}
.datei {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: var(--sc-radius-sm);
    overflow: hidden;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
}
.datei img { width: 100%; height: 100%; object-fit: cover; display: block; }
.datei__chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 100%;
    padding: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--sc-muted);
    text-align: center;
    word-break: break-all;
}
.datei__chip svg { width: 26px; height: 26px; color: var(--sc-muted); }
.datei__nr {
    position: absolute;
    left: 5px; bottom: 5px;
    min-width: 22px; height: 22px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.7);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 0 6px;
}
.datei__x {
    position: absolute;
    top: 5px; right: 5px;
    width: 28px; height: 28px;
    border: 0;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.7);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}
.dateien-leer { color: var(--sc-muted); font-size: 14px; margin: 12px 0 4px; }

/* ========================== Consent / Checkboxen ======================== */
.check {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    border: 1.5px solid var(--sc-border);
    border-radius: var(--sc-radius-sm);
    background: #fff;
    cursor: pointer;
    margin-bottom: 14px;
}
.check input {
    width: 22px; height: 22px;
    margin: 2px 0 0;
    flex: none;
    accent-color: var(--sc-primary);
}
.check span { font-size: 14.5px; line-height: 1.55; }
.check a { color: var(--sc-primary-dark); font-weight: 600; }

/* ============================= Lade-Screen ============================== */
.spinner {
    width: 56px; height: 56px;
    margin: 26px auto 18px;
    border-radius: 50%;
    border: 5px solid #dcfce7;
    border-top-color: var(--sc-primary);
    animation: scSpin 0.9s linear infinite;
}
@keyframes scSpin { to { transform: rotate(360deg); } }
.lade-hinweis {
    text-align: center;
    color: var(--sc-muted);
    font-size: 15px;
    min-height: 46px;
    margin: 0 0 8px;
}
.lade-mini { color: var(--sc-muted); font-size: 14.5px; padding: 8px 0; }

/* =============================== Ergebnis ============================== */
.erg-hero { text-align: center; padding: 26px 20px; }
.erg-zahl {
    font-size: 52px;
    font-weight: 800;
    letter-spacing: -1.5px;
    line-height: 1.05;
    color: var(--sc-primary-dark);
    margin: 6px 0 2px;
}
.erg-sub  { color: var(--sc-ink); font-size: 16px; margin: 4px 0 0; font-weight: 600; }
.erg-sub2 { color: var(--sc-muted); font-size: 14px; margin: 6px 0 0; }
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fef9c3;
    color: #854d0e;
    border: 1px solid #fde68a;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 700;
    margin-top: 12px;
}
.sparte-badge {
    display: inline-flex;
    align-items: center;
    background: var(--sc-primary-soft);
    color: var(--sc-primary-dark);
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 13px;
    font-weight: 800;
}
.vgl-kopf {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 14px;
    color: var(--sc-muted);
    flex-wrap: wrap;
}
.vgl-tab { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.vgl-tab th, .vgl-tab td {
    padding: 8px 6px;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: top;
}
.vgl-tab th { font-weight: 600; color: var(--sc-muted); width: 34%; }
.vgl-tab thead th { color: var(--sc-ink); font-weight: 800; }
.vgl-tab .neu { color: var(--sc-primary-dark); font-weight: 700; }
.vgl-ersparnis {
    margin-top: 12px;
    padding: 10px 12px;
    background: var(--sc-primary-soft);
    border: 1px solid #bbf7d0;
    border-radius: var(--sc-radius-sm);
    font-size: 15px;
}
.hinweis-klein { font-size: 12.5px; color: var(--sc-muted); margin: 10px 2px 0; }

/* ============================ Termin / Slots ============================ */
.tage {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 2px 8px;
    -webkit-overflow-scrolling: touch;
}
.tag-chip {
    flex: none;
    min-width: 76px;
    padding: 10px 12px;
    border-radius: var(--sc-radius-sm);
    border: 1.5px solid var(--sc-border);
    background: #fff;
    text-align: center;
    cursor: pointer;
    font-family: inherit;
}
.tag-chip .tw { display: block; font-size: 12px; color: var(--sc-muted); font-weight: 700; }
.tag-chip .td { display: block; font-size: 15px; font-weight: 800; color: var(--sc-ink); }
.tag-chip.is-active {
    border-color: var(--sc-primary);
    background: var(--sc-primary-soft);
    box-shadow: inset 0 0 0 1px var(--sc-primary);
}
.zeiten {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
    gap: 8px;
    margin-top: 12px;
}
.zeit {
    min-height: 48px;
    border-radius: 10px;
    border: 1.5px solid var(--sc-border);
    background: #fff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    color: var(--sc-ink);
    cursor: pointer;
}
.zeit.is-active {
    background: var(--sc-primary);
    border-color: var(--sc-primary);
    color: #fff;
}
.slot-auswahl {
    margin-top: 12px;
    font-size: 14.5px;
    font-weight: 700;
    color: var(--sc-primary-dark);
}

/* ============================ Fertig-Screen ============================= */
.erfolg-icon { width: 74px; height: 74px; margin: 12px auto 6px; display: block; color: var(--sc-primary); }
.termin-box {
    background: var(--sc-primary-soft);
    border: 1px solid #bbf7d0;
    border-radius: var(--sc-radius-sm);
    padding: 14px;
    margin: 14px 0 8px;
    font-size: 15px;
    text-align: left;
}
.termin-box b { display: block; margin-bottom: 2px; }

/* ================================ Toast ================================= */
.toast {
    position: fixed;
    left: 50%;
    bottom: calc(24px + var(--safe-bottom));
    transform: translateX(-50%);
    background: #0f172a;
    color: #fff;
    padding: 13px 18px;
    border-radius: var(--sc-radius-sm);
    font-size: 14.5px;
    font-weight: 600;
    box-shadow: var(--sc-shadow-lg);
    z-index: 60;
    max-width: min(92vw, 520px);
    text-align: center;
}
.toast.is-fehler { background: var(--sc-danger); }
.toast[hidden] { display: none; }

/* ================================ Footer ================================ */
.fuss {
    margin-top: 30px;
    padding: 18px 0 8px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
    font-size: 13px;
    color: var(--sc-muted);
}
.fuss nav { margin-bottom: 6px; }
.fuss a { color: var(--sc-muted); text-decoration: underline; margin: 0 8px; }

/* ============================ Rechtsseiten ============================== */
.zurueck {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 4px 0 14px;
    color: var(--sc-primary-dark);
    font-weight: 700;
    font-size: 14.5px;
    text-decoration: none;
}
.zurueck:hover { text-decoration: underline; }
.legal .card { padding: 24px; }
.legal h1 { font-size: 24px; margin-top: 0; }
.legal h2 { font-size: 17.5px; margin: 26px 0 8px; }
.legal p, .legal li { font-size: 14.5px; color: #334155; line-height: 1.65; }
.legal ul { padding-left: 20px; margin: 8px 0 14px; }
.legal .stand { color: var(--sc-muted); font-size: 13px; margin-top: 22px; }
.legal a { color: var(--sc-primary-dark); }

/* Groessere Screens: etwas mehr Luft */
@media (min-width: 480px) {
    h1 { font-size: 30px; }
    .erg-zahl { font-size: 60px; }
}
