/* Formulaire d'inscription multi-étapes - Couleurs AdET */
:root {
    --primary-color: #D14741;
    --secondary-color: #48766D;
    --primary-light: #E85A54;
    --secondary-light: #5A8A82;
    --text-dark: #2c3e50;
    --text-light: #6c757d;
    --bg-light: #f8f9fa;
    --border-color: #e9ecef;
}

/* Formulaire d'inscription multi-étapes */
.progress-container {
    position: relative;
    margin-bottom: 3rem;
}

.progress-line {
    position: absolute;
    top: 25px;
    left: 0;
    right: 0;
    height: 4px;
    background-color: var(--border-color);
    z-index: 1;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    transition: width 0.3s ease;
    width: 0%;
}

.step-indicators {
    display: flex;
    justify-content: space-between;
    position: relative;
    z-index: 2;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
    max-width: 200px;
}

.step-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--border-color);
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
    border: 3px solid var(--border-color);
}

.step.active .step-circle {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(209, 71, 65, 0.3);
}

.step.completed .step-circle {
    background: linear-gradient(135deg, var(--secondary-color), var(--secondary-light));
    color: white;
    border-color: var(--secondary-color);
    box-shadow: 0 4px 15px rgba(72, 119, 109, 0.3);
}

.step-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-light);
    transition: color 0.3s ease;
}

.step.active .step-label {
    color: var(--primary-color);
    font-weight: 600;
}

.step.completed .step-label {
    color: var(--secondary-color);
    font-weight: 600;
}

/* Conteneur du formulaire */
.form-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
    padding: 3.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.step-content {
    min-height: 400px;
}

.step-header {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.2rem;
    border-bottom: 3px solid var(--bg-light);
}

.step-icon {
    width: 65px;
    height: 65px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 26px;
    margin-right: 1.5rem;
    box-shadow: 0 6px 20px rgba(209, 71, 65, 0.3);
    transition: transform 0.3s ease;
}

.step-icon:hover {
    transform: scale(1.05);
}

.step-title h2 {
    color: var(--primary-color);
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.step-title p {
    color: var(--text-light);
    margin: 0.6rem 0 0 0;
    font-size: 1rem;
    font-weight: 500;
}

/* Grille du formulaire */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Exception pour les lignes avec col-12 */
.form-row:has(.col-12) {
    grid-template-columns: 1fr;
}

/* Fallback pour les navigateurs qui ne supportent pas :has() */
.form-row.full-width {
    grid-template-columns: 1fr;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-control {
    padding: 0.8rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: var(--bg-light);
    font-weight: 500;
    height: 50px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    vertical-align: middle;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.3rem rgba(209, 71, 65, 0.15);
    background-color: white;
    transform: translateY(-2px);
}

/* Assurer la même hauteur pour tous les types de champs */
input.form-control,
select.form-control {
    height: 50px !important;
    line-height: 1.2;
    display: flex;
    align-items: center;
}

/* Exception pour les textarea */
textarea.form-control {
    height: auto;
    min-height: 50px;
    resize: vertical;
    line-height: 1.4;
}

/* Style simple pour Flatpickr */
.flatpickr-calendar {
    border: none !important;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1) !important;
    border-radius: 8px !important;
}

.flatpickr-day.selected {
    background: var(--primary-color) !important;
    color: white !important;
}

.flatpickr-day:hover {
    background: #f0f0f0 !important;
}

/* Styles pour les conteneurs de recherche */
.search-container {
    position: relative;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid var(--primary-color);
    border-top: none;
    border-radius: 0 0 12px 12px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    display: none;
}

.search-result-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.search-result-item:hover {
    background: var(--primary-color);
    color: white;
    transform: translateX(5px);
}

.search-result-item:active {
    background: var(--secondary-color);
    transform: scale(0.98);
}

.search-result-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary-color);
    transform: scaleY(0);
    transition: transform 0.2s ease;
}

.search-result-item:hover::before {
    transform: scaleY(1);
}

.search-result-item.autre-option {
    background: #f8f9fa;
    color: var(--primary-color);
    font-weight: 500;
    border-top: 2px solid var(--primary-color);
}

.search-result-item.autre-option:hover {
    background: var(--primary-color);
    color: white;
}

.autre-option {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed var(--primary-color);
}

.autre-option label {
    color: var(--primary-color);
    font-weight: 500;
    margin-bottom: 8px;
    display: block;
}

/* Styles pour les contacts d'urgence */
.contact-item {
    margin-bottom: 1rem;
    padding: 1rem;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.contact-item:hover {
    border-color: #c1c8cd;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.contact-actions {
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.btn-add-contact {
    background: #6c757d;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 400;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-add-contact:hover {
    background: #5a6268;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(108, 117, 125, 0.2);
}

.btn-remove-contact {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    font-weight: 400;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    min-width: 40px;
}

.btn-remove-contact:hover {
    background: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.2);
}

#contacts-container {
    position: relative;
}

/* Bouton d'ajout global */
.add-contact-global {
    margin-top: 1rem;
    text-align: center;
}

.btn-add-global {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-add-global:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(209, 71, 65, 0.3);
}

/* Styles pour le champ photo */
input[type="file"].form-control {
    padding: 0.6rem 1rem;
    height: auto;
    line-height: 1.4;
    width: 100%;
}

.col-12 {
    width: 100%;
    flex: 0 0 100%;
    max-width: 100%;
}

.form-text {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.3rem;
}

.photo-preview {
    text-align: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 12px;
    border: 2px dashed var(--primary-color);
    margin-top: 1rem;
    transition: all 0.3s ease;
    animation: fadeInUp 0.5s ease-out;
}

.photo-preview:hover {
    border-color: var(--primary-light);
    box-shadow: 0 4px 15px rgba(209, 71, 65, 0.1);
}

.photo-preview img {
    max-width: 150px;
    max-height: 150px;
    border-radius: 12px;
    border: 3px solid white;
    object-fit: cover;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.photo-preview img:hover {
    transform: scale(1.05);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    border-radius: 4px;
}

.btn-outline-danger {
    color: #dc3545;
    border: 1px solid #dc3545;
    background: transparent;
}

.btn-outline-danger:hover {
    background: #dc3545;
    color: white;
}

/* Styles pour le récapitulatif */
.recap-container {
    max-width: 800px;
    margin: 0 auto;
}

.recap-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-left: 4px solid var(--primary-color);
}

.recap-section h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.recap-content {
    display: grid;
    gap: 1rem;
}

.recap-item {
    padding: 0.8rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid var(--secondary-color);
    font-size: 1rem;
    line-height: 1.5;
}

.recap-item strong {
    color: var(--text-dark);
    font-weight: 600;
    margin-right: 0.5rem;
}

.recap-item span {
    color: var(--text-light);
    font-weight: 500;
}

.recap-section:nth-child(2) {
    border-left-color: var(--secondary-color);
}

.recap-section:nth-child(3) {
    border-left-color: #28a745;
}

.recap-section:nth-child(4) {
    border-left-color: #ffc107;
}

/* Correction spécifique pour les selects */
select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding: 0.6rem 1rem;
    padding-right: 40px;
}

.form-control.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.3rem rgba(220, 53, 69, 0.15);
}

/* Recherche avec résultats */
.search-container {
    position: relative;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid var(--primary-color);
    border-top: none;
    border-radius: 0 0 12px 12px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.search-results.show {
    display: block;
}

.search-result-item {
    padding: 1rem 1.2rem;
    cursor: pointer;
    border-bottom: 1px solid var(--bg-light);
    transition: all 0.3s ease;
    font-weight: 500;
}

.search-result-item:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    transform: translateX(5px);
}

.search-result-item:last-child {
    border-bottom: none;
}

/* Checkbox personnalisé */
.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding: 1rem;
    border-radius: 12px;
    background-color: var(--bg-light);
    transition: all 0.3s ease;
}

.checkbox-label:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(209, 71, 65, 0.3);
}

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

.checkmark {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-color);
    border-radius: 6px;
    margin-right: 15px;
    position: relative;
    transition: all 0.3s ease;
    background: white;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: linear-gradient(135deg, var(--secondary-color), var(--secondary-light));
    border-color: var(--secondary-color);
    box-shadow: 0 4px 15px rgba(72, 119, 109, 0.3);
}

.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);
}

/* Compétences */
.competence-item {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: 15px;
    background: linear-gradient(135deg, var(--bg-light), white);
    transition: all 0.3s ease;
}

.competence-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(209, 71, 65, 0.2);
}

/* Navigation */
.form-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 3px solid var(--bg-light);
}

.btn {
    padding: 1.2rem 3rem;
    border-radius: 15px;
    font-weight: 700;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    min-width: 150px;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    box-shadow: 0 8px 25px rgba(209, 71, 65, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(209, 71, 65, 0.5);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary-color), var(--secondary-light));
    color: white;
    box-shadow: 0 8px 25px rgba(72, 119, 109, 0.4);
}

.btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(72, 119, 109, 0.5);
}

.btn-success {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.4);
}

.btn-success:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(40, 167, 69, 0.5);
}

/* Responsive */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .step-indicators {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .step {
        max-width: none;
    }
    
    .step-circle {
        width: 45px;
        height: 45px;
        font-size: 16px;
    }
    
    .form-container {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .step-header {
        flex-direction: column;
        text-align: center;
    }
    
    .step-icon {
        margin-right: 0;
        margin-bottom: 1.5rem;
        width: 60px;
        height: 60px;
        font-size: 24px;
    }
    
    .step-title h2 {
        font-size: 1.6rem;
    }
}

/* Animations */
.step-content {
    animation: fadeInUp 0.6s ease-out;
}

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

/* Loading states */
.loading {
    opacity: 0.7;
    pointer-events: none;
    filter: blur(1px);
}

/* Messages d'erreur */
.error-message {
    color: #dc3545;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    font-weight: 600;
}

/* Success states */
.success-message {
    color: var(--secondary-color);
    font-size: 0.9rem;
    margin-top: 0.5rem;
    font-weight: 600;
}

/* Effets de survol pour les éléments interactifs */
.form-control:hover {
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.step:hover .step-circle {
    transform: scale(1.05);
}

/* Récapitulatif simplifié */
.recap-simple {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.recap-group {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
}

.recap-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.recap-group h4 {
    color: #495057;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-color);
    display: inline-block;
}

.recap-group p {
    margin: 8px 0;
    color: #6c757d;
    font-size: 0.95rem;
}

.recap-group strong {
    color: #495057;
    font-weight: 600;
}

/* Animation de progression */
.progress-fill {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--primary-light));
    background-size: 200% 100%;
    animation: progressGradient 2s ease-in-out infinite;
}

@keyframes progressGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}