/* ====================================
   FORMULAIRE INSCRIPTION ÉTABLISSEMENT - ULTRA AVANCÉ
   ==================================== */

:root {
    --primary: #667eea;
    --secondary: #764ba2;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #1f2937;
    --light: #f9fafb;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    padding: 40px 20px;
    position: relative;
    overflow-x: hidden;
}

/* Particules animées en arrière-plan */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 1px, transparent 1px),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 1px, transparent 1px),
        radial-gradient(circle at 40% 20%, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
    background-size: 100px 100px, 150px 150px, 200px 200px;
    animation: particlesFloat 25s linear infinite;
    z-index: 0;
    pointer-events: none;
}

@keyframes particlesFloat {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(50px, 50px) rotate(360deg); }
}

/* Vagues animées */
body::after {
    content: '';
    position: fixed;
    bottom: -100px;
    left: 0;
    width: 200%;
    height: 200px;
    background: linear-gradient(90deg, 
        rgba(255,255,255,0.05) 0%, 
        rgba(255,255,255,0.1) 50%, 
        rgba(255,255,255,0.05) 100%);
    border-radius: 50%;
    animation: waves 15s ease-in-out infinite;
    z-index: 0;
}

@keyframes waves {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-30px); }
}

.inscription-container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

/* BARRE DE PROGRESSION VERTICALE */
.progress-sidebar {
    position: sticky;
    top: 40px;
    width: 280px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2), 
                0 0 0 1px rgba(255, 255, 255, 0.1);
    animation: slideInLeft 0.6s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.progress-header {
    text-align: center;
    margin-bottom: 30px;
}

.progress-circle-container {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto 20px;
}

.progress-circle-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.progress-circle {
    transform: rotate(-90deg);
    filter: drop-shadow(0 0 10px rgba(102, 126, 234, 0.5));
}

.progress-circle-bg-path {
    fill: none;
    stroke: #e5e7eb;
    stroke-width: 8;
}

.progress-circle-progress {
    fill: none;
    stroke: url(#progressGradient);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 0 8px rgba(102, 126, 234, 0.6));
}

.progress-percentage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 36px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.progress-percentage-label {
    font-size: 12px;
    color: #6b7280;
    font-weight: 600;
    margin-top: 8px;
}

.progress-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 8px;
}

.progress-subtitle {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 25px;
}

.progress-stats {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    background: linear-gradient(135deg, #f0f4ff, #faf5ff);
    border-radius: 12px;
    margin-bottom: 25px;
}

.progress-stat {
    text-align: center;
}

.progress-stat-value {
    display: block;
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}

.progress-stat-label {
    font-size: 11px;
    color: #6b7280;
    font-weight: 600;
    margin-top: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.progress-steps-vertical {
    position: relative;
}

.progress-step-vertical {
    position: relative;
    padding-left: 45px;
    padding-bottom: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.progress-step-vertical:last-child {
    padding-bottom: 0;
}

.progress-step-vertical::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 35px;
    bottom: -5px;
    width: 2px;
    background: linear-gradient(180deg, 
        var(--primary) 0%, 
        var(--secondary) 100%);
    opacity: 0.2;
    transition: opacity 0.3s ease;
}

.progress-step-vertical:last-child::before {
    display: none;
}

.progress-step-vertical.completed::before {
    opacity: 1;
    background: var(--success);
    animation: lineGrow 0.5s ease-out;
}

@keyframes lineGrow {
    from {
        transform: scaleY(0);
        transform-origin: top;
    }
    to {
        transform: scaleY(1);
    }
}

.step-icon-container {
    position: absolute;
    left: 0;
    top: 0;
    width: 35px;
    height: 35px;
    border-radius: 10px;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #9ca3af;
    font-size: 14px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 1;
}

.progress-step-vertical.active .step-icon-container {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.5);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 8px 20px rgba(102, 126, 234, 0.5);
    }
    50% {
        box-shadow: 0 8px 30px rgba(102, 126, 234, 0.8);
    }
}

.progress-step-vertical.completed .step-icon-container {
    background: var(--success);
    color: white;
    transform: scale(1.05);
    animation: checkBounce 0.5s ease-out;
}

@keyframes checkBounce {
    0%, 100% { transform: scale(1.05); }
    50% { transform: scale(1.2); }
}

.step-content {
    margin-top: 5px;
}

.step-title {
    font-size: 14px;
    font-weight: 700;
    color: #9ca3af;
    margin-bottom: 4px;
    transition: color 0.3s ease;
}

.progress-step-vertical.active .step-title {
    color: var(--primary);
}

.progress-step-vertical.completed .step-title {
    color: var(--success);
}

.step-description {
    font-size: 12px;
    color: #9ca3af;
    line-height: 1.4;
}

.step-fields-count {
    display: inline-block;
    margin-top: 5px;
    padding: 3px 8px;
    background: #f3f4f6;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
}

.progress-step-vertical.active .step-fields-count {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary);
}

.progress-step-vertical.completed .step-fields-count {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

/* CARTE PRINCIPALE */
.inscription-card {
    flex: 1;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 50px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2),
                0 0 0 1px rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    animation: slideInRight 0.6s ease-out;
}

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

.inscription-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, 
        var(--primary) 0%, 
        var(--secondary) 50%, 
        #f093fb 100%);
    background-size: 200% 100%;
    animation: gradientSlide 3s linear infinite;
}

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

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    padding: 12px 24px;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 30px;
    background: rgba(102, 126, 234, 0.05);
    border: 2px solid transparent;
}

.back-link:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: var(--primary);
    transform: translateX(-8px);
}

.back-link i {
    transition: transform 0.3s ease;
}

.back-link:hover i {
    transform: translateX(-5px);
    animation: bounceLeft 0.6s ease infinite;
}

@keyframes bounceLeft {
    0%, 100% { transform: translateX(-5px); }
    50% { transform: translateX(-10px); }
}

.inscription-header {
    text-align: center;
    margin-bottom: 50px;
    position: relative;
}

.inscription-header::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 2px;
}

.inscription-header h1 {
    font-size: 38px;
    color: var(--dark);
    margin-bottom: 12px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.inscription-header h1 i {
    color: var(--primary);
    margin-right: 12px;
    animation: rotateIcon 3s ease-in-out infinite;
}

@keyframes rotateIcon {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(10deg); }
}

.inscription-header p {
    color: #6b7280;
    font-size: 16px;
    font-weight: 500;
}

.message {
    padding: 18px 24px;
    border-radius: 16px;
    margin-bottom: 30px;
    font-weight: 600;
    animation: messageSlide 0.5s ease-out;
    border: 2px solid;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.message::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    animation: progressBar 3s ease-in-out;
}

@keyframes progressBar {
    from { height: 0%; }
    to { height: 100%; }
}

.message.success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border-color: var(--success);
}

.message.success::before {
    background: var(--success);
}

.message.error {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border-color: var(--danger);
}

.message.error::before {
    background: var(--danger);
}

form {
    position: relative;
}

.form-section {
    margin-bottom: 35px;
    padding: 35px;
    background: linear-gradient(135deg, #fafbff 0%, #f5f7ff 100%);
    border-radius: 20px;
    border: 2px solid #e5e7eb;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.form-section::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.6s ease;
}

.form-section:hover::before {
    left: 100%;
}

.form-section:hover {
    border-color: var(--primary);
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
}

.form-group {
    position: relative;
    animation: fadeInUp 0.6s ease-out backwards;
}

.form-group:nth-child(1) { animation-delay: 0.1s; }
.form-group:nth-child(2) { animation-delay: 0.15s; }
.form-group:nth-child(3) { animation-delay: 0.2s; }
.form-group:nth-child(4) { animation-delay: 0.25s; }
.form-group:nth-child(5) { animation-delay: 0.3s; }
.form-group:nth-child(6) { animation-delay: 0.35s; }

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

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: var(--dark);
    font-weight: 700;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-group label i {
    color: var(--primary);
    font-size: 16px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 14px;
    font-size: 15px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
    font-family: inherit;
    font-weight: 500;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1),
                0 8px 20px rgba(102, 126, 234, 0.15);
    transform: translateY(-3px);
    background: #fafbff;
}

.form-group textarea {
    min-height: 130px;
    resize: vertical;
}

.form-group input:valid:not(:placeholder-shown),
.form-group select:valid,
.form-group textarea:valid:not(:placeholder-shown) {
    border-color: var(--success);
    background: linear-gradient(135deg, white 0%, #f0fdf4 100%);
}

.form-group input:valid:not(:placeholder-shown) ~ .field-check,
.form-group select:valid ~ .field-check,
.form-group textarea:valid:not(:placeholder-shown) ~ .field-check {
    opacity: 1;
    transform: scale(1);
}

.field-check {
    position: absolute;
    right: 15px;
    top: 45px;
    width: 24px;
    height: 24px;
    background: var(--success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.file-upload {
    position: relative;
}

.file-upload input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.file-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 30px;
    border: 3px dashed #d1d5db;
    border-radius: 16px;
    background: linear-gradient(135deg, #fafbff 0%, white 100%);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 700;
    color: #374151;
    position: relative;
    overflow: hidden;
}

.file-upload-label::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.1), transparent);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.file-upload-label:hover::before {
    width: 400px;
    height: 400px;
}

.file-upload-label:hover {
    border-color: var(--primary);
    background: linear-gradient(135deg, #f0f4ff 0%, #faf5ff 100%);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.2);
}

.file-upload-label i {
    font-size: 36px;
    color: var(--primary);
    transition: transform 0.4s ease;
}

.file-upload-label:hover i {
    transform: scale(1.2) rotate(10deg);
}

.btn-submit {
    width: 100%;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-submit::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn-submit:hover::before {
    width: 500px;
    height: 500px;
}

.btn-submit:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.6);
}

.btn-submit:active {
    transform: translateY(-2px);
}

.btn-submit i {
    font-size: 20px;
    position: relative;
    z-index: 1;
    animation: iconBounce 1s ease infinite;
}

@keyframes iconBounce {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(5px); }
}

/* RESPONSIVE */
@media (max-width: 1024px) {
    .inscription-container {
        flex-direction: column;
    }
    
    .progress-sidebar {
        width: 100%;
        position: relative;
        top: 0;
    }
    
    .progress-steps-vertical {
        display: flex;
        gap: 15px;
        overflow-x: auto;
        padding-bottom: 10px;
    }
    
    .progress-step-vertical {
        flex: 0 0 auto;
        padding-left: 0;
        padding-bottom: 0;
        min-width: 120px;
    }
    
    .progress-step-vertical::before {
        display: none;
    }
    
    .step-icon-container {
        position: relative;
        margin: 0 auto 10px;
    }
}

@media (max-width: 768px) {
    .inscription-card {
        padding: 30px 20px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .inscription-header h1 {
        font-size: 28px;
    }
    
    .progress-circle-container {
        width: 120px;
        height: 120px;
    }
    
    .progress-percentage {
        font-size: 30px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 20px 10px;
    }
    
    .inscription-card {
        padding: 25px 15px;
        border-radius: 16px;
    }
    
    .form-section {
        padding: 20px 15px;
    }
}