/* ============================================================
   ENS - Interface Étudiant - Choix de Sections
   École Normale Supérieure du Burundi
   ============================================================ */

/* ---- Reset & Base ---- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    color: #1a1a1a;
    background-color: #f2f4f7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 16px;
}

/* ---- Carte principale ---- */
.carte {
    background: #fff;
    width: 100%;
    max-width: 680px;
    border: 1px solid #d0d5dd;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    overflow: hidden;
}

/* ---- En-tête de la carte ---- */
.carte-entete {
    background-color: #1a3a5c;
    color: #fff;
    padding: 14px 20px 12px;
    border-bottom: 3px solid #c00;
}

.carte-entete .titre-ens {
    font-size: 15px;
    font-weight: bold;
    letter-spacing: 0.3px;
    margin-bottom: 3px;
}

.carte-entete .sous-titre {
    font-size: 12px;
    color: #ccd9e8;
    font-weight: normal;
}

/* ---- Corps de la carte ---- */
.carte-corps {
    padding: 20px 24px 24px;
}

/* ---- Titres de bienvenue ---- */
.bienvenue {
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid #e8eaed;
}

.bienvenue h2 {
    font-size: 14px;
    font-weight: normal;
    color: #1a1a1a;
    margin-bottom: 5px;
    line-height: 1.5;
}

.bienvenue h2 .souligne,
.bienvenue h2 a {
    color: #0000EE;
    text-decoration: underline;
}

.bienvenue p {
    font-size: 13px;
    color: #444;
}

/* ---- Section saisie numéro ---- */
.section-numero {
    margin-bottom: 6px;
}

.section-numero label {
    display: block;
    margin-bottom: 7px;
    font-size: 13px;
    color: #333;
    font-weight: normal;
}

.section-numero input[type="text"] {
    width: 220px;
    height: 28px;
    border: 1px solid #aaa;
    border-radius: 2px;
    padding: 3px 8px;
    font-size: 13px;
    display: block;
    margin-bottom: 10px;
    transition: border-color 0.2s;
    background: #fff;
    color: #1a1a1a;
}

.section-numero input[type="text"]:focus {
    outline: none;
    border-color: #1a3a5c;
    box-shadow: 0 0 0 2px rgba(26,58,92,0.12);
}

/* ---- Bouton Continuer ---- */
.btn-continuer {
    display: inline-block;
    padding: 5px 20px;
    background-color: #fff;
    border: 1px solid #c00;
    color: #c00;
    font-size: 13px;
    cursor: pointer;
    text-decoration: underline;
    font-family: Arial, Helvetica, sans-serif;
    border-radius: 2px;
    transition: background-color 0.15s;
}

.btn-continuer:hover {
    background-color: #fff0f0;
}

/* ---- Note sous le bouton ---- */
.note-continuer {
    font-size: 12px;
    margin-top: 10px;
    margin-bottom: 4px;
    color: #555;
    max-width: 500px;
    line-height: 1.6;
    font-style: italic;
}

.note-continuer .souligne {
    text-decoration: underline;
    font-style: normal;
}

/* ---- Messages d'erreur ---- */
.erreur {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: #b00;
    font-size: 13px;
    margin: 10px 0;
    padding: 9px 12px;
    border: 1px solid #f5c2c2;
    border-left: 4px solid #c00;
    background-color: #fff5f5;
    border-radius: 2px;
    line-height: 1.5;
}

.erreur::before {
    content: "⚠";
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 1px;
}

/* ---- Bandeau infos étudiant ---- */
.bandeau-etudiant {
    background: #f7f9fc;
    border: 1px solid #d0d5dd;
    border-radius: 3px;
    padding: 10px 14px;
    margin-bottom: 14px;
}

.etudiant-nom {
    font-size: 14px;
    font-weight: bold;
    color: #1a3a5c;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.etudiant-nom .numero {
    font-size: 12px;
    font-weight: normal;
    color: #666;
    background: #e8edf3;
    padding: 2px 7px;
    border-radius: 10px;
}

/* ---- Infos de l'étudiant (DPE, DCE, Ecole) ---- */
.infos-etudiant {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.info-box {
    border: 1px solid #b0bec5;
    padding: 4px 10px;
    font-size: 12px;
    background: #fff;
    border-radius: 2px;
    color: #333;
    white-space: nowrap;
}

.info-box strong {
    color: #1a3a5c;
}

.infos-autres {
    font-size: 11px;
    color: #888;
    margin-top: 4px;
    margin-bottom: 0;
    font-style: italic;
}

.infos-autres .souligne {
    text-decoration: underline;
}

/* ---- Titre CHOIX DE TROIS SECTIONS ---- */
.titre-choix {
    font-size: 11px;
    font-weight: bold;
    margin-bottom: 6px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #444;
    display: flex;
    align-items: center;
    gap: 6px;
}

.titre-choix::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 12px;
    background: #c00;
    border-radius: 2px;
}

/* ---- Compteur de choix ---- */
.compteur-choix {
    font-size: 12px;
    color: #555;
    margin-bottom: 8px;
    padding: 5px 10px;
    background: #f7f9fc;
    border: 1px solid #e0e4ea;
    border-radius: 2px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.compteur-choix .nb {
    font-weight: bold;
    color: #c00;
    font-size: 14px;
}

/* ---- Tableau des départements / sections ---- */
.table-choix {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #bbb;
    margin-bottom: 16px;
}

.table-choix td {
    border: 1px solid #bbb;
    vertical-align: middle;
    padding: 10px 12px;
}

.col-departement {
    width: 44%;
    font-size: 13px;
    font-weight: bold;
    color: #1a3a5c;
    background-color: #f4f6fa;
    vertical-align: middle;
    line-height: 1.4;
}

.col-sections {
    width: 56%;
    vertical-align: top;
    padding-top: 8px;
    padding-bottom: 4px;
}

/* ---- Checkboxes ---- */
.choix-section {
    display: flex;
    align-items: center;
    margin-bottom: 7px;
    font-size: 13px;
    padding: 3px 4px;
    border-radius: 3px;
    transition: background 0.1s;
}

.choix-section:last-child {
    margin-bottom: 2px;
}

.choix-section:hover {
    background-color: #f0f4f8;
}

.choix-section.selectionne {
    background-color: #eaf0fb;
}

.choix-section input[type="checkbox"] {
    width: 15px;
    height: 15px;
    margin-right: 8px;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: #1a3a5c;
}

.choix-section input[type="checkbox"]:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.choix-section label {
    cursor: pointer;
    flex: 1;
    color: #222;
}

.choix-section input[type="checkbox"]:disabled + label {
    color: #aaa;
    cursor: not-allowed;
}

/* ---- Badge ordre de préférence ---- */
.badge-ordre {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #c00;
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    margin-left: 6px;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(200,0,0,0.3);
    animation: pop-in 0.15s ease;
}

@keyframes pop-in {
    from { transform: scale(0.5); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

/* ---- Bouton Valider ---- */
.zone-valider {
    text-align: center;
    margin: 4px 0 14px;
}

.btn-valider {
    padding: 6px 32px;
    background-color: #fff;
    border: 1px solid #555;
    color: #333;
    font-size: 13px;
    cursor: pointer;
    font-family: Arial, Helvetica, sans-serif;
    border-radius: 2px;
    transition: background-color 0.15s, border-color 0.15s;
}

.btn-valider:hover {
    background-color: #f0f0f0;
    border-color: #333;
}

/* ---- Note sous Valider ---- */
.note-valider {
    font-size: 12px;
    color: #666;
    max-width: 580px;
    line-height: 1.6;
    margin: 0 auto;
    font-style: italic;
    text-align: center;
}

/* ============================================================
   PAGE RÉCAPITULATIF
   ============================================================ */

.recapitulatif {
    margin-bottom: 20px;
}

.recapitulatif h3 {
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 10px;
    padding: 6px 10px;
    background-color: #1a3a5c;
    color: #fff;
    border-radius: 2px;
    letter-spacing: 0.3px;
}

.recap-grille {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 6px 10px;
    font-size: 13px;
    margin-bottom: 14px;
    padding: 10px 12px;
    background: #f7f9fc;
    border: 1px solid #e0e4ea;
    border-radius: 2px;
}

.recap-label {
    font-weight: bold;
    color: #444;
}

.recap-valeur {
    color: #1a1a1a;
}

/* ---- Tableau récapitulatif des choix ---- */
.recap-choix-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
    font-size: 13px;
}

.recap-choix-table thead tr {
    background-color: #1a3a5c;
    color: #fff;
}

.recap-choix-table th {
    padding: 7px 12px;
    text-align: left;
    font-weight: bold;
    font-size: 12px;
    letter-spacing: 0.3px;
}

.recap-choix-table td {
    border-bottom: 1px solid #e8eaed;
    padding: 7px 12px;
    color: #222;
}

.recap-choix-table tbody tr:nth-child(even) {
    background-color: #f7f9fc;
}

.recap-choix-table tbody tr:hover {
    background-color: #eaf0fb;
}

.badge-rang {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-weight: bold;
    font-size: 12px;
    margin-right: 6px;
    flex-shrink: 0;
}

.badge-rang.rang-1 { background: #c00;    color: #fff; }
.badge-rang.rang-2 { background: #1a3a5c; color: #fff; }
.badge-rang.rang-3 { background: #5a7a9c; color: #fff; }

/* ---- Code de soumission ---- */
.code-soumission {
    text-align: center;
    padding: 16px 14px;
    border: 2px solid #c00;
    background: linear-gradient(135deg, #fff8f8 0%, #fff 100%);
    margin-bottom: 20px;
    border-radius: 3px;
}

.code-soumission .label-code {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.code-soumission .valeur-code {
    font-size: 22px;
    font-weight: bold;
    color: #c00;
    letter-spacing: 3px;
    font-family: 'Courier New', Courier, monospace;
}

.code-soumission .note-code {
    font-size: 11px;
    color: #999;
    margin-top: 6px;
}

/* ---- Boutons du récapitulatif ---- */
.zone-boutons-recap {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.btn-modifier {
    padding: 6px 22px;
    background-color: #fff;
    border: 1px solid #aaa;
    font-size: 13px;
    cursor: pointer;
    font-family: Arial, Helvetica, sans-serif;
    color: #444;
    border-radius: 2px;
    transition: background-color 0.15s;
}

.btn-modifier:hover {
    background-color: #f5f5f5;
    border-color: #777;
}

.btn-soumettre {
    padding: 6px 24px;
    background-color: #c00;
    border: 1px solid #a00;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: bold;
    border-radius: 2px;
    transition: background-color 0.15s;
}

.btn-soumettre:hover {
    background-color: #a00;
}

.btn-soumettre:disabled {
    background-color: #bbb;
    border-color: #bbb;
    cursor: not-allowed;
}

/* ---- Message succès ---- */
.succes {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: #1a6630;
    font-size: 13px;
    margin: 10px 0;
    padding: 10px 14px;
    border: 1px solid #a3d9b0;
    border-left: 4px solid #1a6630;
    background-color: #f0fff4;
    border-radius: 2px;
    line-height: 1.5;
}

.succes::before {
    content: "✓";
    font-size: 15px;
    flex-shrink: 0;
    margin-top: 0;
    font-weight: bold;
}

/* ---- Zone modification (details/summary) ---- */
details.zone-modification {
    border: 1px solid #e0c070;
    background-color: #fffdf5;
    border-radius: 3px;
    padding: 10px 14px;
    margin-bottom: 14px;
}

details.zone-modification summary {
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    color: #7a5000;
    user-select: none;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

details.zone-modification summary::before {
    content: "▶";
    font-size: 10px;
    transition: transform 0.2s;
}

details.zone-modification[open] summary::before {
    transform: rotate(90deg);
}

/* ---- Alerte modification épuisée ---- */
.alerte-modif {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background-color: #fffbe6;
    border: 1px solid #e6c84a;
    border-left: 4px solid #c8960a;
    color: #5a4000;
    padding: 9px 12px;
    font-size: 12px;
    margin-bottom: 12px;
    border-radius: 2px;
    line-height: 1.5;
}

.alerte-modif::before {
    content: "ℹ";
    font-size: 14px;
    flex-shrink: 0;
    color: #c8960a;
}

/* ---- Séparateur ---- */
hr.sep {
    border: none;
    border-top: 1px solid #e0e4ea;
    margin: 16px 0;
}

/* ---- Pied de page ---- */
.carte-pied {
    background: #f7f9fc;
    border-top: 1px solid #e0e4ea;
    padding: 8px 20px;
    font-size: 11px;
    color: #999;
    text-align: center;
}

/* ---- Responsive ---- */
@media (max-width: 520px) {
    body {
        padding: 10px 8px;
    }

    .carte-corps {
        padding: 14px 14px 18px;
    }

    .infos-etudiant {
        flex-direction: column;
    }

    .info-box {
        white-space: normal;
    }

    .recap-grille {
        grid-template-columns: 1fr;
    }

    .zone-boutons-recap {
        flex-direction: column;
        align-items: center;
    }

    .section-numero input[type="text"] {
        width: 100%;
        max-width: 280px;
    }
}

/* ---- Bouton retour à l'accueil ---- */
.zone-retour {
    text-align: center;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e8eaed;
}

.btn-retour {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 20px;
    background: #fff;
    border: 1.5px solid #1a3a5c;
    border-radius: 4px;
    color: #1a3a5c;
    font-size: 13px;
    font-weight: bold;
    text-decoration: none;
    font-family: Arial, Helvetica, sans-serif;
    transition: background 0.15s, color 0.15s;
}

.btn-retour:hover {
    background: #1a3a5c;
    color: #fff;
}

/* Fin du fichier style.css */

/* ---- Espace en bas pour ne pas cacher le contenu derrière le bouton WhatsApp ---- */
@media (max-width: 768px) {
    .carte { margin-bottom: 70px; }
}
