/* ═══════════════════════════════════════════════════════════
   MODULE SOUMISSION DOCUMENTS v2.6.0 - CSS
   ═══════════════════════════════════════════════════════════ */

.sp-docs-wrapper {
    max-width: 1200px;
    margin: 40px auto;
    padding: 20px;
}

@media (max-width: 768px) {
    .sp-docs-wrapper {
        margin: 10px;
        padding: 10px;
    }
}

/* Messages */
.sp-docs-alert {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-weight: 500;
}

.sp-docs-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.sp-docs-error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

/* Box principale */
.sp-docs-box {
    background: #fff;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.sp-docs-box h2 {
    color: #1a3c34;
    margin: 0 0 16px 0;
    font-size: 28px;
}

/* Header dossier */
.sp-docs-header {
    background: linear-gradient(135deg, #1a3c34 0%, #2d5f52 100%);
    padding: 24px;
    border-radius: 8px;
    color: white;
    margin-bottom: 32px;
}

.sp-docs-header h2 {
    color: #fff;
    margin: 0 0 8px 0;
    font-size: 24px;
}

.sp-docs-dossier {
    color: rgba(255,255,255,0.9);
    margin: 0;
    font-size: 14px;
}

.sp-docs-dossier strong {
    color: #f5a623;
}

/* Grille de cartes - 3 colonnes sur desktop */
.sp-docs-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 32px 0;
    max-width: 100%;
}

@media (max-width: 768px) {
    .sp-docs-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px;
    }
    
    .sp-docs-box {
        padding: 20px 15px;
    }
}

@media (max-width: 480px) {
    .sp-docs-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
    }
    
    .sp-docs-box {
        padding: 15px 10px;
    }
}

/* Carte individuelle (style simulateur) */
.sp-doc-card {
    position: relative;
    background: linear-gradient(135deg, #fff 0%, #f9f9f9 100%);
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 24px 16px;
    min-height: 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
}

.sp-doc-card:hover {
    transform: translateY(-4px);
    border-color: #f5a623;
    box-shadow: 0 8px 20px rgba(245, 166, 35, 0.2);
}

.sp-doc-card:active {
    transform: translateY(-2px);
}

/* Carte avec fichiers */
.sp-doc-card.sp-has-files {
    border-color: #28a745;
    background: linear-gradient(135deg, #f0fff4 0%, #e6f9ea 100%);
}

.sp-doc-card.sp-has-files .sp-doc-icon {
    filter: drop-shadow(0 2px 4px rgba(40, 167, 69, 0.3));
}

/* Badge obligatoire */
.sp-doc-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #f5a623;
    color: #fff;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Icône de la carte */
.sp-doc-icon {
    font-size: 48px;
    margin-bottom: 12px;
    display: block;
}

/* Nom du document */
.sp-doc-name {
    color: #1a3c34;
    font-weight: 600;
    font-size: 15px;
    line-height: 1.3;
    margin: 0 0 8px 0;
}

/* Compteur de fichiers */
.sp-doc-count {
    background: #28a745;
    color: #fff;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
}

/* Checkmark */
.sp-doc-checkmark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 64px;
    color: #28a745;
    opacity: 0.3;
}

/* ═══════════════════════════════════════════════════════════
   MODALE
   ═══════════════════════════════════════════════════════════ */

.sp-docs-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 999999999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.sp-docs-modal.sp-modal-open {
    display: flex;
}

.sp-docs-modal-content {
    background: #fff;
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    animation: sp-slide-in 0.3s ease-out;
}

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

/* Header de la modale */
.sp-docs-modal-header {
    background: linear-gradient(135deg, #1a3c34 0%, #2d5f52 100%);
    padding: 24px;
    border-radius: 16px 16px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sp-docs-modal-title {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    margin: 0;
    font-size: 20px;
}

.sp-docs-modal-icon {
    font-size: 32px;
}

.sp-docs-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sp-docs-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Body de la modale */
.sp-docs-modal-body {
    padding: 32px;
}

/* Zone d'alerte dans la modale */
.sp-modal-alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    display: none;
}

.sp-modal-alert.sp-modal-error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
    display: block;
}

.sp-modal-alert.sp-modal-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
    display: block;
}

.sp-docs-modal-desc {
    color: #666;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

/* Choix du type (pour pièce ID) */
.sp-id-type-choice {
    margin-bottom: 24px;
    padding: 20px;
    background: #f5f9f7;
    border-radius: 8px;
}

.sp-id-type-choice label {
    font-weight: 600;
    color: #1a3c34;
    margin-bottom: 12px;
    display: block;
}

.sp-id-type-option {
    display: flex;
    align-items: center;
    padding: 12px;
    margin-bottom: 8px;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.sp-id-type-option:hover {
    border-color: #f5a623;
    background: #fff7e6;
}

.sp-id-type-option input[type="radio"] {
    margin-right: 12px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.sp-id-type-option:has(input:checked) {
    border-color: #f5a623;
    background: #fff7e6;
}

.sp-id-type-label {
    flex: 1;
    cursor: pointer;
}

.sp-id-type-label strong {
    color: #1a3c34;
    display: block;
    margin-bottom: 4px;
}

.sp-id-type-label small {
    color: #666;
    font-size: 13px;
}

/* Zone d'upload */
.sp-upload-zone {
    border: 3px dashed #ccc;
    border-radius: 12px;
    padding: 48px 24px;
    text-align: center;
    background: #f9f9f9;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 20px;
}

.sp-upload-zone:hover,
.sp-upload-zone.sp-drag-over {
    border-color: #f5a623;
    background: #fff7e6;
}

.sp-upload-icon {
    font-size: 48px;
    margin-bottom: 12px;
    display: block;
}

.sp-upload-text {
    color: #1a3c34;
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 6px;
    display: block;
}

.sp-upload-hint {
    color: #999;
    font-size: 13px;
}

.sp-upload-input {
    display: none;
}

/* Liste des fichiers */
.sp-files-list {
    margin-top: 20px;
}

.sp-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f5f9f7;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 10px;
    transition: all 0.3s;
}

.sp-file-item:hover {
    background: #edf5f2;
    border-color: #f5a623;
}

.sp-file-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sp-file-icon {
    font-size: 24px;
}

.sp-file-details {
    flex: 1;
}

.sp-file-name {
    color: #1a3c34;
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 2px;
}

.sp-file-size {
    color: #999;
    font-size: 12px;
}

.sp-file-remove {
    background: #dc3545;
    color: #fff;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s;
}

.sp-file-remove:hover {
    background: #c82333;
    transform: scale(1.05);
}

/* Actions de la modale */
.sp-docs-modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.sp-docs-modal-btn {
    flex: 1;
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.sp-docs-modal-btn-cancel {
    background: #e0e0e0;
    color: #666;
}

.sp-docs-modal-btn-cancel:hover {
    background: #ccc;
}

.sp-docs-modal-btn-save {
    background: #f5a623;
    color: #fff;
}

.sp-docs-modal-btn-save:hover {
    background: #e69500;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 166, 35, 0.3);
}

/* Bouton principal */
.sp-docs-submit {
    text-align: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 2px solid #e0e0e0;
}

.sp-docs-btn {
    padding: 16px 48px;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}

.sp-docs-btn-primary {
    background: linear-gradient(135deg, #1a3c34 0%, #2d5f52 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(26, 60, 52, 0.3);
}

.sp-docs-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(26, 60, 52, 0.4);
}

.sp-docs-btn-secondary {
    background: #e0e0e0;
    color: #666;
    margin-top: 16px;
}

.sp-docs-btn-secondary:hover {
    background: #ccc;
}

/* Formulaire de vérification */
.sp-docs-verify-form {
    max-width: 500px;
    margin: 0 auto;
}

.sp-docs-field {
    margin-bottom: 20px;
}

.sp-docs-field label {
    display: block;
    color: #1a3c34;
    font-weight: 600;
    margin-bottom: 8px;
}

.sp-docs-field input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.sp-docs-field input:focus {
    outline: none;
    border-color: #f5a623;
}

.sp-docs-field small {
    display: block;
    color: #999;
    margin-top: 6px;
    font-size: 13px;
}

/* Help box */
.sp-docs-help {
    background: #f5f9f7;
    padding: 20px;
    border-radius: 8px;
    margin-top: 24px;
    border-left: 4px solid #f5a623;
}

.sp-docs-help p {
    margin: 8px 0;
    color: #666;
}

.sp-docs-help strong {
    color: #1a3c34;
}

/* Responsive */
@media (max-width: 992px) {
    .sp-docs-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sp-docs-wrapper {
        padding: 16px;
    }
    
    .sp-docs-box {
        padding: 20px;
    }
    
    .sp-docs-grid {
        gap: 16px;
    }
    
    .sp-doc-card {
        min-height: 140px;
        padding: 20px 12px;
    }
    
    .sp-doc-icon {
        font-size: 40px;
    }
    
    .sp-doc-name {
        font-size: 14px;
    }
    
    .sp-docs-modal-content {
        margin: 0;
        border-radius: 12px;
    }
    
    .sp-docs-modal-body {
        padding: 24px;
    }
}

@media (max-width: 480px) {
    .sp-docs-grid {
        grid-template-columns: 1fr;
    }
}
