* { box-sizing: border-box; }
body { margin: 0; font-family: "Segoe UI", Arial, sans-serif; background: #f2f4f7; color: #1f2933; }
.banner { display: flex; align-items: center; gap: 16px; padding: 16px 24px; background: #0b3d6e; color: #fff; }
.banner img { height: 56px; background: #fff; border-radius: 6px; padding: 4px; }
.banner h1 { margin: 0; font-size: 20px; }
.banner p { margin: 4px 0 0; font-size: 13px; opacity: .85; }
main { max-width: 520px; margin: 40px auto; padding: 0 16px; }
.card { background: #fff; border-radius: 10px; padding: 28px; box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.card h2 { margin: 0 0 8px; font-size: 18px; color: #0b3d6e; }
.muted { color: #616e7c; font-size: 14px; }
label { display: block; margin: 18px 0 6px; font-weight: 600; font-size: 14px; }
input[type=text] { width: 100%; padding: 11px 12px; border: 1px solid #cbd2d9; border-radius: 6px; font-size: 15px; }
input[type=text]:focus { outline: none; border-color: #0b3d6e; box-shadow: 0 0 0 3px rgba(11,61,110,.15); }
button { margin-top: 24px; width: 100%; padding: 12px; border: 0; border-radius: 6px; background: #0b3d6e; color: #fff; font-size: 15px; font-weight: 600; cursor: pointer; }
button:hover { background: #0e4f8f; }
.alert { margin: 16px 0 0; padding: 12px; border-radius: 6px; background: #fde8e8; color: #9b1c1c; font-size: 14px; }
.success { margin: 16px 0; padding: 12px; border-radius: 6px; background: #e3f9e5; color: #1e6a2c; font-size: 14px; }
.topline { display: flex; justify-content: space-between; align-items: center; }
.link { color: #0b3d6e; font-size: 14px; }
.foot { text-align: center; font-size: 12px; color: #9aa5b1; padding: 24px 16px; }

/* ---- Formulaires additionnels ---- */
select, textarea { width: 100%; padding: 11px 12px; border: 1px solid #cbd2d9; border-radius: 6px; font-size: 15px; font-family: inherit; background: #fff; }
input[type=password] { width: 100%; padding: 11px 12px; border: 1px solid #cbd2d9; border-radius: 6px; font-size: 15px; }
input[type=file] { width: 100%; font-size: 14px; }
label.radio { display: flex; gap: 8px; align-items: center; font-weight: normal; margin: 8px 0; }
.recap { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 14px; }
.recap th { text-align: left; width: 38%; color: #616e7c; font-weight: 600; padding: 8px 8px 8px 0; vertical-align: top; border-bottom: 1px solid #eef0f3; }
.recap td { padding: 8px 0; border-bottom: 1px solid #eef0f3; word-break: break-word; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; background: #e4e7eb; color: #3e4c59; }
.badge.en_attente { background: #fff3c4; color: #8d5b00; }
.badge.acceptee { background: #e3f9e5; color: #1e6a2c; }
.badge.refusee { background: #fde8e8; color: #9b1c1c; }

/* ---- Admin ---- */
main.large { max-width: 1200px; }
.adminnav { display: flex; gap: 4px; padding: 0 24px; background: #08305a; flex-wrap: wrap; }
.adminnav a { color: #d9e2ec; text-decoration: none; padding: 12px 14px; font-size: 14px; }
.adminnav a.on, .adminnav a:hover { color: #fff; background: rgba(255,255,255,.12); }
.adminnav a.right { margin-left: auto; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: #fff; border-radius: 10px; padding: 16px; box-shadow: 0 2px 10px rgba(0,0,0,.06); font-size: 13px; color: #616e7c; }
.stat span { display: block; font-size: 26px; font-weight: 700; color: #0b3d6e; }
.stat.acceptee span { color: #1e6a2c; } .stat.refusee span { color: #9b1c1c; } .stat.en_attente span { color: #8d5b00; }
.filtres { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.filtres input[type=text] { flex: 1 1 220px; width: auto; }
.filtres select { width: auto; }
.btn { display: inline-block; margin: 0; width: auto; padding: 10px 16px; border: 0; border-radius: 6px; background: #0b3d6e; color: #fff; font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn.sec { background: #e4e7eb; color: #1f2933; }
.liste { width: 100%; border-collapse: collapse; font-size: 14px; }
.liste th { text-align: left; background: #f5f7fa; padding: 10px 8px; color: #3e4c59; border-bottom: 2px solid #e4e7eb; }
.liste td { padding: 9px 8px; border-bottom: 1px solid #eef0f3; }
.liste tr:hover td { background: #fafbfc; }
.liste .vide { text-align: center; color: #9aa5b1; padding: 24px; }
.card { overflow-x: auto; }
.grille2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.etroit { max-width: 600px; }
.codes { display: flex; flex-wrap: wrap; gap: 6px; max-height: 420px; overflow-y: auto; }
.codes span { background: #f0f4f8; border-radius: 4px; padding: 4px 8px; font-family: Consolas, monospace; font-size: 13px; }
@media (max-width: 800px) { .grille2 { grid-template-columns: 1fr; } .adminnav a.right { margin-left: 0; } }
.liste td.actions { display: flex; gap: 10px; align-items: center; white-space: nowrap; }
.liste td.actions form { margin: 0; }
.btn.petit { padding: 5px 10px; font-size: 12px; }

/* ---- Relevé de notes ---- */
.releve { margin-top: 16px; }
.semestre { background: #fff; border-radius: 10px; box-shadow: 0 2px 10px rgba(0,0,0,.06); margin-bottom: 16px; overflow-x: auto; }
.semestre-tete { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 18px; background: #eaf1f8; border-radius: 10px 10px 0 0; color: #0b3d6e; }
.semestre .liste th, .semestre .liste td { padding-left: 18px; }
.notes td.code { font-family: Consolas, monospace; font-size: 13px; color: #616e7c; white-space: nowrap; }
.notes td { white-space: nowrap; }
.notes td:nth-child(2) { white-space: normal; min-width: 200px; }
.legende { font-size: 12px; }
.suite { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.suite .btn { margin: 0; }
.alert + .releve, main > .alert { margin-top: 16px; }
.titre-section { color: #0b3d6e; font-size: 18px; margin: 24px 0 0; }
.annee { color: #0b3d6e; font-size: 17px; margin: 28px 0 10px; padding-bottom: 6px; border-bottom: 2px solid #0b3d6e; }
.releve > .annee:first-child { margin-top: 8px; }
.sem-num { display: inline-block; min-width: 34px; text-align: center; padding: 2px 8px; margin-right: 6px; border-radius: 6px; background: #0b3d6e; color: #fff; font-weight: 700; font-size: 13px; }
.annee { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.annee-res { font-size: 14px; font-weight: normal; color: #3e4c59; }
.notes span.code { font-family: Consolas, monospace; font-size: 12px; color: #616e7c; margin-right: 4px; }
.notes td { vertical-align: top; }
.choix-filiere { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; align-items: end; margin-bottom: 16px; }
.choix-filiere label { margin-top: 0; }
@media (max-width: 700px) { .choix-filiere { grid-template-columns: 1fr; } }
.situation-intro { margin-top: 0; }

/* ---- Étape 2 : choix de filière ---- */
.ancienne { display: flex; flex-direction: column; gap: 2px; margin: 16px 0; padding: 12px 14px; border-left: 4px solid #0b3d6e; background: #f5f7fa; border-radius: 6px; }
.choix-cartes { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 12px; }
label.carte-filiere { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 16px; border: 2px solid #cbd2d9; border-radius: 10px; cursor: pointer; font-weight: normal; position: relative; }
label.carte-filiere:hover { border-color: #0b3d6e; }
label.carte-filiere input { position: absolute; top: 16px; right: 16px; }
label.carte-filiere:has(input:checked) { border-color: #0b3d6e; background: #eaf1f8; }
.carte-titre { font-weight: 700; color: #0b3d6e; font-size: 16px; padding-right: 24px; }
.carte-detail { font-size: 13px; }
.groupe-filiere { color: #0b3d6e; font-size: 15px; margin: 20px 0 0; }

/* ---- Phase de test ---- */
.bandeau-test { background: #b45309; color: #fff; text-align: center; padding: 8px 16px; font-weight: 700; font-size: 14px; letter-spacing: .3px; }
.carte-mode.mode-test { border: 2px solid #b45309; }
.carte-mode.mode-prod { border: 2px solid #1e6a2c; }
.carte-mode .recap td, .carte-mode .recap th { width: auto; }
button.btn-test { background: #b45309; }
button.btn-test:hover { background: #92400e; }
.success.etroit, .alert.etroit { margin-bottom: 16px; }
.notes td.ancien { white-space: normal; font-size: 13px; min-width: 220px; }

/* ---- Étape 3 : semestres de l'étudiant ---- */
.resume { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 16px 0; }
.resume div { background: #fff; border-radius: 10px; padding: 14px 16px; box-shadow: 0 2px 10px rgba(0,0,0,.06); color: #616e7c; font-size: 13px; }
.resume span { display: block; font-size: 26px; font-weight: 700; color: #0b3d6e; }
.resume .ok span { color: #1e6a2c; } .resume .ko span { color: #9b1c1c; }
.semestres-etudiant { display: flex; flex-direction: column; gap: 10px; }
.sem-ligne { background: #fff; border-radius: 10px; box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.sem-valide { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 18px; border-left: 5px solid #1e6a2c; }
.sem-non-valide { border-left: 5px solid #9b1c1c; }
.sem-non-valide summary { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 18px; cursor: pointer; list-style: none; }
.sem-non-valide summary::-webkit-details-marker { display: none; }
.sem-non-valide summary::after { content: "▸"; margin-left: auto; color: #616e7c; font-size: 18px; transition: transform .15s; }
.sem-non-valide[open] summary::after { transform: rotate(90deg); }
.sem-non-valide summary:hover { background: #fafbfc; border-radius: 10px; }
.sem-titre { font-weight: 600; color: #1f2933; }
.sem-compte { color: #616e7c; font-size: 13px; }
.sem-corps { padding: 0 18px 16px; overflow-x: auto; }
.sem-corps h4 { margin: 14px 0 6px; color: #0b3d6e; font-size: 14px; }
@media (max-width: 600px) { .resume { grid-template-columns: 1fr; } .sem-non-valide summary::after { margin-left: 0; } }

/* ---- Étape 4 : modules à étudier ---- */
.sem-bloc { padding: 0 0 8px; border-left: 5px solid #0b3d6e; overflow-x: auto; }
.sem-bloc-tete { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 18px 6px; }
.liste-modules { margin: 4px 0 8px; padding: 0 18px 0 46px; }
.liste-modules li { padding: 3px 0; }
.ok-txt { color: #1e6a2c; font-weight: 600; }
.ko-txt { color: #9b1c1c; font-weight: 600; }
.resume2 { grid-template-columns: repeat(2, 1fr); } .liste-modules .badge { margin-left: 6px; }

/* ---- Étape 5 : récapitulatif final ---- */
.form-terminer { margin: 0; }
.form-terminer button { margin: 0; width: auto; padding: 10px 22px; }
.recap-final .sous-titre { color: #0b3d6e; font-size: 16px; margin: 22px 0 6px; }
.recap-final .recap th { width: 30%; }
.recap-sem { border: 1px solid #e4e7eb; border-left: 5px solid #0b3d6e; border-radius: 8px; margin-bottom: 10px; }
.message-etalib { margin-top: 22px; padding: 14px 16px; background: #eaf1f8; border-left: 5px solid #0b3d6e; border-radius: 6px; font-size: 15px; color: #0b3d6e; }
.message-etalib a { font-weight: 700; color: #0b3d6e; }
@media print {
    .no-print, .banner + .bandeau-test, .foot { display: none !important; }
    body { background: #fff; }
    .card { box-shadow: none; }
}
.liste-modules .code { font-family: Consolas, monospace; font-size: 12px; color: #616e7c; }
/* Attestation d'assurance avant « Terminer » */
.form-assurance { margin-top: 16px; border-left: 5px solid #0b3d6e; }
.form-assurance h2 { margin: 0 0 6px; color: #0b3d6e; font-size: 18px; }
.suite-form { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.suite-form button { margin: 0; width: auto; padding: 10px 22px; }
.obligatoire { color: #c81e1e; font-weight: 700; }
/* Admin : suppression des demandes */
.btn-danger { background: #c81e1e; }
.btn-danger:hover { background: #9b1c1c; }
.barre-selection { margin-bottom: 10px; }
.liste td.actions button { margin: 0; width: auto; }
/* Récapitulatif : modules VE et non autorisés */
.recap-ve { border-left-color: #1e6a2c; }
.recap-na { border-left-color: #9b1c1c; }
.note-ve { margin-left: 6px; color: #1e6a2c; }
.prerequis-na { display: block; font-size: 12px; }
/* Récapitulatif : semestres regroupés + non autorisés en jaune */
.badge.a-etudier { background: #e0ecf8; color: #0b3d6e; }
/* Badges : à repasser (bleu ciel) / non autorisé (rouge foncé) */
.badge.a-repasser { background: #d6efff; color: #0369a1; border: 1px solid #7cc4f2; }
.badge.non-autorise { background: #8b0000; color: #fff; }
/* Pages « bientôt disponible » / « clôturé » et date limite */
.page-etat { max-width: 560px; margin: 24px auto; text-align: center; padding: 40px 28px; }
.page-etat h2 { font-size: 22px; margin: 6px 0 4px; }
.etat-icone { font-size: 44px; line-height: 1; }
.etat-sous-titre { font-size: 17px; font-weight: 600; color: #0b3d6e; margin: 0 0 14px; }
.date-limite { margin: 14px 0 0; padding: 10px 14px; border-left: 4px solid #b45309; background: #fff7ed; border-radius: 6px; font-size: 14px; color: #7a3d06; }
.carte-mode.mode-ferme { border: 2px solid #c81e1e; }
input[type=date] { padding: 10px 12px; border: 1px solid #cbd2d9; border-radius: 6px; font-size: 15px; font-family: inherit; }
