/* --- Grundlegende Styles für das Formular-Container --- */
.contact-form-section {
    max-width: 800px; /* Oder eine andere Breite, die für Ihre Seite passt */
    margin: 40px auto; /* Zentriert das Formular auf der Seite mit etwas Abstand */
    padding: 30px;
    background-color: #ffffff; /* Dunklerer Hintergrund, fast Schwarz */
    border-radius: 8px; /* Leicht abgerundete Ecken */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4); /* Subtiler Schatten für Tiefe */
    font-family: 'Arial', sans-serif; /* Eine saubere, gut lesbare Schrift */
    color: #000000; /* Helle Textfarbe für guten Kontrast */
}

/* --- Nachrichtenbereich (Erfolgs-/Fehlermeldungen) --- */
.form-message {
    background-color: #ffffff; /* Dunkles Blau für Nachrichten-Hintergrund */
    color: #000000; /* Weißer Text für Nachrichten */
    padding: 15px 20px;
    border-radius: 5px;
    text-align: center;
    margin-bottom: 25px;
    font-size: 1.2em;
    font-weight: bold;
}

/* --- Legenden (Titel der Feldgruppen) --- */
.form-legend {
    font-size: 2.2em; /* Größer für mehr Präsenz */
    font-weight: bold;
    color: #4a90e2; /* Kräftiges Blau als Akzentfarbe */
    text-align: center;
    padding-bottom: 20px;
    margin-bottom: 30px;
    border-bottom: 2px solid #2c3e50; /* Trennlinie in dunklem Blau */
    width: 100%; /* Volle Breite */
}

/* --- Feldgruppen (fieldset) --- */
.form-fieldset {
    border: none; /* Entfernt den Standard-Rand von fieldset */
    padding: 0;
    margin-bottom: 30px; /* Abstand zwischen den Feldgruppen */
}

/* --- Allgemeine Input-Styles --- */
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 18px; /* Abstand zwischen den Feldern */
    border: 1px solid #444; /* Dunkelgrauer Rand */
    border-radius: 4px;
    background-color: #ffffff; /* Etwas helleres Schwarz als der Hintergrund */
    color: #000000; /* Weißer Text im Input */
    font-size: 1em;
    outline: none; /* Entfernt den Standard-Fokus-Rand */
    transition: border-color 0.3s ease, box-shadow 0.3s ease; /* Sanfte Übergänge */
}

/* Platzhalter-Text Farbe anpassen */
.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #888; /* Helles Grau für den Platzhaltertext */
}

/* Fokus-Effekt für Input-Felder */
.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="tel"]:focus,
.form-group select:focus,
.form-group textarea::focus {
    border-color: #4a90e2; /* Blauer Rand beim Fokus */
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.3); /* Blauer Schatten beim Fokus */
}

/* Select-Box Pfeil-Farbe anpassen (Browser-spezifisch) */
.form-group select {
    -webkit-appearance: none; /* Safari, Chrome */
    -moz-appearance: none;    /* Firefox */
    appearance: none;         /* Standard */
    background-image: url('data:image/svg+xml;utf8,<svg fill="#ffffff" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 20px;
    padding-right: 35px; /* Platz für das Icon */
}

/* --- Grid-Layout für Reihen (z.B. Vorname/Nachname, Straße/Nr.) --- */
.form-grid {
    display: flex; /* Flexbox für nebeneinander liegende Elemente */
    gap: 20px; /* Abstand zwischen den Spalten */
    margin-bottom: 18px; /* Abstand zum nächsten Element */
}

.form-grid .form-group {
    flex: 1; /* Nimmt gleichen Platz ein */
    margin-bottom: 0; /* Entfernt den unteren Margin der einzelnen Gruppen */
}

/* Spezifische Anpassungen für Straße/Nummer und PLZ/Stadt */
.street-nr-grid .form-group.nr-input {
    flex: 0 0 25%; /* Nummer kleiner machen */
}
.plz-location-grid .form-group.plz-input {
    flex: 0 0 30%; /* PLZ etwas kleiner machen */
}

/* --- Checkbox-Stil --- */
.checkbox-group {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
    font-size: 0.95em;
    color: #000000; /* Etwas helleres Grau für Checkbox-Text */
}

.checkbox-group input[type="checkbox"] {
    margin-right: 10px;
    width: 18px; /* Größe anpassen */
    height: 18px;
    background-color: #ffffff;
    border: 1px solid #4a90e2; /* Blauer Rand für die Checkbox */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    border-radius: 3px;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.checkbox-group input[type="checkbox"]:checked {
    background-color: #4a90e2; /* Blauer Hintergrund, wenn gecheckt */
    border-color: #4a90e2;
}

.checkbox-group input[type="checkbox"]:checked::before {
    content: '✓'; /* Haken-Symbol */
    display: block;
    color: #ffffff; /* Weißer Haken */
    font-size: 14px;
    line-height: 16px;
    text-align: center;
}

.checkbox-group label {
    cursor: pointer;
}

/* --- ReCaptcha-Bereich --- */
.recaptcha-group {
    text-align: center;
    margin-bottom: 25px;
}
/* ReCaptcha selbst hat oft feste Breiten, aber wir können den Container zentrieren */
.g-recaptcha {
    display: inline-block;
}

/* --- Button-Styles --- */
.form-buttons {
    display: flex;
    justify-content: flex-end; /* Buttons rechts ausrichten */
    gap: 15px; /* Abstand zwischen den Buttons */
    margin-top: 30px;
}

.button {
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.button-primary {
    background-color: #4a90e2; /* Kräftiges Blau für den Absende-Button */
    color: #ffffff; /* Weißer Text */
}

.button-primary:hover {
    background-color: #367ac8; /* Dunkleres Blau beim Hover */
}

.button-secondary {
    background-color: #333; /* Dunkelgrau für den Reset-Button */
    color: #ffffff; /* Weißer Text */
    border: 1px solid #555;
}

.button-secondary:hover {
    background-color: #444; /* Etwas helleres Grau beim Hover */
}

/* --- Responsive Anpassungen für kleinere Bildschirme --- */
@media (max-width: 600px) {
    .form-grid {
        flex-direction: column; /* Spalten untereinander auf kleinen Bildschirmen */
        gap: 0;
    }
    .form-grid .form-group {
        flex: none; /* Deaktiviert Flex Grow */
        width: 100%; /* Volle Breite */
    }
    .form-legend {
        font-size: 1.8em;
    }
    .contact-form-section {
        padding: 20px;
        margin: 20px auto;
    }
    .form-buttons {
        flex-direction: column; /* Buttons untereinander auf kleinen Bildschirmen */
        align-items: stretch; /* Volle Breite für Buttons */
    }
    .button {
        width: 100%; /* Buttons nehmen volle Breite ein */
        margin-bottom: 10px; /* Abstand zwischen den gestapelten Buttons */
    }
}

/* Hilfsklasse für Screenreader-only Labels */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}