/* ---- RUNDES & DYNAMISCHES FLOATING LABEL DESIGN MIT LADE-ANIMATION ---- */

/* --- LADE-ANIMATIONEN (KEYFRAMES) --- */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Grundlegendes Box-Sizing für das Formular */
.float-form-wrapper *,
.float-form-wrapper *::before,
.float-form-wrapper *::after {
    box-sizing: border-box;
}

.float-page {
    background-color: var(--bg-h);
    padding-top: 10rem;
    padding-bottom: 8rem;
    min-height: 100vh;
    max-width: 100vw; 
    overflow-x: hidden;
}

.float-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* --- HEADER (Animiert: Startet sofort) --- */
.float-header {
    text-align: center;
    margin-bottom: 4rem;
    animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.float-header h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -1px;
}

.float-header p {
    font-size: 1.15rem;
    color: var(--text-gr);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* --- KLARE ABGRENZUNG (Die Box - Animiert: Startet leicht verzögert) --- */
.float-form-wrapper {
    background-color: var(--white);
    border-radius: 30px; 
    padding: 4rem 5rem;
    box-shadow: 0 15px 40px rgba(0,0,0,0.06); 
    border: 1px solid rgba(0,0,0,0.03);
    width: 100%;
    overflow: hidden;
    
    /* Animation */
    animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
}

/* --- FORMULAR ABSCHNITTE (Kaskaden-Animation) --- */
.form-section {
    padding-bottom: 3.5rem;
    margin-bottom: 3.5rem;
    border-bottom: 1px solid #f0f0f0;
    
    /* Jede Sektion wird einzeln animiert */
    animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Verzögerungen für den Kaskaden-Effekt (01, 02, 03 bauen sich nacheinander auf) */
.form-section:nth-child(1) { animation-delay: 0.25s; }
.form-section:nth-child(2) { animation-delay: 0.35s; }
.form-section:nth-child(3) { animation-delay: 0.45s; }
.form-section:nth-child(4) { animation-delay: 0.55s; }

.form-section.no-border {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.section-title {
    font-size: 1.2rem;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.section-desc {
    color: var(--text-gr);
    font-size: 0.95rem;
    margin-top: -1.5rem; 
    margin-bottom: 2rem;
}

/* --- GRIDS --- */
.form-grid-2 {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 2rem;
    width: 100%;
}
.form-grid-plz {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2.5fr);
    gap: 2rem;
    width: 100%;
}
.mt-4 {
    margin-top: 2rem;
}

/* --- FLOATING ANIMATION & RUNDE FELDER --- */
.input-float {
    position: relative;
    width: 100%;
    min-width: 0; 
}

.input-float input[type="text"],
.input-float input[type="email"],
.input-float input[type="tel"] {
    width: 100%;
    padding: 1.1rem 1.5rem; 
    border: 1px solid #d1d5db;
    border-radius: 50px; 
    background-color: transparent;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-d);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.custom-select select {
    width: 100%;
    padding: 1.1rem 2.5rem 1.1rem 1.5rem !important; 
    border: 1px solid #d1d5db;
    border-radius: 50px; 
    background-color: transparent;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-d);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
}

.input-float textarea {
    width: 100%;
    padding: 1.2rem 1.5rem;
    border: 1px solid #d1d5db;
    border-radius: 20px; 
    background-color: transparent;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-d);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    resize: vertical;
    min-height: 120px;
}

/* Das Label sitzt im Feld */
.input-float label:not(.upload-label) {
    position: absolute;
    left: 1.5rem; 
    top: 1.1rem;
    color: #9ca3af;
    font-size: 1rem;
    pointer-events: none;
    transition: all 0.25s cubic-bezier(0.2, 1, 0.2, 1);
    background-color: transparent; 
    padding: 0 0.4rem;
    margin-left: -0.4rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 85%;
}

.input-float label span {
    font-weight: 400;
    font-size: 0.85rem;
}
.input-float label .req {
    color: #dc3545;
    font-weight: 700;
}

/* Wenn fokussiert: Label fährt hoch und bekommt WEISSEN Hintergrund */
.input-float input:focus ~ label:not(.upload-label),
.input-float input:not(:placeholder-shown) ~ label:not(.upload-label),
.input-float textarea:focus ~ label:not(.upload-label),
.input-float textarea:not(:placeholder-shown) ~ label:not(.upload-label) {
    top: -0.6rem;
    left: 1.2rem;
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 600;
    background-color: var(--white);
}

.input-float input:focus,
.input-float textarea:focus,
.custom-select select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 79, 158, 0.1);
}

/* --- STATIC FLOATS --- */
.input-float.static-float label:not(.upload-label),
.input-float.static-float .label-fake {
    position: absolute;
    top: -0.6rem;
    left: 1.2rem;
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 600;
    background-color: var(--white) !important;
    padding: 0 0.4rem;
    pointer-events: none;
    z-index: 10;
    white-space: nowrap;
}

.custom-select {
    position: relative;
    width: 100%;
}
.custom-select::after {
    content: "▼";
    font-size: 0.7rem;
    color: var(--text-gr);
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

/* --- CUSTOM UPLOAD --- */
.upload-area {
    position: relative;
    width: 100%;
    min-width: 0; 
}
.upload-input {
    position: absolute;
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    z-index: -1;
}
.upload-label {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1.5rem; 
    border: 1px dashed #cbd5e1;
    border-radius: 50px; 
    cursor: pointer;
    transition: border-color 0.3s;
    height: 100%; 
    min-height: 3.4rem;
    width: 100%;
    min-width: 0; 
}
.upload-label:hover {
    border-color: var(--primary);
}
.upload-btn {
    background-color: var(--primary); 
    color: var(--white);
    border: none;
    padding: 0.4rem 1.2rem;
    border-radius: 50px; 
    font-size: 0.85rem;
    font-weight: 600;
    flex-shrink: 0; 
}
.upload-text {
    font-size: 0.95rem;
    color: var(--text-gr);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1 1 0%; 
    min-width: 0; 
}

/* --- CHECKBOXEN --- */
.final-actions {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.check-box-modern {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    position: relative;
}
.check-box-modern input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}
.check-mark {
    height: 22px;
    width: 22px;
    background-color: var(--white);
    border: 1px solid #d1d5db;
    border-radius: 6px; 
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
    transition: all 0.2s ease;
}
.check-box-modern input:checked ~ .check-mark {
    background-color: var(--primary);
    border-color: var(--primary);
}
.check-box-modern input:checked ~ .check-mark::after {
    content: "✓";
    color: white;
    font-size: 14px;
    font-weight: bold;
}
.check-text {
    font-size: 0.95rem;
    color: var(--text-d);
    line-height: 1.5;
}

/* --- BUTTON --- */
.float-btn-submit {
    background-color: var(--primary);
    color: var(--white);
    border: none;
    padding: 1.2rem 2rem;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 50px; 
    cursor: pointer;
    margin-top: 1.5rem;
    width: 100%;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}

.float-btn-submit:hover {
    background-color: var(--primary-h);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(30, 79, 158, 0.2);
}

/* --- VALIDIERUNG & ERRORS --- */
.error-message {
    display: none;
    color: #dc3545;
    font-size: 0.85rem;
    margin-top: 0.4rem;
    margin-left: 1.5rem; 
}
.is-invalid {
    border-color: #dc3545 !important;
}
.is-invalid + label:not(.upload-label) {
    color: #dc3545 !important; 
}
.is-invalid-checkbox .check-mark {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.2);
}

/* --- RESPONSIVE --- */
@media (max-width: 992px) {
    .float-form-wrapper {
        padding: 3rem 2rem;
        border-radius: 20px;
    }
}

@media (max-width: 768px) {
    .float-container {
        padding: 0 1rem;
    }
    .float-form-wrapper {
        padding: 2.5rem 1.5rem; 
    }
    .form-grid-2,
    .form-grid-plz {
        grid-template-columns: minmax(0, 1fr);
        gap: 1.5rem;
    }
    .mt-4 {
        margin-top: 1.5rem;
    }
    .upload-label {
        padding: 0.8rem 1rem;
        gap: 0.5rem;
    }
}

/* --- ERFOLGSMELDUNGEN --- */
.success-wrapper { 
    display: none; 
    text-align: center; 
    padding: 4rem 2rem; 
    background: #ffffff; 
    border-radius: 30px; 
    border: 1px solid rgba(30, 79, 158, 0.1); 
    box-shadow: 0 15px 40px rgba(0,0,0,0.04); 
    margin-bottom: 2rem;
}

.success-icon { 
    width: 80px; 
    height: 80px; 
    background-color: rgba(30, 79, 158, 0.1); 
    color: var(--primary); 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 3rem; 
    font-weight: 700; 
    margin: 0 auto 2rem auto;
}

.success-wrapper h2 { 
    font-size: 2rem; 
    color: var(--primary); 
    font-weight: 700; 
    margin-bottom: 1rem; 
    letter-spacing: -0.5px;
}

.success-wrapper p { 
    color: var(--text-gr); 
    font-size: 1.1rem; 
    max-width: 500px; 
    margin: 0 auto 2.5rem auto; 
    line-height: 1.6;
}