/* PJP – Espace client 3D
   Couleur principale : modifiez --accent pour l'adapter à votre charte. */
:root {
  --accent: #e8711a;
  --accent-fonce: #b9560f;
  --fond: #f4f2ef;
  --carte: #ffffff;
  --texte: #23201c;
  --texte-doux: #6b655d;
  --bord: #e3dfd9;
  --rayon: 10px;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color: var(--texte);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--fond); }
a { color: inherit; }

/* Bandeau */
.bandeau {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 18px; background: #1f1d1a; color: #fff;
  min-height: 56px;
}
.bandeau img.logo { height: 34px; width: auto; display: block; }
.bandeau .titre { font-weight: 600; font-size: 1.05rem; flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bandeau .titre small { display: block; font-weight: 400; font-size: .8rem; color: #bdb6ad; }
.bandeau a.retour { text-decoration: none; padding: 6px 12px; border-radius: 6px;
  background: rgba(255,255,255,.1); font-size: .9rem; white-space: nowrap; }
.bandeau a.retour:hover { background: rgba(255,255,255,.2); }

/* Accueil */
main.accueil { max-width: 1000px; margin: 0 auto; padding: 28px 18px 60px; }
main.accueil h1 { font-size: 1.5rem; margin: 0 0 4px; }
main.accueil p.intro { color: var(--texte-doux); margin: 0 0 24px; }
.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.modele {
  display: flex; flex-direction: column; background: var(--carte);
  border: 1px solid var(--bord); border-radius: var(--rayon); overflow: hidden;
  text-decoration: none; transition: transform .12s, box-shadow .12s;
}
.modele:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.08); }
.modele .vignette { height: 140px; background: #2b2824 center/cover no-repeat;
  display: flex; align-items: center; justify-content: center; color: var(--accent); }
.modele .vignette svg { width: 56px; height: 56px; opacity: .9; }
.modele .corps { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.modele .nom { font-weight: 600; font-size: 1.05rem; }
.modele .desc { color: var(--texte-doux); font-size: .92rem; flex: 1; }
.modele .meta { display: flex; justify-content: space-between; align-items: center; font-size: .82rem; color: var(--texte-doux); }
.badge { background: #fdf0e6; color: var(--accent-fonce); padding: 2px 8px; border-radius: 99px; font-weight: 600; }
.vide { background: var(--carte); border: 1px dashed var(--bord); border-radius: var(--rayon);
  padding: 30px; text-align: center; color: var(--texte-doux); }
footer.pied { text-align: center; color: var(--texte-doux); font-size: .85rem; padding: 20px; }

/* Visionneuses */
body.vue { display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; }
.scene { position: relative; flex: 1; min-height: 0; }
#cesium, model-viewer { position: absolute; inset: 0; width: 100%; height: 100%; }
model-viewer { background: radial-gradient(#4a4540, #1f1d1a); --poster-color: transparent; }

.panneau {
  position: absolute; top: 12px; right: 12px; width: 230px; z-index: 5;
  background: rgba(31,29,26,.88); color: #fff; border-radius: var(--rayon);
  padding: 12px; display: flex; flex-direction: column; gap: 8px; font-size: .9rem;
  backdrop-filter: blur(4px);
}
.panneau h3 { margin: 4px 0 0; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: #bdb6ad; font-weight: 600; }
.panneau button, .panneau select {
  width: 100%; padding: 8px 10px; border-radius: 6px; border: 1px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.08); color: #fff; font: inherit; cursor: pointer; text-align: left;
}
.panneau select option { color: #000; }
.panneau button:hover { background: rgba(255,255,255,.16); }
.panneau button.actif { background: var(--accent); border-color: var(--accent); }
.panneau input[type=range] { width: 100%; accent-color: var(--accent); }
.panneau .ligne { display: flex; gap: 6px; }
.panneau .ligne button { text-align: center; }
.panneau .replier { display: none; }

.resultat {
  position: absolute; left: 12px; bottom: 28px; z-index: 5; max-width: min(420px, calc(100% - 24px));
  background: rgba(31,29,26,.9); color: #fff; border-radius: var(--rayon); padding: 10px 14px;
  font-size: .9rem; line-height: 1.5; display: none; font-variant-numeric: tabular-nums;
}
.resultat b { color: var(--accent); }
.resultat .note { color: #bdb6ad; font-size: .78rem; }
.consigne {
  position: absolute; left: 50%; top: 12px; transform: translateX(-50%); z-index: 6;
  background: var(--accent); color: #fff; padding: 6px 14px; border-radius: 99px; font-size: .9rem;
  display: none; pointer-events: none;
}
.chargement {
  position: absolute; inset: 0; z-index: 7; display: flex; align-items: center; justify-content: center;
  background: #1f1d1a; color: #fff; font-size: 1rem; flex-direction: column; gap: 12px;
}
.chargement .roue { width: 38px; height: 38px; border: 4px solid rgba(255,255,255,.2);
  border-top-color: var(--accent); border-radius: 50%; animation: tourne 1s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }
.aide {
  position: absolute; inset: 0; z-index: 8; background: rgba(0,0,0,.55);
  display: none; align-items: center; justify-content: center; padding: 16px;
}
.aide .boite { background: #fff; color: var(--texte); border-radius: var(--rayon); padding: 20px 24px;
  max-width: 460px; line-height: 1.55; }
.aide .boite h2 { margin-top: 0; font-size: 1.15rem; }
.aide .boite button { margin-top: 10px; padding: 8px 16px; border: 0; border-radius: 6px;
  background: var(--accent); color: #fff; font: inherit; cursor: pointer; }

/* Cesium : on allège l'interface native */
.cesium-viewer-bottom { opacity: .7; }

@media (max-width: 640px) {
  .panneau { width: auto; left: 12px; right: 12px; top: auto; bottom: 12px; max-height: 55%; overflow: auto; }
  .panneau.ferme > :not(.replier) { display: none; }
  .panneau .replier { display: block; text-align: center; }
  .resultat { bottom: auto; top: 12px; }
  .bandeau img.logo { display: none; }
}
