/**
 * gesuchformular.css
 *
 * Standalone Stylesheet für das mehrstufige Gesuchformular.
 *
 */

.gf-container {
    color: #212529;
    box-sizing: border-box;
    padding: 0 20px
}

.gf-container *,
.gf-container *::before,
.gf-container *::after {
    box-sizing: inherit;
}

/* ---------- Formular-Container ---------- */

.gf-form-wrap {
    max-width: 1000px;
    margin: 0 auto;
}

@media only screen and (min-width: 1200px) {
    .gf-form-wrap {
        max-width: 1000px;
        padding-right: 220px;
    }
}

/* ---------- Schritt-Anzeige ---------- */

.gf-step-header {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
}

.gf-step-header-count {
    font-size: 1rem;
    font-weight: 600;
    color: #be3455;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.gf-step-header-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #212529;
    display: none;
}

/* ---------- Fortschrittsbalken ---------- */

.gf-progress {
    height: 4px;
    background: #e2e5e9;
    border-radius: 2px;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.gf-progress-bar {
    height: 100%;
    width: 0%;
    background: #be3455;
    transition: width 0.2s ease;
}

/* ---------- Schritt-Panels ---------- */

.gf-step-panel {
    display: none;
}

.gf-step-panel.is-active {
    display: block;
    animation: gf-fade-in 0.15s ease;
}

@keyframes gf-fade-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.gf-step-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
}

.gf-step-description {
    color: #6c757d;
    font-size: 0.9rem;
    margin: 0 0 1.25rem;
    line-height: 1.25 !important;
}

/* ---------- Formularfelder ---------- */

.gf-field {
    margin-bottom: 1rem;
}

.gf-field label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 0.3rem;
}

.gf-field label.gf-checkbox-label {
    display: flex;
    gap: 0.5rem;
    font-weight: 400;
    cursor: pointer;
}

.gf-checkbox-label input[type="checkbox"] {
    flex: 0 0 auto;
    width: 1.05rem;
    height: 1.05rem;
    accent-color: #be3455;
}

.gf-checkbox-label input[type="checkbox"]:focus {
    outline: none;
}

.gf-field-legend {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.gf-section-legend {
    font-size: 1rem;
    font-weight: 700;
    color: #be3455;
    margin: 1.5rem 0 0.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid #e2e5e9;
}

.gf-section-legend-first {
    /* Steht ganz oben im Schritt-Panel -- keine Trennlinie zu etwas,
       das darueber gar nicht existiert. Wird zur Laufzeit von
       updateFirstLegends() in gesuchformular.js gesetzt, weil erst die
       eingeblendeten gf-conditional-Bloecke entscheiden, welche
       Ueberschrift oben steht. Nicht von Hand ins Markup schreiben. */
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.gf-radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.gf-radio-group-inline {
    flex-direction: row;
    gap: 1rem;
}

.gf-radio-group-inline .gf-radio-label {
    flex: 0 0 auto;
    border: none;
    padding: 0;
}

.gf-field label.gf-radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 400;
    font-size: 0.95rem;
    margin-bottom: 0;
    cursor: pointer;
    padding: 0.5rem 0.65rem;
    border: 1px solid #ced4da;
    border-radius: 6px;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.gf-radio-label:hover {
    border-color: #be3455;
    background: #fdf3f5;
}

.gf-radio-label input[type="radio"],
.gf-radio-label input[type="checkbox"] {
    /* .gf-radio-label wird als Karten-Layout auch fuer Mehrfachauswahl-Checkboxen
       genutzt (z.B. Nachhaltigkeits-Bereiche), nicht nur fuer Radios. */
    flex: 0 0 auto;
    width: 1.05rem;
    height: 1.05rem;
    accent-color: #be3455;
}

.gf-radio-label input[type="radio"]:focus,
.gf-radio-label input[type="checkbox"]:focus {
    /* Die Markierung des .gf-radio-label (Rahmenfarbe, siehe unten) genuegt --
       kein zusaetzlicher Fokus-Ring auf dem Input selbst. */
    outline: none;
}

/* ---------- Wiederholbare Eintragslisten (Banken, Aktionaere/Gesellschafter) ---------- */

.gf-repeat-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 0.75rem;
    transition: opacity 0.15s ease;
}

.gf-repeat-list.is-disabled {
    opacity: 0.5;
    pointer-events: none;
}

.gf-repeat-entry {
    padding: 0.85rem 1rem 0.25rem;
    border: 1px solid #e2e5e9;
    border-radius: 8px;
    background: #f8f9fa;
}

.gf-repeat-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.gf-repeat-entry-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #6c757d;
}

.gf-repeat-entry-remove {
    appearance: none;
    border: none;
    background: none;
    color: #a12622;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.15rem 0.35rem;
}

.gf-repeat-entry-remove:hover {
    text-decoration: underline;
}

.gf-repeat-add-btn {
    margin-bottom: 1.25rem;
}

.gf-field .gf-hint {
    display: block;
    font-weight: 400;
    color: #6c757d;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

/* Visuell verstecktes Label (bleibt für Screenreader vorhanden) */
.gf-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- Benoetigte Unterlagen (Beschreibung, keine eigene Validierung --
   die Vollstaendigkeit prueft die BG Mitte manuell nach dem Einreichen) ---------- */

.gf-file-requirements {
    list-style: none;
    margin: 0 0 1.25rem;
    padding: 0 0 0 20px;
}

.gf-file-requirements li {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    padding: 0.1rem 0;
    font-size: 0.9rem;
    line-height: 1.45;
    color: #212529;
    margin-bottom: 0;
}

.gf-file-requirements li::before {
    content: "";
    flex: 0 0 auto;
    width: 0.4rem;
    height: 0.4rem;
    margin-top: 0.5rem;
    border-radius: 50%;
    background: #be3455;
}

/* ---------- Datei-Upload ---------- */

.gf-upload {
    margin-bottom: 1.25rem;
}

.gf-upload-input {
    /* per JS/hidden-Attribut ausgeblendet, Fokus bleibt ueber die Dropzone erreichbar */
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.gf-upload-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.35rem;
    padding: 1.75rem 1rem;
    border: 2px dashed #ced4da;
    border-radius: 8px;
    background: #f8f9fa;
    color: #495057;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.gf-upload-dropzone:hover,
.gf-upload-dropzone:focus-visible {
    border-color: #be3455;
    background: #eef4fb;
    outline: none;
}

.gf-upload-dropzone.is-dragover {
    border-color: #be3455;
    background: #eef4fb;
}

.gf-upload-icon {
    color: #6c757d;
}

.gf-upload-text {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
}

.gf-upload-browse {
    color: #be3455;
    text-decoration: underline;
}

.gf-upload-hint {
    margin: 0;
    font-size: 0.8rem;
    color: #6c757d;
}

.gf-upload-list {
    list-style: none;
    margin: 0.75rem 0 0;
    padding: 0;
}

.gf-upload-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.65rem;
    border: 1px solid #e2e5e9;
    border-radius: 6px;
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
}

.gf-upload-item-name {
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gf-upload-item-size {
    color: #6c757d;
    white-space: nowrap;
}

.gf-upload-item.is-invalid {
    border-color: #f3c1bd;
    background: #fdecea;
    color: #a12622;
}

.gf-upload-item-remove {
    appearance: none;
    border: none;
    background: none;
    color: #6c757d;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.1rem 0.35rem;
}

.gf-upload-item-remove:hover {
    color: #a12622;
}

.gf-field input[type="text"],
.gf-field input[type="email"],
.gf-field input[type="tel"],
.gf-field input[type="number"],
.gf-field input[type="date"],
.gf-field select,
.gf-field textarea {
    width: 100%;
    padding: 0.5rem 0.65rem;
    font-size: 0.95rem;
    border: 1px solid #ced4da;
    border-radius: 6px;
    background: #fff;
    color: #212529;
}

.gf-field input:focus,
.gf-field select:focus,
.gf-field textarea:focus {
    outline: none;
    border-color: #be3455;
    box-shadow: 0 0 0 3px rgba(190, 52, 85, 0.15);
}

.gf-field input.is-invalid,
.gf-field select.is-invalid,
.gf-field textarea.is-invalid {
    border-color: #a12622;
}

.gf-field input[readonly] {
    background: #f1f3f5;
    color: #495057;
}

.gf-radio-label:has(input.is-invalid) {
    border-color: #a12622;
}

.gf-field-row {
    display: flex;
    gap: 1rem;
}

.gf-field-row .gf-field {
    flex: 1 1 0;
}

/* ---------- Aktionen / Buttons ---------- */

.gf-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid #e2e5e9;
}

.gf-btn {
    appearance: none;
    border: none;
    border-radius: 6px;
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, opacity 0.15s ease;
}

.gf-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.gf-btn-primary {
    background: #be3455;
    color: #fff;
}

.gf-btn-primary:hover:not(:disabled) {
    background: #942942;
}

.gf-btn-secondary {
    background: #e9ecef;
    color: #212529;
}

.gf-btn-secondary:hover:not(:disabled) {
    background: #dde1e5;
}

/* ---------- Statusmeldungen ---------- */

.gf-alert {
    display: none;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.gf-alert.is-visible {
    display: block;
}

.gf-alert-error {
    background: #fdecea;
    color: #a12622;
    border: 1px solid #f3c1bd;
}

.gf-alert-success {
    background: #e7f6ec;
    color: #1e6b34;
    border: 1px solid #bfe6cc;
}

/* ---------- Responsive ---------- */

@media (max-width: 576px) {
    .gf-step-header {
        flex-direction: column;
        gap: 0.15rem;
    }

    .gf-field-row {
        flex-direction: column;
        gap: 0;
    }

    .gf-actions {
        flex-direction: column-reverse;
        gap: 0.5rem;
    }

    .gf-actions .gf-btn {
        width: 100%;
    }
}
