/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.form-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    animation: slideUp 0.6s ease-out;
}

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

/* Header */
.header {
    color: black;
    padding: 40px;
    text-align: center;
}

/* Progress Bar *//* Progress Bar */
.progress-container {
    padding: 32px 48px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e1e7ef;
    backdrop-filter: blur(10px);
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
}

.step-circle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid #e2e8f0;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    color: #64748b;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.step-circle::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.4));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.step-circle:hover::before {
    opacity: 0.3;
}

.step-circle.active {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
    color: white;
    border-color: #334155;
    transform: scale(1.12);
    box-shadow: 0 8px 24px rgba(51, 65, 85, 0.3), 0 0 0 4px rgba(51, 65, 85, 0.1);
}

.step-circle.completed {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-color: #059669;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3), 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.step-circle.completed::after {
    content: '✓';
    font-size: 1.3rem;
    font-weight: 700;
    animation: checkmark 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
.step-circle.completed:hover {
    cursor: pointer;
}

@keyframes checkmark {
    0% {
        transform: scale(0) rotate(-45deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(-10deg);
        opacity: 0.8;
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.step-title {
    margin-top: 12px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #64748b;
    text-align: center;
    max-width: 85px;
    line-height: 1.4;
    transition: all 0.3s ease;
}

.step-title.active {
    color: #334155;
    font-weight: 600;
    transform: translateY(-2px);
}

.step-title.completed {
    color: #059669;
    font-weight: 600;
}

.progress-line {
    position: absolute;
    top: 28px;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #e2e8f0 0%, #cbd5e1 100%);
    border-radius: 2px;
    z-index: 1;
    overflow: hidden;
}

.progress-line::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    transform: translateX(-100%);
    animation: shimmer 2s infinite;
}

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

.progress-line-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #059669 30%, #334155 100%);
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}

.progress-line-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: translateX(-100%);
    animation: progressShimmer 1.5s infinite;
}

@keyframes progressShimmer {
    100% {
        transform: translateX(100%);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .progress-container {
        padding: 24px 32px;
    }
    
    .step-circle {
        width: 48px;
        height: 48px;
        font-size: 1rem;
    }
    
    .step-title {
        font-size: 0.8rem;
        max-width: 70px;
    }
    
    .progress-line {
        top: 24px;
    }
}

/* Form Steps */
.step {
    display: none;
    padding: 40px;
    min-height: 500px;
}

.step.active {
    display: block;
    animation: fadeIn 0.4s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

.step-content {
    background: #f8fafc;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
}

.step-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
}

/* Form Elements */


.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

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


.error-message {
    color: #ef4444;
    font-size: 0.85rem;
    margin-top: 5px;
    font-weight: 500;
    display: none;
}

.error-message.show {
    display: block;
    animation: slideDown 0.3s ease;
}

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

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.section-header h3 {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-primary {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
}

.btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}
.btn-danger {
    background: linear-gradient(135deg, #b97e10, #e9b14a);
    color: white;
}

.btn-add {
    background: #4f46e5;
    color: white;
    padding: 8px 16px;
    font-size: 0.9rem;
    border-radius: 6px;
}

.btn-save {
    background: linear-gradient(135deg, #059669, #10b981);
    color: white;
}

.btn-save:hover {
    background: linear-gradient(135deg, #047857, #059669);
}

.btn-remove {
    background: #ef4444;
    color: white;
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 4px;
    position: absolute;
    top: 10px;
    right: 10px;
}

.plus-icon {
    font-size: 1.2rem;
    font-weight: bold;
}

/* Locataires */
.locataire-item {
    background: white;
    border: 2px solid #e2e8f0;
    border-left: 4px solid #4f46e5;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    position: relative;
}

.locataire-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.locataire-header h4 {
    color: #374151;
    font-weight: 600;
}

/* Navigation */
.navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 40px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    gap: 15px;
}

.error-summary {
    color: #ef4444;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    flex: 1;
}

/* Summary */
.summary-section {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.summary-section h4 {
    color: #1e293b;
    font-weight: 600;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}

.summary-section p {
    margin-bottom: 5px;
    color: #475569;
}

.summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Responsive Design */
@media (max-width: 992px) {
    .container {
        padding: 0 10px;
    }
    
    .form-container {
        border-radius: 0;
        margin: 0 -10px;
    }
    
    .header {
        padding: 30px 20px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .progress-container {
        padding: 20px;
    }
    
    .progress-steps {
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .step {
        padding: 20px;
    }
    
    .step-content {
        padding: 20px;
    }
    
    .form-grid,
    .form-grid-3 {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .navigation {
        padding: 20px;
        flex-direction: column;
        gap: 15px;
    }
    
    .error-summary {
        margin: 0;
        order: -1;
    }
    
    .step-circle {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .step-title {
        font-size: 0.8rem;
        max-width: 60px;
    }
    
    .summary-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .progress-steps {
        justify-content: center;
    }
    
    .step-circle {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
    
    .step-title {
        font-size: 0.75rem;
        max-width: 50px;
    }
    
    .progress-line {
        display: none;
    }
}

    /* Overlay gris semi-transparent */
    #loader-overlay {
        display: none;
        position: fixed;
        inset: 0; /* top:0; left:0; right:0; bottom:0 */
        background: rgba(0,0,0,0.5);
        z-index: 9999;
        justify-content: center;
        align-items: center;
        flex-direction: column;
        color: white;
        font-size: 1.5rem;
    }

    /* Spinner circulaire */
    .spinner {
        border: 6px solid rgba(255, 255, 255, 0.3);
        border-top: 6px solid white;
        border-radius: 50%;
        width: 50px;
        height: 50px;
        animation: spin 1s linear infinite;
        margin-bottom: 15px;
    }

    @keyframes spin {
        0%   { transform: rotate(0deg); }
        100% { transform: rotate(360deg); }
    }