/* ============================================================
   MACSTEEL - configurateur, couche de presentation (v3)
   ------------------------------------------------------------
   Chargee APRES macsteel.css et configurateur2.css. Elle ne
   modifie aucune regle existante : elle surcharge, et tout ce
   qu'elle ajoute porte un prefixe c3-.

   Objet : hierarchie de lecture, hierarchie des actions,
   lisibilite typographique, tenue sur telephone.
   ============================================================ */

/* ------------------------------------------------------------
   1. TYPOGRAPHIE DES INTITULES DE SECTION
   Le petit corps en majuscules avec un interlettrage de 0,24 em
   est elegant en maquette et penible a lire a l'ecran. On garde
   le principe, on desserre la contrainte.
   ------------------------------------------------------------ */
.sim.c2-look .c2-sec > h6,
.sim.c2-look .c2-ess-tete span {
  font-size: .74rem; letter-spacing: .1em; color: #54687a;
}
.sim.c2-look .sim-vue h4,
.sim.c2-look .c2-tete h5 { letter-spacing: .1em; font-size: .76rem; }

/* ------------------------------------------------------------
   2. BANDEAU DE DEMONSTRATION
   L'outil arrive calcule. Le bandeau dit que les valeurs a
   l'ecran sont un exemple, et donne la sortie pour repartir de
   zero. Il disparait a la premiere saisie.
   ------------------------------------------------------------ */
.c3-demo {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: #eaf6fd; border: 1px solid #9ed6f2; border-radius: 10px;
  padding: 12px 16px; margin-bottom: 16px; font-size: .82rem; color: #12283c;
}
.c3-demo b { font-weight: 700; }
.c3-demo .c3-demo-txt { flex: 1; min-width: 220px; line-height: 1.5; }
.c3-demo button {
  border: 1px solid #159FD8; background: #fff; color: #0F7CAA; border-radius: 999px;
  padding: 7px 15px; font: inherit; font-size: .76rem; font-weight: 600;
  cursor: pointer; white-space: nowrap; transition: .15s;
}
.c3-demo button:hover { background: #159FD8; color: #fff; }

/* ------------------------------------------------------------
   3. COMPARATEUR
   Le chiffre qui vend n'est pas le tonnage : c'est l'ecart. Il
   est calcule sur le batiment saisi, pas sur une moyenne de
   plaquette. Aucune valeur monetaire n'y figure.
   ------------------------------------------------------------ */
.c3-cmp {
  background: #0E2233; border-radius: 10px; padding: 18px 20px 20px;
  margin-bottom: 16px; color: #fff;
}
.c3-cmp-t {
  font-size: .68rem; letter-spacing: .16em; text-transform: uppercase;
  color: #7FC7E8; font-weight: 600; margin-bottom: 14px;
}
.c3-cmp-g {
  display: grid; grid-template-columns: 1fr auto 1fr auto; gap: 18px;
  align-items: center;
}
.c3-col span {
  display: block; font-size: .7rem; color: #93A7B7; margin-bottom: 6px;
  letter-spacing: .04em;
}
.c3-col b {
  font-size: 1.75rem; font-weight: 800; letter-spacing: -.02em; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.c3-col b small { font-size: .74rem; font-weight: 500; color: #93A7B7; margin-left: 4px; }
.c3-col em {
  display: block; font-style: normal; font-size: .72rem; color: #93A7B7;
  margin-top: 6px; line-height: 1.4;
}
.c3-ref b { color: #B9C9D5; }
.c3-nous b { color: #fff; }
.c3-nous span { color: #7FC7E8; }
.c3-fl { color: #45607a; font-size: 1.2rem; line-height: 1; }
.c3-gain {
  border-left: 1px solid #24425c; padding-left: 18px; text-align: right;
}
.c3-gain b {
  display: block; font-size: 1.62rem; font-weight: 800; color: #4FD08A;
  letter-spacing: -.02em; line-height: 1; font-variant-numeric: tabular-nums;
}
.c3-gain span { display: block; font-size: .72rem; color: #93A7B7; margin-top: 6px; }
.c3-cmp-p {
  font-size: .7rem; color: #7d93a6; margin-top: 14px; line-height: 1.5;
  border-top: 1px solid #24425c; padding-top: 11px;
}

/* ------------------------------------------------------------
   4. LIVRABLES : UNE ACTION PRINCIPALE, PAS QUATRE
   ------------------------------------------------------------ */
.c3-liv-tete {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; margin-bottom: 14px;
}
.c3-liv-tete h5 {
  font-size: .76rem; letter-spacing: .1em; text-transform: uppercase;
  color: #12283c; font-weight: 700; margin: 0;
}
.c3-liv-tete em {
  font-style: normal; font-size: .7rem; color: #8b9aa8; letter-spacing: .04em;
}

/* le dossier redevient une ligne de service, pas un encadre */
.c2-livrables .dossier {
  border: 0; border-top: 1px dashed #e3e9ef; background: none;
  padding: 12px 0 0; margin: 16px 0 0;
}
.c2-livrables .dossier-tete b { font-size: .82rem; }
.c2-livrables .dossier-aide { font-size: .68rem; }

/* v182 - CES REGLES PAR IDENTIFIANT SONT RETIREES. Elles donnaient trois
   REGISTRES aux trois documents - gros bouton plein, lien souligne, contour
   a cadenas - et c'etait deja une reponse au meme probleme (« quatre boutons
   pleins de meme largeur, c'est aucun bouton »). La v182 repond autrement :
   les trois pieces sont des LIGNES egales (piece-liste, feuille principale),
   chacune avec son petit bouton constant, et la hierarchie est portee par la
   colonne d'etat, pas par la forme du bouton. Un style par identifiant bat
   toute classe : le laisser ici aurait ecrase la liste en silence - c'est
   exactement ce qui s'est produit au premier rendu.
   Seul le verrou de la note garde son signe : il dit ce qu'aucune phrase ne
   dit. */
.c2-livrables #dlNote::before { content: "\1F512"; margin-right: 7px; font-size: .85em; }

/* badges normatifs : la rigueur du moteur cesse d'etre invisible */
.c3-normes {
  display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 4px;
}
.c3-normes span {
  border: 1px solid #dde4ea; border-radius: 999px; padding: 4px 11px;
  font-size: .68rem; color: #54687a; letter-spacing: .04em; background: #fafcfd;
}
.c3-normes span b { color: #12283c; font-weight: 700; }

/* partage : le code de restitution existe deja, il devient un lien */
.c3-partage {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 14px; padding-top: 13px; border-top: 1px dashed #e3e9ef;
}
.c3-partage button {
  border: 1px solid #dde4ea; background: #fff; border-radius: 7px; padding: 8px 14px;
  font: inherit; font-size: .76rem; color: #12283c; cursor: pointer; transition: .15s;
}
.c3-partage button:hover { border-color: #159FD8; color: #0F7CAA; }
.c3-partage button:disabled { opacity: .45; cursor: not-allowed; }
.c3-partage em { font-style: normal; font-size: .7rem; color: #8b9aa8; }

/* le devis n'est pas un telechargement : il ne doit pas y ressembler */
.c2-livrables .devis-bloc {
  background: #0E2233; border-radius: 8px; padding: 16px 18px; margin-top: 18px;
}
.c2-livrables #dlDevis {
  width: 100%; justify-content: center; background: #C9A227; color: #0E2233;
  font-weight: 700;
}
.c2-livrables #dlDevis:hover:not(:disabled) { background: #DDB935; }
.c2-livrables #dlDevis:disabled { background: #3a5266; color: #8b9aa8; cursor: not-allowed; }
.c2-livrables .devis-bloc .doc-pied-devis { color: #93A7B7; margin-top: 10px; }

.c2-livrables .restit { margin-top: 16px; }
.c2-livrables .note-mention { font-size: .7rem; color: #8b9aa8; margin-top: 14px; }

/* ------------------------------------------------------------
   5. METHODE : repliee. Elle expliquait trois fois la meme chose
   au-dessus du premier resultat.
   ------------------------------------------------------------ */
.c3-methode {
  background: #fff; border: 1px solid #e3e9ef; border-radius: 10px;
  padding: 0; margin-top: 16px;
}
.c3-methode > summary {
  cursor: pointer; list-style: none; padding: 15px 20px;
  font-size: .76rem; letter-spacing: .1em; text-transform: uppercase;
  color: #12283c; font-weight: 700;
}
.c3-methode > summary::-webkit-details-marker { display: none; }
.c3-methode > summary::after { content: " +"; color: #159FD8; font-weight: 800; }
.c3-methode[open] > summary::after { content: " –"; }
.c3-methode .regles, .c3-methode .sim-note { padding: 0 20px; }
.c3-methode .sim-note { padding-bottom: 18px; }

/* ------------------------------------------------------------
   6. CURSEURS : la valeur se lit, la course se comprend
   ------------------------------------------------------------ */
.c2-glis span {
  min-width: 62px; font-size: .82rem; font-weight: 700; color: #12283c;
  letter-spacing: 0; text-transform: none;
}
.c3-bornes {
  display: flex; justify-content: space-between; font-size: .64rem;
  color: #a3b1bd; margin-top: -2px; padding-right: 72px;
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------
   7. BARRE COLLANTE - telephone uniquement
   Le geste central est : je bouge un curseur, je vois le chiffre
   bouger. Sur telephone le chiffre est hors ecran.
   ------------------------------------------------------------ */
.c3-barre {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; display: none;
  align-items: center; justify-content: space-between; gap: 12px;
  background: #0E2233; color: #fff; padding: 10px 14px;
  box-shadow: 0 -2px 14px rgba(14,34,51,.25);
}
.c3-barre .c3-b-val { font-size: .78rem; line-height: 1.35; }
.c3-barre .c3-b-val b {
  font-size: 1.05rem; font-weight: 800; font-variant-numeric: tabular-nums;
}
.c3-barre .c3-b-val small { display: block; font-size: .66rem; color: #93A7B7; }
.c3-barre button {
  border: 0; background: #159FD8; color: #fff; padding: 11px 16px;
  font: inherit; font-size: .74rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; cursor: pointer; white-space: nowrap; border-radius: 6px;
}

/* ------------------------------------------------------------
   8. TENUE SUR PETIT ECRAN
   ------------------------------------------------------------ */
@media (max-width: 1080px) {
  .c3-cmp-g { grid-template-columns: 1fr 1fr; gap: 14px; }
  .c3-fl { display: none; }
  .c3-gain { grid-column: 1 / -1; border-left: 0; border-top: 1px solid #24425c;
    padding-left: 0; padding-top: 14px; text-align: left; }
}
@media (max-width: 900px) {
  .c3-barre.c3-on { display: flex; }
  body.c3-barre-on { padding-bottom: 72px; }
}
@media (max-width: 760px) {
  .c3-cmp-g { grid-template-columns: 1fr; }
  .c3-gain { padding-top: 12px; }
  .c2-tuiles { grid-template-columns: 1fr 1fr; }
  /* les tableaux ne debordent plus : ils defilent dans leur cadre */
  .courbe-tab, .c2-scroll, .c3-tab-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .courbe-tab table, .c2-tab { min-width: 520px; }
  /* l'apercu PDF est illisible sur 380 px : on le reduit, le SVG natif
     du panneau de dessins prend le relais */
  .sim.c2-look #c2dessins .plan iframe { min-height: 300px; }
  .plan { min-height: 320px; }
  .plan iframe { height: 320px; }
  .c2-livrables { padding: 16px; }
  .c3-demo { font-size: .78rem; }
}

/* le graphique ne se deforme plus : preserveAspectRatio est corrige en JS,
   il reste a lui donner une hauteur qui tienne sur un telephone */
#svgTrame { width: 100%; height: auto; }

/* ---- bascule de famille depuis le comparateur ----
   Elle change reellement l'etude : plan, note et metre suivent. */
.c3-bascule {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  flex-wrap: wrap; margin-top: 16px; padding-top: 14px;
  border-top: 1px solid #24425c; font-size: .78rem; color: #C6D6E2; line-height: 1.5;
}
.c3-bascule span { flex: 1; min-width: 240px; }
.c3-bascule b { color: #fff; font-weight: 700; }
.c3-bascule button {
  border: 1px solid #4FD08A; background: transparent; color: #4FD08A;
  border-radius: 999px; padding: 9px 18px; font: inherit; font-size: .76rem;
  font-weight: 700; cursor: pointer; white-space: nowrap; transition: .15s;
}
.c3-bascule button:hover { background: #4FD08A; color: #0E2233; }

/* ---- ligne « poteaux intérieurs » du panneau de détail ----
   Deux mentions sous la section : le poids au mètre et la longueur de
   flambement hors plan, qui n'est pas celle du poteau de rive. */
.sim.c2-look #c3rPotInt small { display: block; margin-top: 1px; }
.sim.c2-look #c3rPotInt small::before { content: ""; }

/* ---- degraissage : elements replies ou migres ---- */
.c3-repli {
  border-top: 1px dashed #e3e9ef; margin-top: 14px; padding-top: 4px;
}
.c3-repli > summary {
  cursor: pointer; list-style: none; padding: 9px 0;
  font-size: .74rem; letter-spacing: .1em; text-transform: uppercase;
  color: #54687a; font-weight: 700;
}
.c3-repli > summary::-webkit-details-marker { display: none; }
.c3-repli > summary::after { content: " +"; color: #159FD8; font-weight: 800; }
.c3-repli[open] > summary::after { content: " –"; }
/* la prose migree dans l'accordeon methode retrouve sa marge */
.c3-methode .c3-migre { padding: 0 20px 12px; margin: 0; }

/* ============================================================
   FENETRE DE DEMANDE DE DEVIS
   ============================================================ */
.c4-fond {
  position: fixed; inset: 0; z-index: 200; display: flex;
  align-items: center; justify-content: center; padding: 24px;
  background: rgba(14, 34, 51, .55); overflow-y: auto;
}
.c4-fond[hidden] { display: none; }
.c4-fen {
  position: relative; background: #fff; border-radius: 12px;
  width: 100%; max-width: 620px; padding: 30px 32px 26px;
  box-shadow: 0 20px 60px rgba(14, 34, 51, .3); margin: auto;
}
.c4-x {
  position: absolute; top: 12px; right: 14px; border: 0; background: none;
  font-size: 1.6rem; line-height: 1; color: #8b9aa8; cursor: pointer; padding: 4px 8px;
}
.c4-x:hover { color: #12283c; }
.c4-fen h3 {
  margin: 0 0 4px; font-size: 1.12rem; font-weight: 800; color: #0E2233;
  letter-spacing: -.01em;
}
.c4-sous {
  margin: 0 0 20px; font-size: .74rem; letter-spacing: .1em; text-transform: uppercase;
  color: #8b9aa8; font-weight: 600;
}
.c4-grille { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.c4-fen label {
  display: block; font-size: .74rem; font-weight: 600; color: #54687a; letter-spacing: .02em;
}
.c4-fen input, .c4-fen textarea {
  display: block; width: 100%; margin-top: 5px; padding: 10px 12px;
  border: 1px solid #dde4ea; border-radius: 7px; font: inherit; font-size: .88rem;
  color: #12283c; background: #fff; box-sizing: border-box;
}
.c4-fen input:focus, .c4-fen textarea:focus {
  outline: 0; border-color: #159FD8; box-shadow: 0 0 0 3px rgba(21, 159, 216, .12);
}
.c4-msg { display: block; margin-top: 16px; }
.c4-fen textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .78rem;
  line-height: 1.5; resize: vertical;
}
.c4-piece {
  margin: 12px 0 0; font-size: .76rem; color: #54687a; line-height: 1.5;
  background: #f3f8fb; border-left: 3px solid #159FD8; padding: 10px 13px; border-radius: 0 6px 6px 0;
}
.c4-piece b { color: #12283c; }
.c4-err {
  margin: 12px 0 0; font-size: .78rem; color: #B4232A; line-height: 1.5;
  background: #fdf1f1; border-left: 3px solid #B4232A; padding: 10px 13px; border-radius: 0 6px 6px 0;
}
.c4-actions {
  display: flex; gap: 10px; justify-content: flex-end; align-items: center; margin-top: 20px;
}
.c4-annul {
  border: 1px solid #dde4ea; background: #fff; border-radius: 7px; padding: 11px 18px;
  font: inherit; font-size: .82rem; color: #54687a; cursor: pointer;
}
.c4-annul:hover { border-color: #b0bcc7; color: #12283c; }
.c4-env {
  border: 0; background: #C9A227; color: #0E2233; border-radius: 7px; padding: 12px 22px;
  font: inherit; font-size: .82rem; font-weight: 700; cursor: pointer;
}
.c4-env:hover:not(:disabled) { background: #DDB935; }
.c4-env:disabled { background: #e3e9ef; color: #8b9aa8; cursor: default; }
.c4-mention { margin: 14px 0 0; font-size: .7rem; color: #8b9aa8; line-height: 1.5; }
.c4-ok { text-align: center; padding: 22px 8px 8px; }
.c4-ok-p {
  width: 52px; height: 52px; margin: 0 auto 16px; border-radius: 50%;
  background: #E8F7EF; color: #2E9E63; font-size: 1.6rem; line-height: 52px; font-weight: 800;
}
.c4-ok p { margin: 0 0 20px; font-size: .9rem; color: #12283c; line-height: 1.6; }

@media (max-width: 640px) {
  .c4-fond { padding: 0; align-items: flex-end; }
  .c4-fen { max-width: none; border-radius: 12px 12px 0 0; padding: 24px 20px 20px; }
  .c4-grille { grid-template-columns: 1fr; }
  .c4-actions { flex-direction: column-reverse; }
  .c4-actions button { width: 100%; }
}

/* le select de qualite s'aligne sur les champs texte de la fenetre */
.c4-fen select {
  display: block; width: 100%; margin-top: 5px; padding: 10px 12px;
  border: 1px solid #dde4ea; border-radius: 7px; font: inherit; font-size: .88rem;
  color: #12283c; background: #fff; box-sizing: border-box; height: 41px;
}
.c4-fen select:focus {
  outline: 0; border-color: #159FD8; box-shadow: 0 0 0 3px rgba(21, 159, 216, .12);
}

/* ---- bandeau d'information apres ouverture de la messagerie ---- */
.c4-bulle {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 120%);
  z-index: 210; max-width: 560px; width: calc(100% - 32px);
  background: #0E2233; color: #fff; border-radius: 10px; padding: 15px 20px;
  font-size: .82rem; line-height: 1.55; cursor: pointer;
  box-shadow: 0 14px 40px rgba(14, 34, 51, .35);
  opacity: 0; transition: transform .25s ease, opacity .25s ease;
}
.c4-bulle.c4-on { transform: translate(-50%, 0); opacity: 1; }
.c4-bulle b { font-weight: 700; }
.c4-bulle-x { color: #93A7B7; font-size: .76rem; }
@media (max-width: 900px) { .c4-bulle { bottom: 84px; } }

/* ---- bulle de confirmation apres un clic sur la courbe ---- */
.c3-pt-bulle {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 120%);
  z-index: 205; background: #0E2233; color: #fff; border-radius: 999px;
  padding: 11px 22px; font-size: .82rem; font-weight: 600;
  box-shadow: 0 12px 34px rgba(14, 34, 51, .32);
  opacity: 0; transition: transform .22s ease, opacity .22s ease; pointer-events: none;
}
.c3-pt-bulle.c3-on { transform: translate(-50%, 0); opacity: 1; }
/* le curseur dit que la courbe se clique */
#svgTrame { cursor: pointer; }

/* ---- rappel : la trame est imposee, l'optimiseur est en pause ---- */
.c3-rappel {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 10px 0 0; padding: 10px 14px; font-size: .78rem; color: #12283c;
  background: #FBF4E4; border-left: 3px solid #C9A227; border-radius: 0 6px 6px 0;
}
.c3-rappel[hidden] { display: none; }
.c3-rappel b { font-weight: 700; }
.c3-rappel button {
  border: 1px solid #C9A227; background: #fff; color: #7A6218; border-radius: 999px;
  padding: 6px 14px; font: inherit; font-size: .74rem; font-weight: 600;
  cursor: pointer; white-space: nowrap; transition: .15s;
}
.c3-rappel button:hover { background: #C9A227; color: #fff; }

/* ---- survol de la courbe : le point qu'un clic retiendrait ---- */
.c3-survol {
  position: fixed; z-index: 120; pointer-events: none;
  background: #0E2233; color: #fff; border-radius: 7px; padding: 7px 11px;
  font-size: .72rem; line-height: 1.4; white-space: nowrap;
  box-shadow: 0 8px 22px rgba(14, 34, 51, .28);
  opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s;
}
.c3-survol.c3-on { opacity: 1; transform: translateY(0); }
.c3-survol b { display: block; font-size: .92rem; font-weight: 800;
  font-variant-numeric: tabular-nums; }
.c3-survol span { display: block; color: #93A7B7; font-size: .68rem; }
