/* --- 1. LAYOUT & CONTAINER --- */
.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(2rem, 4vw, 4rem);
    align-items: center; 
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    max-width: var(--container-width);
    min-height: calc(100dvh - var(--header-height) + var(--footer-height));
    padding-top: calc(var(--header-height) + clamp(2rem, 5vw, 4rem)); 
    padding-bottom: clamp(2rem, 5vw, 4rem);
    position: relative;
    z-index: 1;
}

/* --- 2. LINKE SPALTE (TEXT & BUTTONS) --- */
.text-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.text-content h1 {
    color: var(--text-main);
    margin-bottom: 1rem;
    font-weight: 700;
    transition: color .5s ease;
    font-size: clamp(2.2rem, 5vw, 3.5rem); 
    line-height: 1.2;
}

.description {
    color: var(--text-muted);
    font-size: clamp(1rem, 2vw, 1.1rem);
    margin-bottom: 2.5rem;
    max-width: 100%;
    line-height: 1.6;
    transition: color .5s ease;
}

/* Wrapper für Kontakt-Buttons */
.contact-buttons-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    max-width: 400px;
}

/* Kontakt Link Button (Glass Style) */
.contact-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    width: 100%;
    cursor: pointer;
    text-align: left;
    text-decoration: none; /* Für <a> Tags */
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(12px);
    border-radius: 16px;
    position: relative;
    transition: all .5s ease;
}

.contact-link:hover {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 20px rgba(204, 51, 204, 0.25), inset 0 0 10px rgba(204, 51, 204, 0.05);
}

.icon-box {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px; 
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--icon-box-shadow);
}

.color-brand {
  background: var(--bg-color-brand);
}

.link-text small {
    display: block;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    opacity: 0.8;
    margin-bottom: 3px;
    transition: color .5s ease;
}

.link-text span {
    color: var(--brand);
    font-weight: 600;
    font-size: 1.1rem;
}

.error-banner {
    background-color: rgba(255, 75, 75, 0.1);
    color: var(--error-color);
    border: 1px solid var(--error-color);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
    display: none; /* Standardmäßig aus */
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- 3. RECHTE SPALTE (FORMULAR) --- */
.form-card {
    padding: 3rem;
    border: 1px solid var(--card-border);
    position: relative;
    /* Glass Panel Styles kommen global aus .glass-panel */
}

/* --- 4. INPUT FELDER & GLOW --- */
.form-group {
    margin-bottom: 1.5rem;
    position: relative;
    user-select: none;
}

.form-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    /* Viel Padding oben für Floating Label */
    padding: 28px 16px 8px 16px; 
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    transition: all .5s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 60px;
}

/* Focus State & Aurora Glow */
.form-input:focus,
.custom-select-trigger:focus,
.drop-zone.drop-zone--over {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 20px rgba(204, 51, 204, 0.25), inset 0 0 10px rgba(204, 51, 204, 0.05);
}

.form-input::placeholder {
    color: transparent; /* Verstecken für Floating Logic */
}

.form-input,
.custom-select-trigger {
    font-size: max(16px, 1rem); 
    min-height: 60px;
}

.form-input.input-error,
.custom-select-wrapper.input-error .custom-select-trigger {
    border-color: var(--error-color) !important;
    background-color: rgba(255, 75, 75, 0.02);
    box-shadow: 0 0 0 2px rgba(255, 75, 75, 0.1);
}

/* Checkbox Fehler Animation (Shake) */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.form-checkbox-group.input-error .checkmark {
    border-color: var(--error-color);
    box-shadow: 0 0 0 2px rgba(255, 75, 75, 0.2);
    animation: shake 0.4s ease-in-out;
}

.form-checkbox-group.input-error .label-text {
    color: var(--error-color);
}

/* --- 5. FLOATING LABELS (STANDARD INPUTS) --- */
.floating-group .form-label {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    transition: all .5s ease;
    transform-origin: left top;
    padding: 0 2px;
    opacity: 0.7;
}

/* Aktiv-Zustand (Oben) */
.form-input:focus ~ .form-label,
.form-input:not(:placeholder-shown) ~ .form-label {
    top: 10px;
    transform: translateY(0) scale(0.75);
    color: var(--brand);
    font-weight: 600;
    opacity: 1;
}

.optional {
    font-weight: 400;
    opacity: 0.7;
    font-size: 0.9em;
}

/* --- 6. TEXTAREA --- */
textarea.form-input {
    resize: none;
    overflow: hidden;
    min-height: 120px;
    line-height: 1.5;
}

/* Label Positionierung für Textarea */
textarea.form-input ~ .form-label {
    top: 28px;
}
textarea.form-input:focus ~ .form-label,
textarea.form-input:not(:placeholder-shown) ~ .form-label {
    top: 10px;
}

/* --- 8. CUSTOM SELECT (FIXED FLOATING) --- */
.custom-select-wrapper {
    position: relative;
    cursor: pointer;
}

.custom-select-trigger {
    position: relative;
    display: flex;
    align-items: center; /* Vertikal zentrieren */
    justify-content: space-between;
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 28px 16px 8px 16px; 
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    min-height: 60px; /* Gleiche Höhe wie Inputs */
    transition: all .5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
}

/* Focus State & Glow (Exakt wie Inputs) */
.custom-select-trigger:focus,
.custom-select-wrapper.open .custom-select-trigger {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 20px rgba(204, 51, 204, 0.25), inset 0 0 10px rgba(204, 51, 204, 0.05);
}

/* Der ausgewählte Text */
.selected-value-text {
    opacity: 0; /* Unsichtbar bis Auswahl getroffen */
    transition: opacity .5s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 20px; /* Platz zum Pfeil lassen */
    color: var(--text-main);
}

/* Sichtbar machen, wenn Wert da ist */
.custom-select-wrapper.has-value .selected-value-text {
    opacity: 1;
}

.custom-select-trigger .arrow {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%) rotate(0deg) !important; 
    transition: transform .5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    color: var(--text-muted);
    font-size: 0.9rem;
    pointer-events: none;
    transition: color .5s ease;
}

.custom-select-wrapper.open .arrow {
    transform: translateY(-50%) rotate(180deg) !important;
    color: var(--brand);
}

.custom-select-wrapper .select-label {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    transition: all .5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 3;
    opacity: 0.7;
    transform-origin: left top;
    font-size: 1rem;
    font-weight: 400;
}

.custom-select-wrapper.open .select-label,
.custom-select-trigger:focus ~ .select-label,
.custom-select-wrapper.has-value .select-label {
    top: 10px;
    transform: translateY(0) scale(0.75);
    color: var(--brand);
    font-weight: 600;
    opacity: 1;
}

/* Dropdown Optionen */
.custom-options {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background: var(--bg-l3);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all .5s ease;
    pointer-events: none;
}

.custom-options.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: all;
}

.custom-option {
    padding: 12px 16px;
    cursor: pointer;
    color: var(--text-main);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: all .5s;
}

.custom-option:first-child {
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.custom-option:last-child {
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

.custom-option:hover, .custom-option.selected {
    background: var(--brand);
    color: white;
}

/* --- FILE UPLOAD --- */
.file-upload-wrapper {
    margin-top: 2rem;
}

.drop-zone {
    width: 100%;
    min-height: 120px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    color: var(--text-muted);
    border: 2px dashed var(--card-border);
    border-radius: 12px;
    transition: all .5s ease;
    background: rgba(255, 255, 255, 0.02);
}

.drop-zone:hover, .drop-zone--over {
    border-color: var(--brand);
    background: rgba(204, 51, 204, 0.1);
}

.drop-zone__prompt i {
    font-size: 2.2rem;
    margin-bottom: 12px;
    display: block;
    color: var(--brand);
    transition: transform .5s ease;
}

.drop-zone:hover .drop-zone__prompt i {
    transform: translateY(-5px);
}

.drop-zone__input { display: none; }

/* File List Item */
.file-list {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    /* Kein gap hier nutzen, sonst springt es beim Löschen. Margin am Item nutzen */
}

.file-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    
    /* WICHTIG für Animation: */
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
    max-height: 100px; /* Start-Höhe */
    transform: translateX(0);
    overflow: hidden; /* Damit Inhalt beim Zusammenklappen nicht raussteht */
}

/* Zustand beim Löschen */
.file-item.removing {
    opacity: 0;
    transform: translateX(50px); /* Schiebt es nach rechts raus */
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-bottom: 0;
    border-color: transparent;
}

.file-item-left {
    flex-grow: 1;
    margin-right: 15px;
    min-width: 0;
}

.file-info-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto; /* Zwingt Spalte 1 zum Schrumpfen */
    gap: 10px;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-main);
    margin-bottom: 6px;
}

/* 3. Wrapper für Name und Endung */
.file-name-wrapper {
    display: flex;
    align-items: center;
    min-width: 0; /* Erlaubt das Abschneiden der Kinder */
}

/* 4. Der Text, der mit ... abgekürzt wird */
.file-name-base {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 5. Die Endung bleibt immer komplett sichtbar */
.file-name-ext {
    white-space: nowrap;
    flex-shrink: 0;
}

.file-percent {
    font-weight: 600;
    color: var(--brand);
    min-width: 35px;
    text-align: right;
}

/* Progress Bar */
.file-progress-bg {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    overflow: hidden;
}

.file-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--brand-gradient);
    border-radius: 3px;
    transition: width 0.1s linear;
}

/* Actions (Spinner, Check, Delete) */
.file-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    min-width: 60px;
}

/* Spinner */
.loading-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Success Check */
.upload-success-icon {
    color: var(--success-color);
    font-size: 1.2rem;
    display: none;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Remove Button */
.btn-remove-file {
    background: transparent;
    border: none;
    color: var(--error-color, #ff4b4b);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 5px;
    display: flex; /* Wird via JS gesteuert (none/flex) */
    align-items: center;
    justify-content: center;
    transition: transform .5s ease;
}
.btn-remove-file:hover { transform: scale(1.2); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes popIn { from { transform: scale(0); } to { transform: scale(1); } }

.file-error {
    color: var(--error-color, #ff4b4b);
    font-size: 0.85rem;
    margin-top: 8px;
    text-align: center;
    display: none;
}

/* --- CHECKBOX --- */
.form-checkbox-group {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.custom-checkbox-container {
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-muted);
    user-select: none;
    line-height: 1.5;
    transition: color .5s ease;
}

.custom-checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: relative;
    height: 22px;
    width: 22px;
    background-color: transparent;
    border: 2px solid var(--text-muted);
    border-radius: 6px;
    transition: all .5s ease;
    flex-shrink: 0;
    margin-top: 0px;
}

.checkmark svg {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    color: white;
    transform: translate(-50%, -50%) scale(0);
    transition: transform .5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.custom-checkbox-container:hover input ~ .checkmark {
    border-color: var(--brand);
    background-color: var(--brand);
}

.custom-checkbox-container input:checked ~ .checkmark {
    background-color: var(--brand);
    border-color: var(--brand);
    box-shadow: 0 0 10px rgba(204, 51, 204, 0.4);
}

.custom-checkbox-container input:checked ~ .checkmark svg {
    transform: translate(-50%, -50%) scale(1);
}

.label-text a {
    color: var(--brand);
    text-decoration: none;
    border-bottom: 1px dashed transparent;
    transition: border .5s;
}

.label-text a:hover { 
    border-bottom-color: var(--brand); 
}

/* --- SUBMIT BUTTON --- */
.btn-submit {
    width: 100%;
    padding: 18px;
    border: none;
    border-radius: 12px;
    background: var(--brand-gradient);
    color: white;
    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all .5s ease;
    box-shadow: 0 4px 15px rgba(204, 51, 204, 0.4);
    position: relative;
    overflow: hidden;
}

.btn-submit span { position: relative; z-index: 2; }

.btn-submit:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(204, 51, 204, 0.6);
}

/* --- TOOLTIPS --- */
.copy-tooltip {
    visibility: hidden;
    background-color: var(--card-bg);
    color: var(--text-main);
    text-align: center;
    padding: 6px 12px;
    border-radius: 6px;
    position: absolute;
    z-index: 10;
    bottom: 115%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity .5s;
    font-size: 0.8rem;
    font-weight: 600;
    pointer-events: none;
    white-space: nowrap;
    outline: none;
    border: 1px solid;
    border-color: var(--brand);
    box-shadow: 0 0 16px rgba(204, 51, 204, 0.25), inset 0 0 8px rgba(204, 51, 204, 0.05);
}

.copy-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--brand) transparent transparent transparent;
}

.copy-tooltip.show {
    visibility: visible;
    opacity: 1;
    bottom: 115%;
}

/* --- RESPONSIVE --- */
@media (hover: hover) and (pointer: fine) {
    .contact-link:hover {
        outline: none;
        border-color: var(--brand);
        box-shadow: 0 0 20px rgba(204, 51, 204, 0.25), inset 0 0 10px rgba(204, 51, 204, 0.05);
    }
    
    .custom-option:hover {
        background: var(--brand);
        color: white;
    }
    
    .drop-zone:hover {
        border-color: var(--brand);
        background: rgba(204, 51, 204, 0.1);
    }
    
    .drop-zone:hover .drop-zone__prompt i {
        transform: translateY(-5px);
    }
    
    .btn-submit:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 30px rgba(204, 51, 204, 0.6);
    }
    
    .custom-checkbox-container:hover input ~ .checkmark {
        border-color: var(--brand);
        background-color: rgba(204, 51, 204, 0.05);
    }
}

@media (max-height: 1000px) {
    .contact-container {
        align-items: start;
    }
}

@media (max-width: 992px) {
    .contact-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .description {
        text-align: center;
    }

    .text-content h1 {
        text-align: center;
    }
    
    .description {
        margin-left: auto;
        margin-right: auto;
    }

    .contact-buttons-wrapper {
        margin-left: auto;
        margin-right: auto;
    }
}

@media (max-width: 480px) {
    .form-card { 
        padding: 1.5rem 1rem;
        border-radius: 16px;
    }
    
    .contact-container { 
        padding-left: 16px; 
        padding-right: 16px; 
    }
}