/* ------------------------------------------------------------------ *
 * home.ucdv.fr — portail des applications métiers
 * Charte reprise du site ucdv.fr : Barlow, vert du logo, forêt, blé.
 * ------------------------------------------------------------------ */

@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 400; font-display: swap; src: url('/assets/fonts/barlow-400.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 600; font-display: swap; src: url('/assets/fonts/barlow-600.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 700; font-display: swap; src: url('/assets/fonts/barlow-condensed-700.woff2') format('woff2'); }

:root {
  --vert: #007218;          /* prélevé dans le logo */
  --vert-fonce: #00530f;
  --vert-pale: #e7f2e9;
  --foret: #14381c;
  --ble: #b98a0c;
  --ble-pale: #fbf3dc;
  --sarcelle: #1f6f74;
  --sarcelle-pale: #e3f1f1;
  --olive: #5d6b1e;
  --olive-pale: #eff2df;
  --rouge: #b5342b;

  --encre: #182615;
  --texte: #44513f;
  --gris: #6f7b69;
  --fond: #f6f7f0;
  --carte: #ffffff;
  --ligne: #e0e3d0;
  --ligne-forte: #cdd3b8;

  --ombre: 0 1px 2px rgba(20, 56, 28, .06), 0 10px 28px -14px rgba(20, 56, 28, .22);
  --ombre-survol: 0 2px 4px rgba(20, 56, 28, .06), 0 22px 44px -18px rgba(20, 56, 28, .38);
  --rayon: 14px;
  --police: 'Barlow', "Segoe UI", -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  --titre: 'Barlow Condensed', 'Barlow', "Segoe UI", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --vert: #4cbb62; --vert-fonce: #3a9c4f; --vert-pale: #16271a;
    --ble: #e2b84a; --ble-pale: #2a2412;
    --sarcelle: #5fb8bd; --sarcelle-pale: #132627;
    --olive: #b3c160; --olive-pale: #22261a;
    --rouge: #e3746a;
    --encre: #e8efe4; --texte: #b5c2ae; --gris: #8c9886;
    --fond: #0e140f; --carte: #161f17; --ligne: #263127; --ligne-forte: #34413a;
    --ombre: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 28px -14px rgba(0, 0, 0, .7);
    --ombre-survol: 0 2px 4px rgba(0, 0, 0, .4), 0 22px 44px -18px rgba(0, 0, 0, .9);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font-family: var(--police); font-size: 16px; line-height: 1.5;
  color: var(--encre); background: var(--fond); -webkit-font-smoothing: antialiased;
}
main { flex: 1; }
a { color: inherit; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.conteneur { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px; }
kbd {
  display: inline-block; min-width: 1.6em; padding: 0 .4em; border: 1px solid var(--ligne-forte);
  border-bottom-width: 2px; border-radius: 5px; font: 600 .75rem/1.5 var(--police);
  text-align: center; color: var(--gris); background: var(--fond);
}

/* --- Barre du haut -------------------------------------------------- */
.barre { background: var(--carte); border-bottom: 1px solid var(--ligne); }
.barre-int { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.marque { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.marque img { display: block; width: 44px; height: 44px; }
.marque-texte { display: flex; flex-direction: column; line-height: 1.1; }
.marque-texte strong { font: 700 1.35rem/1 var(--titre); letter-spacing: .04em; color: var(--vert); }
.marque-texte span { font-size: .82rem; color: var(--gris); letter-spacing: .02em; }
.lien-site {
  font-size: .88rem; font-weight: 600; color: var(--gris); text-decoration: none;
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--ligne);
}
.lien-site:hover { color: var(--vert); border-color: var(--vert); }

/* --- Bandeau -------------------------------------------------------- */
.bandeau {
  position: relative; color: #fff; overflow: hidden;
  background:
    linear-gradient(100deg, rgba(20, 56, 28, .96) 0%, rgba(20, 56, 28, .88) 45%, rgba(20, 56, 28, .55) 100%),
    url('/assets/img/luzerne-champ.jpg') center 38% / cover no-repeat,
    var(--foret);
}
.bandeau-int { padding-top: 56px; padding-bottom: 104px; }
.surtitre {
  margin: 0 0 10px; font-size: .82rem; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: #f3d786;
}
.bandeau h1 {
  margin: 0; max-width: 18ch; font: 700 clamp(2.2rem, 5vw, 3.4rem)/1.02 var(--titre);
  letter-spacing: .005em;
}
.chapo { margin: 14px 0 28px; max-width: 52ch; font-size: 1.08rem; color: rgba(255, 255, 255, .82); }

.recherche {
  position: relative; display: flex; align-items: center; max-width: 520px;
  background: rgba(255, 255, 255, .97); border-radius: 12px;
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .45);
}
.recherche svg {
  position: absolute; left: 16px; width: 20px; height: 20px;
  fill: none; stroke: #6f7b69; stroke-width: 2; stroke-linecap: round;
}
.recherche input {
  flex: 1; width: 100%; height: 52px; padding: 0 52px 0 48px; border: 0; border-radius: 12px;
  background: transparent; color: #182615; font: 400 1rem var(--police); outline: none;
}
.recherche input::placeholder { color: #8a9584; }
.recherche:focus-within { box-shadow: 0 0 0 3px rgba(243, 215, 134, .75), 0 12px 30px -12px rgba(0, 0, 0, .45); }
.recherche .raccourci { position: absolute; right: 14px; background: #f6f7f0; border-color: #cdd3b8; color: #6f7b69; }
.recherche input::-webkit-search-cancel-button { display: none; }

/* --- Disponibilité globale ------------------------------------------ */
.etat-global {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 16px; padding: 5px 14px 5px 12px; border-radius: 999px;
  font-size: .85rem; color: #fff; background: rgba(255, 255, 255, .12);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.pastille { width: 8px; height: 8px; border-radius: 50%; flex: none; background: #b5c2ae; }
.pastille.ok { background: #5fd27a; box-shadow: 0 0 0 3px rgba(95, 210, 122, .25); }
.pastille.ko { background: #ff8a7f; box-shadow: 0 0 0 3px rgba(255, 138, 127, .25); }
.pastille.verif { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

/* --- Grille des applications ---------------------------------------- */
.grille {
  position: relative; z-index: 1; list-style: none; margin: -64px 0 56px; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px;
}
.grille > li { display: flex; }

.appli {
  position: relative; flex: 1; display: flex; gap: 16px; padding: 22px 22px 18px;
  text-decoration: none; background: var(--carte); border: 1px solid var(--ligne);
  border-radius: var(--rayon); box-shadow: var(--ombre);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.appli::after {
  content: ""; position: absolute; left: 22px; right: 22px; top: -1px; height: 3px;
  border-radius: 0 0 3px 3px; background: var(--ton, var(--vert)); opacity: 0; transition: opacity .18s ease;
}
.appli:hover, .appli:focus-visible {
  transform: translateY(-3px); box-shadow: var(--ombre-survol); border-color: var(--ligne-forte); outline: none;
}
.appli:hover::after, .appli:focus-visible::after { opacity: 1; }
.appli:focus-visible { box-shadow: 0 0 0 3px var(--vert-pale), 0 0 0 5px var(--vert), var(--ombre-survol); }

.appli-icone {
  flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px;
  color: var(--ton); background: var(--ton-pale);
}
.appli-icone svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ton-terrain { --ton: var(--vert); --ton-pale: var(--vert-pale); }
.ton-usine   { --ton: var(--ble); --ton-pale: var(--ble-pale); }
.ton-rh      { --ton: var(--sarcelle); --ton-pale: var(--sarcelle-pale); }
.ton-gestion { --ton: var(--olive); --ton-pale: var(--olive-pale); }

.appli-corps { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.appli-tete { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.appli-nom { font: 700 1.38rem/1.15 var(--titre); letter-spacing: .01em; color: var(--encre); }
.appli-categorie {
  margin-top: 2px; font-size: .74rem; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ton);
}
.appli-desc { margin-top: 10px; font-size: .95rem; line-height: 1.45; color: var(--texte); }
.appli-pied {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: auto; padding-top: 16px;
}
.hote { font-size: .84rem; color: var(--gris); }
.hote::after {
  content: "→"; display: inline-block; margin-left: 6px; color: var(--ton);
  transition: transform .18s ease;
}
.appli:hover .hote::after { transform: translateX(4px); }

.etat {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  font-size: .76rem; font-weight: 600; color: var(--gris); white-space: nowrap;
}
.etat::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ligne-forte); }
.etat.verif::before { animation: pulse 1.2s ease-in-out infinite; }
.etat.ok { color: var(--vert); }
.etat.ok::before { background: var(--vert); }
.etat.ko { color: var(--rouge); }
.etat.ko::before { background: var(--rouge); }

.vide { position: relative; z-index: 1; background: var(--carte); margin: 0 0 56px; padding: 28px; text-align: center; color: var(--gris); border: 1px dashed var(--ligne-forte); border-radius: var(--rayon); }

/* --- Pied ----------------------------------------------------------- */
.pied { border-top: 1px solid var(--ligne); background: var(--carte); }
.pied-int { display: flex; justify-content: space-between; gap: 16px; padding-top: 18px; padding-bottom: 18px; font-size: .85rem; color: var(--gris); }

/* --- Adaptations ---------------------------------------------------- */
@media (max-width: 960px) {
  .grille { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .conteneur { padding: 0 16px; }
  .barre-int { height: 60px; }
  .marque img { width: 38px; height: 38px; }
  .bandeau-int { padding-top: 36px; padding-bottom: 84px; }
  .chapo { font-size: 1rem; margin-bottom: 22px; }
  .recherche .raccourci, .appli-pied kbd, .pied .aide { display: none; }
  .grille { grid-template-columns: 1fr; gap: 12px; }
  .appli { padding: 18px 16px 14px; gap: 14px; }
  .appli-icone { width: 42px; height: 42px; border-radius: 10px; }
  .appli-icone svg { width: 22px; height: 22px; }
  .appli-desc { margin-top: 6px; font-size: .92rem; }
  .appli-pied { padding-top: 10px; }
}
@media (hover: none) {
  .recherche .raccourci, .appli-pied kbd, .pied .aide { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* --- Page 404 ------------------------------------------------------- */
.introuvable { padding-bottom: 72px; }
.bouton {
  display: inline-block; padding: 12px 20px; border-radius: 10px; font-weight: 600;
  text-decoration: none; color: #14381c; background: #f3d786;
}
.bouton:hover { background: #fff; }
