@import url(https://db.onlinewebfonts.com/c/81ac2124fcb0485a9fb3c187cf30f60d?family=Fontania);
@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap');

/* Reset et configuration de base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Montserrat", sans-serif;
    /* font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; */
    /* background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); */
    /* background: linear-gradient(90deg, rgb(4, 157, 191) 0%, rgb(255, 183, 3) 100%); */
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
    color: #2c3e50;
}

/* Container principal */
.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    border: 1px solid #2c3e50;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
    position: relative;
}

/* Header */
.header {
    /* background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%); */
    background: linear-gradient(-90deg, rgb(4, 157, 191) 0%, rgb(255, 183, 3) 100%);
    color: white;
    padding: 30px;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 20"><defs><pattern id="grain" width="4" height="4" patternUnits="userSpaceOnUse"><circle cx="2" cy="2" r="0.5" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="20" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.header h1 {
    font-size: 2.2em;
    margin-bottom: 10px;
    font-weight: 300;
    position: relative;
    z-index: 2;
}

.header p {
    opacity: 0.9;
    font-size: 1.1em;
    position: relative;
    z-index: 2;
}

/* Barre de progression */
.progress-container {
    background: #f8f9fa;
    padding: 20px 30px;
    border-bottom: 1px solid #e9ecef;
}

.progress-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: #e9ecef;
    transform: translateY(-50%);
    z-index: 1;
    border-radius: 2px;
}

.progress-fill {
    position: absolute;
    top: 50%;
    left: 0;
    height: 4px;
    /* background: linear-gradient(90deg, #667eea, #764ba2); */
    background: linear-gradient(-90deg, rgb(4, 157, 191) 0%, rgb(255, 183, 3) 100%);
    transform: translateY(-50%);
    z-index: 2;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    width: 16.66%;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

.step {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: 3px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    z-index: 3;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    color: #6c757d;
    font-size: 14px;
    position: relative;
    cursor: pointer;
}

.step::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: transparent;
    transform: translate(-50%, -50%) scale(0);
    transition: all 0.3s ease;
    z-index: -1;
}

.step.active {
    /* background: linear-gradient(135deg, #667eea, #764ba2); */
    background: linear-gradient(-90deg, rgb(4, 157, 191) 0%, rgb(255, 183, 3) 100%);
    color: white;
    /* border-color: #667eea; */
    border-color: rgb(4, 157, 191);
    transform: scale(1.15);
    box-shadow: 0 5px 20px rgba(255, 183, 3, 0.4);
}

.step.active::after {
    /* background: rgba(102, 126, 234, 0.1); */
    transform: translate(-50%, -50%) scale(1);
}

.step.completed {
    background: #28a745;
    border-color: #28a745;
    color: white;
    transform: scale(1.05);
    box-shadow: 0 3px 15px rgba(40, 167, 69, 0.3);
}

.step:hover:not(.active):not(.completed) {
    /* border-color: #667eea; */
    border-color: rgb(255, 183, 3);
    transform: scale(1.05);
}

/* Container du formulaire */
.form-container {
    padding: 40px;
    min-height: 500px;
    position: relative;
}

/* Étapes du formulaire */
.form-step {
    display: none;
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-step.active {
    display: block;
    opacity: 1;
    transform: translateX(0);
    animation: slideIn 0.6s ease forwards;
}

.conditional-step {
    display: none !important;
}

.conditional-step.active {
    display: block !important;
    opacity: 1;
    transform: translateX(0);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Titre des étapes */
.step-title {
    font-size: 1.8em;
    color: transparent;
    background: linear-gradient(90deg, rgb(4, 157, 191), rgb(255, 183, 3));
    background-clip: text;
    margin-bottom: 30px;
    text-align: center;
    position: relative;
    padding-bottom: 15px;
}

.step-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 80px;
    height: 3px;
    background: rgb(4, 157, 191);
    transform: translateX(-50%);
    border-radius: 2px;
}

/* Groupes de formulaire */
.form-group {
    margin-bottom: 25px;
    position: relative;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

/* Labels */
label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
}

label::before {
    content: '';
    position: absolute;
    left: -15px;
    top: 50%;
    width: 3px;
    height: 0;
    background: linear-gradient(180deg, #667eea, #764ba2);
    transform: translateY(-50%);
    transition: height 0.3s ease;
    border-radius: 2px;
}

.form-group:focus-within label::before {
    height: 100%;
}

/* Inputs, selects, textarea */
input, select, textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #f8f9fa;
    color: #2c3e50;
    font-family: inherit;
}

input::placeholder,
textarea::placeholder {
    color: #6c757d;
    opacity: 0.7;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
}

input:valid:not(:placeholder-shown) {
    border-color: #28a745;
    background: rgba(40, 167, 69, 0.05);
}

input:invalid:not(:placeholder-shown):not(:focus) {
    border-color: #dc3545;
    background: rgba(220, 53, 69, 0.05);
}

/* Textarea spécifique */
textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

/* Select spécifique */
select {
    cursor: pointer;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23667eea" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6,9 12,15 18,9"></polyline></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

/* Groupes de checkbox/radio */
.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    padding: 18px 20px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #f8f9fa;
    position: relative;
    overflow: hidden;
}

.checkbox-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transition: left 0.5s ease;
}

.checkbox-item:hover {
    /* border-color: #667eea; */
    border-color: rgb(4, 157, 191);
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.1);
}

.checkbox-item:hover::before {
    left: 100%;
}

.checkbox-item input[type="radio"] {
    width: auto;
    margin-right: 12px;
    transform: scale(1.2);
    /* accent-color: #667eea; */
    accent-color: rgb(4, 157, 191);
}

.checkbox-item label {
    margin: 0;
    font-weight: 500;
    text-transform: none;
    letter-spacing: normal;
    cursor: pointer;
    color: #2c3e50;
}

.checkbox-item.selected {
    /* border-color: #667eea; */
    border-color: rgb(4, 157, 191);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15), rgba(118, 75, 162, 0.15));
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.2);
}

.checkbox-item.selected label {
    /* color: #667eea; */
    color: rgb(4, 157, 191);
    font-weight: 600;
}

/* Champs conditionnels */
.conditional-field {
    margin-top: 25px;
    padding: 25px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 15px;
    border-left: 4px solid #667eea;
    position: relative;
    animation: slideDown 0.4s ease forwards;
}

.conditional-field::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, #667eea, #764ba2);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
        max-height: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 500px;
    }
}

/* Notice de confidentialité */
.confidentiality-notice {
    background: linear-gradient(135deg, #e3f2fd, #f3e5f5);
    border: 1px solid #bbdefb;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    color: #1565c0;
    line-height: 1.6;
    position: relative;
    overflow: hidden;
}

.confidentiality-notice::before {
    content: '🔒';
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 24px;
    opacity: 0.3;
}

.confidentiality-notice h3 {
    color: #0d47a1;
    margin-bottom: 15px;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.confidentiality-notice h3::before {
    content: '🛡️';
    font-size: 18px;
}

/* Navigation */
.navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #e9ecef;
    position: relative;
}

.navigation::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 1px;
    background: linear-gradient(90deg, transparent, #667eea, transparent);
}

/* Boutons */
.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    min-width: 140px;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    /* background: linear-gradient(135deg, #667eea, #764ba2); */
    background: rgb(4, 157, 191);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    /* background: linear-gradient(135deg, #5a6fd8, #6a4190); */
    background:rgb(255, 183, 3);
}

.btn-secondary {
    /* background: #6c757d; */
    background:rgb(255, 183, 3);
    color: white;
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.btn-secondary:hover {
    /* background: #5a6268; */
    background: rgb(4, 157, 191);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(108, 117, 125, 0.4);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

.btn:active {
    transform: translateY(-1px);
}

/* Loading state */
.btn.loading {
    color: transparent;
    position: relative;
}

.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Animation de fondu */
.fade-in {
    animation: fadeIn 0.6s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* États de validation visuels */
.form-group.error input,
.form-group.error select,
.form-group.error textarea {
    border-color: #dc3545;
    background-color: rgba(220, 53, 69, 0.05);
    animation: shake 0.3s ease-in-out;
}

.form-group.success input,
.form-group.success select,
.form-group.success textarea {
    border-color: #28a745;
    background-color: rgba(40, 167, 69, 0.05);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Focus indicators améliorés */
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.btn:focus-visible {
    outline: 3px solid rgba(102, 126, 234, 0.3);
    outline-offset: 2px;
}

/* Responsive design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        margin: 0;
        border-radius: 15px;
    }

    .header {
        padding: 20px;
    }

    .header h1 {
        font-size: 1.8em;
    }

    .progress-container {
        padding: 15px 20px;
    }

    .step {
        width: 35px;
        height: 35px;
        font-size: 12px;
    }

    .form-container {
        padding: 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .checkbox-group {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .checkbox-item {
        padding: 15px;
    }

    .step-title {
        font-size: 1.5em;
        margin-bottom: 20px;
    }

    .btn {
        padding: 12px 20px;
        font-size: 14px;
        min-width: 120px;
    }

    .navigation {
        flex-direction: column;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5em;
    }

    .header p {
        font-size: 1em;
    }

    .step-title {
        font-size: 1.3em;
    }

    .form-container {
        padding: 15px;
    }

    .progress-bar {
        padding: 0 10px;
    }

    .step {
        width: 30px;
        height: 30px;
        font-size: 11px;
    }
}

/* Améliorations pour l'accessibilité */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Mode sombre support */
@media (prefers-color-scheme: dark) {
    .container {
        background: #1a1a1a;
        color: #e0e0e0;
    }

    input, select, textarea {
        background: #2d2d2d;
        border-color: #404040;
        color: #e0e0e0;
    }

    input:focus, select:focus, textarea:focus {
        background: #333;
        border-color: #667eea;
    }

    .form-step {
        color: #e0e0e0;
    }

    .step-title {
        color: #e0e0e0;
    }

    label {
        color: #e0e0e0;
    }
}