/* =========================================================================
   Complement Team Helper au moteur 3D verre.
   Ajoute : formulaire serveur (statut, champ piege), bandeau d'information,
   pages legales, mode sans 3D, accessibilite (lien d'evitement, focus).
   Charge APRES styles.css : toutes les regles ci-dessous surchargent.
   ========================================================================= */

:root {
  --th-ok: #6ee7b7;
  --th-alerte: #ff9438;
  --th-erreur: #ff7a7a;
}

/* ---------------------------------------------------- accessibilite */
.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 1000;
  padding: 12px 18px;
  border-radius: 0 0 10px 10px;
  background: var(--accent, #ff9438);
  color: #10131a;
  font-weight: 600;
  text-decoration: none;
  transition: top .2s ease;
}
.skip-link:focus { top: 0; }

/* Le header est transparent : une fois descendu, le texte du site passe derriere le
   logo et devient illisible. On lui donne un fond des que la page est scrollee. */
.main-header.is-colle,
body.is-scrolled .main-header {
  background: rgba(11, 13, 18, .82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}
/* Le lien d'evitement ne doit jamais pousser le contenu en se positionnant. */
.skip-link:not(:focus) { width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent, #ff9438);
  outline-offset: 3px;
}

/* Les champs obligatoires sont annonces aussi a l'ecrit, pas seulement par la couleur. */
.field input:required,
.field textarea:required { border-color: rgba(255, 255, 255, .28); }
.field em { color: var(--accent, #ff9438); font-style: normal; margin-left: 2px; }

/* ---------------------------------------------------- champ piege */
/* Invisible pour un humain, attire les robots qui remplissent tout. */
.champ-piege {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0; padding: 0; margin: -1px;
}

/* ---------------------------------------------------- formulaire : statut */
.form-message {
  margin: 0 0 18px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .06);
  font-size: 14px;
  line-height: 1.5;
}
.form-message.is-merci      { border-color: rgba(110, 231, 183, .45); color: var(--th-ok); }
.form-message.is-journalise { border-color: rgba(255, 148, 56, .45); color: var(--th-alerte); }
.form-message.is-trop,
.form-message.is-erreur     { border-color: rgba(255, 122, 122, .45); color: var(--th-erreur); }

.contact-delai {
  margin-top: 18px;
  font-size: 14px;
  color: #9aa3b4;
}

/* ---------------------------------------------------- bandeau d'information */
.banniere-cookies {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 20px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(16, 19, 26, .92);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .5);
  font-size: 14px;
  color: #cfd6e2;
}
/* display:flex ci-dessus ecrase l'attribut hidden : sans cette regle, le bandeau
   reste affiche apres le clic et masque la fin du formulaire. */
.banniere-cookies[hidden] { display: none; }
.banniere-cookies p { margin: 0; flex: 1; }
.banniere-actions { display: flex; align-items: center; gap: 14px; white-space: nowrap; }
.banniere-actions a { color: #9aa3b4; }
.banniere-actions button {
  padding: 10px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--accent, #ff9438);
  color: #10131a;
  font-weight: 600;
  cursor: pointer;
}
@media (max-width: 760px) {
  .banniere-cookies { flex-direction: column; align-items: flex-start; gap: 12px; }
  .banniere-actions { width: 100%; justify-content: space-between; }
}

/* Le bandeau ne doit jamais masquer la fin du formulaire. */
body.banniere-active .contact { padding-bottom: 150px; }
body.banniere-active .contact-footer { padding-bottom: 130px; }

/* ---------------------------------------------------- pied de page : liens legaux */
.footer-links { display: inline-flex; gap: 18px; }
.footer-links a { color: #9aa3b4; text-decoration: none; }
.footer-links a:hover { color: #fff; text-decoration: underline; text-underline-offset: 6px; }

/* ---------------------------------------------------- mode sans 3D */
/* WebGL absent, script refuse, ou visiteur sensible au mouvement :
   le fond redevient lisible sans l'objet de verre. */
body.sans-3d #webgl { display: none !important; }
body.sans-3d .cinematic-container { background: radial-gradient(120% 90% at 50% 0%, #1a2030 0%, #0b0d12 70%); }

/* ---------------------------------------------------- pages legales */
.page-legale {
  min-height: 100vh;
  background: #0b0d12;
  color: #dfe4ec;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  line-height: 1.7;
}
.legal-wrap { max-width: 820px; margin: 0 auto; padding: 64px 24px 96px; }
.legal-wrap h1 { font-size: clamp(30px, 5vw, 46px); line-height: 1.1; margin: 0 0 32px; color: #fff; }
.legal-wrap h2 { font-size: 20px; margin: 44px 0 12px; color: #fff; }
.legal-wrap p { margin: 0 0 14px; color: #c3cad6; }
.legal-wrap a { color: var(--accent, #ff9438); }
.legal-retour a { color: #9aa3b4; text-decoration: none; font-size: 14px; }
.legal-retour a:hover { color: #fff; }
.legal-note { margin-top: 56px; font-size: 13px; color: #6f7787; }
.legal-fiche {
  display: grid;
  grid-template-columns: minmax(140px, 220px) 1fr;
  gap: 6px 20px;
  margin: 0 0 20px;
  padding: 0;
}
.legal-fiche dt { color: #8d96a5; }
.legal-fiche dd { margin: 0; color: #dfe4ec; }
@media (max-width: 620px) {
  .legal-fiche { grid-template-columns: 1fr; gap: 2px; }
  .legal-fiche dd { margin-bottom: 12px; }
}
.a-completer {
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(255, 148, 56, .16);
  border: 1px dashed rgba(255, 148, 56, .6);
  color: var(--th-alerte);
  font-size: 13px;
}

/* Le logo du client remplace l'etoile par defaut : on lui laisse un peu plus de place
   et on arrondit, pour qu'il se fonde dans le header sombre. */
.brand-mark { width: 34px; height: 34px; flex: 0 0 34px; }
.brand-mark img { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: 8px; }

/* Coordonnees directes : telephone et adresse a cote de l'email. C'est le premier
   reflexe d'un visiteur sur mobile, et le premier contact d'un artisan. */
.contact-coord {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
  margin: 14px 0 0;
  font-size: 17px;
  line-height: 1.5;
  color: #cfd6e2;
}
.contact-coord a { color: var(--accent, #ef9400); text-decoration: none; font-weight: 600; white-space: nowrap; }
.contact-coord a:hover { text-decoration: underline; text-underline-offset: 5px; }
.coord-sep { width: 1px; height: 15px; background: rgba(255,255,255,.22); }
@media (max-width: 620px) {
  .contact-coord { font-size: 15px; }
  .coord-sep { display: none; }
}

/* ---------------------------------------------------------------------------
   Page ouverte sans serveur (double-clic) ou navigateur sans WebGL.
   Sans le moteur, les cinq chapitres restaient superposes au meme endroit :
   on les remet dans le flux, l'un sous l'autre, et on rend les textes visibles.
   Le site reste consultable et referencable, simplement sans animation 3D.
   --------------------------------------------------------------------------- */
body.sans-3d { overflow-x: hidden; }
body.sans-3d .cinematic-container {
  position: relative;
  height: auto;
  padding: 90px 24px 40px;
  display: block;
  pointer-events: auto;
}
body.sans-3d .main-header {
  position: relative;
  width: 100%;
  height: auto;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  background: rgba(11, 13, 18, .9);
}
body.sans-3d .header-nav { display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: center; }
body.sans-3d .slide,
body.sans-3d #slide-1, body.sans-3d #slide-2,
body.sans-3d #slide-3, body.sans-3d #slide-4 {
  position: relative;
  left: auto; right: auto; top: auto; bottom: auto;
  width: auto; max-width: 780px;
  margin: 0 auto;
  padding: 46px 0;
  pointer-events: auto;
}
body.sans-3d .slide + .slide { border-top: 1px solid rgba(255, 255, 255, .07); }
body.sans-3d .slide-title { margin-left: 0 !important; }
body.sans-3d .line-inner { transform: none !important; opacity: 1 !important; filter: none !important; }
body.sans-3d .slide-desc, body.sans-3d .benefits, body.sans-3d .figures { opacity: 1 !important; transform: none !important; }
body.sans-3d .benefit, body.sans-3d .figure { opacity: 1 !important; transform: none !important; }
body.sans-3d .scroll-stage { display: none; }
body.sans-3d .story-progress, body.sans-3d .header-progress,
body.sans-3d .cursor-inner, body.sans-3d .cursor-outer, body.sans-3d .cursor-label { display: none; }
body.sans-3d #webgl { display: none !important; }
body.sans-3d .contact { padding-top: 60px; }
body.sans-3d .contact .line-inner { transform: none !important; opacity: 1 !important; filter: none !important; }
