/* GestDoc — consultation web
   Couleurs regroupées ici : changer une variable change tout le site. */
:root {
  --fond: #f3f6f9;
  --surface: #ffffff;
  --surface-2: #f7f9fb;
  --bordure: #dfe5eb;
  --texte: #17222c;
  --texte-2: #5a6874;
  --accent: #1d6fa5;
  --accent-fonce: #155a87;
  --accent-doux: #e3f0f8;
  --sur-accent: #ffffff;
  --surlignage: #fff1a8;
  --erreur: #b42318;
  --erreur-doux: #fdecea;
  --ombre: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --ombre-haute: 0 8px 24px rgba(16, 24, 40, .12);
  --rayon: 10px;
  --police: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #11171d;
    --surface: #1a222a;
    --surface-2: #202a33;
    --bordure: #2e3a45;
    --texte: #e6edf3;
    --texte-2: #9aa8b4;
    --accent: #5aa9dc;
    --accent-fonce: #7dbde6;
    --accent-doux: #1d3445;
    --sur-accent: #0b1a24;
    --surlignage: #6b5a12;
    --erreur: #ff8a80;
    --erreur-doux: #3a1d1b;
    --ombre: 0 1px 2px rgba(0, 0, 0, .4);
    --ombre-haute: 0 8px 24px rgba(0, 0, 0, .5);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fond); color: var(--texte); font: 15px/1.5 var(--police); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2;
      stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
code { font: 13px/1 ui-monospace, Consolas, monospace; background: var(--surface-2);
       border: 1px solid var(--bordure); border-radius: 4px; padding: 2px 5px; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Logo ---------- */
.logo { width: 28px; height: 28px; stroke: none; }
.logo.grand { width: 56px; height: 56px; }
.logo-fond { fill: var(--accent); opacity: .35; }
.logo-avant { fill: var(--accent); }
.logo-lignes { stroke: #fff; stroke-width: 2; fill: none; }

/* ---------- Barre du haut ---------- */
.barre { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px;
         padding: 10px 24px; background: var(--surface); border-bottom: 1px solid var(--bordure); }
.marque { display: flex; align-items: center; gap: 10px; color: var(--texte); font-weight: 700;
          font-size: 18px; margin-right: auto; }
.marque:hover { text-decoration: none; }
.etiquette { font-size: 12px; font-weight: 600; color: var(--accent); background: var(--accent-doux);
             padding: 2px 8px; border-radius: 999px; }
.compte { display: flex; align-items: center; gap: 10px; }
.compte form { margin: 0; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
          background: var(--accent); color: var(--sur-accent); font-weight: 700; }
.identite { display: flex; flex-direction: column; line-height: 1.2; }
.identite small { color: var(--texte-2); }

/* ---------- Boutons ---------- */
.bouton { display: inline-flex; align-items: center; justify-content: center; gap: 6px;
          border: 1px solid transparent; border-radius: 8px; padding: 9px 18px; font: 600 14px var(--police);
          cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s; }
.bouton:hover { text-decoration: none; }
.bouton.principal { background: var(--accent); color: var(--sur-accent); }
.bouton.principal:hover { background: var(--accent-fonce); }
.bouton.secondaire { background: var(--surface); color: var(--accent); border-color: var(--bordure); }
.bouton.secondaire:hover { border-color: var(--accent); }
.bouton.large { width: 100%; padding: 11px; font-size: 15px; }
.bouton-discret { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0;
                  color: var(--texte-2); font: 14px var(--police); cursor: pointer; padding: 6px 8px; border-radius: 6px; }
.bouton-discret:hover { background: var(--surface-2); color: var(--texte); }
.bouton-icone { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 8px;
                border: 1px solid var(--bordure); background: var(--surface); color: var(--texte-2); font-size: 16px; }
.bouton-icone:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }

/* ---------- Champs ---------- */
input[type=search], input[type=email], input[type=password], input[type=text], select {
  font: 15px var(--police); color: var(--texte); background: var(--surface);
  border: 1px solid var(--bordure); border-radius: 8px; padding: 10px 12px; width: 100%; }
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-doux); }

/* ---------- Mise en page ---------- */
.contenu { max-width: 1080px; margin: 0 auto; padding: 24px 16px 48px; }

/* ---------- Panneau de recherche ---------- */
.panneau-recherche { background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon);
                     box-shadow: var(--ombre); padding: 28px 28px 22px; margin: 32px 0 24px; }
.panneau-recherche.compact { margin-top: 0; padding: 18px 22px 14px; }
.accroche { margin: 0 0 18px; font-size: 24px; }
.onglets { display: flex; gap: 4px; border-bottom: 1px solid var(--bordure); margin-bottom: 18px; overflow-x: auto; }
.onglet { background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px;
          padding: 10px 16px; font: 600 14px var(--police); color: var(--texte-2); cursor: pointer; white-space: nowrap; }
.onglet:hover { color: var(--texte); }
.onglet[aria-selected=true] { color: var(--accent); border-bottom-color: var(--accent); }

.barre-recherche { position: relative; display: flex; gap: 10px; }
.barre-recherche .loupe { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--texte-2); }
.barre-recherche input { padding-left: 42px; font-size: 16px; height: 46px; }
.barre-recherche .bouton { height: 46px; }
.barre-recherche.petite input { height: 38px; font-size: 14px; }
.barre-recherche.petite { flex: 1; }
.aide { color: var(--texte-2); font-size: 13px; margin: 10px 0 0; line-height: 1.9; }

/* Mots clés */
.motcle-tete { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.compteur { font-size: 13px; color: var(--texte-2); }
.compteur.actif { color: var(--accent); font-weight: 600; }
.liste-motcles { display: flex; flex-wrap: wrap; gap: 8px; max-height: 230px; overflow-y: auto;
                 padding: 12px; background: var(--surface-2); border: 1px solid var(--bordure); border-radius: 8px; }
.puce-choix { cursor: pointer; position: relative; }
.puce-choix input { position: absolute; opacity: 0; pointer-events: none; }
.puce-choix span { display: inline-block; padding: 5px 12px; border-radius: 999px; font-size: 13px;
                   background: var(--surface); border: 1px solid var(--bordure); transition: all .12s; }
.puce-choix:hover span { border-color: var(--accent); }
.puce-choix input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--sur-accent); }
.puce-choix input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.motcle-pied { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-top: 14px; }
.motcle-pied .bouton { margin-left: auto; }
.interrupteur { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; position: relative; }
.interrupteur input { position: absolute; opacity: 0; }
.interrupteur span { width: 36px; height: 20px; border-radius: 999px; background: var(--bordure); position: relative; transition: background .15s; }
.interrupteur span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
                            border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: var(--ombre); }
.interrupteur input:checked + span { background: var(--accent); }
.interrupteur input:checked + span::after { transform: translateX(16px); }
.interrupteur input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Chapitres */
.grille-chapitres { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.tuile-chapitre { display: flex; align-items: center; gap: 10px; padding: 12px 14px; color: var(--texte);
                  background: var(--surface-2); border: 1px solid var(--bordure); border-radius: 8px; }
.tuile-chapitre svg { color: var(--accent); }
.tuile-chapitre:hover { border-color: var(--accent); text-decoration: none; }
.tuile-chapitre.active { background: var(--accent-doux); border-color: var(--accent); }
.tuile-chapitre.vide { opacity: .55; }
.tuile-chapitre .nom { flex: 1; font-weight: 600; font-size: 14px; }
.tuile-chapitre .nombre { font-size: 12px; color: var(--texte-2); background: var(--surface);
                          border-radius: 999px; padding: 1px 8px; border: 1px solid var(--bordure); }

/* ---------- Résultats ---------- */
.resultats-tete { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
                  flex-wrap: wrap; margin-bottom: 14px; }
.resultats-tete h2 { margin: 0; font-size: 19px; }
.sous-titre { margin: 2px 0 0; color: var(--texte-2); font-size: 14px; }
.tri { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--texte-2); }
.tri select { width: auto; padding: 7px 10px; font-size: 14px; }

.liste-documents { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.document { display: flex; gap: 16px; align-items: flex-start; padding: 16px 18px; background: var(--surface);
            border: 1px solid var(--bordure); border-radius: var(--rayon); box-shadow: var(--ombre);
            transition: box-shadow .15s, border-color .15s; }
.document:hover { box-shadow: var(--ombre-haute); border-color: var(--accent-doux); }
.document-corps { flex: 1; min-width: 0; }
.document h3 { margin: 0; font-size: 16px; line-height: 1.35; }
.revision { display: inline-block; margin-left: 6px; font-size: 11px; font-weight: 600; color: var(--texte-2);
            border: 1px solid var(--bordure); border-radius: 4px; padding: 0 5px; vertical-align: 2px; }
.meta { margin: 4px 0 0; font-size: 13px; color: var(--texte-2); display: flex; flex-wrap: wrap; gap: 4px 14px; }
.meta .fichier { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.extrait { margin: 8px 0 0; font-size: 14px; color: var(--texte); border-left: 3px solid var(--accent-doux); padding-left: 10px; }
.extrait mark { background: var(--surlignage); color: inherit; border-radius: 2px; padding: 0 2px; }
.puces { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.puces li { font-size: 12px; background: var(--accent-doux); color: var(--accent-fonce); border-radius: 999px; padding: 2px 10px; }
.document-actions { display: flex; align-items: center; gap: 8px; }
.indisponible { font-size: 12px; color: var(--texte-2); font-style: italic; white-space: nowrap; }

.badge-type { width: 44px; height: 52px; flex-shrink: 0; display: grid; place-items: center; border-radius: 6px;
              font: 700 11px var(--police); letter-spacing: .5px; color: #fff; background: #7b8794;
              clip-path: polygon(0 0, 72% 0, 100% 20%, 100% 100%, 0 100%); }
.fam-pdf { background: #d1453b; }
.fam-word { background: #2b67c6; }
.fam-excel { background: #1f8a4c; }
.fam-ppt { background: #d0702c; }
.fam-image { background: #8a4fc2; }
.fam-mail { background: #0f8b8d; }
.fam-archive { background: #8d6e3f; }

.pagination { display: flex; justify-content: center; align-items: center; gap: 4px; margin-top: 22px; flex-wrap: wrap; }
.pagination a, .pagination span { min-width: 36px; height: 36px; padding: 0 10px; display: inline-grid; place-items: center;
                                  border-radius: 8px; font-size: 14px; }
.pagination a { color: var(--texte); border: 1px solid var(--bordure); background: var(--surface); }
.pagination a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.pagination .courante { background: var(--accent); color: var(--sur-accent); font-weight: 700; }
.pagination .inactif, .pagination .ellipse { color: var(--texte-2); opacity: .6; }

/* ---------- Messages ---------- */
.alerte { padding: 12px 14px; border-radius: 8px; font-size: 14px; margin-bottom: 16px; }
.alerte.erreur { background: var(--erreur-doux); color: var(--erreur); border: 1px solid currentColor; }
.etat-vide { text-align: center; padding: 48px 16px; color: var(--texte-2); }
.etat-vide svg { width: 44px; height: 44px; opacity: .5; }
.etat-vide h1 { color: var(--texte); }
.page-erreur { margin-top: 60px; }

/* ---------- Connexion ---------- */
.page-connexion { min-height: 100vh;
  background: radial-gradient(circle at 15% 20%, var(--accent-doux), transparent 45%),
              radial-gradient(circle at 85% 80%, var(--accent-doux), transparent 40%), var(--fond); }
.page-connexion .contenu { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.carte-connexion { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--bordure);
                   border-radius: 14px; box-shadow: var(--ombre-haute); padding: 32px; }
.connexion-marque { text-align: center; margin-bottom: 22px; }
.connexion-marque h1 { margin: 8px 0 0; font-size: 26px; }
.connexion-marque p { margin: 2px 0 0; color: var(--texte-2); }
.formulaire label { display: block; font-size: 14px; font-weight: 600; margin: 14px 0 6px; }
.formulaire .bouton { margin-top: 22px; }
.champ-mdp { position: relative; }
.champ-mdp input { padding-right: 44px; }
.oeil { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0;
        color: var(--texte-2); cursor: pointer; padding: 6px; border-radius: 6px; display: grid; }
.oeil:hover, .oeil.actif { color: var(--accent); }
.note { margin: 18px 0 0; font-size: 12px; color: var(--texte-2); text-align: center; }

/* ---------- Téléphone / petite fenêtre ---------- */
@media (max-width: 640px) {
  .barre { padding: 10px 16px; }
  .identite, .etiquette, .bouton-discret span { display: none; }
  .panneau-recherche { padding: 18px 16px; margin-top: 8px; }
  .barre-recherche { flex-direction: column; }
  .barre-recherche .loupe { top: 23px; }
  .document { flex-wrap: wrap; padding: 14px; }
  .badge-type { width: 36px; height: 44px; }
  .document-corps { flex-basis: calc(100% - 52px); }
  .document-actions { width: 100%; justify-content: flex-end; }
  .meta .fichier { max-width: 100%; }
  .carte-connexion { padding: 24px 20px; }
}

/* ---------- Mode démonstration ---------- */
.bandeau-demo { background: #f4b740; color: #2b2100; text-align: center; font: 600 13px var(--police); padding: 6px 12px; }
.page-connexion .bandeau-demo { position: fixed; top: 0; left: 0; right: 0; z-index: 20; }
.demo-presentation { text-align: center; margin: 4px 0 6px; }
.demo-presentation p { margin: 0 0 8px; }
.demo-presentation .discret { color: var(--texte-2); font-size: 13px; }
