/**
 * Bibercare CMS - Kontaktformular Vollständiges CSS
 * Datei: assets/css/modules/contact.css
 * Funktionen: Kontaktformular-Styling, Auto-Save System, Autocomplete, Mobile-optimiert
 * Pfad: assets/css/modules/contact.css
 */

/* ==========================================
   CONTACT SECTION - OPTIMIERT FÜR DIREKTEN START
   ========================================== */

.contact,
.contact-section {
    padding-top: 1rem;
    padding-bottom: 3rem;
    padding-left: 2rem;
    padding-right: 2rem;
    background: white;
    min-height: 100vh;
}

/* Mobile: Noch kompakter */
@media (max-width: 768px) {
    .contact,
    .contact-section {
        padding-top: 0.5rem;
        padding-bottom: 2rem;
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Sehr kleine Bildschirme */
@media (max-width: 480px) {
    .contact,
    .contact-section {
        padding-top: 0.5rem;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}

.contact-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 4rem;
}

/* Mobile: Sidebar unter Formular */
@media (max-width: 768px) {
    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* ==========================================
   FORM CONTAINER & WRAPPER
   ========================================== */

.contact-form,
.contact-form-wrapper {
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(44, 90, 160, 0.1);
    overflow: hidden;
}

.form-card {
    padding: 2rem;
}

.contact-form-wrapper {
    background: var(--secondary-color, #f8f9fa);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* Mobile: Kompakteres Padding */
@media (max-width: 768px) {
    .contact-form,
    .contact-form-wrapper {
        padding: 1.5rem;
        border-radius: 15px;
    }
    
    .form-card {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .contact-form,
    .contact-form-wrapper {
        padding: 1rem;
        border-radius: 10px;
    }
    
    .form-card {
        padding: 1rem;
    }
}

.form-header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--accent-color, #e8f2ff);
    background: linear-gradient(135deg, var(--primary-color, #2c5aa0), #1e4080);
    color: white;
    padding: 2rem;
    border-radius: 15px 15px 0 0;
    margin: -2.5rem -2.5rem 2rem -2.5rem;
}

.form-header i {
    font-size: 3rem;
    color: white;
    margin-bottom: 1rem;
}

.form-header h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
}

.form-header p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin: 0;
    opacity: 0.95;
}

/* Mobile: Kompakterer Header */
@media (max-width: 768px) {
    .form-header {
        padding: 1.5rem;
        margin: -1.5rem -1.5rem 1.5rem -1.5rem;
        border-radius: 15px 15px 0 0;
    }
    
    .form-header h3 {
        font-size: 1.3rem;
    }
    
    .form-header p {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .form-header {
        padding: 1rem;
        margin: -1rem -1rem 1rem -1rem;
        border-radius: 10px 10px 0 0;
    }
    
    .form-header h3 {
        font-size: 1.2rem;
    }
}

/* ==========================================
   FORM SECTIONS
   ========================================== */

.form-section {
    border: none;
    margin: 0 0 2.5rem 0;
    padding: 1.5rem;
    background: white;
    border-left: 4px solid var(--primary-color, #2c5aa0);
    border-radius: 0 8px 8px 0;
}

/* Mobile: Kompaktere Sections */
@media (max-width: 768px) {
    .form-section {
        padding: 1rem;
        margin: 0 0 1.5rem 0;
        border-left-width: 3px;
    }
}

@media (max-width: 480px) {
    .form-section {
        padding: 0.8rem;
        margin: 0 0 1rem 0;
    }
}

.form-section legend {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--primary-color, #2c5aa0);
    margin-bottom: 1.5rem;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 2px solid var(--accent-color, #e8f2ff);
    padding-bottom: 0.5rem;
    width: 100%;
}

.form-section legend i {
    font-size: 1.1rem;
}

/* Mobile: Kompaktere Legend */
@media (max-width: 480px) {
    .form-section legend {
        font-size: 0.95rem;
        padding: 0 0.5rem;
        margin-bottom: 0.8rem;
    }
}

/* ==========================================
   FORM GRIDS
   ========================================== */

.form-grid {
    display: grid;
    gap: 1.5rem;
}

.form-grid.grid-2 { 
    grid-template-columns: 1fr 1fr; 
}

.form-grid.grid-3 { 
    grid-template-columns: 1fr 1fr 1fr; 
}

.grid-span-2 { 
    grid-column: span 2; 
}

/* Mobile: Alle Grids werden zu single column */
@media (max-width: 768px) {
    .form-grid.grid-2,
    .form-grid.grid-3 {
        grid-template-columns: 1fr;
    }
    
    .grid-span-2 {
        grid-column: span 1;
    }
}

/* ==========================================
   FORM GROUPS
   ========================================== */

.form-group {
    margin-bottom: 1.5rem;
}

/* Mobile: Kompaktere Form Groups */
@media (max-width: 480px) {
    .form-group {
        margin-bottom: 1rem;
    }
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark, #2d3748);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-group label i {
    color: var(--primary-color, #2c5aa0);
    width: 16px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

/* Mobile: Kompaktere Inputs */
@media (max-width: 480px) {
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 0.6rem 0.8rem;
        font-size: 0.95rem;
        border-radius: 6px;
    }
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color, #2c5aa0);
    box-shadow: 0 0 0 3px rgba(44, 90, 160, 0.1);
}

.form-group input:invalid:not(:placeholder-shown) {
    border-color: #e53e3e;
}

.form-group input:valid {
    border-color: var(--success-color, #48bb78);
}

/* ==========================================
   BOOTSTRAP SELECT INTEGRATION
   ========================================== */

.form-select-lg {
    font-size: 1.1rem !important;
    padding: 0.75rem 1rem !important;
    min-height: 3rem;
    border: 2px solid var(--border-color, #e2e8f0);
}

.form-select-lg:hover {
    border-color: var(--primary-color, #2c5aa0);
    box-shadow: 0 2px 8px rgba(44, 90, 160, 0.1);
}

.form-select-lg:focus {
    border-color: var(--primary-color, #2c5aa0);
    box-shadow: 0 0 0 0.25rem rgba(44, 90, 160, 0.25);
}

@media (max-width: 576px) {
    .form-select-lg {
        font-size: 1rem !important;
        padding: 0.6rem 0.8rem !important;
        min-height: 2.5rem;
    }
}

/* ==========================================
   GEBURTSDATUM-FELDER (VERBESSERT)
   ========================================== */

.birthdate-selects {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 0.75rem;
}

.birthdate-selects select {
    padding: 0.75rem 0.5rem;
    font-size: 1rem;
    font-weight: 500;
}

@media (max-width: 576px) {
    .birthdate-selects {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
}

/* ==========================================
   ALTERS-ANZEIGE
   ========================================== */

#calculated_age {
    transition: all 0.3s ease;
    border-left: 4px solid var(--primary-color, #2c5aa0);
}

#calculated_age.show {
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================
   KRANKENKASSEN AUTOCOMPLETE
   ========================================== */

.autocomplete-container {
    position: relative;
}

.autocomplete-container .form-control {
    border: 2px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.autocomplete-container .form-control:focus {
    border-color: var(--primary-color, #2c5aa0);
    box-shadow: 0 0 0 3px rgba(44, 90, 160, 0.1);
    outline: none;
}

.autocomplete-container .form-control.is-valid {
    border-color: var(--success-color, #48bb78);
    background-color: #f0fff4;
}

#insurance_dropdown {
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    background: white;
    margin-top: 2px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1050;
}

#insurance_dropdown .dropdown-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f3f4;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 0.9rem;
    line-height: 1.4;
}

#insurance_dropdown .dropdown-item:hover {
    background-color: #f8f9fa;
}

#insurance_dropdown .dropdown-item:last-child {
    border-bottom: none;
}

#insurance_dropdown .dropdown-item.active {
    background-color: var(--primary-color, #2c5aa0);
    color: white;
}

#insurance_dropdown .dropdown-item .insurance-name {
    font-weight: 600;
    color: var(--text-dark, #2d3748);
}

#insurance_dropdown .dropdown-item .insurance-details {
    font-size: 0.8rem;
    color: var(--text-muted, #718096);
    margin-top: 0.2rem;
}

#insurance_dropdown .dropdown-item.active .insurance-name,
#insurance_dropdown .dropdown-item.active .insurance-details {
    color: white;
}

#insurance_dropdown .no-results {
    padding: 1rem;
    text-align: center;
    color: var(--text-muted, #718096);
    font-style: italic;
}

#insurance_info {
    padding: 0.75rem;
    background: #e6fffa;
    border: 1px solid var(--success-color, #48bb78);
    border-radius: 6px;
    color: #22543d;
    margin-top: 0.5rem;
}

#insurance_info .badge {
    font-size: 0.75rem;
    margin-right: 0.5rem;
}

@media (max-width: 768px) {
    #insurance_dropdown {
        max-height: 200px;
    }

    #insurance_dropdown .dropdown-item {
        padding: 0.6rem;
        font-size: 0.85rem;
    }
}

/* ==========================================
   CHECKBOXES - VERBESSERT & GRÖßER
   ========================================== */

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    cursor: pointer;
    margin-bottom: 1rem;
    line-height: 1.5;
    padding: 0.75rem;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.checkbox-label:hover {
    background-color: var(--accent-color, #e8f2ff);
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkbox-label .checkmark {
    width: 24px;
    height: 24px;
    background: #f8f9fa;
    border: 3px solid #cbd5e0;
    border-radius: 6px;
    flex-shrink: 0;
    margin-top: 2px;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    min-width: 24px;
    min-height: 24px;
    box-sizing: border-box;
    display: inline-block;
}

/* Hover-Effekt für bessere Interaktivität */
.checkbox-label:hover .checkmark {
    border-color: var(--primary-color, #2c5aa0);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(44, 90, 160, 0.15);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: var(--primary-color, #2c5aa0);
    border-color: var(--primary-color, #2c5aa0);
    box-shadow: 0 4px 12px rgba(44, 90, 160, 0.4);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 7px;
    top: 3px;
    width: 6px;
    height: 12px;
    border: solid white;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
    box-sizing: border-box;
}

/* Spezielle Behandlung für Required Checkboxes (Datenschutz) */
.checkbox-label.required .checkmark {
    border-color: var(--primary-color, #2c5aa0);
    border-width: 3px;
    background: linear-gradient(135deg, #ffffff, #e6fffa);
    box-shadow: 0 3px 10px rgba(44, 90, 160, 0.2);
}

.checkbox-label.required:hover .checkmark {
    border-color: #1e4080;
    box-shadow: 0 4px 15px rgba(44, 90, 160, 0.3);
    background: linear-gradient(135deg, #ffffff, #f0fff4);
}

/* Content in Checkboxes */
.checkbox-content {
    flex: 1;
    line-height: 1.4;
}

.checkbox-content strong {
    color: var(--text-dark, #2d3748);
    display: block;
    margin-bottom: 0.25rem;
}

.checkbox-content small {
    color: var(--text-muted, #718096);
    font-size: 0.85rem;
}

/* Mobile: Checkboxes noch etwas größer für Touch */
@media (max-width: 768px) {
    .checkbox-label .checkmark {
        width: 28px;
        height: 28px;
        margin-top: 0;
        border-width: 4px;
        min-width: 28px;
        min-height: 28px;
    }
    
    .checkbox-label input[type="checkbox"]:checked + .checkmark::after {
        left: 8px;
        top: 3px;
        width: 7px;
        height: 14px;
    }
    
    .checkbox-label {
        gap: 1.25rem;
        margin-bottom: 1.25rem;
    }
}

/* Focus-State für Accessibility */
.checkbox-label:focus-within .checkmark {
    outline: 2px solid var(--primary-color, #2c5aa0);
    outline-offset: 2px;
}

/* Disabled State */
.checkbox-label.disabled .checkmark {
    background: #e2e8f0;
    border-color: #cbd5e0;
    opacity: 0.6;
    cursor: not-allowed;
}

.checkbox-label.disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .checkbox-label .checkmark {
        border-width: 3px;
        border-color: #000;
        background: #fff;
    }
    
    .checkbox-label input[type="checkbox"]:checked + .checkmark {
        background: #000;
        border-color: #000;
    }
}

/* ==========================================
   CHECKBOX GRIDS
   ========================================== */

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

/* Mobile: Single Column für Checkbox Grid */
@media (max-width: 768px) {
    .checkbox-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
}

.checkbox-grid .checkbox-label {
    background: var(--light-gray, #f8f9fa);
    border: 2px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0;
    transition: all 0.3s ease;
}

/* Mobile: Kompakteres Checkbox Grid */
@media (max-width: 480px) {
    .checkbox-grid .checkbox-label {
        padding: 0.8rem;
        border-radius: 6px;
    }
}

.checkbox-grid .checkbox-label:hover {
    border-color: var(--primary-color, #2c5aa0);
}

/* ==========================================
   TIME SLOTS
   ========================================== */

.time-slots {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.5rem;
    margin-top: 1rem;
}

/* Mobile: 2 Columns für Time Slots */
@media (max-width: 768px) {
    .time-slots {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.4rem;
    }
}

/* Sehr kleine Bildschirme: 1 Column */
@media (max-width: 400px) {
    .time-slots {
        grid-template-columns: 1fr;
    }
}

.time-slots .checkbox-label {
    background: var(--light-gray, #f8f9fa);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 6px;
    padding: 0.5rem;
    margin-bottom: 0;
    font-size: 0.85rem;
    justify-content: center;
    text-align: center;
}

/* Mobile: Kompaktere Time Slots */
@media (max-width: 480px) {
    .time-slots .checkbox-label {
        padding: 0.4rem;
        font-size: 0.8rem;
        border-radius: 4px;
    }
}

/* ==========================================
   CONTACT INFO & SIDEBAR
   ========================================== */

.contact-info h3 {
    font-size: 1.8rem;
    color: var(--text-dark, #2d3748);
    margin-bottom: 2rem;
}

.contact-item,
.contact-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    border-left: 4px solid var(--primary-color, #2c5aa0);
    box-shadow: 0 4px 16px rgba(44, 90, 160, 0.1);
    transition: all 0.3s ease;
}

.contact-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(44, 90, 160, 0.15);
}

.contact-icon {
    width: 50px;
    height: 50px;
    background: var(--accent-color, #e8f2ff);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.5rem;
}

.contact-icon i {
    color: var(--primary-color, #2c5aa0) !important;
}

.contact-details h4 {
    margin: 0 0 0.5rem 0;
    color: var(--text-dark, #2d3748);
    font-size: 1.1rem;
}

.contact-details p {
    margin: 0 0 0.25rem 0;
    color: var(--text-color, #2d3748);
}

.contact-details p a {
    color: var(--primary-color, #2c5aa0);
    text-decoration: none;
}

.contact-details p a:hover {
    text-decoration: underline;
}

.contact-details small {
    color: var(--text-muted, #718096);
    font-size: 0.85rem;
}

.contact-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Mobile: Sidebar kompakter */
@media (max-width: 768px) {
    .contact-sidebar {
        gap: 1rem;
    }
    
    .contact-card {
        padding: 0.8rem;
        border-radius: 12px;
    }
    
    .contact-icon {
        width: 40px;
        height: 40px;
    }
}

/* ==========================================
   FORM ACTIONS
   ========================================== */

.form-actions {
    text-align: center;
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 2px solid var(--accent-color, #e8f2ff);
}

/* Mobile: Kompaktere Form Actions */
@media (max-width: 768px) {
    .form-actions {
        padding: 1.5rem;
        margin: 0 -1.5rem -1.5rem -1.5rem;
    }
}

@media (max-width: 480px) {
    .form-actions {
        padding: 1rem;
        margin: 0 -1rem -1rem -1rem;
    }
}

.btn {
    display: inline-block;
    padding: 1rem 2rem;
    border: none;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color, #2c5aa0) 0%, #1e4080 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(44, 90, 160, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(44, 90, 160, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn-large {
    padding: 1.25rem 2.5rem;
    font-size: 1.1rem;
    min-width: 200px;
}

/* Mobile: Vollbreite Button */
@media (max-width: 768px) {
    .btn-large {
        width: 100%;
        min-width: auto;
        padding: 0.9rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .btn-large {
        padding: 0.8rem 1rem;
        font-size: 1rem;
    }
}

.form-note {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--text-muted, #718096);
    line-height: 1.5;
}

.form-note i {
    color: var(--success-color, #48bb78);
    margin-right: 0.5rem;
}

@media (max-width: 480px) {
    .form-note {
        font-size: 0.8rem;
    }
}

/* ==========================================
   FIELD HELPERS
   ========================================== */

.field-description {
    color: var(--text-muted, #718096);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    font-style: italic;
}

.field-help {
    font-size: 0.85rem;
    color: var(--text-muted, #718096);
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

@media (max-width: 480px) {
    .field-description,
    .field-help {
        font-size: 0.85rem;
    }
}

.character-count {
    text-align: right;
    font-size: 0.8rem;
    color: var(--text-muted, #718096);
    margin-top: 0.25rem;
}

@media (max-width: 480px) {
    .character-count {
        font-size: 0.75rem;
    }
}

/* Phone Placeholder Styling */
.phone-placeholder {
    color: var(--text-muted, #718096);
    font-style: italic;
    background: var(--accent-color, #e8f2ff);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
    display: inline-block;
}

/* ==========================================
   ERFOLGS- UND FEHLERMELDUNGEN
   ========================================== */

.success-message {
    background: #c6f6d5;
    border: 1px solid var(--success-color, #48bb78);
    color: #22543d;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.error-message {
    background: #fed7d7;
    border: 1px solid #f56565;
    color: #c53030;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

/* Mobile: Kompaktere Nachrichten */
@media (max-width: 480px) {
    .success-message,
    .error-message {
        padding: 1rem;
        font-size: 0.9rem;
    }
}

/* Success Animation */
@keyframes successPulse {
    0% {
        transform: scale(0.95);
        opacity: 0;
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ==========================================
   AUTO-SAVE INDIKATOR
   ========================================== */

#autosave-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: white;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.8rem;
    color: var(--text-muted, #718096);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 1000;
    opacity: 0.7;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    user-select: none;
    pointer-events: none;
}

#autosave-indicator:hover {
    opacity: 1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

#autosave-indicator .fas {
    margin-right: 4px;
    font-size: 0.9rem;
}

#autosave-indicator.saving {
    border-color: var(--primary-color, #2c5aa0);
    color: var(--primary-color, #2c5aa0);
    opacity: 1;
    animation: savePulse 1.5s ease-in-out;
}

#autosave-indicator.success {
    border-color: var(--success-color, #48bb78);
    color: var(--success-color, #48bb78);
    opacity: 1;
}

#autosave-indicator.error {
    border-color: #f56565;
    color: #f56565;
    opacity: 1;
}

/* Mobile Anpassung */
@media (max-width: 768px) {
    #autosave-indicator {
        bottom: 10px;
        right: 10px;
        padding: 6px 10px;
        font-size: 0.75rem;
    }
}

/* ==========================================
   AUTO-SAVE ANIMATIONEN
   ========================================== */

@keyframes savePulse {
    0%, 100% {
        opacity: 0.5;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

@keyframes saveSuccess {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}



@keyframes fadeInDialog {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInDialog {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}


/* ==========================================
   PROGRESS INDICATOR
   ========================================== */

.autosave-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(44, 90, 160, 0.1);
    z-index: 1001;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.autosave-progress.active {
    transform: translateY(0);
}

.autosave-progress-bar {
    height: 100%;
    background: var(--primary-color, #2c5aa0);
    width: 0%;
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

.autosave-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* ==========================================
   FORM FIELD STATUS INDICATORS
   ========================================== */

.form-field-saved {
    position: relative;
}

.form-field-saved::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--success-color, #48bb78);
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.form-field-saved.visible::after {
    opacity: 0.6;
}

.autosave-status {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    background: #f0f9ff;
    border: 1px solid #0ea5e9;
    border-radius: 4px;
    font-size: 0.75rem;
    color: #0284c7;
    margin-left: 0.5rem;
}

.autosave-status i {
    margin-right: 4px;
    font-size: 0.7rem;
}

.autosave-status.active {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* ==========================================
   DARK MODE SUPPORT
   ========================================== */

@media (prefers-color-scheme: dark) {
    #autosave-indicator {
        background: #1f2937;
        border-color: #374151;
        color: #9ca3af;
    }
    
    .restore-data-content {
        background: #1f2937;
        color: #f9fafb;
    }
    
    .restore-data-info {
        background: #111827;
        color: #e5e7eb;
    }
    
    .autosave-status {
        background: #0c4a6e;
        border-color: #0284c7;
        color: #7dd3fc;
    }
}

/* ==========================================
   ACCESSIBILITY IMPROVEMENTS
   ========================================== */

.sr-only-autosave {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

#autosave-indicator:focus-visible {
    outline: 2px solid var(--primary-color, #2c5aa0);
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    #autosave-indicator {
        border-width: 2px;
        border-color: #000;
        background: #fff;
        color: #000;
    }
    
    #autosave-indicator.success {
        border-color: #00a000;
        color: #00a000;
    }
    
    #autosave-indicator.error {
        border-color: #d00;
        color: #d00;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    #autosave-indicator,
    .autosave-progress-bar,
    .restore-data-content {
        animation: none;
        transition: none;
    }
    
    .autosave-status.active {
        animation: none;
    }
}

/* ==========================================
   SECTION HEADER (falls verwendet)
   ========================================== */

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2.5rem;
    color: var(--text-dark, #2d3748);
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.2rem;
    color: var(--text-muted, #718096);
    margin: 0;
}

/* ==========================================
   ANIMATIONS
   ========================================== */

.fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease forwards;
}

.fade-in:nth-child(2) { animation-delay: 0.2s; }
.fade-in:nth-child(3) { animation-delay: 0.4s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Screen Reader Only Utility Class */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Form Loading State */
.form-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.form-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(2px);
    z-index: 100;
}

/* Success Form State */
.form-success {
    background: linear-gradient(135deg, #c6f6d5, #9ae6b4);
    border: 2px solid var(--success-color, #48bb78);
    color: #22543d;
    padding: 2rem;
    border-radius: 15px;
    margin-bottom: 1rem;
    text-align: center;
    box-shadow: 0 8px 25px rgba(72, 187, 120, 0.3);
    animation: successPulse 0.6s ease-in;
}