/* ═══════════════════════════════════════════════════════════════════
   AutoKostenVergleich – site.css
   Schweizer Industriecharme: dunkel, präzise, lesbar
   ═══════════════════════════════════════════════════════════════════ */

:root {
    --bg:        #0d1117;
    --bg-card:   #161b22;
    --bg-card2:  #1c2330;
    --border:    rgba(255,255,255,0.08);
    --border-hl: rgba(255,255,255,0.18);
    --text:      #e2e8f0;
    --muted:     #8b95a8;
    --ev:        #00c9a7;
    --ev-light:  rgba(0,201,167,0.15);
    --ice:       #ff6b35;
    --ice-light: rgba(255,107,53,0.15);
    --gold:      #f4c430;
    --radius:    12px;
    --shadow:    0 4px 24px rgba(0,0,0,0.45);
    font-size:   16px;
}

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

html { width: 100%; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    width: 100%;
}

/* ─── HEADER ─────────────────────────────────────────────────────── */
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
    position: sticky; top: 0; z-index: 100;
}

.logo { display: flex; align-items: center; gap: .5rem; text-decoration: none; color: var(--text); font-family: 'Space Mono', monospace; font-size: 1.1rem; font-weight: 700; }
.logo-bolt { font-size: 1.4rem; }

.site-header nav a {
    color: var(--muted); text-decoration: none; font-size: .9rem;
    padding: .4rem .9rem; border: 1px solid var(--border); border-radius: 6px;
    transition: all .2s;
}
.site-header nav a:hover { color: var(--text); border-color: var(--border-hl); }

/* ─── FOOTER ─────────────────────────────────────────────────────── */
.site-footer {
    text-align: center; padding: 1.5rem; color: var(--muted); font-size: .78rem;
    border-top: 1px solid var(--border); margin-top: 4rem;
}

/* ─── HERO ───────────────────────────────────────────────────────── */
.hero { text-align: center; padding: 4rem 2rem 2.5rem; width: 100%; box-sizing: border-box; }
.hero-eyebrow { font-family: 'Space Mono', monospace; font-size: .75rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin-bottom: .75rem; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 700; line-height: 1.15; margin-bottom: 1rem; }
.hero h1 .vs { color: var(--muted); font-weight: 300; margin: 0 .4rem; }
.hero-sub { color: var(--muted); max-width: 560px; margin: 0 auto; }

/* result hero */
.hero-result { padding-top: 2.5rem; }
.winner-badge { display: inline-block; padding: .4rem 1.2rem; border-radius: 40px; font-size: clamp(1.4rem,3vw,2.2rem); }
.ev-winner { background: var(--ev-light); color: var(--ev); border: 1px solid var(--ev); }
.ice-winner { background: var(--ice-light); color: var(--ice); border: 1px solid var(--ice); }
.savings { color: var(--gold); }

/* ─── CARDS ──────────────────────────────────────────────────────── */
main { width: 100%; margin: 0; padding: 0 0 3rem; box-sizing: border-box; }

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    box-shadow: var(--shadow);
}
.card h2 { font-size: 1.05rem; font-weight: 600; margin-bottom: 1.4rem; display: flex; align-items: center; gap: .5rem; }

.card-badge { display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: .2rem .65rem; border-radius: 4px; margin-bottom: .75rem; }
.ev-badge { background: var(--ev-light); color: var(--ev); border: 1px solid var(--ev); }
.ice-badge { background: var(--ice-light); color: var(--ice); border: 1px solid var(--ice); }

.card-ev { border-left: 3px solid var(--ev); }
.card-ice { border-left: 3px solid var(--ice); }
.card-params { margin-top: 1.5rem; }
.card-prices { margin-top: 1.5rem; }
.card-prices summary { cursor: pointer; user-select: none; }
.card-prices summary h2 { display: inline; }
.card-prices[open] .params-grid { margin-top: 1.2rem; }

/* ─── FORM GRID ──────────────────────────────────────────────────── */
.compare-form {
    margin-top: 2rem;
    width: 80%;
    margin-left: auto;
    margin-right: auto;
    padding: 0 1.5rem;
    box-sizing: border-box;
}
@media (max-width: 900px) {
    .compare-form { width: 95%; }
}
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 700px) {
    .form-grid { grid-template-columns: 1fr; }
}

/* ─── FIELDS ─────────────────────────────────────────────────────── */
.field { margin-bottom: 1.2rem; }
.field label { display: block; font-size: .85rem; font-weight: 500; color: var(--muted); margin-bottom: .35rem; }
.field input[type="text"],
.field input[type="number"] {
    width: 100%; padding: .6rem .85rem;
    background: var(--bg-card2); border: 1px solid var(--border);
    border-radius: 8px; color: var(--text); font-size: .95rem;
    font-family: 'Space Mono', monospace;
    transition: border-color .2s;
}
.field input:focus { outline: none; border-color: var(--ev); }

.input-unit { display: flex; align-items: stretch; }
.input-unit input { border-radius: 8px 0 0 8px; flex: 1; }
.unit { background: var(--bg); border: 1px solid var(--border); border-left: none; border-radius: 0 8px 8px 0; padding: .6rem .75rem; color: var(--muted); font-size: .78rem; white-space: nowrap; display: flex; align-items: center; }

.hint { font-size: .75rem; color: var(--muted); margin-top: .25rem; display: block; }

/* ─── RADIO CARDS ────────────────────────────────────────────────── */
.radio-group { display: grid; grid-template-columns: repeat(3,1fr); gap: .6rem; }
.radio-group-2 { grid-template-columns: repeat(2,1fr); }

.radio-card { position: relative; cursor: pointer; }
.radio-card input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }
.radio-card > span.radio-icon { display: block; text-align: center; font-size: 1.4rem; margin-bottom: .2rem; }
.radio-card > span.radio-label { display: block; font-size: .78rem; line-height: 1.3; text-align: center; }
.radio-card {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: .75rem .5rem;
    background: var(--bg-card2); border: 1.5px solid var(--border);
    border-radius: 10px; transition: all .2s;
}
.radio-card:has(input:checked) { border-color: var(--ev); background: var(--ev-light); }
.radio-card:hover { border-color: var(--border-hl); }

/* ─── RANGE ──────────────────────────────────────────────────────── */
input[type="range"] {
    -webkit-appearance: none; width: 100%; height: 6px;
    background: var(--bg-card2); border-radius: 3px; outline: none; margin: .4rem 0;
    accent-color: var(--ev);
}
.range-labels { display: flex; justify-content: space-between; font-size: .7rem; color: var(--muted); }

/* ─── PARAMS GRID ────────────────────────────────────────────────── */
.params-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.params-grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 700px) {
    .params-grid-4 { grid-template-columns: 1fr 1fr; }
    .params-grid { grid-template-columns: 1fr; }
}

/* ─── SUBMIT ─────────────────────────────────────────────────────── */
.submit-row { text-align: center; margin-top: 2rem; }
.btn-calc {
    background: var(--ev); color: #000; border: none; padding: 1rem 3rem;
    font-size: 1.05rem; font-weight: 700; border-radius: 10px; cursor: pointer;
    font-family: 'DM Sans', sans-serif; transition: all .2s; letter-spacing: .02em;
}
.btn-calc:hover { background: #00e8c0; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,201,167,.3); }
.btn-icon { margin-right: .4rem; }

/* ─── RESULT – KPI ROW ───────────────────────────────────────────── */
.kpi-row {
    display: flex; align-items: stretch; gap: 1.5rem; margin: 1.5rem 0;
    flex-wrap: wrap;
}
.kpi {
    flex: 1; min-width: 220px; padding: 1.5rem 1.75rem;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); text-align: center;
}
.kpi-winner { border-color: var(--gold); background: rgba(244,196,48,.06); }
.kpi-label { font-size: .8rem; color: var(--muted); margin-bottom: .4rem; }
.kpi-value { font-family: 'Space Mono', monospace; font-size: 1.9rem; font-weight: 700; color: var(--text); }
.kpi-sub { font-size: .75rem; color: var(--muted); margin-top: .25rem; }
.kpi-divider { display: flex; align-items: center; font-size: 1.3rem; color: var(--muted); font-weight: 700; padding: 0 .25rem; }

/* ─── CHART ──────────────────────────────────────────────────────── */
.card-chart { margin-bottom: 1.5rem; }
#kostenChart { max-height: 380px; }

/* ─── DETAIL GRID ────────────────────────────────────────────────── */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 1.5rem; }
@media (max-width: 700px) { .detail-grid { grid-template-columns: 1fr; } }

.detail-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.detail-table td { padding: .55rem .25rem; border-bottom: 1px solid var(--border); }
.detail-table td:last-child { text-align: right; font-family: 'Space Mono', monospace; font-size: .82rem; }
.detail-table .highlight-row td { background: rgba(255,255,255,.03); font-weight: 600; }
.detail-table .total-row td { border-top: 2px solid var(--border-hl); padding-top: .75rem; font-size: 1rem; }

/* ─── BREAK-EVEN ─────────────────────────────────────────────────── */
.card-breakeven { margin-bottom: 1.5rem; }
.breakeven-info { display: flex; gap: 2rem; margin-bottom: 1rem; }
.be-item { text-align: center; }
.be-val { font-family: 'Space Mono', monospace; font-size: 1.8rem; font-weight: 700; color: var(--ev); }
.be-label { font-size: .78rem; color: var(--muted); }
.be-note { color: var(--muted); font-size: .9rem; }
.be-never { color: var(--ice); }

/* ─── YEAR TABLE ─────────────────────────────────────────────────── */
.table-scroll { overflow-x: auto; }
.year-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.year-table th, .year-table td { padding: .6rem .75rem; border-bottom: 1px solid var(--border); text-align: right; }
.year-table th:first-child, .year-table td:first-child { text-align: center; }
.year-table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.year-table tbody tr:hover { background: rgba(255,255,255,.03); }
.diff-ev { color: var(--ev); font-weight: 600; }
.diff-ice { color: var(--ice); font-weight: 600; }

/* ─── ACTION ROW ─────────────────────────────────────────────────── */
.result-actions { display: flex; gap: 1rem; justify-content: center; margin-top: 2rem; flex-wrap: wrap; }
.btn-back {
    padding: .75rem 1.75rem; border: 1px solid var(--border); border-radius: 8px;
    color: var(--text); text-decoration: none; font-size: .9rem; transition: all .2s;
}
.btn-back:hover { border-color: var(--border-hl); }
.btn-print {
    padding: .75rem 1.75rem; background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 8px; color: var(--text); font-size: .9rem; cursor: pointer; transition: all .2s;
    font-family: 'DM Sans', sans-serif;
}
.btn-print:hover { border-color: var(--border-hl); }

/* ─── PRINT ──────────────────────────────────────────────────────── */
@media print {
    .site-header, .site-footer, .result-actions, #kostenChart { display: none; }
    body { background: #fff; color: #000; }
    .card { border: 1px solid #ccc; }
}

/* ─── FAHRZEUG-PICKER ────────────────────────────────────────────── */
.picker-row { display: flex; gap: .6rem; align-items: stretch; }

.picker-select {
    flex: 1; padding: .6rem .85rem;
    background: var(--bg-card2); border: 1px solid var(--border);
    border-radius: 8px; color: var(--text); font-size: .88rem;
    font-family: 'DM Sans', sans-serif; cursor: pointer;
    transition: border-color .2s;
}
.picker-select:focus { outline: none; border-color: var(--ev); }
.picker-select option, .picker-select optgroup { background: #1c2330; color: var(--text); }

.btn-uebernehmen {
    padding: .6rem 1.1rem; background: transparent;
    border: 1px solid var(--ev); border-radius: 8px;
    color: var(--ev); font-size: .85rem; font-weight: 600;
    cursor: pointer; white-space: nowrap;
    font-family: 'DM Sans', sans-serif; transition: all .2s;
}
.btn-uebernehmen:hover { background: var(--ev-light); }

.db-quelle {
    display: none; margin-top: .4rem;
    font-size: .75rem; color: var(--muted);
    background: var(--bg-card2); border-radius: 6px;
    padding: .35rem .6rem; border-left: 2px solid var(--ev);
}

.divider {
    border: none; border-top: 1px solid var(--border);
    margin: 1.2rem 0;
}

/* ─── LÄNDER-SWITCHER ────────────────────────────────────────────── */
.land-switcher {
    display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
    width: 100%; padding: 0 2rem; margin-bottom: 1.25rem; box-sizing: border-box;
}
.land-label { font-size: .82rem; color: var(--muted); }
.land-btn {
    padding: .35rem 1rem; border: 1px solid var(--border);
    border-radius: 20px; color: var(--muted); text-decoration: none;
    font-size: .85rem; font-weight: 500; transition: all .2s;
}
.land-btn:hover { border-color: var(--border-hl); color: var(--text); }
.land-active {
    background: var(--ev-light); color: var(--ev) !important;
    border-color: var(--ev) !important; font-weight: 700;
}

/* ─── LÄNDER-DROPDOWN ────────────────────────────────────────────── */
.land-switcher {
    display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
    width: 80%; margin: 0 auto 1.25rem; padding: 0 1.5rem;
    box-sizing: border-box;
}
@media (max-width: 900px) {
    .land-switcher { width: 95%; }
}
.land-label { font-size: .85rem; color: var(--muted); font-weight: 500; white-space: nowrap; }
.land-select {
    padding: .45rem 2rem .45rem .85rem; background: var(--bg-card);
    border: 1px solid var(--border); border-radius: 8px; color: var(--text);
    font-size: .88rem; font-family: 'DM Sans', sans-serif; cursor: pointer;
    appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238b95a8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right .6rem center;
    min-width: 220px; transition: border-color .2s;
}
.land-select:focus { outline: none; border-color: var(--ev); }
.land-select option { background: #1c2330; color: var(--text); }
.land-quelle { font-size: .72rem; color: var(--muted); flex: 1; }

/* ─── KURS-HINWEIS ───────────────────────────────────────────────── */
.kurs-hinweis {
    font-size: .73rem; color: var(--muted);
    background: rgba(244,196,48,.06); border: 1px solid rgba(244,196,48,.3);
    border-radius: 6px; padding: .3rem .65rem; margin-top: .3rem;
}

/* ─── VERGLEICHSSEITEN ───────────────────────────────────────────── */
.winner-pill {
    display: inline-block; padding: .5rem 1.4rem; border-radius: 24px;
    font-size: .95rem; font-weight: 700; letter-spacing: .01em;
}
.ev-winner  { background: rgba(0,201,167,.15); border: 1px solid var(--ev); color: var(--ev); }
.ice-winner { background: rgba(255,107,53,.12); border: 1px solid var(--ice); color: var(--ice); }

.kpi-row    { display: flex; gap: 1rem; align-items: stretch; margin-bottom: 1.5rem; flex-wrap: wrap; }
.kpi-divider { display: flex; align-items: center; font-size: 1.2rem; color: var(--muted); font-weight: 300; flex-shrink: 0; }
.kpi-winner { border-color: var(--ev) !important; }

.card-badge { font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; margin-bottom: .6rem; }
.ev-badge   { color: var(--ev); }
.ice-badge  { color: var(--ice); }

.card-ev  { border-left: 3px solid var(--ev); }
.card-ice { border-left: 3px solid var(--ice); }

.detail-table { width: 100%; border-collapse: collapse; font-size: .87rem; }
.detail-table td { padding: .35rem 0; border-bottom: 1px solid rgba(255,255,255,.05); color: var(--muted); }
.detail-table td:last-child { text-align: right; color: var(--text); }
.detail-table th { padding: .35rem 0; text-align: left; font-weight: 700; }
.detail-table tr:last-child td { border-bottom: none; }
.detail-table .highlight-row td { color: var(--text); font-weight: 600; padding-top: .6rem; border-top: 1px solid var(--border); }
.total-row td { font-weight: 700; color: var(--text) !important; padding-top: .5rem; border-top: 1px solid var(--border) !important; }

.table-scroll { overflow-x: auto; }
.year-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.year-table th { padding: .5rem .75rem; background: rgba(255,255,255,.04); text-align: left; font-weight: 600; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
.year-table td { padding: .4rem .75rem; border-bottom: 1px solid rgba(255,255,255,.04); }
.year-table tbody tr:hover { background: rgba(255,255,255,.03); }
.diff-ev   { color: var(--ev); font-weight: 600; }
.diff-ice  { color: var(--ice); font-weight: 600; }

.breakeven-info { display: flex; gap: 2rem; flex-wrap: wrap; justify-content: center; }
.be-item { text-align: center; }
.be-val  { font-family: 'Space Mono', monospace; font-size: 1.6rem; font-weight: 700; color: var(--gold, #f4c430); }
.be-label { font-size: .78rem; color: var(--muted); margin-top: .2rem; }
.be-note { font-size: .85rem; color: var(--muted); line-height: 1.6; }
.be-never { color: var(--ev); }

/* ─── ERGEBNISSEITE 80% ─────────────────────────────────────────── */
.ergebnis-wrap {
    width: 80%;
    margin: 0 auto;
    box-sizing: border-box;
    padding: 0 1.5rem;
}
@media (max-width: 900px) {
    .ergebnis-wrap { width: 95%; padding: 0 1rem; }
}
