/* ============================================================================
 * app.css — Design commun Job Sécurité (PC, tablette, mobile)
 *
 * À inclure dans chaque page refaite :
 *   <link rel="stylesheet" href="style/app.css?v=5">
 *
 * Organisation :
 *   1. Variables (couleurs, tailles)       6. Formulaires
 *   2. Base                               7. Boutons
 *   3. En-tête (logo)                     8. Messages
 *   4. Mise en page (menu + contenu)      9. Pied de page
 *   5. Titres et cartes                  10. Utilitaires
 * ========================================================================== */

/* 1. VARIABLES ------------------------------------------------------------ */
:root {
  --marine: #14334F;          /* couleur principale de l'application */
  --marine-fonce: #0E2539;
  --bleu: #0D5C83;            /* bleu du logo */
  --bleu-vif: #008BCE;
  --rouge: #9E1B13;           /* rouge du logo */
  --orange: #F28F09;          /* focus des champs (existant) */
  --obligatoire: #D90000;

  --fond: #F4F6F8;
  --carte: #FFFFFF;
  --bord: #E3E8EF;
  --bord-champ: #CDD6E0;
  --texte: #1F2A37;
  --texte-doux: #6B7686;

  --rayon: 10px;
  --rayon-champ: 6px;
  --ombre: 0 2px 6px rgba(20, 51, 79, .06);

  --hauteur-entete: 72px;
  --largeur-menu: 309px;      /* même largeur que le menu de gauche actuel */
}
@media (max-width: 767px) {
  :root { --hauteur-entete: 60px; }
}

/* 2. BASE ----------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.app {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--fond);
  color: var(--texte);
  font-family: 'Roboto', Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
body.app img { max-width: 100%; }
body.app a { color: var(--bleu-vif); }

/* 3. EN-TÊTE -------------------------------------------------------------- */
.app-entete {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--hauteur-entete);
  background: var(--marine);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
}
.app-entete__interieur {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 24px;
}
.app-entete__logo { display: block; flex: 0 0 auto; line-height: 0; }
.app-entete__logo img {
  height: calc(var(--hauteur-entete) - 16px);
  width: auto;
  border-radius: 4px;
}
.app-entete__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.app-entete__lien {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: var(--rayon-champ);
  color: #fff !important;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .2s;
}
.app-entete__lien:hover { background: rgba(255, 255, 255, .1); }
.app-entete__lien .app-texte-court { display: none; }

/* Bouton ☰ (pages avec menu) : visible uniquement sur tablette / mobile */
.app-burger {
  display: none;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font-size: 19px;
  cursor: pointer;
}

@media (max-width: 767px) {
  .app-entete__interieur { padding: 0 12px; gap: 10px; }
  .app-entete__lien { padding: 8px 10px; }
  .app-entete__lien .app-texte-long { display: none; }   /* texte raccourci sur mobile */
  .app-entete__lien .app-texte-court { display: inline; }
}
@media (max-width: 380px) {
  .app-entete__logo img { height: calc(var(--hauteur-entete) - 22px); }
}

/* 4. MISE EN PAGE --------------------------------------------------------- */
.app-cadre {
  flex: 1;
  display: flex;
  align-items: flex-start;
  width: 100%;
}
/* Colonne du menu de gauche (pages connectées) */
.app-menu {
  flex: 0 0 var(--largeur-menu);
  width: var(--largeur-menu);
  position: sticky;
  top: var(--hauteur-entete);
  max-height: calc(100vh - var(--hauteur-entete));
  overflow-y: auto;
}
.app-voile { display: none; }

/* Zone de contenu : prend toute la place disponible */
.app-contenu {
  flex: 1;
  min-width: 0;                 /* évite les débordements des tableaux larges */
  padding: 28px 32px 40px;
}
/* Pages sans menu (inscription, connexion...) : contenu centré, largeur confortable */
.app-contenu--centre {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
}

@media (max-width: 1023px) {
  .app-burger { display: inline-flex; align-items: center; justify-content: center; }
  .app-menu {
    position: fixed;
    top: var(--hauteur-entete);
    left: 0;
    bottom: 0;
    z-index: 60;
    max-height: none;
    width: min(var(--largeur-menu), 86vw);
    background: #fff;
    box-shadow: 4px 0 18px rgba(0, 0, 0, .2);
    transform: translateX(-105%);
    transition: transform .25s ease;
  }
  .app-voile {
    position: fixed;
    inset: var(--hauteur-entete) 0 0 0;
    z-index: 55;
    background: rgba(14, 37, 57, .45);
  }
  body.app-menu-ouvert .app-menu { transform: none; }
  body.app-menu-ouvert .app-voile { display: block; }
  body.app-menu-ouvert { overflow: hidden; }
  .app-contenu { padding: 22px 20px 32px; }
}
@media (max-width: 767px) {
  .app-contenu { padding: 18px 12px 28px; }
}

/* 5. TITRES ET CARTES ----------------------------------------------------- */
.app-haut-page {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin-bottom: 20px;
}
.app-titre-page {
  margin: 0;
  color: var(--marine);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
}
.app-titre-page i { margin-right: 8px; }
.app-sous-titre {
  margin: 4px 0 0;
  color: var(--texte-doux);
  font-size: 14px;
}

.app-carte {
  background: var(--carte);
  border: 1px solid var(--bord);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  padding: 22px 26px;
  margin-bottom: 20px;
}
.app-carte__titre {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--marine);
  color: var(--marine);
  font-size: 17px;
  font-weight: 700;
}
.app-carte__note {
  margin: -6px 0 18px;
  color: var(--texte-doux);
  font-size: 13px;
}
@media (max-width: 767px) {
  .app-titre-page { font-size: 19px; }
  .app-carte { padding: 18px 16px; margin-bottom: 14px; }
  .app-carte__titre { font-size: 16px; }
}

/* 6. FORMULAIRES ---------------------------------------------------------- */
/* Grille de champs : 2 colonnes sur PC / tablette, 1 colonne sur mobile */
.app-grille {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 24px;
}
.app-grille--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.app-grille > .app-large { grid-column: 1 / -1; }
@media (max-width: 1023px) {
  .app-grille--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 639px) {
  .app-grille, .app-grille--3 { grid-template-columns: 1fr; }
}

.app-champ { margin-bottom: 18px; min-width: 0; }
.app-champ > label {
  display: block;
  margin: 0 0 6px;
  color: var(--marine);
  font-size: 14px;
  font-weight: 600;
}
.app em, .app-champ em {
  color: var(--obligatoire);
  font-style: normal;
  font-weight: 700;
}
.app-champ input[type=text],
.app-champ input[type=tel],
.app-champ input[type=email],
.app-champ input[type=date],
.app-champ input[type=number],
.app-champ input[type=password],
.app-champ select,
.app-champ textarea {
  display: block;
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--bord-champ);
  border-radius: var(--rayon-champ);
  background: #fff;
  color: var(--texte);
  font: inherit;
  font-size: 15px;
  transition: border-color .2s, box-shadow .2s;
}
.app-champ input[readonly] { background: #F7F9FB; color: var(--texte-doux); }
.app-champ input:focus,
.app-champ select:focus,
.app-champ textarea:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(242, 143, 9, .15);
}
.app-champ input[type=file] {
  display: block;
  width: 100%;
  padding: 10px;
  border: 1px dashed var(--bord-champ);
  border-radius: var(--rayon-champ);
  background: #F7F9FB;
  font: inherit;
  font-size: 14px;
}
.app-note {
  display: block;
  margin-top: 6px;
  color: var(--texte-doux);
  font-size: 12.5px;
  line-height: 1.4;
}
.app-note--alerte { color: var(--obligatoire); }
@media (max-width: 767px) {
  /* 16px minimum : évite le zoom automatique de l'iPhone sur les champs */
  .app-champ input, .app-champ select, .app-champ textarea { font-size: 16px !important; min-height: 46px; }
}

/* Cases à cocher et boutons radio : grandes zones faciles à toucher */
.app-options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.app-options--ligne { flex-direction: row; flex-wrap: wrap; }
.app-option {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid var(--bord-champ);
  border-radius: var(--rayon-champ);
  background: #fff;
  cursor: pointer;
  transition: border-color .2s, background-color .2s;
}
.app-options--ligne .app-option { min-width: 120px; }
.app-option:hover { border-color: var(--marine); }
.app-option input[type=checkbox],
.app-option input[type=radio] {
  width: 20px;
  height: 20px;
  margin: 0;
  flex: 0 0 20px;
  accent-color: var(--marine);
  cursor: pointer;
}
.app-option span { color: var(--marine); font-size: 14.5px; font-weight: 600; }
.app-option:has(input:checked) { border-color: var(--marine); background: #EEF3F8; }
.app-question { margin: 0 0 10px; color: var(--marine); font-size: 14px; font-weight: 600; }

/* Bloc qui apparaît selon une réponse (masqué par défaut, affiché par le JavaScript de la page) */
.app-sous-bloc {
  display: none;
  margin: -2px 0 16px 18px;
  padding: 16px 18px 4px;
  border-left: 3px solid var(--orange);
  border-radius: 0 8px 8px 0;
  background: #F7F9FB;
}
@media (max-width: 639px) {
  .app-sous-bloc { margin-left: 0; padding: 14px 14px 2px; }
  .app-options--ligne .app-option { flex: 1; }
}

/* 7. BOUTONS -------------------------------------------------------------- */
.app-btn,
.app input[type=submit].app-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 24px;
  border: 1px solid transparent;
  border-radius: var(--rayon-champ);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none !important;
  cursor: pointer;
  transition: background-color .2s, border-color .2s;
}
.app-btn--principal { background: var(--marine); color: #fff !important; }
.app-btn--principal:hover { background: #1A4486; }
.app-btn--secondaire { background: #fff; color: var(--marine) !important; border-color: var(--bord-champ); }
.app-btn--secondaire:hover { background: #F0F3F6; }
.app-btn--discret { background: #F0F0F0; color: #444 !important; font-size: 13px; font-weight: 600; padding: 8px 16px; min-height: 0; }
.app-btn--discret:hover { background: #E0E0E0; }

.app-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 15px;
  margin: 4px 0 16px;
}
@media (max-width: 639px) {
  .app-actions { flex-direction: column; align-items: stretch; }
  .app-actions .app-btn { width: 100%; min-height: 48px; }
}

/* 8. MESSAGES ------------------------------------------------------------- */
.app-message {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0 0 18px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
}
.app-message i { margin-top: 3px; }
.app-message--erreur { background: #FDECEA; border: 1px solid #F5C2BD; color: #C62828; }
.app-message--info   { background: #E8F3FA; border: 1px solid #C3DFF0; color: #0D4F73; }
.app-message--ok     { background: #E9F7EF; border: 1px solid #BFE5CD; color: #1D6B33; }
.app-texte-final { margin: 0 0 10px; color: var(--marine); font-size: 13px; }

/* Page de connexion (et pages courtes du même type : mot de passe oublié...) */
.app-contenu--connexion {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 48px;
  padding-bottom: 48px;
}
.app-connexion { width: 100%; max-width: 440px; }
.app-connexion .app-carte { padding: 30px 32px 26px; margin-bottom: 16px; }
.app-connexion__titre {
  margin: 0 0 6px;
  color: var(--marine);
  font-size: 24px;
  font-weight: 700;
  text-align: center;
}
.app-connexion__intro { margin: 0 0 24px; color: var(--texte-doux); font-size: 14px; text-align: center; }
.app-connexion .app-btn { width: 100%; min-height: 48px; }
.app-connexion__lien-discret { display: block; margin-top: 14px; font-size: 14px; text-align: center; }
.app-connexion__sep {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  color: var(--texte-doux);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.app-connexion__sep::before,
.app-connexion__sep::after { content: ""; flex: 1; height: 1px; background: var(--bord); }
.app-connexion__inscriptions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.app-connexion__inscriptions .app-btn { font-size: 14px; padding: 10px 12px; }

/* Champ mot de passe avec bouton « afficher » */
.app-mdp { position: relative; }
.app-mdp input { padding-right: 48px !important; }
.app-mdp__voir {
  position: absolute;
  top: 0;
  right: 0;
  width: 46px;
  height: 100%;
  border: 0;
  background: none;
  color: var(--texte-doux);
  font-size: 16px;
  cursor: pointer;
}
.app-mdp__voir:hover { color: var(--marine); }

@media (max-width: 639px) {
  .app-contenu--connexion { justify-content: flex-start; padding-top: 24px; }
  .app-connexion .app-carte { padding: 24px 18px 20px; }
  .app-connexion__titre { font-size: 21px; }
}
@media (max-width: 359px) {
  .app-connexion__inscriptions { grid-template-columns: 1fr; }
}

/* Étapes numérotées (ex. mot de passe oublié : 1. Mail  2. Code  3. Nouveau mot de passe) */
.app-etapes { display: flex; gap: 6px; margin: 0 0 22px; padding: 0; list-style: none; }
.app-etapes li {
  flex: 1;
  padding-top: 8px;
  border-top: 4px solid var(--bord);
  color: var(--texte-doux);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}
.app-etapes li.fait { border-top-color: #8FB3CC; color: var(--marine); }
.app-etapes li.actif { border-top-color: var(--marine); color: var(--marine); }

/* Bouton d'en-tête mis en avant (ex. « Accéder à la plateforme ») */
.app-entete__lien--principal { background: #C89C47; border-color: #C89C47; color: #fff !important; font-weight: 700; }
.app-entete__lien--principal:hover { background: #B08637; }

/* PAGE D'ACCUEIL --------------------------------------------------------- */
.app-contenu--large { width: 100%; max-width: 1180px; margin: 0 auto; }

.app-heros {
  position: relative;
  overflow: hidden;
  margin-bottom: 24px;
  padding: 44px 44px 40px;
  border-radius: 14px;
  background: linear-gradient(120deg, var(--marine) 0%, var(--bleu) 62%, #1C6E98 100%);
  color: #fff;
}
.app-heros::after {                       /* liseré rouge du logo */
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--bleu) 0 30%, var(--rouge) 30%);
}
.app-heros h1 { max-width: 760px; margin: 0 0 12px; font-size: 32px; line-height: 1.2; font-weight: 700; }
.app-heros h1 span { color: #7FD0F5; }
.app-heros p { max-width: 680px; margin: 0 0 22px; font-size: 16px; opacity: .9; }
.app-pastilles { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 28px; padding: 0; list-style: none; }
.app-pastilles li {
  padding: 7px 14px;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
  font-size: 14px;
  font-weight: 500;
}
.app-pastilles b { color: #FFD27A; }
.app-heros__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.app-btn--orange { background: #C89C47; color: #fff !important; }
.app-btn--orange:hover { background: #B08637; }
.app-btn--clair { background: transparent; color: #fff !important; border-color: rgba(255, 255, 255, .5); }
.app-btn--clair:hover { background: rgba(255, 255, 255, .12); }

.app-section-titre { margin: 8px 0 14px; color: var(--marine); font-size: 21px; font-weight: 700; }
.app-deux-colonnes { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 8px; }
.app-deux-colonnes .app-carte { margin-bottom: 20px; }

.app-liste-avantages { margin: 0; padding: 0; list-style: none; }
.app-liste-avantages li {
  position: relative;
  padding: 10px 0 10px 32px;
  border-bottom: 1px solid #EEF1F4;
  font-size: 14.5px;
  line-height: 1.5;
}
.app-liste-avantages li:last-child { border-bottom: 0; }
.app-liste-avantages li::before {
  content: "\f00c";
  position: absolute;
  left: 2px;
  top: 11px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #E9F7EF;
  color: #2E8B57;
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 11px;
  line-height: 20px;
  text-align: center;
}
.app-liste-avantages b { color: var(--marine); }

.app-logos { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 14px; }
.app-logos__item {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  padding: 14px;
  border: 1px solid var(--bord);
  border-radius: var(--rayon);
  background: #fff;
  transition: transform .2s, box-shadow .2s;
}
.app-logos__item:hover { transform: translateY(-3px); box-shadow: 0 6px 14px rgba(20, 51, 79, .12); }
.app-logos__item img { max-width: 100%; max-height: 100%; object-fit: contain; }
.app-vide { margin: 0; color: var(--texte-doux); font-size: 14px; }

.app-partenaires { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; }
.app-partenaires img { width: 170px; height: 100px; object-fit: cover; border-radius: 6px; box-shadow: var(--ombre); }

@media (max-width: 1023px) {
  .app-heros { padding: 34px 28px 32px; }
  .app-heros h1 { font-size: 27px; }
}
@media (max-width: 767px) {
  .app-deux-colonnes { grid-template-columns: 1fr; gap: 0; }
  .app-deux-colonnes .app-carte { margin-bottom: 14px; }
  .app-heros { padding: 26px 18px 26px; border-radius: 10px; }
  .app-heros h1 { font-size: 23px; }
  .app-heros p { font-size: 15px; }
  .app-heros__actions .app-btn { flex: 1 1 100%; min-height: 48px; }
  .app-logos { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .app-section-titre { font-size: 19px; }
}

/* Pages de texte (mentions légales, protection des données, contact...) */
.app-contenu--lecture { width: 100%; max-width: 900px; margin: 0 auto; }
.app-texte { font-size: 15.5px; line-height: 1.7; }
.app-texte h2 {
  margin: 26px 0 8px;
  color: var(--marine);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.app-texte h2:first-child { margin-top: 0; }
.app-texte p { margin: 0 0 12px; }
.app-texte a { word-break: break-word; }
.app-texte .app-btn { max-width: 100%; overflow-wrap: anywhere; text-align: center; }
.app-citation {
  margin: 0 auto;
  max-width: 640px;
  text-align: center;
}
.app-citation__titre { margin: 0 0 6px; color: var(--marine); font-size: 26px; font-weight: 700; }
.app-citation__ref { margin: 0 0 18px; color: var(--texte-doux); font-size: 14px; }
.app-citation blockquote {
  margin: 0 0 22px;
  padding: 18px 22px;
  border-left: 4px solid var(--rouge);
  border-radius: 0 8px 8px 0;
  background: #F7F9FB;
  font-size: 15.5px;
  font-style: italic;
  line-height: 1.7;
  text-align: left;
}
.app-citation__mentions { margin: 0; color: var(--marine); font-size: 15px; line-height: 1.8; }
@media (max-width: 639px) {
  .app-texte { font-size: 15px; }
  .app-citation__titre { font-size: 22px; }
  .app-citation blockquote { padding: 14px 16px; }
}

/* 9. PIED DE PAGE --------------------------------------------------------- */
.app-pied {
  background: var(--marine-fonce);
  color: rgba(255, 255, 255, .75);
  padding: 18px 24px;
  font-size: 13px;
  text-align: center;
}
.app-pied nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 18px;
  margin-bottom: 8px;
}
.app-pied a { color: #fff !important; text-decoration: none; }
.app-pied a:hover { text-decoration: underline; }

/* 10. UTILITAIRES --------------------------------------------------------- */
.app-cache { display: none !important; }
