/*
 * Führerschein Anmeldeformular CSS - V3.0
 * Korrigierte Spezifität für Buttons und Elemente.
 */

/* --- GRUNDEINSTELLUNGEN --- */
html, body {
    box-sizing: border-box;
}

#fs-form-wrapper {
    max-width: 700px;
    margin: 40px auto;
    padding: 0 10px; 
    position: relative;
    display: block; 
}

/* --- FORTSCHRITTSBALKEN --- */
#progress-text {
    text-align: center;
    font-size: 1.1rem;
    margin-bottom: 8px;
}
#progress-bar {
    width: 100%;
    height: 12px;
    background: #eee;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 25px;
}
#progress-fill {
    width: 0%;
    height: 100%;
    /* Gradient im passenden Gelb-Ton */
    background: linear-gradient(90deg, #FFD700, #FFEB3B); 
    border-radius: 6px;
    transition: width .4s ease;
}

/* --- HAUPTFORMULAR-LAYOUT --- */
#multiStepForm {
    background: #fff;
    color: #000;
    padding: 20px; 
    border-radius: 18px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: block; 
}

#multiStepForm h2 {
    font-size: 1.4rem;
    margin-bottom: 25px;
    text-transform: uppercase;
    color: #000; /* Sicherstellen, dass Überschriften schwarz sind */
    word-break: break-word; 
    /* NEU: Optionale Silbentrennung hinzufügen, falls es doch umbrochen werden muss */
    -webkit-hyphens: auto; 
    -moz-hyphens: auto;
    -ms-hyphens: auto;
    hyphens: auto;
}

#multiStepForm fieldset {
    display: none;
    border: 0;
    animation: fadeIn .3s ease;
    padding: 0;
    margin: 0;
}
#multiStepForm fieldset:first-of-type {
    display: block;
}

/* --- INPUTS & SELEKTOREN --- */
input, select, textarea {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 18px;
    border: 2px solid #ccc;
    border-radius: 8px;
    font-size: 16px;
    transition: border .2s; 
    box-sizing: border-box;
}
input:focus, select:focus, textarea:focus {
    /* Fokusfarbe auf Gelb setzen */
    border-color: #FFD700; 
    outline: none;
}

/* --- BUTTONS (Mit !important) --- */
#multiStepForm button {
    /* Basis-Stil mit maximaler Spezifität */
    background-color: #FFFF00 !important; /* Gelber Hintergrund ERZWINGEN */
    color: #000 !important;             /* Schwarze Schrift ERZWINGEN */
    border: none !important;
    padding: 12px 25px !important;
    margin: 5px !important;
    border-radius: 8px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    transition: transform .2s, box-shadow .2s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important; 
}

#multiStepForm button:hover {
    transform: translateY(-2px);
    /* Auch Hover-Farbe mit !important sichern, falls nötig */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2) !important;
}

/* --- SPEZIELLE ELEMENTE --- */
.radio-group {
    display: flex;
    gap: 20px;
    margin: 10px 0 20px 0;
}

/* Grid für Führerscheinklassen (PC/Tablet) */
#fuehrerscheinklassen-container {
    display: grid;
    gap: 10px;
    /* Lässt 120px breite Spalten zu, wenn Platz ist */
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); 
}

/* Klasse/Datenschutz Boxen */
.klasse-box, .datenschutz-box {
    /* Wichtig für Mobil, damit die Box die volle Spaltenbreite nutzt und nicht übersteht */
    width: 100%; 
    display: flex; 
    align-items: center; 
    padding: 16px 18px; /* Standard-Padding für größere Bildschirme */
    border: 2px solid #ccc;
    border-radius: 10px;
    cursor: pointer;
    background: #fff;
    transition: all .25s;
    position: relative; 
    box-sizing: border-box; 
    margin-bottom: 10px;
}

.klasse-box:hover, .datenschutz-box:hover {
    border-color: #FFD700;
    background: rgba(255, 215, 0, 0.1); /* Helles Gelb-Overlay */
}

.klasse-box.active, .datenschutz-box.active {
    border-color: #FFD700;
    background: rgba(255, 215, 0, 0.15);
}

.klasse-box span, .datenschutz-box span {
    user-select: none;
    line-height: 1.3;
    flex-grow: 1; 
}

/* Verstecken des Checkbox-Inputs, aber sichtbar im Label-Container */
.klasse-box input[type="checkbox"], .datenschutz-box input[type="checkbox"] {
    position: absolute !important; 
    right: 15px !important;       
    top: 50% !important;           
    transform: translateY(-50%) scale(1.4) !important; 
    pointer-events: none !important; /* Wichtig: Klick auf Label soll es umschalten */
    width: auto !important; 
    height: auto !important;
    margin: 0 !important;
}

.g-recaptcha {
    margin: 20px 0;
}

/* --- ANIMATION --- */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- RESPONSIVE ANPASSUNGEN --- */

/* MOBILE-ANPASSUNG: Reduziert Überschrift und erzwingt Stapelung (bis 600px) */
@media (max-width: 600px) {
    /* NEU: Überschrift schon ab 600px etwas verkleinern, um das Problem zu lösen */
    #multiStepForm h2 {
        font-size: 1.15rem; 
        margin-bottom: 20px;
    }
    
    #fuehrerscheinklassen-container {
        /* Erzwingt eine einzige Spalte (1fr = 100% Breite) für gestapelte Ansicht */
        grid-template-columns: 1fr; 
        min-width: 100%;
        max-width: 100%;
    }
    .radio-group {
        flex-direction: column;
        gap: 10px;
    }
}


/* Globale Anpassung für kleinste Bildschirme (bis 480px) */
@media (max-width: 480px) {
    /* Formular-Container Padding reduzieren */
    #fs-form-wrapper {
        padding: 0 5px; 
    }
    #multiStepForm {
        padding: 15px; 
    }
    
    /* NEU: Überschrift auf kleinsten Geräten DEUTLICH kleiner machen */
    #multiStepForm h2 {
        font-size: 1.0rem; 
        margin-bottom: 20px;
    }
    
    /* Padding der Klasse-Boxen für Mobil reduzieren */
    .klasse-box, .datenschutz-box {
        padding: 12px 14px; 
    }
}

@media (min-width: 768px) {
    #multiStepForm {
        padding: 40px; 
    }
    #fs-form-wrapper {
        padding: 0; 
    }
    #multiStepForm h2 {
        font-size: 1.6rem;
    }
}