/* ==========================================================
   RHIT Suisse – Outils RH
   Couleurs : #b39d78 (or/beige) · #ffffff · #2e281f (brun foncé)
   ========================================================== */
:root {
  --or: #b39d78;
  --or-clair: #c9b796;
  --or-pale: #f1ebe0;
  --brun: #2e281f;
  --blanc: #ffffff;
  --fond: #f8f8f8;
  --texte: #1f1f1f;
  --gris: #6b6b6b;
  --bord: #d6d6d6;
  --rayon: 14px;
  --largeur: 1140px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: "Open Sans", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--texte);
  background: var(--fond);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a { color: var(--brun); }
a:hover { color: var(--or); }

.conteneur {
  width: 100%;
  max-width: var(--largeur);
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------- En-tête ---------- */
.entete {
  background: var(--fond);
  padding: 18px 0;
}
.entete .conteneur {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.logo img { height: 48px; width: auto; display: block; }

.nav {
  display: flex;
  gap: 36px;
  flex-wrap: wrap;
}
.nav a {
  text-decoration: none;
  text-transform: uppercase;
  font-size: 15px;
  letter-spacing: .3px;
  color: var(--texte);
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: border-color .2s, color .2s;
}
.nav a:hover,
.nav a.actif { color: var(--brun); border-bottom-color: var(--or); }

/* ---------- Contenu ---------- */
main { flex: 1; padding: 24px 0 64px; }

h1 {
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 700;
  font-size: clamp(28px, 4vw, 40px);
  text-align: center;
  color: #111;
  margin: 10px 0 12px;
}
.intro {
  max-width: 760px;
  margin: 0 auto 40px;
  text-align: center;
  color: #333;
}

/* ---------- Grille des outils ---------- */
.grille-outils {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 28px;
}
.carte-outil {
  display: flex;
  flex-direction: column;
  background: var(--blanc);
  border: 1px solid #e6e1d8;
  border-radius: var(--rayon);
  padding: 28px 24px 24px;
  text-decoration: none;
  color: var(--texte);
  box-shadow: 0 2px 10px rgba(46, 40, 31, .05);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.carte-outil:hover {
  transform: translateY(-3px);
  border-color: var(--or);
  box-shadow: 0 8px 22px rgba(46, 40, 31, .12);
  color: var(--texte);
}
.carte-outil .icone {
  width: 56px; height: 56px;
  border-radius: 12px;
  background: var(--brun);
  color: var(--or);
  display: grid; place-items: center;
  margin-bottom: 18px;
}
.carte-outil h2 {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 20px;
  margin: 0 0 8px;
  color: var(--brun);
}
.carte-outil p { margin: 0 0 20px; font-size: 15px; color: #444; flex: 1; }
.carte-outil .lien { font-weight: 600; color: var(--brun); }

.carte-outil.bientot {
  background: transparent;
  border: 1px dashed var(--bord);
  box-shadow: none;
  color: var(--gris);
  cursor: default;
}
.carte-outil.bientot:hover { transform: none; border-color: var(--bord); box-shadow: none; }
.carte-outil.bientot .icone { background: #e8e4dc; color: var(--gris); }
.carte-outil.bientot h2 { color: var(--gris); }

/* ---------- Boutons (style rhit.ch) ---------- */
.bouton {
  display: inline-block;
  font-family: inherit;
  font-size: 15px;
  color: var(--brun);
  background: var(--or-clair);
  border: 2px solid var(--brun);
  border-radius: 8px;
  padding: 10px 26px;
  cursor: pointer;
  text-decoration: none;
  transition: background .2s, color .2s;
}
.bouton:hover { background: var(--brun); color: var(--blanc); }

/* ---------- Outil : panneau ---------- */
.fil-ariane { font-size: 14px; color: var(--gris); margin-bottom: 8px; }
.fil-ariane a { color: var(--gris); }

.panneau {
  max-width: 720px;
  margin: 0 auto;
  background: var(--blanc);
  border: 1px solid #e6e1d8;
  border-radius: var(--rayon);
  padding: 32px;
  box-shadow: 0 2px 10px rgba(46, 40, 31, .05);
}
.panneau label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
}
.ligne-saisie { display: flex; gap: 12px; flex-wrap: wrap; }
.ligne-saisie input {
  flex: 1 1 240px;
  font-family: inherit;
  font-size: 18px;
  padding: 10px 14px;
  border: 1px solid #8a8a8a;
  border-radius: 2px;
  background: var(--blanc);
}
.ligne-saisie input:focus { outline: 2px solid var(--or); outline-offset: 1px; }
.aide { font-size: 13px; color: var(--gris); margin: 8px 0 0; }

.resultat {
  margin-top: 26px;
  padding: 20px 22px;
  border-radius: 10px;
  background: var(--or-pale);
  border-left: 5px solid var(--or);
  display: none;
}
.resultat.visible { display: block; }
.resultat.erreur { background: #fbecec; border-left-color: #b54a4a; }
.resultat .principal {
  font-size: 26px;
  font-weight: 700;
  color: var(--brun);
  margin: 0 0 4px;
}
.resultat .detail { margin: 0; font-size: 14px; color: #555; }

/* ---------- Tableau de référence ---------- */
.reference { max-width: 720px; margin: 40px auto 0; }
.reference h2 { font-family: Arial, Helvetica, sans-serif; font-size: 20px; color: var(--brun); }
.tableau-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--blanc); font-size: 15px; }
th, td { padding: 8px 12px; border-bottom: 1px solid #ece8e1; text-align: left; }
th { background: var(--brun); color: var(--blanc); font-weight: 600; }
tr:nth-child(even) td { background: #faf8f4; }

/* ---------- Pied de page ---------- */
.pied {
  background: var(--brun);
  color: var(--blanc);
  padding: 40px 0 28px;
  font-size: 15px;
}
.pied .conteneur {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}
.pied strong { font-family: Arial, Helvetica, sans-serif; }
.pied a { color: var(--or); }
.pied a:hover { color: var(--blanc); }
.pied .liens { text-align: right; }
.pied .liens a { display: block; }
.pied .copyright { font-size: 13px; color: #cfc6b6; margin-top: 6px; }

@media (max-width: 700px) {
  .entete .conteneur { justify-content: center; }
  .nav { gap: 20px; justify-content: center; }
  .panneau { padding: 22px 18px; }
  .pied .liens { text-align: left; }
}

/* ==========================================================
   Simulateur de frais de déplacement
   ========================================================== */
.sim-entete {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; margin: 0 auto 32px; flex-wrap: wrap;
}
.sim-entete span { font-size: 14px; color: var(--gris); }

.segment {
  display: inline-flex; background: #ece7de; border-radius: 999px; padding: 4px;
}
.segment input { position: absolute; opacity: 0; pointer-events: none; }
.segment label {
  padding: 7px 18px; border-radius: 999px; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--brun);
  transition: background .2s, color .2s; user-select: none;
}
.segment input:checked + label { background: var(--brun); color: var(--blanc); }
.segment input:focus-visible + label { outline: 2px solid var(--or); outline-offset: 2px; }

.sim-grille {
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 28px; align-items: start;
}
.sim-colonne { display: flex; flex-direction: column; gap: 20px; }

.carte {
  background: var(--blanc); border: 1px solid #e6e1d8; border-radius: var(--rayon);
  padding: 22px 24px; box-shadow: 0 2px 10px rgba(46, 40, 31, .05);
}
.carte h2 {
  font-family: Arial, Helvetica, sans-serif; font-size: 17px; color: var(--brun);
  margin: 0 0 16px; display: flex; align-items: center; gap: 10px;
}
.carte h2 .num {
  width: 26px; height: 26px; border-radius: 50%; background: var(--or); color: var(--blanc);
  display: inline-grid; place-items: center; font-size: 13px;
}

.champ { margin-bottom: 16px; }
.champ:last-child { margin-bottom: 0; }
.champ > label, .champ > .etiquette {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 13px; font-weight: 700; margin-bottom: 6px;
}
.champ .unite { font-weight: 400; color: var(--gris); }

.saisie-unite { position: relative; }
.saisie-unite input {
  width: 100%; font-family: inherit; font-size: 17px;
  padding: 9px 70px 9px 12px; border: 1px solid #8a8a8a; border-radius: 2px; background: var(--blanc);
}
.saisie-unite input:focus { outline: 2px solid var(--or); outline-offset: 1px; }
.saisie-unite .suffixe {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  font-size: 14px; color: var(--gris); pointer-events: none;
}
.deux-champs { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

input[type=range] { width: 100%; accent-color: var(--brun); margin-top: 10px; }

.profils { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.profil {
  font-family: inherit; text-align: left; cursor: pointer;
  background: var(--fond); border: 2px solid #e2dccf; border-radius: 10px; padding: 10px 12px;
  transition: border-color .2s, background .2s; color: var(--texte);
}
.profil strong { display: block; font-size: 14px; color: var(--brun); }
.profil small { font-size: 12px; color: var(--gris); }
.profil:hover { border-color: var(--or); }
.profil[aria-pressed=true] { border-color: var(--brun); background: var(--or-pale); }

.note-info {
  margin-top: 16px; padding: 12px 14px; border-radius: 8px;
  background: var(--or-pale); font-size: 13px; color: #4a4339;
}
.note-info a { color: var(--brun); }

.compteur { display: inline-flex; align-items: center; border: 1px solid #8a8a8a; border-radius: 8px; overflow: hidden; }
.compteur button {
  width: 44px; height: 44px; border: 0; background: var(--or-clair); color: var(--brun);
  font-size: 22px; cursor: pointer; font-family: inherit;
}
.compteur button:hover { background: var(--brun); color: var(--blanc); }
.compteur button:disabled { opacity: .4; cursor: default; background: var(--or-clair); color: var(--brun); }
.compteur output { min-width: 56px; text-align: center; font-size: 18px; font-weight: 700; }

/* Résultat sticky */
.sim-resultat { position: sticky; top: 20px; }
.resultat-carte { background: var(--brun); color: var(--blanc); border-radius: var(--rayon); padding: 26px 24px; }
.resultat-carte .libelle { font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--or-clair); margin: 0; }
.resultat-carte .chiffre {
  font-family: Arial, Helvetica, sans-serif; font-size: clamp(34px, 5vw, 46px); font-weight: 700;
  margin: 4px 0 2px; line-height: 1.1;
}
.resultat-carte .sous { font-size: 14px; color: #d9d0c0; margin: 0 0 20px; }

.mini-cartes { display: grid; gap: 10px; }
.mini {
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(179, 157, 120, .35);
  border-radius: 10px; padding: 12px 14px;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.mini .t { font-size: 14px; font-weight: 600; }
.mini .d { font-size: 12px; color: #cfc6b6; display: block; font-weight: 400; }
.mini .v { font-size: 18px; font-weight: 700; color: var(--or-clair); white-space: nowrap; }
.mini[hidden] { display: none; }

.actions { display: grid; gap: 10px; margin-top: 16px; }
.actions .bouton { width: 100%; text-align: center; }
.bouton.secondaire { background: var(--blanc); }
.bouton.secondaire:hover { background: var(--brun); }

.volet { margin-top: 10px; background: var(--blanc); border: 1px solid #e6e1d8; border-radius: 10px; padding: 16px; }
.volet[hidden] { display: none; }
.volet input[type=email] {
  width: 100%; font-family: inherit; font-size: 16px; padding: 9px 12px;
  border: 1px solid #8a8a8a; border-radius: 2px; margin-bottom: 10px;
}
.consentement { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; margin-bottom: 12px; }
.consentement input { margin-top: 3px; accent-color: var(--brun); }
.message-retour { font-size: 13px; margin: 10px 0 0; }
.message-retour.ok { color: #2f6b3a; }
.message-retour.ko { color: #a33c3c; }
.pot-de-miel { position: absolute; left: -9999px; }

/* Barre récapitulative fixe (mobile uniquement) */
.barre-mobile {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: var(--brun); color: var(--blanc); padding: 10px 16px;
  justify-content: space-between; align-items: center; font-size: 14px;
  box-shadow: 0 -4px 14px rgba(0, 0, 0, .2);
}
.barre-mobile strong { font-size: 20px; color: var(--or-clair); }
.barre-mobile a { color: var(--blanc); font-size: 13px; }

@media (max-width: 900px) {
  .sim-grille { grid-template-columns: 1fr; }
  .sim-resultat { position: static; }
  .barre-mobile { display: flex; }
  body.page-simulateur { padding-bottom: 60px; }
}
@media (max-width: 520px) {
  .profils { grid-template-columns: 1fr; }
  .deux-champs { grid-template-columns: 1fr; }
}

/* ---------- Info-bulle (menu « Créer un ticket ») ---------- */
.infobulle { position: relative; display: flex; }
.infobulle .bulle {
  position: absolute; top: calc(100% + 12px); right: 0; z-index: 50;
  width: 260px; padding: 10px 14px; border-radius: 8px;
  background: var(--brun); color: var(--blanc);
  font-size: 13px; line-height: 1.45; text-transform: none; letter-spacing: 0;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity .18s, transform .18s, visibility .18s;
  pointer-events: none;
}
.infobulle .bulle::before {
  content: ""; position: absolute; bottom: 100%; right: 22px;
  border: 7px solid transparent; border-bottom-color: var(--brun);
}
.infobulle:hover .bulle,
.infobulle:focus-within .bulle { opacity: 1; visibility: visible; transform: translateY(0); }

/* Pas d'info-bulle sur écrans tactiles / petits écrans */
@media (hover: none), (max-width: 700px) {
  .infobulle .bulle { display: none; }
}

