* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 10px;
    line-height: 1.5;
    overflow-x: hidden;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #6B8E23 0%, #556B2F 100%);
    color: white;
    padding: 20px;
    text-align: center;
}

.header h1 {
    font-size: 24px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.header p {
    font-size: 16px;
    opacity: 0.95;
}

.consignes {
    padding: 15px 20px;
    background: #f0f8e8;
    border-left: 5px solid #6B8E23;
    margin: 15px 20px;
    border-radius: 5px;
}

.consignes h3 {
    color: #556B2F;
    margin-bottom: 10px;
    font-size: 16px;
}

.consignes p {
    color: #556B2F;
    font-size: 14px;
}

.quiz-content {
    padding: 20px;
}

.section-title {
    background: #003366;
    color: white;
    padding: 10px 15px;
    margin-bottom: 15px;
    border-radius: 5px;
    font-weight: 600;
    font-size: 13px;
}

.question {
    margin-bottom: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #6B8E23;
}

.question-text {
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
    font-size: 15px;
}

.option {
    padding: 10px 12px;
    margin: 6px 0;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.option:hover {
    background: #f1f3f5;
    border-color: #6B8E23;
}

.option input {
    margin-right: 10px;
    cursor: pointer;
}

.option label {
    cursor: pointer;
    display: inline;
    font-size: 14px;
}

.hidden {
    display: none;
}

.page-question {
    display: none;
}

.page-question.active {
    display: block;
}

.navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 2px solid #6B8E23;
}

.btn-nav {
    padding: 12px 30px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    background: linear-gradient(135deg, #6B8E23 0%, #556B2F 100%);
    color: white;
}

.btn-nav:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(107, 142, 35, 0.3);
}

.btn-nav:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.progress-bar {
    background: #e9ecef;
    height: 6px;
    border-radius: 10px;
    overflow: hidden;
    margin: 15px 20px 0 20px;
}

.progress-fill {
    background: linear-gradient(135deg, #6B8E23 0%, #556B2F 100%);
    height: 100%;
    transition: width 0.3s ease;
}

.question-counter {
    text-align: center;
    padding: 10px;
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

.buttons {
    text-align: center;
    padding: 30px;
    background: #f8f9fa;
    border-top: 2px solid #6B8E23;
}

.btn {
    padding: 15px 40px;
    margin: 0 10px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-submit {
    background: linear-gradient(135deg, #6B8E23 0%, #556B2F 100%);
    color: white;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(107, 142, 35, 0.3);
}

.btn-reset {
    background: #6c757d;
    color: white;
}

.btn-reset:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.result {
    margin: 15px;
    padding: 14px 20px;
    border-radius: 10px;
    text-align: center;
    display: none;
    line-height: 1.3;
}

.result.success {
    background: #d4edda;
    border: 2px solid #6B8E23;
    color: #155724;
}

.result.failure {
    background: #f8d7da;
    border: 2px solid #dc3545;
    color: #721c24;
}

.result h2 {
    margin-bottom: 6px;
    font-size: 22px;
}

.score-display {
    font-size: 20px;
    font-weight: bold;
    margin: 6px 0;
    line-height: 1.3;
}

.penalty-info {
    font-size: 13px;
    font-weight: 700;
    margin: 3px 0;
    color: inherit;
    opacity: 0.9;
}

.result p {
    font-size: 14px;
    margin: 4px 0;
}

.btn-print {
    background: #007bff;
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    font-size: 15px;
    margin-top: 15px;
    cursor: pointer;
}

.btn-print:hover {
    background: #0056b3;
}

.footer {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    color: #6c757d;
    font-size: 12px;
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
}

.modal-content h3 {
    color: #556B2F;
    margin-bottom: 20px;
    font-size: 20px;
    text-align: center;
}

.modal-content input {
    width: 100%;
    padding: 12px;
    border: 2px solid #6B8E23;
    border-radius: 5px;
    font-size: 16px;
    margin-bottom: 20px;
}

.modal-content input:focus {
    outline: none;
    border-color: #556B2F;
    box-shadow: 0 0 0 3px rgba(107, 142, 35, 0.1);
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-buttons button {
    padding: 10px 25px;
    border: none;
    border-radius: 5px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.modal-btn-cancel {
    background: #6c757d;
    color: white;
}

.modal-btn-cancel:hover {
    background: #5a6268;
}

.modal-btn-ok {
    background: linear-gradient(135deg, #6B8E23 0%, #556B2F 100%);
    color: white;
}

.modal-btn-ok:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(107, 142, 35, 0.3);
}

@media print {
    /* ═══ PAGE ═════════════════════════════════════════════════════════ */
    @page {
        margin: 2cm;
    }
    body {
        background: white;
        padding: 0;
        font-size: 9pt;
        line-height: 1.3;
        color: #111;
    }
    .container { box-shadow: none; border-radius: 0; max-width: 100%; }

    /* ═══ MASQUER TOUT L'INTERACTIF ═════════════════════════════════════ */
    .navigation, .btn-print, .btn-reset, .progress-bar, .question-counter,
    .consignes, .modal-overlay, .buttons, .footer,
    .result, #quizContent { display: none !important; }

    /* ═══ ZONE D'IMPRESSION ══════════════════════════════════════════════ */
    #printableContent { display: block !important; padding: 0; }

    /* ═══ EN-TÊTE ════════════════════════════════════════════════════════ */
    .ph-wrap {
        border: 1.5pt solid #1a3a6b;
        border-radius: 3pt;
        padding: 5pt 8pt;
        margin-bottom: 7pt;
        background: #eef2fa;
        page-break-after: avoid;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
    .ph-title {
        font-size: 9.5pt;
        font-weight: 700;
        color: #1a3a6b;
        margin-bottom: 3pt;
        letter-spacing: 0.2pt;
    }
    .ph-row {
        display: flex;
        align-items: center;
        gap: 10pt;
        flex-wrap: wrap;
        margin-bottom: 4pt;
    }
    .ph-name  { font-size: 10pt; font-weight: 700; color: #1a3a6b; }
    .ph-score { font-size: 8.5pt; font-weight: 600; color: #333; flex: 1; }
    .ph-mention {
        font-size: 8pt; font-weight: 700; color: white;
        padding: 1.5pt 7pt; border-radius: 3pt;
        print-color-adjust: exact; -webkit-print-color-adjust: exact;
    }

    /* ═══ LÉGENDE ════════════════════════════════════════════════════════ */
    .ph-legend {
        display: flex;
        gap: 6pt;
        flex-wrap: wrap;
        padding-top: 3pt;
        border-top: 0.5pt solid #c0c8dc;
    }
    .leg { padding: 1.5pt 5pt; border-radius: 2pt; font-size: 7pt; font-weight: 700;
           print-color-adjust: exact; -webkit-print-color-adjust: exact; }
    .leg-ok    { background: #1b5e20; color: white; }
    .leg-err   { background: #b71c1c; color: white; }
    .leg-omit  { background: #e65100; color: white; }
    .leg-plain { background: #616161; color: white; }

    /* ═══ SECTIONS DOCUMENT ══════════════════════════════════════════════ */
    .pg-section { margin-bottom: 6pt; page-break-inside: avoid; }
    .pg-sec-title {
        font-size: 8.5pt;
        font-weight: 700;
        color: white;
        padding: 3pt 8pt;
        border-radius: 2pt 2pt 0 0;
        letter-spacing: 0.3pt;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
    .pg-questions { padding: 0; }

    /* ═══ BLOC QUESTION ══════════════════════════════════════════════════ */
    .pg-q {
        border-left: 3.5pt solid;
        padding: 3pt 7pt 3pt 7pt;
        margin-bottom: 2.5pt;
        page-break-inside: avoid;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
    .pg-q-text {
        font-size: 8pt;
        font-weight: 700;
        color: #111;
        margin-bottom: 3pt;
        line-height: 1.25;
    }
    .pg-q-type {
        font-weight: 400;
        font-style: italic;
        font-size: 7pt;
        color: #666;
    }

    /* ═══ OPTIONS SUR 1 LIGNE ════════════════════════════════════════════ */
    .pg-opts {
        display: flex;
        flex-wrap: nowrap;
        gap: 4pt;
        overflow: hidden;
    }
    .pg-opt {
        font-size: 7.5pt;
        padding: 2pt 6pt;
        border-radius: 2pt;
        border: 1pt solid #bbb;
        background: #f4f4f4;
        color: #555;
        white-space: nowrap;
        flex-shrink: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    /* ─── ✔ Bonne réponse cochée : vert intense ─── */
    .pg-ok {
        background: #1b5e20;
        color: white;
        border: 2pt solid #1b5e20;
        font-weight: 700;
        font-style: normal;
        text-decoration: none;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    /* ─── ✘ Erreur cochée : rouge intense, barré ─── */
    .pg-err {
        background: #b71c1c;
        color: white;
        border: 2pt solid #b71c1c;
        font-weight: 700;
        text-decoration: line-through;
        text-decoration-color: white;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    /* ─── ○ Oubli : orange, contour ─── */
    .pg-omit {
        background: white;
        color: #e65100;
        border: 2pt solid #e65100;
        font-weight: 700;
        font-style: italic;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    /* ═══ PIED DE PAGE ═══════════════════════════════════════════════════ */
    .pg-footer {
        text-align: center;
        font-size: 7pt;
        color: #777;
        margin-top: 8pt;
        border-top: 0.5pt solid #ccc;
        padding-top: 3pt;
    }
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 22px;
    }
    .btn {
        padding: 12px 25px;
        font-size: 14px;
    }
    .container {
        margin: 10px;
    }
}
