/* ============================================================================
   STYLES POUR LA SECTION PAP - IDENTIFICATION
   ============================================================================ */

.pap-form-container {
    max-width: 1200px;
    margin: 0 auto;
}

.pap-section {
    background: #ffffff;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-left: 4px solid #667eea;
}

.pap-section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.3em;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.pap-section-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3em;
    margin-right: 12px;
}

/* Radio buttons stylisés */
.pap-radio-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.pap-radio-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pap-radio-item:hover {
    background: #e9ecef;
    border-color: #667eea;
    transform: translateY(-2px);
}

.pap-radio-item input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #667eea;
}

.pap-radio-item input[type="radio"]:checked + label {
    color: #667eea;
    font-weight: 600;
}

.pap-radio-item label {
    cursor: pointer;
    margin: 0;
}

/* Formatage CIN */
.cin-input {
    font-family: 'Courier New', monospace;
    font-size: 1.1em;
    letter-spacing: 0.5px; /* Réduit pour éviter trop d'espaces sur tablette */
}

/* Fix pour tablette/mobile */
@media (max-width: 768px) {
    .cin-input {
        letter-spacing: 0 !important;
    }
}

/* Sections conditionnelles */
.pap-conditional-section {
    display: none;
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 2px dashed #667eea;
}

.pap-conditional-section.active {
    display: block;
    animation: slideDown 0.3s ease;
}

/* Container pour la capture de photos */
.pap-photo-capture-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.pap-photo-capture-box {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    border: 2px solid #e0e0e0;
}

.pap-photo-capture-box h4 {
    margin: 0 0 15px 0;
    color: #667eea;
    font-size: 1.1em;
}

.pap-photo-display {
    width: 100%;
    height: 250px;
    background: #fff;
    border: 2px dashed #ccc;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    overflow: hidden;
    position: relative;
}

.pap-photo-placeholder {
    text-align: center;
    color: #999;
    font-size: 0.95em;
}

.pap-photo-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.pap-btn-camera,
.pap-btn-upload {
    flex: 1;
    min-width: 120px;
    padding: 10px 15px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    display: inline-block;
}

.pap-btn-camera:hover,
.pap-btn-upload:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.pap-btn-remove-photo {
    padding: 10px 15px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pap-btn-remove-photo:hover {
    background: #c82333;
    transform: translateY(-2px);
}

/* GPS Coordinates */
.pap-gps-button {
    padding: 10px 20px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pap-gps-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.3);
}

.pap-gps-coordinates {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.pap-coordinate-item {
    background: #f0f9ff;
    padding: 15px;
    border-radius: 10px;
    border: 2px solid #bfdbfe;
}

.pap-coordinate-item label {
    display: block;
    font-size: 0.85em;
    color: #1976d2;
    font-weight: 600;
    margin-bottom: 8px;
}

.pap-coordinate-item input {
    width: 100%;
    background: white;
    border: 1px solid #e0e0e0;
    font-family: 'Courier New', monospace;
    font-size: 1.05em;
}

/* Success message */
.pap-success-message {
    display: none;
    background: #d4edda;
    border: 2px solid #c3e6cb;
    color: #155724;
    padding: 15px;
    border-radius: 10px;
    margin-top: 20px;
    text-align: center;
    font-weight: 600;
    animation: slideDown 0.3s ease;
}

.pap-success-message.show {
    display: block;
}

/* Modal pour la caméra */
#papCameraModal {
    display: none;
    position: fixed;
    z-index: 10001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
}

#papCameraModal .modal-content {
    background-color: #1a1a1a;
    margin: 2% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
}

#papCameraModal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    color: white;
}

#papCameraModal .close {
    color: white;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
}

#papCameraModal video {
    width: 100%;
    height: auto;
    border-radius: 10px;
    background: #000;
}

#papCameraModal .camera-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

#papCameraModal button {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

#papCameraModal .btn-capture {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

#papCameraModal .btn-cancel {
    background: #6c757d;
    color: white;
}

.cin-input.cin-valid {
    border: 2px solid #28a745 !important;
    background: #d4edda !important;
}

.cin-input.cin-invalid {
    border: 2px solid #dc3545 !important;
    background: #f8d7da !important;
}

.cin-input.cin-mismatch {
    border: 2px solid #ffc107 !important;
    background: #fff3cd !important;
}

/* Messages de validation CIN */
.cin-validation-message {
    margin-top: 8px;
    padding: 10px;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 600;
    display: none;
    animation: slideDown 0.3s ease;
}

.cin-validation-message.show {
    display: block;
}

.cin-validation-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.cin-validation-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.cin-validation-message.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.cin-validation-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Animations */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .pap-radio-group {
        flex-direction: column;
    }
    
    .pap-photo-capture-container {
        grid-template-columns: 1fr;
    }
    
    .pap-gps-coordinates {
        grid-template-columns: 1fr;
    }
    
    .pap-photo-buttons {
        flex-direction: column;
    }
    
    .pap-btn-camera,
    .pap-btn-upload {
        width: 100%;
    }
}