/*
 * OFFRE_SUR_MESURE_L2_2026_10 — module « Mon prix et mon audit » des landings (public/js/we-event-simulateur.js).
 * Classes « wes-* » seulement (jamais une classe du site) ; variables posées sur la racine du module. Charte du plan 02 :
 * bleu nuit #0B1F3F, crème #F7F4EE, encre #121A2B, or #C9A24B ; Fraunces (titres) et Inter (texte) servies par le site.
 * Le module vit dans une carte blanche (lot 5 : .wl-osm-carte) : téléphone d'abord, cibles d'au moins 44 px.
 */
@font-face {
  font-family: "WES Fraunces";
  src: url("/assets/fonts/fraunces-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "WES Inter";
  src: url("/assets/fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

[data-we-simulateur] {
  --wes-nuit: #0b1f3f;
  --wes-nuit-profond: #07152e;
  --wes-creme: #f7f4ee;
  --wes-encre: #121a2b;
  --wes-or: #c9a24b;
  --wes-gris: #3a4459;
  --wes-filet: #e5e0d6;
  --wes-bord: #8a8170; /* bord des champs : 3,9:1 sur blanc, 3,5:1 sur crème (WCAG 1.4.11) */
  --wes-erreur: #a1261b;
  --wes-titre-police: "WES Fraunces", "Fraunces Variable", "Fraunces", Georgia, serif;
  --wes-texte-police: "WES Inter", "Inter Variable", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: var(--wes-encre);
  font-family: var(--wes-texte-police);
  font-size: 16px;
  line-height: 1.45;
  text-align: left;
}
[data-we-simulateur] *,
[data-we-simulateur] *::before,
[data-we-simulateur] *::after {
  box-sizing: border-box;
}
/* Le module vit dans une carte blanche : contour bleu nuit (16:1), jamais l'or (2,4:1 sur blanc, revue L2). */
[data-we-simulateur] :focus-visible {
  outline: 3px solid var(--wes-nuit);
  outline-offset: 2px;
}
.wes-titre,
.wes-question,
.wes-sous-titre {
  margin: 0;
  font-family: var(--wes-titre-police);
  font-weight: 600;
  line-height: 1.2;
  color: var(--wes-nuit);
}
.wes-titre {
  font-size: 24px;
}
.wes-question,
.wes-sous-titre {
  font-size: 19px;
}

/* Les 9 métiers : boutons à bascule (aria-pressed) */
.wes-tuiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.wes-tuile {
  min-height: 48px;
  padding: 8px 12px;
  border: 1px solid var(--wes-bord);
  border-radius: 12px;
  background: #fff;
  color: var(--wes-encre);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.wes-tuile:hover {
  border-color: var(--wes-nuit);
}
.wes-tuile[aria-pressed="true"] {
  border: 2px solid var(--wes-nuit);
  background: #f2efe9;
  font-weight: 600;
}
.wes-tuile[data-metier="autre"] {
  grid-column: 1 / -1;
}

/* Le formulaire */
.wes-formulaire {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
}
.wes-formulaire[hidden],
.wes-champ[hidden] {
  display: none;
}
.wes-champ {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.wes-champ label {
  font-size: 14px;
  font-weight: 600;
  color: var(--wes-encre);
}
.wes-champ input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--wes-bord);
  border-radius: 10px;
  background: #fff;
  color: var(--wes-encre);
  font: inherit;
  font-size: 16px;
}
.wes-champ input:focus {
  border-color: var(--wes-nuit);
}
.wes-champ input[aria-invalid="true"] {
  border-color: var(--wes-erreur);
}
.wes-erreur,
.wes-appel,
.wes-information,
.wes-preuve {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
}
.wes-erreur {
  color: var(--wes-erreur);
  font-weight: 500;
}
.wes-erreur:empty,
.wes-message:empty {
  display: none;
}
.wes-appel,
.wes-information {
  color: var(--wes-gris);
}
.wes-information a {
  color: var(--wes-nuit);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.wes-preuve {
  color: var(--wes-gris);
  text-align: center;
}
.wes-piege {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
/* Texte lu par les lecteurs d'écran, invisible à l'écran (la mention « nouvel onglet » d'un lien, revue L2). */
.wes-masque {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Le bouton principal et le message de refus */
.wes-bouton {
  position: relative;
  width: 100%;
  min-height: 56px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  background: var(--wes-nuit);
  color: #fff;
  font: inherit;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}
.wes-bouton:hover:not(:disabled) {
  background: var(--wes-nuit-profond);
}
.wes-bouton:disabled {
  opacity: 0.6;
  cursor: progress;
}
.wes-bouton[aria-busy="true"]::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 18px;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: wes-tourne 0.9s linear infinite;
}
@keyframes wes-tourne {
  to {
    transform: rotate(360deg);
  }
}
.wes-message {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #e8b4ac;
  border-radius: 12px;
  background: #fdf1ef;
  color: #7a1d14;
  font-size: 14px;
  line-height: 1.45;
}

@media (min-width: 560px) {
  .wes-tuiles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-we-simulateur] *,
  [data-we-simulateur] *::before,
  [data-we-simulateur] *::after {
    animation: none !important;
    transition: none !important;
  }
}
