/* parkplatzabzocke.de – helles, responsives Layout */

:root {
    --c-bg:        #ffffff;
    --c-bg-soft:   #f6f7f9;
    --c-text:      #1f2933;
    --c-text-soft: #52606d;
    --c-muted:     #7b8794;
    --c-line:      #d9dde2;
    --c-primary:   #314395;
    --c-primary-d: #25336f;
    --c-success:   #1b7f3a;
    --c-warn:      #b4751c;
    --c-warn-bg:   #fff9e0;
    --c-info-bg:   #eef0f8;
    --c-success-bg:#e7f5ec;
    --c-testimonial-bg: #f0f1f4;
    --radius:      6px;
    --shadow-sm:   0 1px 2px rgba(20,30,40,.06);
    --shadow-md:   0 2px 8px rgba(20,30,40,.08);
}

* { box-sizing: border-box; }

/* hidden Attribut auch dann respektieren, wenn ein Element-Style display setzt. */
[hidden] { display: none !important; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--c-bg);
    color: var(--c-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.55;
}

a { color: var(--c-primary); }
a:hover { color: var(--c-primary-d); }

.container {
    width: 100%;
    max-width: 880px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Header */
.site-header {
    background: #fff;
    border-bottom: 1px solid var(--c-line);
    padding: 12px 0;
}
.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}
.logo img {
    display: block;
    max-height: 50px;
    width: auto;
}
.main-nav a {
    color: var(--c-primary);
    text-decoration: none;
    margin-left: 16px;
    font-size: 15px;
}
.main-nav a:hover { color: var(--c-primary-d); text-decoration: underline; }

/* Hero */
.hero { padding: 28px 0 12px; }
.hero h1 {
    font-size: 28px;
    margin: 0 0 12px;
    line-height: 1.25;
    color: var(--c-primary);
}
.hero .lead { font-size: 18px; color: var(--c-text-soft); }

/* Disclaimer */
.disclaimer {
    background: var(--c-warn-bg);
    border: 1px solid #f0d98a;
    border-radius: var(--radius);
    padding: 14px 18px;
    margin: 18px 0 20px;
    font-size: 14px;
    line-height: 1.5;
}
.disclaimer h2 { margin: 0 0 10px; font-size: 19px; color: var(--c-text); line-height: 1.3; }
.disclaimer ul { margin: 6px 0 0; padding-left: 20px; }
.disclaimer li { margin-bottom: 4px; }

/* Rechtsinfo unter Disclaimer */
.rechtsinfo {
    background: var(--c-info-bg);
    border-left: 4px solid var(--c-primary);
    padding: 12px 16px;
    border-radius: 0 var(--radius) var(--radius) 0;
    margin: 0 0 22px;
    font-size: 15px;
}
.rechtsinfo p { margin: 0 0 6px; }
.rechtsinfo p:last-child { margin-bottom: 0; }

/* Testimonials */
.testimonials {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin: 22px 0 28px;
}
.testimonial {
    background: var(--c-testimonial-bg);
    border-radius: var(--radius);
    padding: 14px 16px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--c-text);
}
.testimonial-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.testimonial-head img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background: #fff;
}
.testimonial-name { font-weight: 600; color: var(--c-text); }

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 18px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    background: #e3e7ec;
    color: var(--c-text);
    font-size: 15px;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    transition: background .15s, border-color .15s;
}
.btn:hover { background: #d2d7dd; }
.btn-primary {
    background: var(--c-primary);
    color: #fff;
}
.btn-primary:hover { background: var(--c-primary-d); color: #fff; }
.btn-secondary {
    background: #fff;
    border-color: var(--c-line);
    color: var(--c-primary);
}
.btn-secondary:hover { background: var(--c-bg-soft); }
.btn-link {
    background: transparent;
    color: var(--c-primary);
    padding: 6px 0;
}
.btn-link:hover { text-decoration: underline; background: transparent; }
.btn-link.inline { padding: 0; font-size: inherit; }
.btn-large { padding: 16px 32px; font-size: 18px; font-weight: 600; }
.btn-xlarge { padding: 20px 44px; font-size: 20px; font-weight: 600; }

/* Steps */
.step {
    padding: 24px 0;
    border-top: 1px solid var(--c-line);
    margin-top: 24px;
}
.step:first-child { border-top: 0; margin-top: 0; }
.step h2 { margin-top: 0; color: var(--c-primary); }

/* Anbieter-Cards */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
    margin: 16px 0;
}
.card {
    background: #fff;
    border: 1px solid var(--c-line);
    border-radius: var(--radius);
    padding: 16px;
    text-align: left;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    font-family: inherit;
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
.card:hover {
    border-color: var(--c-primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}
.card h3 { margin: 0 0 8px; font-size: 16px; color: var(--c-primary); }
.muted { color: var(--c-muted); font-size: 14px; }
.small { font-size: 13px; }

/* Reason-Liste */
.reason-list { display: flex; flex-direction: column; gap: 10px; margin: 16px 0; }
.reason-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #fff;
    border: 1px solid var(--c-line);
    border-radius: var(--radius);
    padding: 14px 16px;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    font-size: 15px;
    color: var(--c-text);
    transition: border-color .15s, background .15s;
}
.reason-item:hover { border-color: var(--c-primary); background: var(--c-bg-soft); }
.reason-letter { font-weight: 700; color: var(--c-primary); flex-shrink: 0; }

/* Erfolgsaussicht-Sublabel pro Option */
.prospect {
    display: block;
    margin-top: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    width: fit-content;
    line-height: 1.4;
}
.prospect-good { background: #e7f5ec; color: #15692f; border: 1px solid #b9dcc5; }
.prospect-mid  { background: #fff5d6; color: #8a5d10; border: 1px solid #efd790; }
.prospect-low  { background: #fce0e0; color: #8a1f1f; border: 1px solid #e9b4b4; }

/* Callouts */
.callout {
    border-left: 4px solid var(--c-line);
    padding: 12px 16px;
    margin: 14px 0;
    background: var(--c-bg-soft);
    border-radius: 0 var(--radius) var(--radius) 0;
}
.callout p:first-child { margin-top: 0; }
.callout p:last-child  { margin-bottom: 0; }
.callout.warn    { border-color: var(--c-warn);    background: var(--c-warn-bg); }
.callout.info    { border-color: var(--c-primary); background: var(--c-info-bg); }
.callout.success { border-color: var(--c-success); background: var(--c-success-bg); }
.callout.danger  { border-color: #c33; background: #fdecec; color: #7a1f1f; }
.callout.danger strong { color: #7a1f1f; }

/* Form */
form fieldset {
    border: 1px solid var(--c-line);
    border-radius: var(--radius);
    padding: 16px 18px;
    margin: 18px 0;
}
form legend {
    padding: 0 8px;
    font-weight: 600;
    color: var(--c-text-soft);
}
form label {
    display: block;
    margin: 10px 0;
    font-size: 14px;
    color: var(--c-text-soft);
}
form label.checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--c-text);
    font-size: 15px;
}
form input[type=text],
form input[type=email],
form input[type=password],
form input[type=date],
form input[type=time],
form input[type=file],
form select {
    display: block;
    width: 100%;
    padding: 9px 11px;
    margin-top: 4px;
    font-size: 15px;
    color: var(--c-text);
    background: #fff;
    border: 1px solid var(--c-line);
    border-radius: var(--radius);
    font-family: inherit;
}
form input:focus, form select:focus {
    outline: none;
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px rgba(49,67,149,.15);
}
.row { display: flex; flex-wrap: wrap; gap: 12px; }
.row > label { flex: 1 1 100%; }
.col-3 { flex: 1 1 80px; max-width: 30%; }
.col-6 { flex: 1 1 200px; }
.col-9 { flex: 1 1 200px; }
.req { color: var(--c-warn); }
/* Kennzeichen - grafisch wie deutsches Auto-Kennzeichen */
.kfz-plate {
    display: inline-flex;
    align-items: stretch;
    border: 3px solid #000;
    border-radius: 8px;
    background: #fff;
    height: 58px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.18);
    margin: 4px 0 4px;
}
.kfz-plate .kfz-eu {
    background: #003399;
    width: 38px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0 6px;
    flex-shrink: 0;
}
.kfz-plate .kfz-stars {
    display: block;
    width: 26px;
    height: 26px;
}
.kfz-plate .kfz-d {
    color: #fff;
    font-weight: 800;
    font-size: 16px;
    line-height: 1;
    font-family: Arial, sans-serif;
}
.kfz-plate .kfz-input {
    border: 0;
    background: #ececec;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 30px;
    line-height: 1;
    padding: 0 4px;
    color: #000;
    text-align: center;
    height: 100%;
    margin: 0;
    box-shadow: none;
    font-family: "Arial Narrow", Arial, sans-serif;
    letter-spacing: 1px;
    border-radius: 0;
}
.kfz-plate .kfz-input:focus { outline: 0; background: #e0e0e0; }
.kfz-plate .kfz-stadt  { width: 82px; }
.kfz-plate .kfz-buchst { width: 60px; margin-left: 4px; }
.kfz-plate .kfz-rest   { width: 100px; margin-left: 4px; }
.kfz-plate .kfz-dash {
    font-weight: 800;
    font-size: 32px;
    line-height: 1;
    align-self: center;
    color: #000;
    padding: 0 2px;
}
@media (max-width: 480px) {
    .kfz-plate { height: 50px; }
    .kfz-plate .kfz-eu { width: 30px; }
    .kfz-plate .kfz-stars { width: 22px; height: 22px; }
    .kfz-plate .kfz-d { font-size: 13px; }
    .kfz-plate .kfz-input { font-size: 22px; }
    .kfz-plate .kfz-stadt  { width: 64px; }
    .kfz-plate .kfz-buchst { width: 50px; }
    .kfz-plate .kfz-rest   { width: 80px; }
    .kfz-plate .kfz-dash { font-size: 26px; }
}
.fahrer-entry {
    border: 1px dashed var(--c-line);
    border-radius: var(--radius);
    padding: 10px 12px;
    margin-bottom: 10px;
    background: #fcfcfd;
}
.form-actions { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* Signatur-Canvas */
.signature-block { margin: 10px 0; }
.signature-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}
.signature-tab {
    padding: 6px 14px;
    background: #fff;
    border: 1px solid var(--c-line);
    border-radius: var(--radius);
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    color: var(--c-text);
}
.signature-tab.active {
    background: var(--c-primary);
    color: #fff;
    border-color: var(--c-primary);
}
.signature-canvas {
    border: 1px dashed var(--c-line);
    border-radius: var(--radius);
    background: #fff;
    width: 100%;
    max-width: 480px;
    height: 180px;
    touch-action: none;
    cursor: crosshair;
    display: block;
}
.signature-controls { margin-top: 6px; display: flex; gap: 8px; align-items: center; }

/* Kosten-Aufstellung */
.kosten {
    background: var(--c-bg-soft);
    border: 1px solid var(--c-line);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin: 14px 0;
}
.kosten table { width: 100%; border-collapse: collapse; font-size: 14px; }
.kosten td { padding: 4px 0; }
.kosten td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.kosten tr.total td {
    border-top: 1px solid var(--c-line);
    padding-top: 8px;
    margin-top: 4px;
    font-weight: 700;
    font-size: 16px;
    color: var(--c-primary);
}

/* Letter (Druckansicht)
   - linker Rand 30 mm für angenehmen Lesefluss
   - Adressfenster (DIN 5008 Form B): Block sitzt bei 20 mm von links,
     45 mm von oben, 85 mm breit - absolut positioniert.
   - großzügiger Zeilenabstand
*/
.letter-wrap { background: #fff; margin: 20px 0; }
.letter {
    position: relative;
    background: #fff;
    border: 1px solid var(--c-line);
    border-radius: var(--radius);
    padding: 105mm 20mm 25mm 30mm;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 11pt;
    line-height: 1.65;
    color: #111;
    width: 210mm;
    min-height: 297mm;
    max-width: 100%;
    margin: 0 auto;
    box-shadow: 0 0 12px rgba(0,0,0,.07);
}
.letter .sender-mini {
    position: absolute;
    top: 45mm; left: 20mm;
    width: 85mm; height: 4mm;
    font-size: 8pt; line-height: 1.3;
    color: #555;
    border-bottom: .5pt solid #888;
    padding-bottom: 1mm;
}
.letter .receiver {
    position: absolute;
    top: 51mm; left: 20mm;
    width: 85mm; min-height: 32mm;
    white-space: pre-line;
    font-size: 11pt; line-height: 1.35;
}
.letter .meta {
    text-align: right;
    margin: 0 0 8mm 0;
    font-size: 11pt;
}
.letter .subject {
    font-weight: 700;
    margin: -3mm 0 6mm 0;
    font-size: 11pt;
    line-height: 1.45;
}
.letter p { margin: 0 0 4mm; }
.letter ol { margin: 3mm 0 3mm 6mm; padding: 0; }
.letter .signature-line {
    margin-top: 20mm;
    font-size: 11pt;
}
.letter .signature-img {
    max-height: 18mm;
    max-width: 60mm;
    display: block;
    margin-bottom: 2mm;
}

/* Kleine PDF-Vorschau (2 Seiten nebeneinander) */
.letter-preview {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 16px 0 8px;
    min-height: 60px;
}
.letter-preview-page {
    border: 1px solid var(--c-line);
    box-shadow: var(--shadow-md);
    background: #fff;
    max-width: 240px;
    width: 100%;
    height: auto;
    display: none;
}
.letter-preview-page.has-content { display: block; }
.letter-preview-loading {
    display: inline-block;
    color: var(--c-muted);
    font-size: 14px;
    padding: 20px;
}

/* Letter-Aktionen unter dem Brief */
.letter-actions {
    background: var(--c-bg-soft);
    border: 1px solid var(--c-line);
    border-radius: var(--radius);
    padding: 16px;
    margin: 18px 0;
}
.letter-actions h3 { margin: 0 0 12px; color: var(--c-primary); }
.letter-actions .btn { margin-right: 8px; margin-bottom: 8px; }

/* Passwort-Wrapper mit Toggle */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 38px; }
.pw-toggle {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: 0;
    cursor: pointer;
    padding: 6px;
    color: var(--c-muted);
    display: flex;
    align-items: center;
}
.pw-toggle:hover { color: var(--c-primary); }
.pw-toggle.on    { color: var(--c-primary); }

/* Login / Dashboard */
.auth-card {
    max-width: 420px;
    margin: 40px auto;
    background: #fff;
    border: 1px solid var(--c-line);
    border-radius: var(--radius);
    padding: 24px 26px;
    box-shadow: var(--shadow-sm);
}
.auth-card h1 { margin-top: 0; color: var(--c-primary); font-size: 22px; }
.dashboard-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.dashboard-item {
    background: #fff;
    border: 1px solid var(--c-line);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 10px;
}
.dashboard-item h3 { margin: 0 0 4px; font-size: 16px; color: var(--c-primary); }
.dashboard-item .item-meta { color: var(--c-muted); font-size: 13px; margin-bottom: 6px; }

/* Action-Buttons: nebeneinander auf Desktop, untereinander auf Mobile */
.dashboard-item .actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0 6px;
    align-items: center;
}
.dashboard-item .actions .inline-form { display: inline-block; margin: 0; }
.dashboard-item .actions .delete-link { color: #a02; }

/* Dezenter Text-Link für "Status aktualisieren" */
.text-link { color: var(--c-primary); text-decoration: underline; cursor: pointer; }
.text-link:hover { color: var(--c-primary-d); }

@media (max-width: 600px) {
    .dashboard-item .actions { flex-direction: column; align-items: stretch; }
    .dashboard-item .actions > *,
    .dashboard-item .actions .inline-form,
    .dashboard-item .actions .inline-form button { width: 100%; display: block; }
    .dashboard-item .actions .btn { text-align: center; }
}
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: #e3e7ec;
    color: var(--c-text-soft);
}
.badge.paid     { background: #e7f5ec; color: var(--c-success); }
.badge.sent     { background: var(--c-info-bg); color: var(--c-primary); }
.badge.draft    { background: #fff3d9; color: var(--c-warn); }

/* Statistik-Seite */
.stat-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin: 20px 0 28px;
}
.stat-kpi {
    background: #fff;
    border: 1px solid var(--c-line);
    border-radius: var(--radius);
    padding: 14px 16px;
    box-shadow: var(--shadow-sm);
}
.stat-kpi-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--c-primary);
    line-height: 1.2;
    margin-bottom: 2px;
}
.stat-kpi-label {
    font-size: 12px;
    color: var(--c-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
}
.stat-card {
    background: #fff;
    border: 1px solid var(--c-line);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: var(--shadow-sm);
}
.stat-card h3 { margin: 0 0 4px; color: var(--c-primary); font-size: 16px; }
.stat-card .muted { margin: 0 0 14px; }
.stat-card-wide { grid-column: 1 / -1; }
.stat-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.stat-table th, .stat-table td { padding: 6px 8px; text-align: left; border-bottom: 1px solid var(--c-line); }
.stat-table th { color: var(--c-text-soft); font-weight: 600; }
.stat-table tbody tr:last-child td { border-bottom: 0; }

/* Verbraucherzentrale-Tipp am Seitenende (Startseite) */
.vz-tip {
    text-align: center;
    margin: 36px auto 12px;
    color: #c8102e;
    font-size: 15px;
    line-height: 1.5;
}
.vz-tip a { color: #c8102e; text-decoration: underline; font-weight: 600; }
.vz-tip a:hover { color: #930b21; }

/* Footer */
.site-footer {
    background: var(--c-bg-soft);
    border-top: 1px solid var(--c-line);
    margin-top: 48px;
    padding: 18px 0 24px;
    text-align: center;
    font-size: 14px;
    color: var(--c-text-soft);
}
.site-footer a { color: var(--c-primary); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-note { font-size: 12px; color: var(--c-muted); margin-top: 8px; }
.desktop-break { display: inline; }
@media (max-width: 700px) {
    .desktop-break { display: none; }
}

/* Step-back */
.step-back { margin-top: 16px; }

/* Druck (für Browser-Druckdialog) */
@media print {
    body { background: #fff; }
    .site-header, .site-footer, .no-print, .step:not([data-step=result]) { display: none !important; }
    main.container { max-width: none; padding: 0; }
    .letter-wrap { margin: 0; }
    .letter {
        box-shadow: none;
        border: 0;
        padding: 20mm 20mm 20mm 25mm;
        width: auto;
        min-height: auto;
        font-size: 11pt;
    }
    .letter-actions, .kosten { display: none !important; }
    @page {
        size: A4 portrait;
        margin: 0;
    }
}

/* Mobile */
@media (max-width: 600px) {
    .hero h1 { font-size: 22px; }
    .hero .lead { font-size: 16px; }
    .letter {
        padding: 12mm 10mm;
        font-size: 10pt;
        width: 100%;
        min-height: auto;
    }
    .letter .receiver, .letter .sender-mini { width: 100%; }
    .main-nav { width: 100%; }
    .main-nav a { margin: 0 14px 0 0; }
    .col-3, .col-6, .col-9 { max-width: 100%; }
    .btn-xlarge { padding: 16px 28px; font-size: 18px; }
}
