/* ==========================================================
   GEOMBPL — Site V2
   CSS principal (propre, sans doublons)
   ========================================================== */

/* --- Reset / base --- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html{ scroll-padding-top: calc(var(--site-hdr-h) + var(--site-gap)); }
[id]{ scroll-margin-top: calc(var(--site-hdr-h) + var(--site-gap)); }

body{
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
               Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue",
               Arial, sans-serif;
  line-height: 1.55;
  color: #111;
  background: #fff;
}

img{
  max-width: 100%;
  height: auto;
  display: block;
}

/* --- Variables --- */
:root{
  --geombpl-blue: #0b4f8a;
  --geombpl-blue-soft: #f4f8fc;
  --border: #e6e6e6;
  --card-bg: #fafafa;

  --site-hdr-h: 96px; /* hauteur header sticky (ajuste si besoin) */
  --site-gap: 12px;
}

/* --- Conteneur global --- */
.container{
  width: min(1100px, 92vw);
  margin: 0 auto;
}

/* --- Typographie --- */
h1{
  font-size: clamp(22px, 3vw, 34px);
  margin: 0 0 12px;
}
h2{
  font-size: clamp(18px, 2.2vw, 26px);
  margin: 20px 0 12px;
  color: var(--geombpl-blue);
  border-left: 4px solid var(--geombpl-blue);
  padding-left: 12px;
}
h3{
  font-size: clamp(16px, 2vw, 20px);
  margin: 16px 0 8px;
  color: #163f66;
}
p{ margin: 0 0 12px; }

.lead{
  max-width: 75ch;
  font-size: 1.05em;
}

.muted{
  font-size: 0.9em;
  color: #555;
}

/* --- Header --- */
.site-header{
border-bottom: 1px solid var(--border);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 1000;
}

/* petit confort visuel quand ça colle en haut */
@supports (backdrop-filter: blur(6px)){
  .site-header{ backdrop-filter: blur(6px); }
}
.site-header{ box-shadow: 0 6px 18px rgba(0,0,0,.06); }


.header-inner{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
}

/* Logo : un peu plus grand */
.logo img{
  max-height: 66px;
}

/* --- Navigation --- */
.nav{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.nav a{
  text-decoration: none;
  color: #111;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 0.95em;
}

.nav a:hover{ border-color: #ddd; }

.nav a.is-active{
  border-color: #111;
  font-weight: 600;
}

/* --- Boutons génériques --- */
.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid #333;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font-size: 0.95em;
  text-decoration: none;
  color: #111;
}

.btn.primary{
  background: #111;
  color: #fff;
  border-color: #111;
}

.btn:hover{ opacity: 0.92; }

.nav a.btn.is-active{
  box-shadow: 0 0 0 2px #111 inset;
}

/* --- Main / sections --- */
.site-main{ padding: 18px 0; }
.hero{ padding: 10px 0 18px; }
.panel{ padding: 18px 0; }

/* --- Cartes / blocs --- */
.card{
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 16px;
  background: var(--card-bg);
  border-left: 4px solid rgba(11,79,138,0.15);
}

.card.highlight{
  border-left: 4px solid var(--geombpl-blue);
  background: var(--geombpl-blue-soft);
}

.card p{ max-width: 75ch; }

/* --- Grille --- */
.grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

.card{
  display: flex;
  flex-direction: column;
}
.card > strong{
  display: block;
  margin-bottom: 12px;
  font-size: 1.05em;
}
.card > *:last-child{ margin-bottom: 0; }

/* --- Formulaires --- */
label{
  display: inline-block;
  margin-bottom: 6px;
  font-size: 0.95em;
}

input:not([type="radio"]):not([type="checkbox"]),
textarea,
select{
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #bbb;
  border-radius: 8px;
  font: inherit;
}

textarea{ resize: vertical; }

/* Radios & checkbox : taille naturelle */
input[type="radio"],
input[type="checkbox"]{
  width: auto;
  padding: 0;
  border: none;
}

/* Ajustement checkbox classique */
input[type="checkbox"]{ margin-right: 6px; }

/* --- Modules (inscription) : radio + texte collés --- */
label.module-item{
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  margin: 0 0 10px 0;
}

label.module-item input[type="radio"]{
  margin: 0;
  flex: 0 0 auto;
}

label.module-item span{
  margin: 0;
  padding: 0;
  flex: 0 1 auto;
  text-align: left;
}

/* --- Date de naissance : 3 selects sur une ligne --- */
.birthdate-row{
  display: flex;
  gap: 10px;
  flex-wrap: nowrap;
  align-items: center;
}
.birthdate-row select{
  width: auto;
  min-width: 110px;
}

/* --- Footer --- */
.site-footer{
  border-top: 1px solid var(--border);
  padding: 18px 0;
  margin-top: 30px;
  background: #fff;
}

.footer-inner{
  font-size: 0.9em;
  color: #444;
}

/* ==========================================================
   BarreIdentification2 (compacte et stable)
   - Non logué : courriel + mdp sur 1 ligne, boutons dessous
   - Logué : Bonjour... sur 1 ligne, bouton quitter en dessous
   ========================================================== */

.MenuIdentification{
  max-width: 420px;
  font-size: 0.85em;
  line-height: 1.15;
}

/* non logué */
.MenuIdentification .bi-grid{
  display: grid;
  gap: 8px;
}

/* deux champs sur une ligne */
.MenuIdentification .bi-fields{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-items: end;
}

.MenuIdentification label{
  margin: 0 0 2px;
  font-size: 0.82em;
}

.MenuIdentification input[type="email"],
.MenuIdentification input[type="password"]{
  padding: 6px 8px;
  font-size: 0.92em;
}

/* boutons dessous */
.MenuIdentification .bi-actions{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

/* mini boutons “sexy” */
.MenuIdentification .mini-btn{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  font-size: 0.85em;
  white-space: nowrap;
}

.MenuIdentification .mini-btn .ico{
  display: inline-flex;
  width: 18px;
  height: 18px;
}

.MenuIdentification .mini-create{
  background: #ede9fe;
  color: #4c3aa9;
  border-color: #c4b5fd;
}
.MenuIdentification .mini-reset{
  background: #f3e8d8;
  color: #a05a12;
  border-color: #e5c69c;
}

/* bouton connexion compact */
.MenuIdentification .bi-login{
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.9em;
}

/* logué : 2 lignes pour laisser de la place au menu */
.MenuIdentification .bi-logged{
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}

.MenuIdentification .bi-hello{
  font-size: 0.92em;
  white-space: nowrap;
}

.MenuIdentification .bi-logout{
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.88em;
}

/* ==========================================================
   Responsive
   ========================================================== */
@media (max-width: 900px){
  .header-inner{
    flex-direction: column;
    align-items: flex-start;
  }
  .nav{ width: 100%; }
  .grid{ grid-template-columns: 1fr; }

  .MenuIdentification{
    max-width: 100%;
    width: 100%;
    margin-top: 10px;
  }
  .MenuIdentification .bi-actions{
    justify-content: flex-start;
  }
}

/* mobile : champs de login en colonne */
@media (max-width: 520px){
  .container{ width: 94vw; }
  .btn{ width: 100%; text-align: center; }
  .nav a{ width: 100%; }

  .MenuIdentification .bi-fields{
    grid-template-columns: 1fr;
  }
}

/* Ressources enseignants : titre + bouton PDF sur la même ligne */
.res-item{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  padding:10px 0;
  border-bottom:1px solid #e6e6e6;
}

.res-left{ flex:1 1 auto; min-width:0; }

.res-title{
  font-weight:700;
  line-height:1.25;
}

.res-desc{
  margin-top:4px;
}

.res-pdf{
  flex:0 0 auto;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:38px;
  height:38px;
  border-radius:10px;
  border:1px solid #bbb;
  background:#fff;
  font-size:18px;
}

.res-pdf:hover{ opacity:0.9; }

/* Accordéons (pages ressources / historique / cours) */
.accordion {
  border: 1px solid #ddd;
  border-radius: 10px;
  margin-bottom: 12px;
  background: #fafafa;
}

.accordion summary {
  cursor: pointer;
  padding: 10px 12px;
  font-weight: 600;
}

.accordion[open] summary {
  margin-bottom: 18px;
  border-bottom: 1px solid #e5e5e5;
  background: #fff;
}

.accordion-body {
  padding-top: 12px;   /* espace entre le titre et le contenu */
  position: relative;
  padding-left: 22px;
}

.accordion-body::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(11,79,138,0.45); /* bleu GEOMBPL doux */
  border-radius: 2px;
}

/* Admin cours – date sur une seule ligne */
.date-row{
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
}

.date-row select{
  width: auto;
  min-width: 90px;
}

.session-date {
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* ===== Vidéo modal : zone visible ===== */
.vid-player{
  display:block;
  width:100%;
  aspect-ratio:16/9;
  max-height:70vh;
  background:#000;
  border-radius:12px;
}

/* === Modal vidéo : garantir une zone d'affichage réelle === */
.modal-backdrop{
  position: fixed;
  inset: 0;
  display: none;               /* affichée en JS */
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0,0,0,0.55);
  z-index: 9999;               /* au-dessus du header */
}

.modal{
  width: min(920px, 96vw);
  background: #111;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.15);
}

.modal video{ display:block; width:100%; height:auto; background:#000; }

.modal-player{
  background:#000;
  width:100%;
}

.modal-player video{
  display:block;
  width:100%;
  height:auto;
  background:#000;
}
/* === FIX rendu vidéo en modal (Safari/Chrome) === */

/* IMPORTANT: éviter tout transform/filter sur les ancêtres du <video> */
#vidModal, #vidModal *{
  filter: none !important;
}

#vidModal{
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0,0,0,.55);
  z-index: 9999;
  transform: none !important; /* crucial si un parent a transform */
}

#vidModal .modal{
  width: min(920px, 96vw);
  background: #111;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.15);
  transform: none !important;
}

#vidModal .modal-player{
  background: #000;
}

#vidModal video{
  display: block;
  width: 100%;
  height: auto;
  max-height: 70vh;       /* force une surface visible */
  background: #000;
  object-fit: contain;
}