/* Réduction et rationalisation sans casser le HTML existant */

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

ul {
  padding-left: 20px;
  margin-bottom: 10px;
}


html, body {
  font-family: Arial, sans-serif;
  font-size: 1.1em;
  line-height: 1.5;
  background: #f0f2f5; /* fond clair global */
  min-height: 100vh;
}

a {
  text-decoration: none;
  color: inherit;
}

/* Couleurs selon profils */
body.enseignant { background-color: #FF8C00; }
body.gendarme   { background-color: #2A4979; }
body.marin      { background-color: #9F9F9F; }
body.normal     { background-color: #FFFF00; }
body.policier   { background-color: #87CEFA; }

/* Conteneurs généraux */
.container,
div.cadre {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 16px;
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 10px;
}

/* Blocs et sections */
div.connecte
{
  background: #F7F7F7;
  border: 1px solid #C7C7C7;
  padding: 10px 15px 15px 15px;
  border-radius: 10px;
  margin: 0;
}

div.newsdemig{
  width: 48%;
  background: #F7F7F7;
  border: 1px solid #C7C7C7;
  margin: 15px 0;
  padding: 15px;
  border-radius: 10px;
}

div.news,
div.newsdemid,
div.formulaire,
div.alerte,
div.recherche {
  background: #F7F7F7;
  border: 1px solid #C7C7C7;
  margin: 15px 0;
  padding: 15px;
  border-radius: 10px;
}

div.alerte {
  background: #FFF0F0;
  border: 2px dashed red;
  color: #900;
  font-weight: bold;
}

div.footer {
  font-size: 0.8em;
  text-align: center;
}

div.footer a,
div.bas a {
  color: #505050;
}

li.flex-puce {
  display: flex;
  align-items: center;
}

li.flex-puce::before {
  content: "☆";
  margin-right: 0.5em;
  color: #333;
}

/* Blocs génériques */
.bloc {
  background: #F7F7F7;
  border: 1px solid #C7C7C7;
  margin: 15px 0;
  padding: 15px;
  border-radius: 10px;
}

.bloc-alert {
  background: #FFF0F0;
  border: 2px dashed red;
  color: #900;
  font-weight: bold;
}

.bloc-positiv {
  background:rgb(158, 244, 115);
  border: 2px dashed green;
  color: green;
  font-weight: bold;
}

.bloc-50 {
  width: 48%;
}

/* Mise en page gauche/droite */
div.gauche {
  float: left;
  width: 29%;
  padding: 10px;
}

div.droite {
  float: right;
  width: 70%;
  padding: 10px;
}

div.spacer {
  clear: both;
}

/* Bannière RGPD */

#cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  color: #000;
  padding: 1em;
  border-top: 2px solid #666;
  text-align: center;
  z-index: 9999;
  font-size: 14px;
  box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
}

.cookie-buttons {
  margin-top: 10px;
}


.cookie-buttons button {
  margin: 0 8px;
  padding: 6px 14px;
  font-size: 14px;
  border: none;
  border-radius: 4px;
  background-color: #39853c;
  color: white;
  cursor: pointer;
}

.cookie-buttons button:hover { background-color: #327435; }

.cookie-buttons button:last-child {
  background: #aaa;
}

.hidden {
  display: none !important;
}


/* Champs de formulaire */
.champ {
  width: 100%;
  padding: 10px;
  font-size: 1em;
  margin-top: 5px;
  border: 1px solid #CCC;
  border-radius: 5px;
}

.champ-large {
  font-size: 1.1em;
  line-height: 1.5;
}

/* Boutons génériques */
.btn {
  display: inline-block;
  padding: 10px;
  font-size: 1em;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  text-align: center;
  color: white;
  margin-top: 10px;
  user-select: none;
  text-decoration: none;
  min-height: 48px;
}

.btn:hover {
  filter: brightness(1.1);
}

.btn:active {
  transform: scale(0.98);
}

.btn-green { background-color: #39853c; }
.btn-green:hover { background-color: #327435; }

.btn-blue { background-color: #007BFF; }
.btn-blue:hover { background-color: #0056b3; }

.btn-red { background-color: #dc3545; }
.btn-red:hover { background-color: #a71d2a; }

.btn-neutral { background-color: #888; }
.btn-neutral:hover { background-color: #666; }

/* Titres */
h1 { 
  font-size: 1.5em;
  font-weight: bold;
  margin-bottom: 15px;
}

h2{
  font-size: 1.3em;  
  font-weight: bold;
  margin-bottom: 10px;
  margin-top: 10px;
}
h3 { font-size: 1em; font-weight: bold; }
h4 { font-size: 1em; }

h2:has(img.icone),
h2:has(a.icone),
li:has(a.icone)
 {
  display: flex;
  align-items: center;
  gap: 0.5em;
}

/* Menu horizontal */

div.haut ul{
  background-color: rgba(255,255,255,0.6);
}

div.haut ul li {
  display: inline-block;
  margin-right: 10px;
  font-weight: bold;
  font-size: 1.1em;
  padding: 4px;
}

div.haut ul li:hover {
  background-color: rgba(255,255,255,0.85);
}

div.haut ul li a {
  color: #343434;
  text-decoration: none;
  margin: 0 5px 0 5px;
}

/* Tableaux classiques (desktop) */
table.formulaire,
table.resultats,
table.int,
table.responsive-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0 20px 0;
}

table.formulaire th,
table.formulaire td,
table.resultats th,
table.resultats td,
table.int td,
table.responsive-table th,
table.responsive-table td {
  border: 1px solid #C8C8C8;
  padding: 10px;
  text-align: left;
}

table.resultats th {
  background: #F3F400;
  text-align: center;
}

ul.none, li.none {
  list-style: none;
  padding: 0;

}

ul.none {
  font-size: 1.1em;
  padding: 5px;
}

ul.none li:hover {
  background-color: rgba(255,255,255,0.85);
}

/* Utilitaires */
.center { text-align: center; }
.right { text-align: right; }
.text-justify { text-align: justify; text-indent: 20px; }
.text-indent-0 { text-indent: 0; }
.underline { text-decoration: underline; }

.border0 { border: 0; }
.border1 { border: 1px solid #000; }

/* Images */
img.icone { 
border: 0;
vertical-align: middle; 
width: 42px;
height: 42px;
padding: 3px;
}

a.icone {
  display: inline-block;
  width: 48px;
  height: 48px;
}

a.icone img {
  width: 42px;
  height: 42px;
  padding: 3px;
  border: 0;
  vertical-align: middle;
}

/* Correctifs divers */
div.haut {
  background: url(images/background.png) no-repeat;
  background-size: cover;
  padding-top: 140px;
  border-radius: 5px;
  font-weight: bold;
  text-align: left;
}

div#gendarme {
  background: url(images/background_gendarme.png) no-repeat;
}

div#marin {
  background: url(images/background_marin.png) no-repeat;
}

div#policier {
  background: url(images/background_policier.png) no-repeat;
}

/* En-tête flex */
.header-flex {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 15px;
  margin-bottom: 0;
  padding-top: 15px;
}

.header-flex h1.titre_logo {
  font-size: 2.2em;
  margin: 0;
  flex-shrink: 0;
}

.header-flex h2.titre_page {
  font-size: 1.6em;
  font-weight: normal;
  margin: 0;
}

span#dossier_site {
  color: grey;
}

/* Listes avec puces */
.liste, .puce1, .puce2, .puce3 {
  margin: 0;
  padding: 0;
}

.puce1 {
  list-style-type: none;
  font-weight: bold;
  text-transform: uppercase;
  color: #004700;
  margin-left: -25px;
}

.puce2 {
  list-style-type: square;
  margin-left: 5px;
}

.puce3 {
  list-style-type: disc;
  margin-left: 15px;
  font-size: 0.9em;
}

.signature {
  margin-left: 345px;
  color: #000;
}

.photo_droite {
  float: right;
  width: 160px;
  border-radius: 10px;
  border: 1px solid #C7C7C7;
}

.photo_actuelle {
    display: flex;
    align-items: center;
    gap: 1em;
    padding: 0.8em;
    border: 1px solid #ccc;
    border-radius: 8px;
    background-color: #f9f9f9;
    margin-bottom: 1em;
    max-width: 600px;
}

.photo_actuelle .photo_preview {
    display: inline-block;
    overflow: hidden;
    border-radius: 8px;
    flex-shrink: 0;
    border: 1px solid #ccc;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.photo_actuelle .photo_preview img {
    display: block;
    max-height: 80px;
    border-radius: 8px !important;
}

.photo_actuelle .infos_photo {
    font-size: 0.9em;
    color: #444;
    line-height: 1.4;
}

.form-extra {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

div#bas{
  text-align: center;
}

div.forgot-link a{
  height: 55px;
  display: block;
}
/* === Responsive : mobile-first === */
@media screen and (max-width: 768px) {

  html, body {
    font-size: 16px;
    background: #f0f2f5;
  }

  body div.haut {
    background-size: auto 100% !important; /* largeur auto, hauteur 100% */
    background-position: center top;
  }

  div.gauche,
  div.droite {
    float: none;
    width: 100%;
    padding: 10px 0;
  }

  .header-flex {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    padding-top: 10px;
  }

  .header-flex h1.titre_logo {
    font-size: 1.8em;
  }

  .header-flex h2.titre_page {
    font-size: 1.3em;
  }

  .photo_droite {
    float: none;
    display: block;
    margin: 10px auto;
    width: 80%;
    max-width: 200px;
  }

  /* TABLEAUX RESPONSIVE */
  table.responsive-table {
    display: block;
    width: 100%;
    border: none;
  }

  /* Supprime toutes traces d'entête sur mobile */
  table.responsive-table thead,
  table.responsive-table thead * {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
  }

  table.responsive-table td[data-label="Nom Prénom"]::before {
    display: none;
  }

  table.responsive-table tr {
    display: block;
    margin: 30px 10px;
    padding: 20px;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    border: 1px solid #e0e0e0;
  }

  table.responsive-table td {
    display: block;
    padding: 6px 0;
    margin-bottom: 8px;
    font-size: 1em;
    word-break: break-word;
    border: none;
    border-bottom: 1px dashed #ddd;
    background: transparent;
  }

  table.responsive-table td:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
  }

  table.responsive-table td::before {
    content: attr(data-label);
    font-weight: bold;
    font-size: 0.9em;
    color: #444;
    margin-bottom: 2px;
    display: block;
  }

  ul.menu, li.menuexept {
    display: inline-block;
    margin: 10px 0 0 16px;
  }

  textarea,
  input[type="text"],
  input[type="password"],
  select {
    font-size: 1.1em;
  }

  input[type="submit"] {
    font-size: 1.1em;
    width: 100%;
  }

  .puce2,
  .puce3 {
    margin-left: 10px;
  }

  div.footer {
    font-size: 0.9em;
    padding: 10px;
  }

  .signature {
    margin-left: 0;
    text-align: center;
    display: block;
  }
}
