/* ============================================
   BOUTON D'INSCRIPTION - VERSION MODERNE
   ============================================ */

/* Bouton Application */
.btn-app {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn-app::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;
}

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

.btn-app:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6941a8 100%);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
    transform: translateY(-2px);
}

.btn-app:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.btn-inscription {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn-inscription::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;
}

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

.btn-inscription:hover {
    background: linear-gradient(135deg, #229954 0%, #1e8449 100%);
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.5);
    transform: translateY(-2px);
}

.btn-inscription:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.4);
}

/* ============================================
   MODAL MODERNE - BACKDROP AMÉLIORÉ
   ============================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.95), rgba(118, 75, 162, 0.95));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    overflow-y: auto;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.hidden {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ============================================
   CONTAINER MODAL - DESIGN MODERNE
   ============================================ */

.modal-container {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 24px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 0;
    position: relative;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    animation: modalSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Scrollbar personnalisée */
.modal-container::-webkit-scrollbar {
    width: 8px;
}

.modal-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.modal-container::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 10px;
}

.modal-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2, #667eea);
}

/* ============================================
   HEADER DU MODAL
   ============================================ */

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2.5rem 2rem;
    border-radius: 24px 24px 0 0;
    position: relative;
    text-align: center;
    color: white;
}

.modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.3;
    border-radius: 24px 24px 0 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 2.2rem;
    font-weight: 700;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.modal-subtitle {
    margin: 0.5rem 0 0 0;
    font-size: 1.1rem;
    opacity: 0.95;
    font-weight: 400;
    position: relative;
    z-index: 1;
}

/* ============================================
   BOUTON FERMER MODERNE
   ============================================ */

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    z-index: 2;
}

.modal-close:hover {
    background: rgba(231, 76, 60, 0.9);
    border-color: rgba(231, 76, 60, 1);
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
}

.modal-close:active {
    transform: rotate(90deg) scale(0.95);
}

/* ============================================
   CONTENU DU FORMULAIRE
   ============================================ */

.modal-body {
    padding: 2rem;
}

.form-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.form-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.1);
}

.form-section h3 {
    margin: 0 0 1rem 0;
    color: #2c3e50;
    font-size: 1.3rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-section h3::before {
    content: '';
    width: 4px;
    height: 24px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 2px;
}

.form-hint {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin: -0.5rem 0 1rem 0;
    font-style: italic;
}

/* ============================================
   DISPOSITION DES CHAMPS
   ============================================ */

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #34495e;
    font-weight: 600;
    font-size: 0.95rem;
}

.required {
    color: #e74c3c;
    margin-left: 2px;
}

/* ============================================
   INPUTS MODERNES
   ============================================ */

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e8ecef;
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: #cbd5e0;
}

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

/* Placeholders */
.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #a0aec0;
}

/* ============================================
   GRILLE DES ÉQUIPES - VERSION MODERNE
   ============================================ */

.equipes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.equipe-card {
    position: relative;
    border: 2px solid #e8ecef;
    border-radius: 16px;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: block;
    background: white;
    overflow: hidden;
}

.equipe-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.equipe-card:hover {
    border-color: #667eea;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.15);
    transform: translateY(-4px);
}

.equipe-card:hover::before {
    transform: scaleX(1);
}

.equipe-card input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.equipe-card input[type="checkbox"]:checked + .equipe-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.equipe-card input[type="checkbox"]:checked + .equipe-content .equipe-icon {
    transform: scale(1.2);
}

.equipe-content {
    text-align: center;
    transition: all 0.3s ease;
    border-radius: 14px;
    padding: 1.5rem;
    position: relative;
}

.equipe-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.75rem;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.equipe-content strong {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 1.05rem;
    font-weight: 600;
}

.equipe-content p {
    font-size: 0.9rem;
    margin: 0;
    opacity: 0.9;
    line-height: 1.4;
}

/* Badge de sélection */
.equipe-card input[type="checkbox"]:checked + .equipe-content::after {
    content: '✓';
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem;
    animation: checkBounce 0.4s ease;
}

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

/* ============================================
   BOUTONS D'ACTION MODERNES
   ============================================ */

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding: 1.5rem 2rem;
    background: #f8f9fa;
    border-radius: 0 0 24px 24px;
    margin-left: -2rem;
    margin-right: -2rem;
    margin-bottom: -2rem;
}

.form-actions button {
    padding: 0.875rem 2rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

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

.btn-primary:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-secondary:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

/* ============================================
   MESSAGES DE RÉSULTAT
   ============================================ */

.message-success,
.message-error {
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    animation: slideDown 0.3s ease;
}

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

.message-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border-left: 4px solid #28a745;
}

.message-success::before {
    content: '✓';
    font-size: 1.5rem;
    font-weight: bold;
}

.message-error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.message-error::before {
    content: '⚠';
    font-size: 1.5rem;
}

/* ============================================
   LOADING STATE
   ============================================ */

.btn-primary #btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary #btn-loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   RESPONSIVE MOBILE
   ============================================ */

@media (max-width: 768px) {
    .modal-overlay {
        padding: 0.5rem;
    }
    
    .modal-container {
        border-radius: 20px;
        max-height: 95vh;
    }
    
    .modal-header {
        padding: 2rem 1.5rem;
        border-radius: 20px 20px 0 0;
    }
    
    .modal-header h2 {
        font-size: 1.75rem;
        padding-right: 40px;
    }
    
    .modal-subtitle {
        font-size: 1rem;
    }
    
    .modal-close {
        width: 40px;
        height: 40px;
        top: 1rem;
        right: 1rem;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
    
    .form-section {
        padding: 1.25rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .equipes-grid {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column-reverse;
        padding: 1rem 1.5rem;
        gap: 0.75rem;
    }
    
    .form-actions button {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .modal-header h2 {
        font-size: 1.5rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .form-section {
        padding: 1rem;
    }
    
    .equipe-content {
        padding: 1.25rem;
    }
    
    .equipe-icon {
        font-size: 2rem;
    }
}

/* ============================================
   ANIMATIONS AVANCÉES
   ============================================ */

@media (prefers-reduced-motion: no-preference) {
    .form-section {
        animation: fadeInUp 0.5s ease backwards;
    }
    
    .form-section:nth-child(1) { animation-delay: 0.1s; }
    .form-section:nth-child(2) { animation-delay: 0.2s; }
    .form-section:nth-child(3) { animation-delay: 0.3s; }
    .form-section:nth-child(4) { animation-delay: 0.4s; }
    .form-section:nth-child(5) { animation-delay: 0.5s; }
    
    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* ============================================
   DARK MODE SUPPORT (optionnel)
   ============================================ */

@media (prefers-color-scheme: dark) {
    .modal-container {
        background: linear-gradient(145deg, #2d3748 0%, #1a202c 100%);
    }
    
    .form-section {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .form-section h3 {
        color: #e2e8f0;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        background: #1a202c;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .form-group input:focus,
    .form-group select:focus,
    .form-group textarea:focus {
        background: #2d3748;
    }
    
    .equipe-card {
        background: #2d3748;
        border-color: #4a5568;
    }
}

/* ============================================
   ACCESSIBILITÉ
   ============================================ */

.form-group input:focus-visible,
.form-group select:focus-visible,
.form-group textarea:focus-visible,
button:focus-visible {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

/* Amélioration du contraste pour les labels */
.form-group label {
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}
