﻿/* =========================================================
   VERSION 3.0 - MASTERCODE UNIVERSAL (CSS)
   ========================================================= */

/* ---------------------------------------------------------
   01. ZENTRALE DESIGN-VARIABLEN (Farben & Schriften)
   Hier kannst du ganz einfach die Hauptfarben anpassen.
   --------------------------------------------------------- */
:root {
    --primary-color: #000099;       /* Hauptfarbe (Buttons, Überschriften) */
    --primary-hover: #0000cc;       /* Farbe beim Drüberfahren mit der Maus */
    --secondary-color: #1c4587;     /* Sekundärfarbe (Rahmen, Neben-Buttons) */
    --secondary-hover: #133061;     
    --accent-color: #dc2626;        /* Akzentfarbe (Rot für Fehler/Wichtiges) */
    --success-color: #059669;       /* Erfolgsfarbe (Grün für korrekt ausgefüllt) */
    --light-green: #22c55e;         /* Hellgrün für das Signatur-Häkchen */
    
    --bg-main: #f4f6f9;             /* Hintergrund des gesamten Rechners */
    --bg-light: #f0f5fa;            /* Leichte Hintergrundfarbe für Boxen */
    --bg-white: #ffffff;            /* Standard Weiß */
    
    --text-main: #333333;           /* Haupt-Textfarbe */
    --text-muted: #4a5568;          /* Abgeschwächte Textfarbe (z.B. für Infos) */
    --text-light: #718096;          /* Sehr helle Textfarbe (Platzhalter) */
    
    --border-color: #e2e8f0;        /* Standard-Rahmenfarbe */
    --border-dark: #cbd5e1;         /* Dunklere Rahmenfarbe */

    --font-primary: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --text-size-base: 16px;         
    --text-size-h2: clamp(16px, 4vw, 32px); 
    --text-size-h3: 1.25em;         
    --text-size-label: 15px;        
    --text-size-small: 0.85em;      
}

/* Verhindert seitliches Wischen (Zurückblättern) auf Handys */
html, body { overscroll-behavior-x: none; }

/* ---------------------------------------------------------
   02. HAUPT-CONTAINER
   --------------------------------------------------------- */
.calc-wrapper {
    font-family: var(--font-primary); font-size: var(--text-size-base);
    color: var(--text-main); background-color: var(--bg-main); 
    /* FIX: Abstände oben um 20px und unten um 10px verringert */
    padding: 0px 20px 10px 20px; 
    border-radius: 12px;
    max-width: 1000px; margin: 0 auto; position: relative; box-sizing: border-box;
}
.calc-wrapper * { box-sizing: border-box; } 
.calc-wrapper h2 { font-size: var(--text-size-h2); color: var(--primary-color); margin-top: 0; margin-bottom: 0px; }
.calc-wrapper h3 { font-size: var(--text-size-h3); color: var(--primary-color); border-bottom: 1px solid var(--primary-color); padding-bottom: 8px; margin-top: 30px; margin-bottom: 20px; text-align: left; font-weight: 600; }
.calc-wrapper label { display: block; text-align: left; margin-bottom: 8px; font-weight: 600; color: var(--text-muted); font-size: var(--text-size-label); }

/* Fokus-Modus (Rechner als Vollbild ohne Ablenkung) */
.calc-wrapper.isolated-mode {
    position: fixed !important;
    top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
    width: 100vw !important; height: 100vh !important;
    z-index: 2147483640 !important; 
    background-color: var(--bg-main) !important;
    overflow-y: auto !important;
    padding: 20px !important; margin: 0 !important; border-radius: 0 !important; box-sizing: border-box !important;
}

/* ---------------------------------------------------------
   03. WEISSE BOXEN (Sektionen)
   --------------------------------------------------------- */
.calculator-section, .form-section-bottom {
    max-width: 800px; margin: 0 auto 30px auto; padding: 25px; background-color: var(--bg-white);
    border-radius: 12px; box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}
.calculator-section { border-top: 5px solid var(--primary-color); position: relative; z-index: 1; }
.form-section-bottom { border-bottom: 5px solid var(--primary-color); padding: 25px; touch-action: pan-y; position: relative; z-index: 2; }

/* Graue Rahmenboxen für die Formular-Schritte */
.section-box {
    background: linear-gradient(180deg, var(--bg-light) 0%, var(--bg-white) 25%); border: 1px solid var(--border-color);
    border-radius: 12px; padding: 25px; margin-bottom: 30px; box-shadow: 0 4px 12px rgba(0,0,153,0.04);
}
.section-box h3 { font-size: var(--text-size-h3); color: var(--primary-color); border-bottom: 1px solid var(--primary-color); padding-bottom: 8px; margin-top: 5px; margin-bottom: 20px; text-align: left; font-weight: 600; border-top: none; }

/* ---------------------------------------------------------
   04. AKKORDEONS (Ausklappbare Textboxen)
   --------------------------------------------------------- */
.calc-wrapper summary {
    cursor: pointer; padding: 15px 20px; list-style: none; display: flex; justify-content: space-between; align-items: center;
    background: linear-gradient(135deg, var(--bg-light) 0%, var(--bg-white) 100%); border-radius: 8px; margin: -5px -5px 25px -5px; box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}
.calc-wrapper summary::-webkit-details-marker { display: none; } 

/* Einheitliches Pfeil-System für Haupt-Akkordeon */
#form-details > summary::after { 
    content: '▼'; 
    color: var(--primary-color); 
    border: 2px solid var(--primary-color); 
    border-radius: 50%;
    width: 24px; height: 24px; 
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.9em; font-weight: bold; 
}
#form-details[open] > summary::after { 
    content: '▲'; 
    color: var(--success-color); 
    border-color: var(--success-color); 
}

/* ---------------------------------------------------------
   05. SCHALTER-LEISTE (Gesamt, Zahlweise, Empfehlung)
   --------------------------------------------------------- */
.mode-selector {
    display: flex; justify-content: center; align-items: stretch; gap: 15px;
    margin: 30px -25px 25px -25px; padding: 15px 25px; background-color: #f1f5f9; border-top: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color);
}
.mode-option {
    padding: 10px 20px; cursor: pointer; transition: all 0.3s ease; font-weight: 700; color: var(--text-muted); background: var(--bg-white);
    display: flex; justify-content: center; align-items: center; text-align: center;
    position: relative; font-size: 1.05em; border-radius: 8px; border: 1px solid var(--border-dark); box-shadow: 0 2px 4px rgba(0,0,0,0.05); flex: 1; max-width: 220px; margin: 0;
}
select.mode-option { appearance: none; -webkit-appearance: none; outline: none; text-align-last: center; font-family: var(--font-primary); }
.mode-option input { display: none; } 
.mode-option span { display: inline-flex; align-items: center; justify-content: center; width: 100%; height: 100%; margin: 0; padding: 0; line-height: 1; text-align: center; }
.mode-option:hover { color: var(--secondary-color); border-color: #94a3b8; }
.mode-option:has(input:checked) { background-color: var(--secondary-color); color: var(--bg-white); border-color: var(--secondary-color); box-shadow: 0 4px 10px rgba(28,69,135,0.2); }

/* ---------------------------------------------------------
   06. SCHIEBEREGLER (Anzahl Dienste)
   --------------------------------------------------------- */
input[type=range] { -webkit-appearance: none; width: 100%; background: transparent; margin: 8px 0; touch-action: manipulation; }
input[type=range]::-webkit-slider-thumb { 
    -webkit-appearance: none; height: 26px; width: 26px; border-radius: 50%; background: var(--primary-color); cursor: pointer; margin-top: -10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25); transition: transform 0.1s; 
}
input[type=range]::-webkit-slider-thumb:active { transform: scale(1.15); }
input[type=range]::-webkit-slider-runnable-track { width: 100%; height: 6px; cursor: pointer; background: var(--border-dark); border-radius: 3px; }
.slider-labels { display: flex; justify-content: space-between; font-size: 0.75em; color: #94a3b8; font-weight: 600; }

/* ---------------------------------------------------------
   07. RASTER FÜR FELDER (Zwei- oder Vierspaltig)
   --------------------------------------------------------- */
.row-3, .row-2, .row-4 { display: flex; flex-wrap: wrap; gap: 15px; margin-bottom: 15px; }
.row-3 > div { flex: 1; min-width: 200px; display: flex; flex-direction: column; justify-content: flex-end; }
.row-2 > div { flex: 1 1 calc(50% - 15px); min-width: 250px; display: flex; flex-direction: column; justify-content: flex-end; }
.row-4 > div { flex: 1 1 calc(25% - 15px); min-width: 150px; display: flex; flex-direction: column; justify-content: flex-end; }

/* ---------------------------------------------------------
   08. FLOATING LABELS (Text rutscht nach oben beim Ausfüllen)
   --------------------------------------------------------- */
.float-wrap { position: relative; display: flex; flex-direction: column; justify-content: flex-end; width: 100%; }
.float-wrap input, .float-wrap select, .float-wrap textarea {
    padding: 24px 16px 8px 16px !important; border: 1px solid var(--border-color); border-radius: 8px; font-size: var(--text-size-base) !important; outline: none; background-color: var(--bg-white);
    width: 100%; transition: border-color 0.3s, box-shadow 0.3s; font-family: var(--font-primary); font-weight: 500; color: var(--text-main);
}
.float-wrap select {
    padding-top: 26px !important; padding-bottom: 6px !important;
    appearance: none; -webkit-appearance: none; 
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%231c4587%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpolyline%20points%3D%226%209%2012%2015%2018%209%22%3E%3C%2Fpolyline%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat; background-position: right 16px center; background-size: 16px; padding-right: 40px !important;
}

.float-wrap input:focus, .float-wrap select:focus, .float-wrap textarea:focus { border-color: var(--primary-color) !important; box-shadow: 0 0 0 3px rgba(0,0,153,0.1); }
.float-wrap input.is-valid, .float-wrap select.is-valid, .float-wrap textarea.is-valid { border-color: var(--success-color) !important; }
.float-wrap input[readonly], .float-wrap select[readonly] { background-color: #f8fafc !important; border: 1px solid var(--success-color) !important; cursor: not-allowed; color: var(--primary-color) !important; }

.float-wrap label {
    position: absolute; top: 18px; left: 16px; font-size: var(--text-size-label); color: var(--text-light); font-weight: 500; transition: all 0.2s ease; pointer-events: none; margin: 0; z-index: 1; text-align: left; max-width: 90%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.float-wrap input:focus ~ label, .float-wrap input:not(:placeholder-shown) ~ label, .float-wrap input.filled ~ label,
.float-wrap select:focus ~ label, .float-wrap select.filled ~ label,
.float-wrap textarea:focus ~ label, .float-wrap textarea:not(:placeholder-shown) ~ label, .float-wrap textarea.filled ~ label {
    top: 6px; font-size: 11px; color: var(--primary-color); font-weight: 700;
}

#label_abschluss_beitrag { color: var(--success-color) !important; font-weight: bold !important; }
.float-wrap input#abschluss_beitrag:focus ~ label#label_abschluss_beitrag, 
.float-wrap input#abschluss_beitrag.filled ~ label#label_abschluss_beitrag,
.float-wrap input#abschluss_beitrag:not(:placeholder-shown) ~ label#label_abschluss_beitrag { color: var(--success-color) !important; }

.float-wrap input.is-valid ~ label, .float-wrap select.is-valid ~ label { color: var(--success-color); }
.req-star { color: var(--accent-color); font-size: 1.2em; vertical-align: middle; margin-left: 4px; font-weight: bold; }

/* Markiert Pflichtfelder gelblich, wenn sie noch leer sind */
.float-wrap input[required]:not(.filled):not(:focus), .float-wrap select[required]:not(.filled):not(:focus), .float-wrap textarea[required]:not(.filled):not(:focus) { background-color: #fffff1 !important; border: 1px solid var(--primary-color) !important; }
.float-wrap select:not([required]) { background-color: #f0fdf4 !important; border-color: #bbf7d0 !important; }
.calc-wrapper .iban-error { border-color: var(--accent-color) !important; background-color: #fff5f5 !important; }

/* Sonderfeld: Initiale Risiko-Auswahl (Zentriert) */
#calc-risiko { padding: 24px 16px 8px 16px !important; font-size: 18px !important; font-weight: 600; text-align: center; border: 1px solid var(--border-color); border-radius: 8px; width: 100%; outline: none; transition: border-color 0.3s; cursor: pointer; background-color: var(--bg-white);}
#calc-risiko.is-valid { border-color: var(--success-color) !important; }

/* ---------------------------------------------------------
   09. SONSTIGE BUTTONS & ELEMENTE
   --------------------------------------------------------- */
/* FIX: Vollbild-Button (Abstände exakt 20px, Padding -5px, grüne Hover Schrift) */
#focus-restore-container-top, #focus-restore-container { margin: 20px 0; text-align: center; }
.focus-toggle-btn {
    border-radius: 30px; border: 1px solid var(--success-color); padding: 5px 20px; display: inline-flex; align-items: center; gap: 8px; color: var(--primary-color);
    background: var(--bg-white); transition: all 0.3s; cursor: pointer; font-size: var(--text-size-label); font-weight: 600; box-shadow: 0 2px 5px rgba(0,0,0,0.05); font-family: var(--font-primary);
}
.focus-toggle-btn:hover, .focus-toggle-btn:focus-visible { 
    background-color: var(--bg-white); color: var(--success-color); outline: none; 
}

#dynamic-tarif-overview { position: sticky; top: 15px; z-index: 99; background: var(--bg-white); padding-top: 5px; }
.selected-tarif-box {
    border: 1px solid var(--border-color); border-radius: 12px; padding: 12px 16px; display: flex; justify-content: space-between; background: var(--bg-white); align-items: center; margin-bottom: 10px; box-shadow: 0 4px 10px rgba(0,0,0,0.05); transition: all 0.3s ease;
}
.selected-tarif-box.theme-antrag { background-color: #E2F3F1; border-color: #3b82f6; box-shadow: 0 4px 12px rgba(59,130,246,0.15); }
.selected-tarif-box.theme-angebot { background-color: #eff6ff; border-color: #3b82f6; box-shadow: 0 4px 12px rgba(59,130,246,0.15); }
.selected-tarif-box.theme-antrag #overview-provider { color: #1d4ed8 !important; }
.selected-tarif-box.theme-angebot #overview-provider { color: #1d4ed8 !important; }
#overview-price { color: var(--primary-color) !important; }

/* Unter-Akkordeons für Highlights & Empfehlungen */
.overview-accordion summary {
    background: var(--bg-white); border: 1px solid var(--border-dark); border-radius: 8px; padding: 14px 20px; font-weight: 600; color: var(--secondary-color); display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; box-shadow: 0 2px 4px rgba(0,0,0,0.02); cursor: pointer; position: relative; z-index: 2; list-style: none;
}
.overview-accordion summary:focus-visible { outline: 2px solid var(--primary-color); }
.overview-accordion summary span { font-size: 18px; }

/* Pfeile (Geschlossen = Blau, Offen = Grün) */
.overview-accordion summary::after { 
    content: '▼'; color: var(--primary-color); font-size: 0.9em; font-weight: bold; 
}
.overview-accordion[open] summary::after { 
    content: '▲'; color: var(--success-color); 
}
.overview-accordion[open] summary { border-radius: 8px 8px 0 0; margin-bottom: 0; border-bottom: 1px solid var(--border-color); }
.overview-accordion .acc-content { padding: 18px; background: var(--bg-white); border: 1px solid var(--border-dark); border-top: none; border-radius: 0 0 8px 8px; margin-bottom: 10px; color: var(--text-muted); line-height: 1.5; animation: fadeIn 0.3s ease; }

.inline-radio-group { display: flex; gap: 20px; align-items: center; height: 53px; padding: 0 16px; background-color: var(--bg-white); border-radius: 8px; border: 1px solid var(--secondary-color); }
.inline-radio-label { margin: 0; cursor: pointer; display: flex; align-items: center; gap: 8px; font-weight: normal; }
.inline-radio-label input { width: auto; transform: scale(1.2); margin: 0; cursor: pointer; }
.mitteilung-wrapper { margin: 20px 0 15px 0; }
.calc-wrapper textarea.text-left { text-align: left; }

/* Legal-Boxen für Widerruf & Datenschutz in Schritt 5 */
.legal-box { 
    border: 0.4px solid var(--border-color); 
    border-radius: 8px; 
    padding: 16px; 
    background: var(--bg-white); 
    transition: all 0.3s ease; 
    display: flex; 
    flex-direction: column; 
    justify-content: flex-start; 
    flex: 1; 
}
.legal-box.is-valid-box { border-color: var(--success-color); background-color: #f0fdf4; }
.legal-text { font-size: 14px !important; font-weight: 500 !important; line-height: 1.5 !important; text-align: left; }
.legal-box-title { font-size: 18px !important; text-transform: uppercase; font-weight: bold; color: var(--text-main); }
.legal-box-content { display: none; margin-top: 10px; margin-left: 34px; font-size: 14px; font-weight: 500; color: var(--text-muted); line-height: 1.5; text-align: left; }
.legal-box:has(input[type="checkbox"]:checked) .legal-box-content { display: block; animation: fadeIn 0.3s ease; }
/* Link Design #000099 hellgrau hinterlegt */
.legal-link { color: #000099 !important; text-decoration: none !important; background-color: #e2e8f0; padding: 2px 6px; border-radius: 4px; font-weight: 600; }

.risiko-details-box {
    background: #f8fafc; padding: 22px; border: 1px solid #94a3b8; border-radius: 10px; margin-bottom: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.02); border-left: 4px solid var(--secondary-color); transition: all 0.3s ease;
}
.risiko-details-box.is-valid-section { border-color: var(--success-color); border-left-color: var(--success-color); background-color: #f0fdf4; }

.radio-group-boxed { display: flex; flex-direction: row; gap: 15px; margin-bottom: 30px; }
.radio-label-boxed { flex: 1; display: flex; flex-direction: column; padding: 18px 20px; border: 1px solid #e0e6ed; border-radius: 10px; cursor: pointer; transition: all 0.2s ease; text-align: left; }
.radio-label-boxed:focus-within { outline: 2px solid var(--primary-color); }
.radio-label-boxed.box-angebot { background-color: #f8fafc; border-color: var(--border-color); }
.box-angebot:has(input[type="radio"]:checked) { background-color: #eff6ff; border-color: #3b82f6; box-shadow: 0 4px 12px rgba(59,130,246,0.15); }
.box-angebot:has(input[type="radio"]:checked) .radio-title { color: #1d4ed8; }
.radio-label-boxed.box-antrag { background-color: #f4fbf7; border-color: #B7E1CD; }
.box-antrag:has(input[type="radio"]:checked) { background-color: #E2F3F1; border-color: #3b82f6; box-shadow: 0 4px 12px rgba(59,130,246,0.15); }
.box-antrag:has(input[type="radio"]:checked) .radio-title { color: #1d4ed8; }
.radio-header { display: flex; align-items: center; width: 100%; }
.radio-header input { margin-right: 15px; transform: scale(1.4); cursor: pointer; }
.radio-title { font-weight: bold; font-size: clamp(14px, 2vw, 17px); color: var(--text-main); letter-spacing: -0.2px; white-space: normal; }
.radio-desc { font-size: 0.95em; color: #555; margin-left: 33px; margin-top: 5px; line-height: 1.4; text-align: left; }

/* Ein einzelner Tarif in der Ergebnisliste */
.result-item { display: flex; flex-direction: column; padding: 12px; border-bottom: 1px solid #eee; background-color: var(--bg-white); transition: background-color 0.2s; }
.result-item:hover { background-color: #f8fafc !important; }
.result-main-row { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.result-left { display: flex; align-items: center; gap: 10px; flex: 1; text-align: left; overflow: hidden; }
.result-left label { font-size: 19px; color: #2d3748; cursor: pointer; margin: 0; display: flex; align-items: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result-right-box { display: flex; align-items: center; gap: 15px; }
.result-price { font-size: 19px; color: var(--primary-color); min-width: 90px; text-align: right; }
.result-radio { transform: scale(1.6); margin-right: 15px; cursor: pointer; flex-shrink: 0; }
.suffix-text { color: var(--secondary-color); font-weight: 400; font-size: var(--text-size-small); white-space: nowrap; margin-left: 6px; }

/* Vertical Bar wird per JavaScript mit den Farben versorgt */
.vertical-bar { width: 4px; height: 24px; border-radius: 2px; margin-right: 12px; }

/* TIPP oder Empfehlungs-Badge neben dem Tarifnamen (nur Desktop) */
.result-badge {
    background-color: var(--accent-color); color: var(--bg-white); font-size: 0.7em; font-weight: bold;
    padding: 3px 8px; border-radius: 12px; margin-left: 12px; text-transform: uppercase;
    letter-spacing: 0.5px; vertical-align: middle; position: relative; top: -1px; pointer-events: none;
}

/* Info-Trigger ("i" Symbol) für den rechten Slider */
.info-trigger { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; color: var(--text-light); transition: color 0.2s; flex-shrink: 0; padding: 8px; margin: -8px; position: relative; z-index: 5; }
.info-trigger:hover, .info-trigger:focus-visible { color: var(--primary-color); outline: none; }
.info-icon { font-size: 22px; font-weight: bold; }

/* Kleine Tooltips bei den Info-Icons */
.h-badge, .i-badge { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; color: var(--bg-white); border-radius: 50%; font-size: 12px; font-weight: bold; margin-left: 6px; position: relative; vertical-align: middle; flex-shrink: 0; }
.h-badge { background-color: var(--success-color); }
.i-badge { background-color: #3b82f6; font-style: normal; font-family: inherit; cursor: help; }
.i-badge:hover::after, .i-badge:active::after, .i-badge:focus::after { content: attr(data-tooltip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background-color: #1e293b; color: var(--bg-white); padding: 8px 12px; border-radius: 6px; font-size: 13px; font-weight: normal; white-space: normal; width: max-content; max-width: 250px; text-align: left; z-index: 100000; box-shadow: 0 4px 10px rgba(0,0,0,0.15); line-height: 1.4; }
.i-badge:hover::before, .i-badge:active::before, .i-badge:focus::before { content: ''; position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); border-width: 6px; border-style: solid; border-color: #1e293b transparent transparent transparent; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }

/* ---------------------------------------------------------
   10. RECHTER SLIDER (Infos zu den Versicherern)
   --------------------------------------------------------- */
#sliderOverlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.6); display: none; z-index: 2147483646 !important; backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
.slider-box { position: fixed; top: 0; right: -100%; width: 100%; max-width: 500px; height: 100%; background: #fffdfa; box-shadow: -10px 0 30px rgba(0,0,0,0.15); transition: right 0.35s cubic-bezier(0.25, 0.8, 0.25, 1); z-index: 2147483647 !important; display: flex; flex-direction: column; border-radius: 20px 0 0 20px; box-sizing: border-box; border-left: 3px solid var(--primary-color); font-family: var(--font-primary); }
.slider-box * { box-sizing: border-box; font-family: var(--font-primary); }
.slider-box.active { right: 0 !important; } 

.slider-header { padding: 12px 20px; background: #fffdfa; border-bottom: 1px solid #eaeaea; display: flex; justify-content: flex-start; gap: 15px; align-items: center; border-radius: 20px 0 0 0; position: sticky; top: 0; z-index: 10; }
.slider-header button { border: none; background: none; font-size: 35px !important; cursor: pointer; color: var(--primary-color) !important; padding: 0; line-height: 1; transition: color 0.2s; margin-right: 5px; }
.slider-header button:hover { color: var(--primary-hover) !important; }
.slider-header h3 { margin: 0; color: var(--secondary-color); font-size: 20px; border: none; padding: 0; }

.slider-body { padding: 30px; overflow-y: auto; flex-grow: 1; background: #fffdfa; text-align: left; }
.modern-list { list-style: none; padding-left: 0; margin-bottom: 30px; }
.modern-list li { position: relative; padding-left: 30px; margin-bottom: 15px; color: var(--text-muted); line-height: 1.5; }
.modern-list li::before { content: '✓'; position: absolute; left: 0; top: 0; color: #006666; font-weight: bold; font-size: 18px; }

/* ---------------------------------------------------------
   11. NAVIGATION & FORTSCHRITTS-BALKEN
   --------------------------------------------------------- */
/* Absenden-Button ganz unten (inkl. Shine-Animation zur Conversion-Steigerung) */
.btn-submit { 
    padding: 16px 30px; font-weight: bold; border: none; border-radius: 8px; cursor: pointer; width: 100%; font-size: 17px; transition: all 0.2s; font-family: var(--font-primary); 
    position: relative; overflow: hidden; margin-top: 15px;
}
.btn-submit::after {
    content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0) 100%);
    transform: rotate(30deg); animation: buttonShine 4s cubic-bezier(0.19, 1, 0.22, 1) infinite;
}
@keyframes buttonShine { 0% { left: -100%; } 20% { left: 100%; } 100% { left: 100%; } }

.btn-antrag { background-color: var(--secondary-color); color: var(--bg-white); }
.btn-antrag:hover, .btn-antrag:focus-visible { background-color: var(--secondary-hover); outline:none;}
.btn-angebot { background-color: #006666; color: var(--bg-white); }
.btn-angebot:hover, .btn-angebot:focus-visible { background-color: #004c4c; outline:none; }

/* FIX: "Direkt Antrag" Switch Button - Gleiche Optik wie Antrag-Button */
#btn-switch-to-antrag { background-color: var(--secondary-color) !important; color: var(--bg-white) !important; margin-left: auto; }
#btn-switch-to-antrag:hover { background-color: var(--secondary-hover) !important; }

/* Digitale Unterschrift Box */
.signature-wrapper { position: relative; width: 100%; }
.signature-container { border: 1px dashed var(--border-dark); background: #f8fafc; border-radius: 12px; margin-top: 5px; overflow: hidden; margin-bottom: 10px; box-shadow: inset 0 2px 6px rgba(0,0,0,0.05); transition: all 0.3s; position: relative; }
/* FIX: Rand dicker und grün bei Unterschrift */
.signature-container.is-signed { border: 2px solid var(--success-color) !important; background-color: #f0fdf4; }
canvas { width: 100%; height: 200px; display: block; touch-action: none; cursor: crosshair; background-color: transparent; }
/* FIX: Hellgrüner Kreis mit weißem Okay Häkchen */
#signature-check { display:none; position:absolute; top:10px; right:12px; background:var(--light-green); color:white; width: 24px; height: 24px; border-radius: 50%; text-align: center; line-height: 24px; font-weight:bold; }

/* Fortschrittsbalken oben (1. Auswahl, 2. Vertrag ...) */
.form-progress { display: flex; justify-content: space-between; margin-bottom: 35px; margin-top: 0px; position: relative; padding: 0 10px; }
.form-progress::before { content: ''; position: absolute; top: 50%; left: 0; width: 100%; height: 4px; background-color: var(--border-color); z-index: 1; transform: translateY(-50%); border-radius: 2px; }
.progress-step { background-color: var(--bg-white); border: 2px solid var(--border-color); color: #94a3b8; font-weight: 600; padding: 8px 16px; border-radius: 20px; z-index: 2; font-size: 14px; transition: all 0.3s; cursor: pointer; outline: none; }
.progress-step:focus-visible { border-color: var(--primary-color); }
.progress-step.active { border-color: var(--primary-color); color: var(--primary-color); background-color: #eef5ff; box-shadow: 0 0 0 4px rgba(0,0,153,0.1); }
.progress-step.completed { background-color: var(--primary-color); color: var(--bg-white); border-color: var(--primary-color); }

/* Versteckt Formular-Sektionen, die gerade nicht dran sind */
.form-step { display: none; animation: fadeIn 0.4s ease; }
.form-step.active { display: block; }

/* Buttons um vor- und zurückzublättern */
.step-nav { display: flex; justify-content: space-between; margin-top: 25px; padding-top: 20px; border-top: 1px solid var(--border-color); align-items: center; }
.step-nav.right-only { justify-content: flex-end; border-top: none; padding-top: 0; }
.btn-nav { padding: 14px 28px; font-weight: bold; border-radius: 8px; cursor: pointer; border: none; font-size: 16px; transition: all 0.2s; outline: none; font-family: var(--font-primary); }
.btn-prev { background-color: #f1f5f9; color: var(--text-muted); border: 1px solid var(--border-dark); }
.btn-prev:hover, .btn-prev:focus-visible { background-color: var(--border-color); }
.btn-next { background-color: var(--secondary-color); color: var(--bg-white); }
.btn-next:hover, .btn-next:focus-visible { background-color: var(--secondary-hover); box-shadow: 0 4px 12px rgba(28,69,135,0.2); }

/* ---------------------------------------------------------
   14. EXTRAS (Toasts, Zusammenfassung, E-Mail-Prüfung, FAQ)
   --------------------------------------------------------- */
/* Kleines Popup unten rechts: "Gespeichert" */
#autosave-badge {
    position: fixed; bottom: 20px; right: 20px; background: rgba(28,69,135,0.9); color: white; padding: 6px 14px; border-radius: 20px; font-size: 13px; font-weight: 500; opacity: 0; transition: opacity 0.4s ease; z-index: 9999; box-shadow: 0 4px 10px rgba(0,0,0,0.15); pointer-events: none;
}

#welcome-toast {
    position: fixed; bottom: -100px; left: 50%; transform: translateX(-50%); background: var(--success-color); color: var(--bg-white); padding: 12px 24px; border-radius: 30px; font-weight: 600; box-shadow: 0 4px 15px rgba(0,0,0,0.2); transition: bottom 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275); z-index: 9999; display: flex; align-items: center; gap: 8px; white-space: nowrap; font-family: var(--font-primary);
}

.checkout-summary { background: #f8fafc; border: 1px solid var(--border-dark); border-radius: 10px; padding: 20px; margin-bottom: 25px; border-left: 5px solid var(--success-color); }
.summary-item { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed #e2e8f0; font-size: 0.95em; }
.summary-item:last-child { border-bottom: none; font-weight: bold; color: var(--primary-color); font-size: 1.1em; }

.social-proof-badge { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 0.9em; color: var(--text-muted); font-weight: 500; }
.success-text-line { display: block; margin-bottom: 8px; }

/* Die 3 Trust-Elemente unter dem Button */
.trust-elements { 
    display: flex; justify-content: center; gap: 20px; margin-top: 25px; margin-bottom: 25px; font-size: 0.9em; 
    color: var(--text-main); font-weight: 500; flex-wrap: wrap; text-align: center; 
}
.trust-elements span { display: inline-flex; align-items: center; gap: 5px; color: var(--text-muted) !important; }

/* E-Mail Tippfehler Erkennung */
.email-suggestion { display:none; color: var(--secondary-color); font-size: 13px; font-weight: 600; margin-top: 5px; cursor: pointer; text-align:left; background: #eef5ff; padding: 6px 10px; border-radius: 6px; border: 1px solid #bfdbfe; transition: background 0.2s; }
.email-suggestion span { text-decoration: underline; }
.email-suggestion:hover { background: #dbeafe; }

/* FIX: Timeline in der Erfolgsmeldung rechts eingerückt */
.success-timeline { margin-top: 25px; text-align: left; background: #f8fafc; border: 1px solid var(--border-color); border-radius: 8px; padding: 25px 20px 25px 50px; }
.timeline-step { display: flex; align-items: flex-start; gap: 15px; margin-bottom: 15px; }
.timeline-step:last-child { margin-bottom: 0; }
.timeline-icon { background: var(--success-color); color: white; width: 24px; height: 24px; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 14px; flex-shrink: 0; margin-top: 2px; }
.timeline-content strong { color: var(--secondary-color); display: block; margin-bottom: 2px; font-size: 15px; }
.timeline-content span { color: var(--text-muted); font-size: 14px; }

/* FIX: FAQ Boxen - Grauer Hintergrund, Texte/Titel +2px, normal Font-Weight, Pfeile rechts */
.faq-container { margin-top: 45px; background-color: #f8fafc; padding: 30px; border-radius: 12px; border-top: 2px solid var(--border-color); margin-bottom: 25px; }
.faq-title { text-align: center; color: var(--secondary-color); font-size: 1.25em; margin-bottom: 20px; font-weight: bold; }

.faq-accordion summary { 
    background: transparent; margin-bottom: 10px; border-bottom: 1px solid var(--border-dark);
    color: var(--text-main); font-weight: normal; font-size: 17px; display: flex; align-items: center; 
    padding: 12px 5px; cursor: pointer; list-style: none; text-align: left;
}
.faq-accordion summary::-webkit-details-marker { display: none; }
.faq-accordion summary::after { content: '▼'; font-size: 14px; color: var(--primary-color); margin-left: auto; }
.faq-accordion[open] summary::after { content: '▲'; color: var(--success-color); }
.faq-accordion[open] summary { margin-bottom: 0; border-bottom: none; }

.faq-accordion .acc-content { background: transparent; padding: 5px 5px 15px 5px; text-align: left; border-bottom: 1px solid var(--border-color);}
.faq-icon { margin-right: 12px; font-size: 1.2em; color: var(--primary-color); }
.faq-box { margin-bottom: 5px; text-align: left; }
.faq-box p { margin: 0; font-size: 16px; color: var(--text-muted); line-height: 1.5; font-weight: normal; text-align: left; }

/* ---------------------------------------------------------
   15. MOBILE ANSICHT (Handy)
   --------------------------------------------------------- */
@media (max-width: 768px) {
    body { margin: 0; padding: 0; }
    .calc-wrapper { padding: 0 !important; border-radius: 0; max-width: 100% !important; margin: 0 !important; width: 100% !important; }
    .calc-wrapper h2 { font-size: 24px !important; padding: 0 !important; margin-left: 0; letter-spacing: -0.5px; }
    .calc-wrapper summary { padding: 15px 10px !important; margin: 0 0 20px 0 !important; }
    .calculator-section { position: sticky; top: 0; z-index: 1; padding: 15px 0 !important; margin: 0 !important; border-radius: 0; border-left: none; border-right: none; box-shadow: none; width: 100%; }
    .form-section-bottom { position: relative; z-index: 10; margin-top: -15px; padding: 25px 0 15px 0 !important; border-radius: 20px 20px 0 0; box-shadow: 0 -10px 25px rgba(0,0,0,0.15); width: 100%; }
    .section-box { padding: 15px 10px !important; border-radius: 0 !important; border-left: none !important; border-right: none !important; margin-left: 0 !important; margin-right: 0 !important; }
    
    .radio-group-boxed { flex-direction: column; }
    .radio-title { font-size: 17px !important; }
    .mode-selector { flex-direction: column; gap: 10px; padding: 15px 10px; margin: 15px 0 !important; }
    .mode-option { max-width: 100%; font-size: 1.15em !important; }
    .result-item { padding: 12px 5px; }
    .result-left { gap: 6px !important; }
    .result-left label { font-size: 16px !important; }
    .result-price { font-size: 18px !important; min-width: auto; }
    .result-radio { transform: scale(1.3) !important; margin-right: 4px !important; margin-left: 0 !important; }
    
    .result-badge { display: none !important; }
    
    /* Tooltips auf dem Handy absolut zentriert anzeigen */
    .i-badge:hover::after, .i-badge:active::after, .i-badge:focus::after {
        position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
        width: 90vw; max-width: 320px; z-index: 99999; box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    }
    
    .slider-box { max-width: 100%; border-radius: 0; }
    #iban_field { width: 100%; }
    .calc-wrapper label { font-size: 14px; }
    .selected-tarif-box { flex-direction: column; align-items: flex-start !important; gap: 15px; }
    .selected-tarif-box > div:last-child { width: 100%; text-align: left !important; border-top: 1px solid var(--border-dark); padding-top: 10px; }
    #overview-price { font-size: 1.6em !important; }
    #time-estimate { margin-top: 25px !important; margin-bottom: 10px !important; display: block; text-align: right; }
    
    .form-progress { padding: 0 10px !important; gap: 4px; display: flex; justify-content: space-between; margin-bottom: 25px; margin-top: 0px;}
    .progress-step span { display: none; }
    .progress-step::after { content: attr(data-step); font-size: 14px; }
    .progress-step { flex: 1; padding: 8px 0; text-align: center; border-radius: 6px; }
    .desktop-only { display: none; }
    
    .step-nav { flex-direction: row; gap: 10px; padding-left: 10px; padding-right: 10px; flex-wrap: wrap; }
    .btn-nav { padding: 14px 10px; font-size: 17px; flex: 1; text-align: center; display: flex; justify-content: center; align-items: center; min-width: 40%; }
    .btn-submit { font-size: 19px !important; padding: 18px 20px !important; margin: 0 10px; width: calc(100% - 20px); }
    #allgemeine_mitteilung { min-height: 110px; }
    .street-col, .city-col { flex: 1 1 100% !important; min-width: 100% !important; }
    
    .success-text-line { display: inline; margin-bottom: 0; }
    .success-text-line::after { content: ' '; }
    .success-timeline { padding: 20px 15px 20px 25px; }
    .faq-container { padding: 20px; }
}
@media (min-width: 769px) {
    .calc-wrapper h3 { font-size: calc(1.25em + 2px); font-weight: 500; }
    .section-box { margin-left: 30px; margin-right: 30px; }
    .step-nav { padding-left: 30px; padding-right: 30px; }
    .form-progress { padding: 0 40px; margin-top: 15px !important; }
}