/* ============================================================================
   assets/css/interface_commune.css — Le tronc commun de l'administration et du tableau
   des modules, chargé après charte.css par vues/gabarits/tete_interface.php.
   Préfixe socle-, JAMAIS « ad- » : les bloqueurs de publicité le masquent.
   AUCUNE COULEUR LITTÉRALE : tout vient des jetons --m-* de charte.css.
   ============================================================================ */

[hidden] { display: none !important; }

/* Lu par les lecteurs d'écran, jamais vu : libellés de champs sans titre visible, annonces. */
.socle-sr {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Le formulaire du bouton de déconnexion (POST avec jeton) : invisible pour la mise en page. */
.socle-deconnexion { display: contents; }

/* Le lien « Aller au contenu » : hors de l'écran, il n'apparaît qu'au clavier. */
.socle-evitement {
  position: fixed; top: 8px; left: 8px; z-index: 1000; padding: 10px 16px;
  background: var(--m-emphase); color: var(--m-sur-emphase); border-radius: var(--m-rayon);
  text-decoration: none; font-weight: 600; transform: translateY(-200%);
  transition: transform .2s var(--m-doux);
}
.socle-evitement:focus { transform: none; }

/* Le filet de la barre : une lueur d'accent le parcourt en 11 s. À 1 px elle se lisait
   comme un reflet, pas comme un mouvement voulu : 2 px. Sous une barre par défaut, le long
   de l'arête droite d'une colonne avec .socle-filet-vertical. */
.socle-filet { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--m-entete-bordure); overflow: hidden; pointer-events: none; }
.socle-filet::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 45%;
  background: linear-gradient(90deg, transparent, var(--m-entete-accent), transparent);
  animation: socleFilet 11s linear infinite;
}
.socle-filet-vertical { top: 0; left: auto; width: 2px; height: auto; }
.socle-filet-vertical::after {
  bottom: auto; left: 0; right: 0; width: auto; height: 18%;
  background: linear-gradient(180deg, transparent, var(--m-entete-accent), transparent);
  animation-name: socleFiletVertical;
}
@keyframes socleFilet { from { transform: translateX(-100%); } to { transform: translateX(222%); } }
@keyframes socleFiletVertical { from { transform: translateY(-100%); } to { transform: translateY(556%); } }

/* La pastille de la personne connectée, dans la barre ou la colonne : blanc translucide,
   initiales blanches, fine bordure. JAMAIS une teinte d'identité : celles-ci distinguent
   les AUTRES personnes entre elles. Avec une photo, le fond et la bordure s'effacent. */
.socle-pastille-moi {
  width: 32px; height: 32px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
  background: var(--m-entete-surface-forte); color: var(--m-entete-fort);
  border: 1px solid var(--m-entete-bordure);
}
/* Sur une surface claire (la fenêtre « Mon profil ») : le gris de la charte, pas celui de la barre. */
.socle-pastille-surface, .socle-pastille-grande { background: var(--m-gris-100); color: var(--m-gris-700); border-color: var(--m-bordure); }
.socle-pastille-surface { width: 40px; height: 40px; font-size: 14px; }
.socle-pastille-grande { width: 96px; height: 96px; font-size: 32px; }
.socle-pastille-moi.avec-photo { background: none; border-color: transparent; }
.socle-pastille-moi img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* La fenêtre « Mon profil » (vues/gabarits/fenetre_profil.php). */
.socle-profil { max-width: 560px; }
.socle-profil-actions { display: flex; justify-content: flex-end; }
.socle-profil-photo { display: flex; align-items: flex-start; gap: var(--m-espace-5); }
.socle-profil-photo-actions { display: flex; flex-direction: column; align-items: flex-start; gap: var(--m-espace-3); min-width: 0; }
.socle-profil-rangee { display: flex; flex-wrap: wrap; gap: var(--m-espace-2); }
.socle-profil-rangee form { margin: 0; }
.socle-profil-confirmation .socle-profil-rangee { margin-top: var(--m-espace-2); }

/* La signature (assets/js/signature_profil.js). Elle est un document, pas un élément
   d'interface : encre sombre sur papier blanc dans les trois thèmes, comme ce qui sera
   imprimé — une encre claire tracée en thème sombre disparaîtrait de la page. Seules
   couleurs écrites ici, lues aussi par le script pour tracer. */
.socle-profil { --socle-papier: #FFFFFF; --socle-encre: #111111; }
.socle-signature-modes { border: 0; margin: 0; padding: 0; min-width: 0; }
.socle-signature-modes legend { padding: 0; margin-bottom: 5px; }
.socle-signature-modes .m-form-choix { flex-direction: row; flex-wrap: wrap; }
.socle-signature-modes .m-radio { min-height: 44px; }
.socle-signature-apercu {
  display: grid; place-items: center; min-height: 96px; padding: var(--m-espace-3);
  background: var(--socle-papier); border: 1px solid var(--m-bordure); border-radius: var(--m-rayon);
}
.socle-signature-apercu img { display: block; max-width: 100%; max-height: 120px; }
.socle-signature-aucune { font-size: 14px; color: var(--socle-encre); opacity: .65; }
.socle-signature-cadre {
  position: relative; background: var(--socle-papier);
  border: 1px solid var(--m-bordure-champ); border-radius: var(--m-rayon);
}
.socle-signature-cadre canvas { display: block; width: 100%; height: 180px; touch-action: none; cursor: crosshair; }
/* La ligne où l'on signe, comme sur un formulaire papier. */
.socle-signature-ligne {
  position: absolute; left: 24px; right: 24px; bottom: 40px; height: 1px;
  background: var(--socle-encre); opacity: .2; pointer-events: none;
}
/* La zone de dépôt de la charte, posée sur un vrai bouton : il n'hérite pas de la police. */
.socle-signature-depot { width: 100%; font-family: inherit; }
.socle-recadrage { position: relative; align-self: center; max-width: 100%; overflow: hidden; touch-action: none; user-select: none; cursor: crosshair; }
.socle-recadrage-image { display: block; max-width: 100%; max-height: min(50vh, 360px); pointer-events: none; }
/* Ce qui sort du rectangle est voilé : c'est ce qui ne sera pas envoyé. */
.socle-recadrage-rectangle {
  position: absolute; cursor: move; outline: 2px solid var(--socle-papier);
  box-shadow: 0 0 0 1px var(--socle-encre), 0 0 0 100vmax rgba(0,0,0,.5);
}
.socle-recadrage-rectangle:focus-visible { outline: 3px solid var(--m-accent); }
.socle-recadrage-poignee {
  position: absolute; width: 16px; height: 16px; border-radius: 50%;
  background: var(--socle-papier); border: 2px solid var(--socle-encre);
}
/* La cible du doigt fait 44 px, la poignée visible 16. */
.socle-recadrage-poignee::before { content: ""; position: absolute; inset: -16px; }
.socle-recadrage-poignee[data-poignee="nw"] { left: -9px; top: -9px; cursor: nwse-resize; }
.socle-recadrage-poignee[data-poignee="ne"] { right: -9px; top: -9px; cursor: nesw-resize; }
.socle-recadrage-poignee[data-poignee="sw"] { left: -9px; bottom: -9px; cursor: nesw-resize; }
.socle-recadrage-poignee[data-poignee="se"] { right: -9px; bottom: -9px; cursor: nwse-resize; }

/* Le champ mot de passe (champ_mot_de_passe()) : l'œil dans le champ, les règles dessous. */
.socle-mdp { position: relative; }
.socle-mdp .m-form-input { width: 100%; padding-right: 46px; }
.socle-mdp-voir {
  position: absolute; top: 50%; right: 4px; transform: translateY(-50%);
  width: 36px; height: 36px; border: none; border-radius: var(--m-rayon-sm); background: none;
  color: var(--m-gris-500); cursor: pointer; display: grid; place-items: center;
}
.socle-mdp-voir:hover { color: var(--m-noir); background: var(--m-gris-50); }
.socle-mdp-voir:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--m-accent); }
.socle-regles-mdp {
  list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr;
  gap: 4px 12px; font-size: 13px; color: var(--m-gris-500);
}
.socle-regles-mdp i { width: 14px; font-size: 7px; text-align: center; }
.socle-regles-mdp .ok { color: var(--m-succes); }
.socle-regles-mdp .ok i { font-size: 11px; }

@media (max-width: 480px) {
  /* Quatre onglets ne tiennent pas sur une ligne de téléphone : deux rangées de deux,
     l'onglet actif souligné de l'accent, comme l'indicateur qu'il remplace. */
  .socle-profil-onglets { display: grid; grid-template-columns: 1fr 1fr; }
  .socle-profil-onglets .m-onglet { padding: 10px 8px; min-height: 44px; white-space: nowrap; border-bottom: 2px solid transparent; }
  .socle-profil-onglets .m-onglet.actif { border-bottom-color: var(--m-accent); }
  .socle-profil-onglets .m-onglets-indicateur { display: none; }
  .socle-profil-photo { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  .socle-filet::after { display: none; }
}
