/* Calculateurs en ligne Mecaflux - styles communs */
.outil-calc {
  border: 1px solid #c9d6e3;
  border-radius: 6px;
  background: #f7fafc;
  padding: 18px;
  margin: 24px 0;
  font-size: .95rem;
}
.outil-calc h2 {
  font-size: 1.35rem;
  margin-bottom: 4px;
  text-align: left;
}
.outil-calc .sous-titre {
  color: #555;
  margin-bottom: 14px;
}
.outil-calc fieldset {
  border: 0;
  margin: 0 0 10px;
  padding: 0;
}
.outil-calc legend {
  font-size: .8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #2a5d8a;
  margin-bottom: 6px;
}
.outil-calc .champs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px 14px;
}
.outil-calc .champs .large {
  grid-column: span 2;
}
@media (max-width: 420px) {
  .outil-calc .champs .large { grid-column: auto; }
}
.outil-calc label {
  display: block;
  font-size: .85rem;
  color: #333;
  margin-bottom: 2px;
}
.outil-calc input,
.outil-calc select {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #b8c4cf;
  border-radius: 4px;
  background: #fff;
}
.outil-calc input[readonly] {
  background: #eef2f5;
  color: #444;
}
.outil-calc .unite-groupe {
  display: flex;
  gap: 6px;
}
.outil-calc .unite-groupe select {
  width: auto;
  flex: 0 0 auto;
}
.outil-calc .erreur {
  color: #a12020;
  font-weight: 600;
  margin: 10px 0 0;
}
.outil-calc .resultat-principal {
  background: #fff;
  border-left: 5px solid #2a5d8a;
  border-radius: 4px;
  padding: 12px 16px;
  margin: 14px 0 10px;
}
.outil-calc .resultat-principal .valeur {
  font-size: 1.7rem;
  font-weight: 700;
  color: #1d4669;
}
.outil-calc table.resultats {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}
.outil-calc table.resultats th,
.outil-calc table.resultats td {
  padding: 5px 10px;
  border-bottom: 1px solid #e3e9ee;
  text-align: left;
}
.outil-calc table.resultats th {
  font-weight: 400;
  color: #555;
  width: 55%;
}
.outil-calc ul.alertes {
  background: #fff6e0;
  border: 1px solid #f0c96a;
  border-radius: 4px;
  padding: 8px 12px 8px 30px;
  margin: 10px 0;
}
.outil-calc .courbe-calc {
  background: #fff;
  border-radius: 4px;
  margin-top: 12px;
  padding: 6px;
}
.outil-calc .courbe-calc svg {
  width: 100%;
  height: auto;
  display: block;
}
.outil-calc .courbe-calc .grille { stroke: #e3e9ee; }
.outil-calc .courbe-calc .graduation { font-size: 11px; fill: #666; }
.outil-calc .courbe-calc .titre-axe { font-size: 12px; fill: #333; }
.outil-calc .courbe-calc .courbe { fill: none; stroke: #2a5d8a; stroke-width: 2.5; }
.outil-calc .courbe-calc .repere { stroke: #d9822b; stroke-dasharray: 4 3; }
.outil-calc .courbe-calc .point { fill: #d9822b; }
.outil-calc .note {
  font-size: .82rem;
  color: #666;
  margin: 10px 0 0;
}

/* Echelle des regimes (nombre de Reynolds) */
.outil-calc .echelle-calc {
  background: #fff;
  border-radius: 4px;
  padding: 6px;
  margin-top: 10px;
}
.outil-calc .echelle-calc svg { width: 100%; height: auto; display: block; }
.outil-calc .echelle-calc .zone { opacity: .45; }
.outil-calc .echelle-calc .zone.active { opacity: 1; }
.outil-calc .echelle-calc .tic { stroke: #888; }
.outil-calc .echelle-calc .graduation { font-size: 13px; fill: #555; }
.outil-calc .echelle-calc .marqueur { fill: #1d2b36; }
.outil-calc .echelle-calc .marqueur-ligne { stroke: #1d2b36; stroke-width: 2; }
.outil-calc .zone0 { fill: #7fb8e0; --zone: #7fb8e0; }
.outil-calc .zone1 { fill: #f2c46d; --zone: #f2c46d; }
.outil-calc .zone2 { fill: #e98b6d; --zone: #e98b6d; }
.outil-calc .zone3 { fill: #b48ad6; --zone: #b48ad6; }
.outil-calc .zone4 { fill: #7cc39b; --zone: #7cc39b; }
.outil-calc ol.zones {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
}
.outil-calc ol.zones li {
  border-left: 6px solid var(--zone);
  background: #fff;
  padding: 6px 10px;
  margin-bottom: 4px;
  color: #666;
  font-size: .88rem;
}
.outil-calc ol.zones li.active {
  color: #1d2b36;
  box-shadow: 0 0 0 1px var(--zone) inset;
}
.outil-calc .formule-calc {
  font-family: Consolas, "Courier New", monospace;
  font-size: .85rem;
  color: #444;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

/* Tableau de choix dans une serie de tubes */
.outil-calc .tableau-defilant {
  overflow-x: auto;
  margin-top: 10px;
}
.outil-calc table.serie {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: .82rem;
}
.outil-calc table.serie th,
.outil-calc table.serie td {
  padding: 4px 5px;
  border-bottom: 1px solid #e3e9ee;
  text-align: right;
  white-space: nowrap;
}
.outil-calc table.serie th:first-child,
.outil-calc table.serie td:first-child,
.outil-calc table.serie th:last-child,
.outil-calc table.serie td:last-child {
  text-align: left;
}
.outil-calc table.serie thead th {
  background: #e8f1f8;
  color: #1d4669;
  font-weight: 600;
}
.outil-calc table.serie tr.non td { color: #999; }
.outil-calc table.serie tr.conseille td {
  background: #dff1e4;
  color: #14532d;
  font-weight: 700;
}
.outil-calc table.serie tr.large td { color: #444; }
.outil-calc table.serie tr.sedim td { color: #a15c00; }
.outil-calc .bilan {
  font-weight: 600;
  color: #1d4669;
  margin: 0;
}

/* Bloc de presentation du logiciel associe a un calculateur */
.bloc-logiciel {
  display: grid;
  gap: 14px;
  border: 2px solid #2a5d8a;
  border-radius: 6px;
  background: #fff;
  padding: 16px;
  margin: -8px 0 28px;
  font-size: .95rem;
}
.bloc-logiciel figure { margin: 0; }
.bloc-logiciel figure a { display: block; }
.bloc-logiciel figure img {
  width: 100%;
  height: auto;
  border: 1px solid #c9d6e3;
  border-radius: 4px;
  transition: box-shadow .15s;
}
.bloc-logiciel figure a:hover img { box-shadow: 0 2px 10px rgba(29, 70, 105, .35); }
.bloc-logiciel figcaption {
  font-size: .8rem;
  color: #555;
  margin-top: 4px;
}
.bloc-logiciel .surtitre {
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #2a5d8a;
  margin: 0;
}
.bloc-logiciel h3 {
  font-size: 1.25rem;
  margin: 2px 0 8px;
  text-align: left;
}
.bloc-logiciel ul {
  padding-left: 18px;
  margin: 0 0 12px;
}
.bloc-logiciel li { margin-bottom: 4px; }
.bloc-logiciel .boutons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.bloc-logiciel .bouton {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 4px;
  border: 2px solid #2a5d8a;
  font-weight: 600;
  text-decoration: none !important;
}
.bloc-logiciel .bouton.principal { background: #2a5d8a; color: #fff; }
.bloc-logiciel .bouton.principal:hover { background: #1d4669; color: #fff; }
.bloc-logiciel .bouton.secondaire { background: #fff; color: #2a5d8a; }
.bloc-logiciel .bouton.secondaire:hover { background: #e8f1f8; }
.bloc-logiciel .garanties {
  font-size: .8rem;
  color: #14532d;
  margin: 0 0 6px;
}
.bloc-logiciel .autre {
  font-size: .85rem;
  color: #555;
  margin: 0;
}

/* Diagnostic colore (NPSH, cavitation) */
.outil-calc .diagnostic.ok { border-left-color: #2f8a4c; }
.outil-calc .diagnostic.attention { border-left-color: #d9822b; background: #fff8ec; }
.outil-calc .diagnostic.danger { border-left-color: #c0392b; background: #fdf0ee; }
.outil-calc .diagnostic .verdict { font-weight: 700; margin-top: 4px; }
.outil-calc .diagnostic.ok .verdict { color: #1f6b38; }
.outil-calc .diagnostic.attention .verdict { color: #9a5200; }
.outil-calc .diagnostic.danger .verdict { color: #a12020; }
.outil-calc .conseils {
  background: #fff;
  border-radius: 4px;
  padding: 10px 12px 4px;
  margin: 10px 0;
}
.outil-calc .conseils p { margin: 0 0 4px; font-weight: 600; }
.outil-calc .conseils ul { margin: 0 0 6px; padding-left: 20px; }

/* Bilan en cascade */
.outil-calc .bilan-calc { background: #fff; border-radius: 4px; padding: 6px; margin-top: 10px; }
.outil-calc .bilan-calc svg { width: 100%; height: auto; display: block; }
.outil-calc .bilan-calc .grille { stroke: #999; }
.outil-calc .bilan-calc .graduation { font-size: 11px; fill: #555; }
.outil-calc .bilan-calc .valeur-barre { font-size: 12px; fill: #1d2b36; font-weight: 600; }
.outil-calc .bilan-calc .barre.positif { fill: #7cc39b; }
.outil-calc .bilan-calc .barre.negatif { fill: #e98b6d; }
.outil-calc .bilan-calc .barre.total { fill: #2a5d8a; }
.outil-calc .bilan-calc .liaison { stroke: #888; stroke-dasharray: 2 2; }
.outil-calc .bilan-calc .seuil { stroke: #c0392b; stroke-width: 1.5; stroke-dasharray: 6 3; }
.outil-calc .bilan-calc .legende-seuil { font-size: .8rem; color: #a12020; margin: 2px 0 0; text-align: center; }

/* Renvoi vers un calculateur depuis une page voisine */
.renvoi-outil {
  border: 1px solid #c9d6e3;
  border-left: 5px solid #2a5d8a;
  border-radius: 4px;
  background: #f7fafc;
  padding: 12px 16px;
  margin: 18px 0;
}
.renvoi-outil p { margin: 0 0 6px; }
.renvoi-outil .titre-renvoi { font-weight: 700; color: #1d4669; }

/* Point de fonctionnement pompe / reseau */
.outil-calc table.saisie-points {
  border-collapse: collapse;
  width: 100%;
  background: #fff;
  font-size: .85rem;
}
.outil-calc table.saisie-points th,
.outil-calc table.saisie-points td {
  padding: 3px 4px;
  border-bottom: 1px solid #e3e9ee;
  text-align: center;
}
.outil-calc table.saisie-points th:first-child { text-align: left; width: 7.5em; color: #555; font-weight: 400; }
.outil-calc table.saisie-points input { padding: 4px; text-align: center; min-width: 0; }
.outil-calc .courbe-calc .reseau { fill: none; stroke: #2aa7c9; stroke-width: 2.5; }
.outil-calc .courbe-calc .pompe-seule { fill: none; stroke: #8a2a4a; stroke-width: 1.5; stroke-dasharray: 5 4; opacity: .6; }
.outil-calc .courbe-calc .pompe { fill: none; stroke: #8a2a4a; stroke-width: 2.5; }
.outil-calc .courbe-calc .point-constructeur { fill: #fff; stroke: #8a2a4a; stroke-width: 1.5; }
.outil-calc .courbe-calc .repere-qd { stroke: #666; stroke-dasharray: 2 3; }
.outil-calc .legende-courbes {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  justify-content: center;
  font-size: .8rem;
  margin: 4px 0 0;
}
.outil-calc .legende-courbes .l-pompe, .outil-calc .legende-courbes .l-pompe-seule { color: #8a2a4a; }
.outil-calc .legende-courbes .l-reseau { color: #1f87a3; }
.outil-calc .legende-courbes .l-point { color: #d9822b; }
.outil-calc .legende-courbes .l-qd { color: #666; }

/* Vitrine Mecaflux Pro3D : grande capture, vignettes et video */
.bloc-logiciel.vitrine { border-color: #1d2b4a; background: linear-gradient(#f4f7fb, #fff 40%); }
.bloc-logiciel .galerie {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.bloc-logiciel .galerie figure:first-child { grid-column: 1 / -1; }
.bloc-logiciel .galerie a[data-agrandir] { position: relative; cursor: zoom-in; }
.bloc-logiciel .galerie a[data-agrandir]::after {
  content: "⤢";
  position: absolute;
  right: 6px;
  bottom: 6px;
  background: rgba(29, 43, 74, .8);
  color: #fff;
  border-radius: 3px;
  padding: 0 5px;
  font-size: .85rem;
}
.bloc-logiciel .galerie figure:not(:first-child) img { aspect-ratio: 16 / 10; object-fit: cover; object-position: left top; }
.bloc-logiciel video {
  width: 100%;
  height: auto;
  border-radius: 4px;
  background: #1d2b4a;
  margin-bottom: 10px;
}
.mf-agrandir {
  border: 0;
  border-radius: 6px;
  padding: 10px;
  max-width: 96vw;
  max-height: 94vh;
  background: #fff;
}
.mf-agrandir::backdrop { background: rgba(10, 20, 35, .8); }
.mf-agrandir img { display: block; max-width: 100%; max-height: 82vh; margin: 0 auto; }
.mf-agrandir .legende { margin: 8px 0 0; font-size: .9rem; color: #333; text-align: center; }
.mf-agrandir .fermer {
  position: absolute;
  top: 6px;
  right: 6px;
  border: 0;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  background: #1d2b4a;
  color: #fff;
  font-size: 1rem;
}

/* Generateur de profils NACA */
.outil-calc .trace-profil { background: #fff; border-radius: 4px; padding: 6px; margin-top: 10px; }
.outil-calc .trace-profil svg { width: 100%; height: auto; display: block; }
.outil-calc .trace-profil .profil { fill: #dce9f5; stroke: #1d4669; stroke-width: 1.5; }
.outil-calc .trace-profil .moyenne { fill: none; stroke: #1f87a3; stroke-width: 1.2; stroke-dasharray: 5 3; }
.outil-calc .trace-profil .corde { stroke: #888; stroke-width: 1; }
.outil-calc .trace-profil .graduation { font-size: 11px; fill: #555; }
.outil-calc .legende-courbes .l-profil { color: #1d4669; }
.outil-calc .telechargements { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.outil-calc .telechargements button {
  padding: 6px 12px;
  border: 2px solid #2a5d8a;
  border-radius: 4px;
  background: #2a5d8a;
  color: #fff;
  font-weight: 600;
}
.outil-calc .telechargements button.discret { background: #fff; color: #2a5d8a; }
.outil-calc textarea.apercu {
  width: 100%;
  font-family: Consolas, "Courier New", monospace;
  font-size: .8rem;
  border: 1px solid #c9d6e3;
  border-radius: 4px;
  background: #fff;
  margin-top: 6px;
}

/* Page recapitulative des outils de calcul en ligne */
.intro-outils { font-size: 1.05rem; }
.titre-groupe {
  font-size: 1.3rem;
  margin: 28px 0 12px;
  padding-bottom: 6px;
  border-bottom: 2px solid #2a5d8a;
  color: #1d4669;
  text-align: left;
}
.grille-outils {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}
.carte-outil {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid #c9d6e3;
  border-radius: 6px;
  background: #f7fafc;
  padding: 14px;
  color: #212529;
  text-decoration: none !important;
  transition: border-color .15s, box-shadow .15s;
}
.carte-outil:hover { border-color: #2a5d8a; box-shadow: 0 2px 10px rgba(29, 70, 105, .2); }
.carte-outil .nom { font-weight: 700; color: #1d4669; font-size: 1.05rem; }
.carte-outil .description { font-size: .9rem; }
.carte-outil .resultats { font-size: .8rem; color: #555; }
.carte-outil .ouvrir { margin-top: auto; font-weight: 600; color: #2a5d8a; font-size: .9rem; }
.carte-outil.logiciel { background: #fff; border-color: #2a5d8a; }
.logiciels-outils { margin-top: 12px; }
.logiciels-outils .garanties { font-size: .85rem; color: #14532d; margin-top: 10px; }
.carte-outil .vignette {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border: 1px solid #c9d6e3;
  border-radius: 4px;
  margin-bottom: 4px;
}
.logiciels-outils .grille-outils { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
