:root {
    --primary-blue: #0d6efd;
    --light-blue: #e8f4ff;
    --dark-blue: #0a58ca;
    --select-blue: #e3f2fd;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.navbar {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-weight: 700;
    color: var(--primary-blue) !important;
    font-size: 1.5rem;
}

.form-section {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    padding: 30px;
    margin-bottom: 30px;
    display: none;
}

.form-section.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Indicateur d'étapes */
.step-indicator {
    display: flex;
    justify-content: space-between;
    margin: 40px 0;
    position: relative;
}

.step-indicator:before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #dee2e6;
    z-index: 1;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    width: 33.33%;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #dee2e6;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 10px;
    border: 4px solid white;
    transition: all 0.3s ease;
}

.step.active .step-number {
    background-color: var(--primary-blue);
    color: white;
    box-shadow: 0 0 0 5px rgba(13, 110, 253, 0.1);
}

.step.completed .step-number {
    background-color: var(--dark-blue);
    color: white;
}

.step-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #6c757d;
    text-align: center;
    transition: color 0.3s ease;
}

.step.active .step-label {
    color: var(--primary-blue);
}

.form-title {
    color: var(--primary-blue);
    border-bottom: 2px solid var(--light-blue);
    padding-bottom: 10px;
    margin-bottom: 25px;
    font-weight: 600;
}

.btn-primary-custom {
    background-color: var(--primary-blue);
    border-color: var(--primary-blue);
    color: var(--light-blue);
    padding: 10px 25px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-primary-custom:hover {
    background-color: var(--dark-blue);
    border-color: var(--dark-blue);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(13, 110, 253, 0.2);
}

.btn-outline-primary-custom {
    color: var(--primary-blue);
    border-color: var(--primary-blue);
    padding: 10px 25px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-outline-primary-custom:hover {
    background-color: var(--light-blue);
    color: var(--dark-blue);
}

.form-control:focus, .custom-select:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.required-field:after {
    content: " *";
    color: #dc3545;
}

.form-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
}

.confirmation-box {
    background-color: var(--light-blue);
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    margin-top: 20px;
}

.confirmation-icon {
    font-size: 4rem;
    color: var(--primary-blue);
    margin-bottom: 20px;
}

footer {
    background-color: #343a40;
    color: white;
    padding: 30px 0;
    margin-top: 50px;
    width: 100%;
}

.info-icon {
    color: var(--primary-blue);
    margin-right: 8px;
}

/* Styles améliorés pour les selects */
.custom-select-wrapper {
    position: relative;
    margin-bottom: 1rem;
}

.custom-select {
    display: block;
    width: 100%;
    padding: 0.375rem 2.25rem 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #495057;
    background-color: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    appearance: none;
    transition: all 0.3s ease;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%230d6efd' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px 16px;
}

.custom-select:hover {
    border-color: #b8d4ff;
    background-color: #f8fbff;
}

.custom-select:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
    background-color: white;
}

.custom-select option {
    padding: 12px;
    font-size: 1rem;
}

.custom-select option:hover {
    background-color: var(--light-blue) !important;
}

.custom-select option:checked {
    background-color: var(--primary-blue);
    color: white;
}

.select-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
}

.select-icon {
    display: none;
}

/* Style pour les selects avec validation */
.custom-select.is-valid {
    border-color: #28a745;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2328a745' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
}

.custom-select.is-invalid {
    border-color: #dc3545;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23dc3545' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
}

/* Select avec badge */
.select-badge {
    display: inline-block;
    padding: 3px 8px;
    background-color: var(--light-blue);
    color: var(--primary-blue);
    border-radius: 20px;
    font-size: 0.75rem;
    margin-left: 8px;
    font-weight: 600;
}

/* Style pour les groupes d'options */
.custom-select optgroup {
    font-weight: 600;
    color: var(--primary-blue);
    background-color: #f8f9fa;
    padding: 5px;
}

/* Animation pour le select quand il change */
.custom-select.changed {
    animation: selectChange 0.5s ease;
}

@keyframes selectChange {
    0% { background-color: white; }
    50% { background-color: var(--light-blue); }
    100% { background-color: white; }
}

/* Style pour les selects dans les cards */
.select-card {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    transition: all 0.3s;
    cursor: pointer;
}

.select-card:hover {
    border-color: var(--primary-blue);
    background-color: #f8fbff;
}

.select-card.selected {
    border-color: var(--primary-blue);
    background-color: var(--light-blue);
    box-shadow: 0 0 0 1px var(--primary-blue);
    color : var(--primary-blue);
}

.select-card input[type="radio"] {
    margin-right: 10px;
}

/* Style pour les selects avec prévisualisation */
.select-preview {
    display: flex;
    align-items: center;
    padding: 10px;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    margin-top: 10px;
    min-height: 60px;
}

.preview-icon {
    font-size: 24px;
    color: var(--primary-blue);
    margin-right: 15px;
}

.preview-text {
    font-size: 0.9rem;
    color: #6c757d;
}

.preview-value {
    font-weight: 600;
    color: var(--dark-blue);
}

/* Styles pour les onglets Souscripteur/Assuré */
.person-tabs {
    margin-bottom: 20px;
}

.person-tabs .nav-tabs {
    border-bottom: 2px solid #dee2e6;
    display: flex;
    justify-content: center;
}

.person-tabs .nav-link {
    color: #6c757d;
    font-weight: 600;
    border: none;
    padding: 12px 20px;
    border-radius: 8px 8px 0 0;
    transition: all 0.3s;
    margin-right: 5px;
}

.person-tabs .nav-link:hover {
    color: var(--primary-blue);
    background-color: var(--light-blue);
}

.person-tabs .nav-link.active {
    color: var(--primary-blue);
    background-color: white;
    border-bottom: 3px solid var(--primary-blue);
}

.person-tabs .tab-content {
    background-color: white;
    border-radius: 0 0 8px 8px;
    padding: 20px;
}

.tab-content-inner {
    padding: 15px;
}

.tab-title {
    color: var(--primary-blue);
    border-bottom: 2px solid var(--light-blue);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

/* Styles pour les champs assuré désactivés */
.assure-field:disabled {
    background-color: #e9ecef;
    opacity: 0.7;
    cursor: not-allowed;
}

/* Indicateur pour champs remplis automatiquement */
.auto-filled {
    position: relative;
}

.auto-filled::after {
    content: "✓ Rempli automatiquement";
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: #28a745;
    background-color: #d4edda;
    padding: 2px 8px;
    border-radius: 12px;
    display: none;
}

.auto-filled.show-indicator::after {
    display: block;
}

/* Animation pour le changement d'onglet */
.tab-pane {
    animation: fadeIn 0.3s ease;
}

/* Styles pour la sélection du type de contrat */
.type-contrat-section {
    text-align: center;
    padding: 30px 0;
}

.type-contrat-options {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin: 30px 0;
}

.type-contrat-card {
    flex: 1;
    min-width: 250px;
    max-width: 300px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    background: white;
}

.type-contrat-card:hover {
    border-color: var(--primary-blue);
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.type-contrat-card.selected {
    border-color: var(--primary-blue);
    background-color: var(--light-blue);
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.2);
}

.type-contrat-icon {
    font-size: 48px;
    color: var(--primary-blue);
    margin-bottom: 15px;
}

.type-contrat-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-blue);
    margin-bottom: 10px;
}

.type-contrat-description {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.type-contrat-badge {
    display: inline-block;
    padding: 4px 10px;
    background-color: var(--light-blue);
    color: var(--primary-blue);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Styles pour les assurés multiples */
.assures-list {
    margin-top: 20px;
}

.assure-item {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    background: white;
    transition: all 0.3s ease;
}

.assure-item:hover {
    border-color: #b8d4ff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.assure-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e9ecef;
}

.assure-item-title {
    font-weight: 600;
    color: var(--primary-blue);
    margin: 0;
}

.assure-item-number {
    display: inline-block;
    width: 30px;
    height: 30px;
    background-color: var(--primary-blue);
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 30px;
    font-weight: bold;
    margin-right: 10px;
}

.btn-remove-assure {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-remove-assure:hover {
    background: #c82333;
    transform: scale(1.1);
}

.btn-add-assure {
    display: block;
    width: 100%;
    padding: 15px;
    background-color: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    color: var(--primary-blue);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 15px;
    text-align: center;
}

.btn-add-assure:hover {
    background-color: var(--light-blue);
    border-color: var(--primary-blue);
}

.btn-add-assure:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #e9ecef;
    border-color: #dee2e6;
}

.assure-counter {
    display: inline-block;
    background-color: var(--light-blue);
    color: var(--primary-blue);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-left: 10px;
}

/* Styles pour le récapitulatif multi-personnes */
.summary-person {
    padding: 15px;
    margin-bottom: 10px;
    border-left: 3px solid var(--primary-blue);
    background-color: #f8f9fa;
}

.summary-person-title {
    font-weight: 600;
    color: var(--primary-blue);
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.summary-person-details {
    font-size: 0.9rem;
    color: #6c757d;
}

.summary-person-total {
    font-weight: 600;
    color: var(--dark-blue);
    text-align: right;
    margin-top: 5px;
}

/* Style pour l'affichage conditionnel */
.hidden {
    display: none !important;
}

/* Animation pour l'apparition des éléments */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in {
    animation: slideIn 0.3s ease forwards;
}

/* Animation pour la suppression */
@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateY(0);
        max-height: 500px;
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
        max-height: 0;
        padding: 0;
        margin: 0;
        overflow: hidden;
    }
}

.slide-out {
    animation: slideOut 0.3s ease forwards;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .step-label {
        font-size: 0.8rem;
    }
    
    .custom-select {
        font-size: 0.95rem;
    }
    
    .form-section {
        padding: 20px;
    }
    
    .btn-primary-custom, .btn-outline-primary-custom {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    
    .person-tabs .nav-link {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
    
    .tab-content-inner {
        padding: 10px 0;
    }
    
    .type-contrat-options {
        flex-direction: column;
        align-items: center;
    }
    
    .type-contrat-card {
        width: 100%;
        max-width: 100%;
    }
    
    .assure-item {
        padding: 15px;
    }
}

/* Animation shake pour les erreurs */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.5s ease;
}