/* PEPS CN23 - Formulaire de déclaration douanière */

.peps-cn23-wrap {
    max-width: 900px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.peps-cn23-header {
    background: linear-gradient(135deg, #1a8a4a, #0d5c32);
    color: #fff;
    padding: 24px 28px;
    border-radius: 12px 12px 0 0;
    margin-bottom: 0;
}
.peps-cn23-header h2 {
    margin: 0 0 8px;
    font-size: 22px;
    color: #fff;
}
.peps-cn23-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 14px;
}

.peps-cn23-selector {
    background: #fff8e1;
    border: 2px solid #f0a050;
    border-radius: 0;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.peps-cn23-selector select {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.peps-cn23-form {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 12px 12px;
}

.cn23-section {
    padding: 24px 28px;
    border-bottom: 1px solid #f0f0f0;
}
.cn23-section:last-of-type { border-bottom: none; }
.cn23-section h3 {
    font-size: 16px;
    font-weight: 700;
    color: #1a8a4a;
    margin: 0 0 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e8f5ee;
}

.cn23-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
}

.cn23-field { display: flex; flex-direction: column; gap: 4px; }
.cn23-field-wide { grid-column: span 2; }
.cn23-field label {
    font-size: 11px;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.cn23-field input,
.cn23-field select,
.cn23-field textarea {
    padding: 9px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
    box-sizing: border-box;
    width: 100%;
}
.cn23-field input:focus,
.cn23-field select:focus,
.cn23-field textarea:focus {
    outline: none;
    border-color: #1a8a4a;
    box-shadow: 0 0 0 3px rgba(26,138,74,0.1);
}
.cn23-field input[readonly] {
    background: #f5f5f5;
    color: #888;
    cursor: not-allowed;
}

/* Nature d'envoi */
.cn23-nature-envoi { margin-bottom: 20px; }
.cn23-nature-envoi > label { font-size: 13px; font-weight: 600; color: #333; display: block; margin-bottom: 10px; }
.cn23-radio-group { display: flex; flex-wrap: wrap; gap: 10px; }
.cn23-radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    font-weight: normal;
    text-transform: none;
    letter-spacing: 0;
}
.cn23-radio-label:has(input:checked) {
    border-color: #1a8a4a;
    background: #e8f5ee;
    color: #1a8a4a;
    font-weight: 600;
}
.cn23-radio-label input { display: none; }

/* Tableau des articles */
.cn23-articles-wrap { overflow-x: auto; }
.cn23-articles-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-bottom: 12px;
}
.cn23-articles-table th {
    background: #f8f9fa;
    padding: 10px 8px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 2px solid #dee2e6;
    white-space: nowrap;
}
.cn23-articles-table td {
    padding: 6px 4px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}
.cn23-articles-table input,
.cn23-articles-table select {
    width: 100%;
    padding: 7px 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 13px;
    box-sizing: border-box;
}
.cn23-desc { min-width: 200px; }
.cn23-qty  { max-width: 60px; }
.cn23-poids, .cn23-valeur { max-width: 90px; }
.cn23-hs   { max-width: 100px; }

.cn23-remove-row {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-size: 16px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}
.cn23-remove-row:hover { background: #fff0f0; }

.cn23-btn-add {
    background: none;
    border: 2px dashed #1a8a4a;
    color: #1a8a4a;
    padding: 8px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
}
.cn23-btn-add:hover { background: #e8f5ee; }

/* Totaux */
.cn23-totaux {
    display: flex;
    gap: 24px;
    background: #f8f9fa;
    padding: 14px 16px;
    border-radius: 8px;
    margin-top: 12px;
}
.cn23-total-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #555;
}
.cn23-total-item strong { color: #1a8a4a; font-size: 16px; }

/* Info */
.cn23-info {
    background: #fff3cd;
    border-left: 4px solid #f0a050;
    padding: 12px 16px;
    border-radius: 0 6px 6px 0;
    font-size: 13px;
    color: #856404;
    margin-bottom: 16px;
}

/* Certification */
.cn23-certification { margin-top: 16px; }
.cn23-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 13px;
    color: #555;
    font-weight: normal;
    text-transform: none;
    letter-spacing: 0;
}
.cn23-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    flex-shrink: 0;
    cursor: pointer;
}

/* Actions */
.cn23-actions {
    padding: 20px 28px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
    border-radius: 0 0 12px 12px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.cn23-btn-submit {
    background: linear-gradient(135deg, #1a8a4a, #0d5c32);
    color: #fff;
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(26,138,74,0.3);
}
.cn23-btn-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26,138,74,0.4);
}
.cn23-btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

#cn23-response.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 14px 18px;
    border-radius: 8px;
    font-size: 14px;
    margin: 0 28px 20px;
}
#cn23-response.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 14px 18px;
    border-radius: 8px;
    font-size: 14px;
    margin: 0 28px 20px;
}

/* ─── Zone Upload Factures ─────────────────────────────────────────────── */
.cn23-upload-notice {
    background: #fff8e1;
    border-left: 4px solid #f39c12;
    padding: 10px 14px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 0.93em;
    color: #7d5a00;
}

.cn23-upload-zone {
    border: 2px dashed #e67e22;
    border-radius: 10px;
    padding: 30px 20px;
    text-align: center;
    background: #fdf6f0;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.15s;
}

.cn23-upload-zone:hover,
.cn23-upload-zone.cn23-drag-over {
    background: #fde9d4;
    border-color: #d35400;
}

.cn23-upload-zone.cn23-drag-over {
    transform: scale(1.01);
}

.cn23-upload-icon {
    font-size: 2.5em;
    margin-bottom: 8px;
}

.cn23-upload-zone p {
    margin: 4px 0;
    color: #555;
}

.cn23-upload-hint {
    font-size: 0.82em !important;
    color: #999 !important;
}

.cn23-file-input {
    display: none;
}

.cn23-btn-upload {
    margin-top: 12px;
    background: #e67e22;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: background 0.2s;
}

.cn23-btn-upload:hover {
    background: #d35400;
}

/* ─── Prévisualisation des fichiers ──────────────────────────────────── */
.cn23-files-preview {
    margin-top: 12px;
}

.cn23-no-files {
    color: #e67e22;
    font-size: 0.88em;
    margin: 8px 0 0;
    padding: 8px 12px;
    background: #fff8e1;
    border-radius: 6px;
    border: 1px solid #f39c12;
}

.cn23-file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f0faf0;
    border: 1px solid #27ae60;
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 6px;
    font-size: 0.9em;
}

.cn23-file-icon {
    font-size: 1.3em;
    flex-shrink: 0;
}

.cn23-file-name {
    flex: 1;
    font-weight: 600;
    color: #1a5c2a;
    word-break: break-all;
}

.cn23-file-size {
    color: #666;
    font-size: 0.85em;
    white-space: nowrap;
}

.cn23-file-remove {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    cursor: pointer;
    font-size: 0.8em;
    line-height: 22px;
    text-align: center;
    flex-shrink: 0;
    transition: background 0.2s;
}

.cn23-file-remove:hover {
    background: #c0392b;
}

/* Champ expéditeur SILVESTRE/NOM mis en valeur */
.cn23-readonly-highlight {
    background: #fff8f0 !important;
    border: 2px solid #e67e22 !important;
    color: #c0392b !important;
    font-weight: 700 !important;
    font-size: 15px !important;
    letter-spacing: 0.5px;
}
