/* Container de formulaire - CORRIGÉ pour la navigation */
.form-section {
    position: relative;
    margin-left: 45%;
    width: 55%;
    height: calc(100vh - var(--nav-height)); /* CORRIGÉ : Soustrait la hauteur de la navigation */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 2;
    overflow: hidden;
}

.form-container {
    width: 100%;
    max-width: 600px;
    background: var(--background-dark);
    border-radius: var(--border-radius-large);
    border: 1px solid var(--border-color);
    padding: 30px;
    backdrop-filter: blur(10px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-height: calc(100vh - var(--nav-height) - 40px); /* CORRIGÉ : Ajuste aussi le max-height */
    overflow-y: auto;
}

.form-header {
    text-align: center;
    margin-bottom: 40px;
}

.form-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--accent-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}

/* Consignes de soumission */
.submission-guidelines {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.submission-guidelines h2 {
    margin: 0 0 12px 0;
    font-size: 1.4em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.submission-guidelines p {
    margin: 8px 0;
    line-height: 1.6;
    opacity: 0.95;
}

.submission-guidelines .highlight {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

/* Description de catégorie */
.category-description {
    background: none;
    border: none;
    border-radius: 0;
    padding: 8px 0;
    margin-top: 5px;
    font-size: 0.9em;
    color: var(--text-primary);
    line-height: 1.4;
    font-style: italic;
    animation: fadeInDescription 0.3s ease-out;
}

.category-description::before {
    content: "";
    margin-right: 0;
}

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

/* Modal de confirmation */
.confirmation-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.confirmation-modal.show {
    opacity: 1;
    visibility: visible;
}

.confirmation-content {
    background: white;
    border-radius: 16px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.confirmation-modal.show .confirmation-content {
    transform: scale(1) translateY(0);
}

.confirmation-header {
    text-align: center;
    margin-bottom: 20px;
}

.confirmation-header .icon {
    font-size: 3em;
    margin-bottom: 10px;
    display: block;
}

.confirmation-header h3 {
    margin: 0;
    color: #2d3748;
    font-size: 1.3em;
}

.confirmation-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 25px;
}

.confirmation-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
}

.confirmation-btn.cancel {
    background: #e2e8f0;
    color: #4a5568;
}

.confirmation-btn.cancel:hover {
    background: #cbd5e0;
}

.confirmation-btn.confirm {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
}

.confirmation-btn.confirm:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.4);
}

/* Groupes de formulaire */
.form-group {
    margin-bottom: 30px;
}

.form-group label {
    display: flex;
    align-items: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.label-icon {
    font-size: 1.3rem;
    margin-right: 10px;
}

/* Champs de saisie */
.form-group input[type="text"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    background: rgba(60, 60, 60, 0.8);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
    resize: none;
}

.form-group input[type="text"]:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(70, 70, 70, 0.9);
    box-shadow: 0 0 0 3px rgba(107, 115, 255, 0.2);
}

.form-group input[type="text"]::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group textarea {
    height: 150px;
    resize: vertical;
    min-height: 120px;
    max-height: 300px;
}

/* Compteur de caractères */
.character-count {
    text-align: right;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 8px;
}

/* Upload de photos */
.photo-upload-area {
    position: relative;
    border: 2px dashed rgba(107, 115, 255, 0.4);
    border-radius: var(--border-radius);
    background: rgba(60, 60, 60, 0.6);
    transition: var(--transition);
    overflow: hidden;
}

.photo-upload-area:hover {
    border-color: var(--primary-color);
    background: rgba(70, 70, 70, 0.8);
}

.photo-upload-area input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.upload-placeholder {
    text-align: center;
    padding: 40px 20px;
    pointer-events: none;
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.upload-placeholder p {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.upload-hint {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Prévisualisation des photos */
.photo-preview-container {
    display: none;
    padding: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.photo-preview-container.has-photos {
    display: flex;
}

.photo-preview-container.has-photos ~ .upload-placeholder {
    display: none;
}

.photo-preview {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(80, 80, 80, 0.8);
}

.photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-remove {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: rgba(255, 0, 0, 0.8);
    border: none;
    color: white;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.photo-remove:hover {
    background: rgba(255, 0, 0, 1);
    transform: scale(1.1);
}

/* Case à cocher personnalisée */
.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 5px;
}

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

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 1.4;
    color: var(--text-secondary);
    font-weight: normal;
}

.checkbox-custom {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(107, 115, 255, 0.4);
    border-radius: 4px;
    background: rgba(60, 60, 60, 0.8);
    position: relative;
    transition: var(--transition);
    margin-top: 2px;
}

.checkbox-custom::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 6px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.checkbox-group input[type="checkbox"]:checked + .checkbox-label .checkbox-custom {
    background: var(--accent-gradient);
    border-color: var(--primary-color);
}

.checkbox-group input[type="checkbox"]:checked + .checkbox-label .checkbox-custom::after {
    opacity: 1;
}

.checkbox-text {
    flex: 1;
}

.terms-link {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.terms-link:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* Erreurs de formulaire */
.form-error {
    color: var(--error-color);
    font-size: 0.9rem;
    margin-top: 8px;
    display: none;
}

.form-error.show {
    display: block;
}

.form-group.error input,
.form-group.error select,
.form-group.error textarea,
.form-group.error .checkbox-custom {
    border-color: var(--error-color);
}

.form-group.error input,
.form-group.error select,
.form-group.error textarea {
    background: rgba(255, 107, 107, 0.1);
}

/* Actions du formulaire */
.form-actions {
    display: flex;
    gap: 20px;
    margin-top: 40px;
    justify-content: center;
}

/* Messages de retour */
.message-container {
    margin-top: 30px;
}

/* Media queries pour formulaires - CORRIGÉES */
@media (max-aspect-ratio: 1/1) {
    .form-section {
        margin-left: 0;
        width: 100%;
        height: calc(100vh - var(--nav-height)); /* CORRIGÉ : Garde la correction sur mobile */
        padding: 20px 15px;
        align-items: center;
        overflow: hidden;
    }
    
    .form-container {
        padding: 30px 25px;
        max-width: none;
        margin: 0 auto;
        max-height: calc(100vh - var(--nav-height) - 40px); /* CORRIGÉ : Ajuste aussi pour mobile */
    }
    
    .form-header h1 {
        font-size: 2rem;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 15px;
    }
    
    .photo-preview {
        width: 100px;
        height: 100px;
    }
    
    .upload-placeholder {
        padding: 30px 15px;
    }
    
    .confirmation-content {
        margin: 20px;
        padding: 25px 20px;
    }
    
    .confirmation-actions {
        flex-direction: column;
    }
    
    .confirmation-btn {
        width: 100%;
    }
}

@media (max-width: 600px) {
    .form-container {
        padding: 25px 20px;
    }
    
    .form-header h1 {
        font-size: 1.8rem;
    }
    
    .form-group textarea {
        height: 120px;
    }
    
    .photo-preview-container {
        justify-content: center;
    }
}