/* 1. Layout & Sektionen */

/* Kompaktere, modernere Sektionen */
.form-section {
    background: var(--bg-card);
    padding: 24px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    margin-bottom: 28px;
}

/*.form-section {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin-bottom: 35px;
    box-shadow: var(--shadow);
}

/* Grid für Formularfelder */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    /* Einheitlicher Abstand */
}

/* 2. Überschriften mit Kreisen */

/* Abschnittsüberschriften */
.form-section h2 {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 1.15rem;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 10px;
    margin-bottom: 22px;
}

/* Nummernkreis */
.form-section h2::before {
    content: attr(data-number);
    background: var(--primary);
    color: #fff;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-weight: 600;
}

/* 3. Eingabefelder (Placeholder & Layout) */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--text-main);
}

/*
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
}
*/

/* Einheitliche Eingabefelder */
input:not([type="checkbox"]):not([type="radio"]),
textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-main);
    font-size: 1rem;
}

input:not([type="checkbox"]):not([type="radio"]):focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 4px rgba(0, 162, 255, 0.4);
}

/* Deaktivierte Checkboxen optisch ausgrauen */
.checkbox-item input:disabled+.checkbox-x {
    opacity: 0.4;
}

/* Deaktivierte Checkboxen komplett blockieren */
.checkbox-item.disabled {
    pointer-events: none;
    opacity: 0.5;
}

.checkbox-item input:disabled~.checkbox-text {
    opacity: 0.4;
}

input[type="checkbox"],
input[type="radio"],
.checkbox-item,
.radio-item {
    -webkit-tap-highlight-color: transparent;
}

/* Placeholder wieder sichtbar machen */
::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

/* 4. Checkboxen & Radiobuttons (Bereinigt) */
.radio-item,
.checkbox-item {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1.1em;
    color: var(--text-main);
}

.form-group .radio-row .radio-item {
    margin-bottom: 20px;
    align-items: center;
    display: flex;
}

.radio-item input,
.checkbox-item input {
    appearance: none;
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-color);
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.radio-item:hover input,
.checkbox-item:hover input {
    border-color: var(--primary);
    background: transparent;
    box-shadow: 0 0 8px rgba(0, 162, 255, 0.4);
}

.radio-item input:checked,
.checkbox-item input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* Dark-Mode bleibt explizit, falls andere Dateien reinfunken */
body.dark-mode .radio-item input:checked,
body.dark-mode .checkbox-item input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* Häkchen im Checkbox-Feld */
.checkbox-item input:checked {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: 80% 80%;
    background-position: center;
    background-repeat: no-repeat;
}

/* Weißer Punkt im Radio-Feld */
.radio-item input:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
}

/* 5. Druck-Button (Wiederherstellung) */
.sticky-print-container {
    position: fixed;
    right: 30px;
    bottom: 30px;
    z-index: 1001;
}

.btn-floating {
    background: var(--primary);
    color: white !important;
    padding: 15px 30px;
    border-radius: 50px;
    font-weight: 800;
    border: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.btn-floating:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

/* 6. Darkmode Fixes */
body.dark-mode input:not([type="checkbox"]):not([type="radio"]),
body.dark-mode textarea {
    background: #252525 !important;
    color: white !important;
    border: 1px solid #444 !important;
}

/* --- STRUKTURIERTER FUSSBEREICH --- */

/* 1. Der Hinweistext (Rechtliches) */
.form-footer-note {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 30px 0;
    padding: 20px;
    background: var(--bg-highlight);
    border-radius: 8px;
    border-left: 4px solid var(--primary);
}

/* 2. Unterschrift & Datum Sektion */
.signature-section {
    display: grid;
    grid-template-columns: 1fr 2fr;
    /* Datum schmaler, Unterschrift breiter */
    gap: 30px;
    margin-bottom: 40px;
    align-items: flex-end;
}

.signature-field {
    border-bottom: 2px solid var(--text-main);
    padding-bottom: 5px;
}

.signature-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 8px;
}

/* 3. Die Versandadresse (Hervorgehoben) */
.shipping-info-box {
    background: var(--bg-darker);
    border: 2px dashed var(--primary);
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 50px;
}

.shipping-info-box h4 {
    color: var(--primary);
    text-transform: uppercase;
    margin-bottom: 10px;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.shipping-info-box p {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text-main);
}

/* Mobile Anpassung für den Fußbereich */
/*@media (max-width: 768px) {
    .signature-section {
        grid-template-columns: 1fr;
    }

    .shipping-info-box {
        padding: 15px;
    }
}*/

/* --- MOBIL-OPTIMIERUNG FORMULAR --- */
@media (max-width: 768px) {

    /* Verhindert Überlappung im Header */
    .content-wrapper {
        margin-top: 20px !important;
    }

    /* Mobil: einspaltig */
    .form-grid {
        grid-template-columns: 1fr;
    }

    /* Überschriften-Kreise etwas kleiner für schmale Bildschirme */
    .form-section h2 {
        font-size: 1rem !important;
        gap: 10px !important;
    }

    .form-section h2::before {
        width: 32px !important;
        height: 32px !important;
        font-size: 1rem !important;
    }

    /* Druck-Button am Handy fixieren (unten) */
    .sticky-print-container {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        z-index: 1100;
    }

    .btn-floating {
        width: 100% !important;
        border-radius: 0 !important;
        justify-content: center;
        padding: 18px !important;
        box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.2);
    }

    footer {
        padding-bottom: 80px !important;
    }

    .scroll-btn {
        display: none !important;
    }

    /* PLZ + Ort untereinander */
    .plz-ort-row {
        flex-direction: column;
        gap: 10px !important;
    }

    .plz-ort-row .plz,
    .plz-ort-row .ort {
        width: 100%;
        margin: 0;
        flex: none !important;
        /* WICHTIG */
    }


    .signature-section {
        grid-template-columns: 1fr;
    }

    .shipping-info-box {
        padding: 15px;
    }
}


/* Adresszeile: Straße + Hausnummer */
.address-row {
    display: flex;
    gap: 10px;
    width: 100%;
}

.address-field {
    display: flex;
    flex-direction: column;
}

.address-field.street {
    flex: 1;
    /* nimmt den verfügbaren Platz */
}

.address-field.hausnummer {
    width: 70px;
    /* perfekt für 1–4 Zeichen */
}

/* Optional: Mobile-Fallback */
@media (max-width: 480px) {
    .address-row {
        flex-direction: column;
    }

    .address-field.hausnummer {
        width: 100%;
    }
}

.ruecksendung-box .checkbox-item {
    display: flex;
    margin-top: 28px;
    align-items: center;
    /* Text und Checkbox vertikal zentrieren */
    /* Mitte Checkbox = Mitte Eingabefeld */
    margin-bottom: 13px;
}

.ruecksendung-box .checkbox-item span:last-child {
    font-weight: 700;
    color: var(--text-main);
}

.checkbox-item span .subline {
    display: block;
    font-size: 12px;
    /*    color: #666;*/
    color: #00a2ff;
    margin-top: 2px;
}

.ruecksendung-box .radio-row {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-top: 5px;
}

.ruecksendung-box .radio-item {
    margin-bottom: 0;
    /* verhindert unnötige Höhe */
}

.plz-ort-row {
    display: flex;
    gap: 20px;
}

.plz-ort-row .plz {
    flex: 0 0 120px;
    /* PLZ fix */
}

.plz-ort-row .ort {
    flex: 1;
    /* Ort flexibel */
}