/* TIE PRO : sobre et professionnel (Florian, 18/11), police Exo 2 hebergee avec le site (polices/, licence
   SIL OFL 1.1 dans polices/OFL.txt : aucun appel a un service tiers). Jour et nuit suivent le reglage de l'ordinateur.
   21/11 (Florian) : l'accent passe au VERT #2FBF71 a la place de l'orange et du rouge de la marque Tie ; un message
   d'erreur reste rouge (c'est un sens, pas une decoration). Texte sombre #111318 sur le vert (7,8:1). Le jour, un lien
   ou le trait en #2FBF71 sur blanc ne ferait que 2,4:1 : ils prennent le meme vert assombri #187444 (5,8:1 sur blanc),
   comme l'accent l'etait deja avant. */
@font-face { font-family: 'Exo 2'; font-weight: 400; font-display: swap; src: url('polices/exo2-400.woff2') format('woff2'); }
@font-face { font-family: 'Exo 2'; font-weight: 500; font-display: swap; src: url('polices/exo2-500.woff2') format('woff2'); }
@font-face { font-family: 'Exo 2'; font-weight: 600; font-display: swap; src: url('polices/exo2-600.woff2') format('woff2'); }
@font-face { font-family: 'Exo 2'; font-weight: 700; font-display: swap; src: url('polices/exo2-700.woff2') format('woff2'); }

:root {
  --fond: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #eef0f3;
  --texte: #16181d;
  --doux: #555b66;
  --bord: #d5d9e0;
  /* 27/11 au soir : le bord d'un champ de saisie se voit (3:1 au moins, WCAG 1.4.11) ; --bord (1,42:1) reste aux cadres. */
  --bord-champ: #7c8391; /* 3,81:1 sur --surface, 3,52:1 sur --fond ; nuit #7a8293 : 4,37:1 */
  --accent: #187444;          /* #2FBF71 assombri : 5,8:1 sur blanc pour le texte, les liens et le trait */
  --accent-fort: #146b3e;
  --degrade: linear-gradient(90deg, #187444, #187444);
  --bouton: #2FBF71;          /* fond des boutons, jour et nuit ; texte #111318 dessus : 7,8:1 */
  --bouton-survol: #27a862;   /* texte #111318 dessus : 6,1:1 */
  --texte-sur-vert: #111318;
  --ok: #1f7a43;
  --ok-fond: #e5f4ea;
  --attente: #8a5a00;
  --attente-fond: #fdf1d8;
  --ko: #b42318;
  --ko-fond: #fde8e6;
  --info-fond: #e8eefb;
  --ombre: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  color-scheme: light;
}
/* 27/11 au soir (Florian) : un seul mode nuit pour les trois sites. La nuit suit l appareil SAUF si la personne a
   choisi le jour au bouton lune/soleil (/bouton-nuit.js, data-theme="light"), et s applique toujours quand elle a choisi
   la nuit (data-theme="dark"). Memes valeurs qu avant, dans les deux cas. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fond: #111318;
    --surface: #1a1d24;
    --surface-2: #232731;
    --texte: #eceef2;
    --doux: #a6adbb;
    --bord: #343a46;
    --bord-champ: #7a8293;
    --accent: #2FBF71;          /* 7,1:1 sur la surface #1a1d24, 7,8:1 sur le fond #111318 */
    --accent-fort: #4fd08a;
    --degrade: linear-gradient(90deg, #2FBF71, #2FBF71);
    --bouton-survol: #4fd08a;   /* texte #111318 dessus : 9,5:1 */
    --ok: #6fd39a;
    --ok-fond: #15301f;
    --attente: #f0c060;
    --attente-fond: #33270c;
    --ko: #ff8a80;
    --ko-fond: #3a1714;
    --info-fond: #1b2540;
    --ombre: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --fond: #111318;
  --surface: #1a1d24;
  --surface-2: #232731;
  --texte: #eceef2;
  --doux: #a6adbb;
  --bord: #343a46;
  --bord-champ: #7a8293;
  --accent: #2FBF71;          /* 7,1:1 sur la surface #1a1d24, 7,8:1 sur le fond #111318 */
  --accent-fort: #4fd08a;
  --degrade: linear-gradient(90deg, #2FBF71, #2FBF71);
  --bouton-survol: #4fd08a;   /* texte #111318 dessus : 9,5:1 */
  --ok: #6fd39a;
  --ok-fond: #15301f;
  --attente: #f0c060;
  --attente-fond: #33270c;
  --ko: #ff8a80;
  --ko-fond: #3a1714;
  --info-fond: #1b2540;
  --ombre: none;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: 'Exo 2', system-ui, sans-serif; background: var(--fond); color: var(--texte); font-size: 15px; line-height: 1.5; }
a { color: var(--accent); }
a:hover { color: var(--accent-fort); }
h1 { font-size: 24px; font-weight: 700; margin: 0 0 4px; }
h2 { font-size: 18px; font-weight: 600; margin: 0 0 12px; }
h3 { font-size: 15px; font-weight: 600; margin: 16px 0 8px; }
.petit { font-size: 13px; }
.doux { color: var(--doux); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
/* « hidden » l'emporte toujours (la navigation est cachee avant la connexion) ; le conteneur de l'ecran recoit
   le focus a chaque changement d'ecran (lecteurs d'ecran) sans cadre visible. */
[hidden] { display: none !important; }
#ecran:focus { outline: none; }

/* L'en-tete : l'emplacement du logo Tie Pro (image a fournir par Florian), puis la navigation. */
.entete { background: var(--surface); border-bottom: 1px solid var(--bord); }
.entete-interieur { max-width: 1120px; margin: 0 auto; padding: 10px 24px; display: flex; align-items: center; gap: 24px; }
.logo-emplacement { text-decoration: none; color: var(--texte); display: flex; align-items: center; gap: 10px; min-width: 150px; height: 40px; }
.logo-emplacement img { height: 40px; width: 40px; object-fit: contain; }
.logo-texte { font-weight: 700; font-size: 20px; letter-spacing: .3px; }
.logo-texte span { background: var(--degrade); -webkit-background-clip: text; background-clip: text; color: transparent; }
.liseret { height: 3px; background: var(--degrade); }
nav.principale { display: flex; gap: 4px; flex: 1; }
nav.principale a { text-decoration: none; color: var(--doux); padding: 8px 12px; border-radius: 6px; font-weight: 500; }
nav.principale a[aria-current="page"] { color: var(--texte); background: var(--surface-2); }
.compte { display: flex; align-items: center; gap: 12px; color: var(--doux); font-size: 13px; }

.contenu { max-width: 1120px; margin: 0 auto; padding: 24px; }
.carte { background: var(--surface); border: 1px solid var(--bord); border-radius: 10px; padding: 20px; box-shadow: var(--ombre); margin-bottom: 16px; }
.grille-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.titre-page { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }

/* Les formulaires */
label.champ { display: block; margin-bottom: 14px; }
label.champ > span { display: block; font-weight: 500; margin-bottom: 4px; }
label.champ > small { display: block; color: var(--doux); margin-top: 3px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=url], input[type=search], input[type=time], select, textarea {
  width: 100%; font: inherit; color: var(--texte); background: var(--surface); border: 1px solid var(--bord-champ); border-radius: 6px; padding: 9px 11px;
}
textarea { min-height: 90px; resize: vertical; }
.obligatoire::after { content: ' *'; color: var(--ko); }
.bouton { font: inherit; font-weight: 600; border: 1px solid transparent; border-radius: 6px; padding: 9px 16px; cursor: pointer; background: var(--bouton); color: var(--texte-sur-vert); text-decoration: none; display: inline-block; }
.bouton:hover { background: var(--bouton-survol); }
.bouton.secondaire { background: var(--surface); color: var(--texte); border-color: var(--bord); }
.bouton.secondaire:hover { background: var(--surface-2); }
/* 19/11 (essai reel) : « a:hover » (lien survole) l'emportait sur « .bouton » : le bouton-lien « Ajouter un lieu »
   survole devenait rouge sur rouge, texte invisible. Un lien en forme de bouton garde la couleur du bouton. */
a.bouton, a.bouton:visited, a.bouton:hover { color: var(--texte-sur-vert); }
a.bouton.secondaire, a.bouton.secondaire:visited, a.bouton.secondaire:hover { color: var(--texte); }
.bouton.danger { background: var(--surface); color: var(--ko); border-color: var(--ko); }
.bouton[disabled] { opacity: .55; cursor: not-allowed; }
.boutons { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.lien-bouton { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; }

/* Les etats */
.pastille { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; border: 1px solid currentColor; white-space: nowrap; }
.pastille.brouillon { color: var(--doux); }
.pastille.en_attente { color: var(--attente); background: var(--attente-fond); }
.pastille.valide { color: var(--ok); background: var(--ok-fond); }
.pastille.refuse { color: var(--ko); background: var(--ko-fond); }
.bandeau { border-radius: 8px; padding: 12px 14px; margin-bottom: 16px; border: 1px solid var(--bord); background: var(--info-fond); }
.bandeau.ok { background: var(--ok-fond); border-color: var(--ok); }
.bandeau.ko { background: var(--ko-fond); border-color: var(--ko); }
.bandeau.attente { background: var(--attente-fond); border-color: var(--attente); }
.bandeau-provisoire { border: 2px dashed var(--attente); background: var(--attente-fond); padding: 10px 14px; border-radius: 8px; }
.erreur { color: var(--ko); font-weight: 500; }
.vide { text-align: center; color: var(--doux); padding: 32px 16px; }

/* Les listes */
table.liste { width: 100%; border-collapse: collapse; }
table.liste th, table.liste td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--bord); vertical-align: top; }
table.liste th { font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--doux); font-weight: 600; }
.resultats button.resultat { display: block; width: 100%; text-align: left; font: inherit; color: var(--texte); background: var(--surface); border: 1px solid var(--bord); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer; }
.resultats button.resultat:hover { border-color: var(--accent); }

/* La completude (vert clair / vert parfait, lib/ficheComplete) */
.jauge { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.jauge > i { display: block; height: 100%; background: var(--ok); }
.manques { margin: 6px 0 0; padding-left: 18px; color: var(--doux); }

/* Les cases a trois etats (Oui / Non / On ne sait pas) */
.cases { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 4px 20px; }
.case3 { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--bord); }
.case3 .choix { display: flex; gap: 2px; flex-shrink: 0; }
.case3 .choix label { font-size: 12px; padding: 3px 8px; border: 1px solid var(--bord); border-radius: 5px; cursor: pointer; user-select: none; }
.case3 .choix input { position: absolute; opacity: 0; pointer-events: none; }
.case3 .choix input:checked + span { font-weight: 700; }
.case3 .choix label:has(input:checked) { background: var(--surface-2); border-color: var(--texte); }
.case3 .choix input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.puces { display: flex; flex-wrap: wrap; gap: 6px; }
.puce { display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--bord); border-radius: 999px; padding: 4px 10px; cursor: pointer; font-size: 13px; }
.puce:has(input:checked) { border-color: var(--accent); background: var(--surface-2); font-weight: 600; }

/* Les horaires */
.horaires-jour { display: grid; grid-template-columns: 110px 1fr; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--surface-2); }
.creneaux { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.creneau { display: flex; gap: 4px; align-items: center; }
.creneau input { width: 110px; }

/* Les fichiers */
.fichiers li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--surface-2); }
.fichiers { list-style: none; padding: 0; margin: 8px 0; }
.depot { border: 1px dashed var(--bord); border-radius: 8px; padding: 12px; margin-bottom: 12px; }

/* Les onglets d'une fiche */
.onglets { display: flex; gap: 4px; border-bottom: 1px solid var(--bord); margin-bottom: 16px; flex-wrap: wrap; }
.onglets button { font: inherit; background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 14px; cursor: pointer; color: var(--doux); font-weight: 600; }
.onglets button[aria-selected="true"] { color: var(--texte); border-bottom-color: var(--accent); }

/* Le message bref (3 s) */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--texte); color: var(--fond); padding: 10px 18px; border-radius: 8px; font-weight: 500; z-index: 10; }

/* Les pages de connexion */
.accueil { max-width: 440px; margin: 48px auto; }
.page-texte { max-width: 760px; margin: 32px auto; padding: 0 24px; }

@media (max-width: 760px) {
  .grille-2 { grid-template-columns: 1fr; }
  .entete-interieur { flex-wrap: wrap; padding: 10px 16px; }
  .contenu { padding: 16px; }
  .horaires-jour { grid-template-columns: 1fr; }
}
