/* Accessibilité et ajustements finaux */
/* Équilibrage final des contrastes et des espacements
   Règles finales de cohérence visuelle et responsive. */

:root {
  --theme-ink: #2A2F36;
  --theme-copy: #43514B;
  --theme-copy-soft: #596760;
  --theme-green: #1E4D3B;
  --theme-green-dark: #15382C;
  --theme-teal: #0D6E6E;
  --theme-sage: #A6C4A2;
  --theme-line: #D4DCDA;
  --theme-soft: #EBECEC;
  --theme-warm: #EBECEC;
  --theme-white: #FFFFFF;
}

/* Lisibilité globale */
body { color: var(--theme-ink); }
p, li, dd, td { color: var(--theme-copy); }
body :is(h1, h2, h3, h4, h5, h6) {
  font-family: var(--font-family-headings);
  font-weight: 600;
  text-wrap: balance;
}
.section-subtitle {
  color: var(--theme-teal);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .16em;
  line-height: 1.3;
}
.section-header {
  max-width: 860px;
  margin-bottom: 50px;
}
.section-header p {
  max-width: 700px;
  margin-top: 18px;
  color: var(--theme-copy);
  font-size: 1.02rem;
  line-height: 1.72;
}

/* Header */
.header-container { min-height: 82px; }
.logo-img-main { width: 224px; }
.main-nav { gap: 28px; }
.nav-link {
  color: #35433D;
  font-size: .9rem;
  font-weight: 650;
}
.nav-btn { min-height: 46px; padding: 11px 19px; }

/* Hero : contenu immédiatement visible et composition moins vide */
body.home-page #home.hero-section {
  min-height: 760px;
  padding: 148px 24px 94px;
}
body.home-page #home .hero-container {
  grid-template-columns: minmax(0, 1.08fr) minmax(400px, .92fr);
  align-items: center;
  gap: 62px;
}
body.home-page #home .hero-content {
  align-self: center;
  max-width: 690px;
}
body.home-page #home .hero-content > * {
  opacity: 1;
  transform: none;
  animation: hero-enter .68s cubic-bezier(.2,.72,.25,1) both;
}
body.home-page #home .hero-content .hero-badge { animation-delay: .04s; }
body.home-page #home .hero-content .hero-catchline { animation-delay: .12s; }
body.home-page #home .hero-content > p { animation-delay: .2s; }
body.home-page #home .hero-content .hero-actions { animation-delay: .28s; }
body.home-page #home .hero-catchline {
  max-width: 720px;
  margin-bottom: 24px;
  color: var(--theme-ink);
  font-size: clamp(3.2rem, 5.25vw, 5.2rem);
  font-weight: 600;
  line-height: .99;
  letter-spacing: -.058em;
}
body.home-page #home .hero-content p {
  max-width: 650px;
  color: var(--theme-copy);
  font-size: 1.06rem;
  line-height: 1.74;
}
body.home-page #home .hero-actions { margin-top: 34px; }
body.home-page #home .visual-wrapper {
  min-height: 535px;
  border-color: #CCD7D1;
  box-shadow: 0 28px 70px rgba(42,47,54,.11);
}
/* Le libellé était rendu à 55 % d'opacité : il est désormais lisible sur tous les écrans. */
body.home-page #home .visual-wrapper::before {
  top: 22px;
  left: 50%;
  right: auto;
  width: auto;
  max-width: calc(100% - 52px);
  padding: 8px 14px;
  border: 1px solid rgba(30,77,59,.14);
  border-radius: 999px;
  background: rgba(255,255,255,.94);
  color: var(--theme-green);
  font-size: .72rem;
  font-weight: 750;
  letter-spacing: .1em;
  line-height: 1.35;
  text-align: center;
  opacity: 1;
  box-shadow: 0 7px 22px rgba(42,47,54,.05);
  transform: translateX(-50%);
}
body.home-page #home .node-details-card {
  display: flex;
  width: 100%;
  margin: 24px auto 0;
  padding: 20px 18px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-color: #CED8D2;
  background: rgba(250,248,244,.96);
  text-align: center;
  right: auto;
  bottom: auto;
}
body.home-page #home .node-details-card p { color: var(--theme-copy); }
body.home-page #home .node-details-card h4,
body.home-page #home .node-details-card p {
  width: 100%;
  margin-inline: auto;
  text-align: center;
}
body.home-page #home .node-details-card h4 { color: var(--theme-green); }
body.home-page #home .node-label { fill: #34433D; }

/* Boutons */
.btn-secondary {
  border-color: #708077;
  color: var(--theme-green);
}
.btn-secondary:hover {
  border-color: var(--theme-green);
  background: rgba(30,77,59,.055);
}

/* Métriques : contraste garanti et respiration sous le hero. */
.metrics-section {
  padding: 40px 24px 44px;
  background: var(--theme-white);
}
.metrics-container {
  max-width: 1180px;
  padding: 4px;
  border: 1px solid #C8D5CE;
  border-radius: 27px;
  background: #EFF4F0;
  box-shadow: 0 18px 48px rgba(21,56,44,.14);
}
.metric-card {
  min-height: 142px;
  padding: 18px 14px;
  background: transparent;
}
.metrics-container .metric-card .metric-value,
.metrics-container .metric-card h3 {
  margin-bottom: 8px;
  color: var(--theme-green-dark) !important;
  font-size: 2.2rem;
  -webkit-text-fill-color: var(--theme-green-dark) !important;
}
.metrics-container .metric-card > p:last-child {
  color: var(--theme-copy) !important;
  font-size: .84rem;
  font-weight: 650;
  line-height: 1.42;
}
.metrics-container .metric-card + .metric-card {
  border-color: #C8D5CE;
}

/* Rythme vertical des sections */
.services-section { padding: 76px 24px 92px; }
.specialites-section { padding: 82px 24px 84px; }
.interactive-grid-section { padding: 78px 24px 92px; }
.contact-section { padding: 92px 24px; }

/* Cartes de services */
.services-grid { gap: 22px; }
.service-card {
  min-height: 530px;
  gap: 20px;
  padding: 34px;
}
.service-card h3 {
  margin-top: 22px;
  color: var(--theme-green-dark);
  font-size: 1.55rem;
  line-height: 1.18;
}
.service-card > p {
  margin: 10px 0 18px;
  color: var(--theme-copy);
  font-size: .97rem;
  line-height: 1.68;
}
.card-list { gap: 11px; }
.card-list li {
  color: #35433D;
  font-size: .9rem;
  line-height: 1.48;
}
.card-featured h3 { color: #FFFFFF; }
.card-featured > p,
.card-featured .card-list li { color: rgba(255,255,255,.93); }
.card-featured::before {
  top: 22px;
  right: 22px;
  padding: 6px 12px;
  font-size: .66rem;
  letter-spacing: .1em;
}
.card-icon, .specialty-icon {
  border-color: #CBD7D0;
  background: #EDF3EE;
  color: var(--theme-green);
}
.card-featured .card-icon {
  border-color: rgba(255,255,255,.24);
  background: rgba(255,255,255,.1);
  color: #FFFFFF;
}

/* Expertises : texte auparavant trop petit */
.specialites-grid { gap: 16px; }
.specialty-card {
  min-height: 270px;
  gap: 15px;
  padding: 25px 22px;
}
.specialty-card h3,
.specialty-card h4 {
  margin-top: 18px;
  color: var(--theme-green-dark);
  font-size: 1.04rem;
  line-height: 1.3;
}
.specialty-card p {
  color: var(--theme-copy);
  font-size: .88rem;
  line-height: 1.58;
}

/* Audit */
.diagnostic-card-wrapper {
  padding: 42px;
}
.card-header { margin-bottom: 32px; }
.card-header h2 {
  color: var(--theme-ink);
  font-size: 1.9rem;
  line-height: 1.12;
}
.diagnostic-grid { gap: 38px; }
.diagnostic-steps { gap: 14px; }
.diagnostic-step {
  padding: 16px;
  border-color: #D4DCDA;
  background: var(--theme-warm);
}
.diagnostic-step h3 { color: var(--theme-green-dark); }
.diagnostic-step p {
  color: var(--theme-copy);
  font-size: .91rem;
  line-height: 1.55;
}
.diagnostic-summary-panel { padding: 28px; }
.diagnostic-summary-panel p,
.diagnostic-summary-panel span,
.diagnostic-summary-panel .mini-spec-item span,
.diagnostic-summary-panel .diagnostic-metric span { color: rgba(255,255,255,.9); }
.diagnostic-summary-panel .mini-spec-item strong { color: #FFFFFF; }

/* Contact et formulaire */
.contact-container { gap: 68px; }
.contact-info { gap: 22px; }
.contact-info h2 {
  max-width: 590px;
  color: #FFFFFF;
  font-size: clamp(2.65rem,4.5vw,4.35rem);
  line-height: 1.04;
}
.contact-info > p {
  max-width: 610px;
  color: #E7EFEA;
  font-size: 1rem;
  line-height: 1.7;
}
.contact-details { gap: 22px; margin-top: 10px; }
.detail-item { gap: 18px; }
.detail-icon {
  border-color: rgba(255,255,255,.22);
  background: rgba(255,255,255,.09);
  color: #D8E8D5;
}
.detail-texts span { color: #D5E1DA; }
.detail-texts strong,
.detail-texts strong a,
.detail-texts address { color: #FFFFFF; }
.contact-form-card {
  padding: 38px;
  border-color: rgba(255,255,255,.22);
}
.form-group label {
  margin-bottom: 7px;
  color: var(--theme-green-dark);
  font-size: .87rem;
  font-weight: 700;
}
.form-group :is(input, textarea, select) {
  min-height: 50px;
  border-color: #AAB7B0;
  color: var(--theme-ink);
  font-size: .94rem;
}
.form-group textarea { min-height: 126px; }
.form-group input::placeholder,
.form-group textarea::placeholder { color: #63716A; }
.form-privacy {
  color: #52615A;
  font-size: .8rem;
  line-height: 1.55;
}

/* Footer : suppression du grand vide sur mobile et meilleur contraste */
.main-footer { padding: 70px 24px 30px; }
.footer-container {
  gap: 62px;
  margin-bottom: 56px;
}
.footer-brand { gap: 16px; }
.logo-img-footer { width: 230px; }
.footer-brand p,
.footer-address,
.footer-col a,
.footer-bottom p { color: #D5E1DA; }
.footer-col h4 { color: #FFFFFF; }
.footer-brand p,
.footer-col a { font-size: .91rem; line-height: 1.55; }
.footer-address { margin-top: 10px; }
.footer-links-grid { gap: 34px; }
.footer-col { gap: 13px; }
.footer-bottom { padding-top: 28px; }

/* Pages légales */
body.legal-page { background: #F7F9F8; }
body.legal-page .legal-hero {
  min-height: auto !important;
  padding: 148px 24px 48px !important;
  background: linear-gradient(180deg,#FFFFFF 0%,#F7F9F8 100%) !important;
}
body.legal-page .legal-hero .hero-container {
  width: 100%;
  max-width: 900px;
  margin-inline: auto;
  grid-template-columns: minmax(0, 1fr) !important;
}
body.legal-page .legal-hero-content {
  width: 100%;
  max-width: 900px !important;
  margin-inline: auto;
  align-items: center !important;
  justify-self: center;
  text-align: center !important;
}
body.legal-page .legal-hero .hero-catchline {
  margin: 0 !important;
  color: var(--theme-ink) !important;
  font-size: clamp(2.65rem,5vw,4.2rem) !important;
  line-height: 1.05 !important;
}
body.legal-page .legal-content-section {
  width: 100%;
  padding: 0 24px 92px !important;
}
body.legal-page .legal-panel {
  width: 100%;
  max-width: 900px !important;
  margin-inline: auto !important;
  padding: 46px 50px !important;
  border: 1px solid var(--theme-line) !important;
  border-radius: 24px !important;
  background: #FFFFFF !important;
  color: var(--theme-copy) !important;
  line-height: 1.75 !important;
  box-shadow: 0 18px 50px rgba(42,47,54,.07) !important;
  backdrop-filter: none !important;
}
body.legal-page .legal-panel h2 {
  margin: 32px 0 12px !important;
  color: var(--theme-green-dark) !important;
  font-size: 1.45rem !important;
  line-height: 1.25 !important;
}
body.legal-page .legal-panel h2:first-child { margin-top: 0 !important; }
body.legal-page .legal-panel p {
  margin-bottom: 0 !important;
  color: var(--theme-copy) !important;
}
body.legal-page .legal-panel a {
  color: var(--theme-teal);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

@keyframes hero-enter {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1050px) {
  body.home-page #home.hero-section { min-height: auto; }
  body.home-page #home .hero-container {
    grid-template-columns: 1fr;
    gap: 48px;
  }
  body.home-page #home .hero-content { max-width: 790px; }
  body.home-page #home .hero-visual { order: initial; }
  .services-grid { gap: 20px; }
  .service-card { min-height: auto; }
}

@media (max-width: 800px) {
  section { padding: 68px 18px; }
  .header-container { min-height: 72px; }
  .main-header { padding-inline: 18px; }
  .logo-img-main { width: 184px; }
  .section-header { margin-bottom: 34px; }
  .section-header h2 {
    font-size: clamp(2rem,9vw,2.65rem);
    line-height: 1.08;
  }
  .section-header p {
    margin-top: 14px;
    font-size: .96rem;
    line-height: 1.66;
  }

  body.home-page #home.hero-section {
    padding: 112px 18px 62px;
  }
  body.home-page #home .hero-container { gap: 42px; }
  body.home-page #home .hero-catchline {
    margin-bottom: 22px;
    font-size: clamp(2.65rem,11.5vw,3.45rem);
    line-height: 1.02;
    letter-spacing: -.055em;
  }
  body.home-page #home .hero-content p {
    font-size: 1rem;
    line-height: 1.7;
  }
  body.home-page #home .hero-actions { margin-top: 28px; }
  body.home-page #home .visual-wrapper {
    min-height: 500px;
    border-radius: 28px 28px 28px 10px;
  }
  body.home-page #home .visual-wrapper::before {
    top: 18px;
    max-width: calc(100% - 32px);
    padding: 7px 11px;
    font-size: .65rem;
    letter-spacing: .075em;
  }

  .metrics-section { padding: 28px 18px 48px; }
  .metrics-container {
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 0;
    padding: 4px;
    border-radius: 24px;
  }
  .metric-card {
    min-height: 116px;
    padding: 16px 10px;
  }
  .metric-card + .metric-card { border-left: 0; }
  .metric-card:nth-child(even) { border-left: 1px solid rgba(255,255,255,.14); }
  .metric-card:nth-child(n+3) { border-top: 1px solid rgba(255,255,255,.14); }
  .metric-card .metric-value,
  .metric-card h3 { font-size: 1.9rem; }
  .metric-card > p:last-child {
    font-size: .73rem;
    line-height: 1.38;
  }

  .services-section { padding: 64px 18px 72px; }
  .specialites-section { padding: 64px 18px 68px; }
  .interactive-grid-section { padding: 62px 18px 72px; }
  .contact-section { padding: 72px 18px; }

  .service-card {
    gap: 18px;
    padding: 28px 22px;
    border-radius: 25px 25px 25px 9px;
  }
  .service-card h3 {
    margin-top: 18px;
    font-size: 1.38rem;
  }
  .service-card > p {
    margin: 7px 0 15px;
    font-size: .95rem;
  }
  .card-list li { font-size: .87rem; }
  .card-featured { padding-top: 66px; }
  .card-featured::before { top: 20px; right: 18px; }
  .card-featured .card-icon { margin-top: 0; }

  .specialty-card {
    min-height: auto;
    padding: 24px 22px;
  }
  .specialty-card h3,
  .specialty-card h4 { font-size: 1.1rem; }
  .specialty-card p { font-size: .92rem; line-height: 1.62; }

  .diagnostic-card-wrapper { padding: 24px; }
  .card-header { margin-bottom: 24px; }
  .card-header h2 {
    font-size: clamp(1.65rem,7.2vw,2rem);
    line-height: 1.08;
  }
  .diagnostic-grid { gap: 26px; }
  .diagnostic-step { gap: 13px; padding: 15px; }
  .diagnostic-summary-panel { padding: 24px 20px; }

  .contact-container { gap: 42px; }
  .contact-info h2 {
    font-size: clamp(2.35rem,10.5vw,3rem);
    line-height: 1.03;
  }
  .contact-form-card { padding: 26px 22px; }
  .form-group :is(input, textarea, select) { font-size: 1rem; }

  .main-footer { padding: 54px 20px 26px; }
  .footer-container {
    gap: 36px;
    margin-bottom: 42px;
  }
  .footer-brand { gap: 14px; }
  .logo-img-footer { width: 210px; }
  .footer-links-grid { gap: 28px; }
  .footer-bottom { padding-top: 24px; }

  body.legal-page .legal-hero { padding: 118px 18px 38px !important; }
  body.legal-page .legal-content-section { padding: 0 18px 70px !important; }
  body.legal-page .legal-panel {
    padding: 28px 24px !important;
    border-radius: 20px !important;
  }
  body.legal-page .legal-panel h2 {
    margin-top: 26px !important;
    font-size: 1.28rem !important;
  }
}

@media (max-width: 420px) {
  .logo-img-main { width: 174px; }
  body.home-page #home.hero-section { padding-top: 104px; }
  body.home-page #home .hero-badge {
    padding: 8px 10px;
    font-size: .61rem;
    letter-spacing: .075em;
  }
  body.home-page #home .visual-wrapper { min-height: 485px; }
  .metric-card { min-height: 120px; }
  .contact-info h2 { font-size: 2.35rem; }
}

@media (prefers-reduced-motion: reduce) {
  body.home-page #home .hero-content > * { animation: none !important; }
}

/* Neutralise les anciennes propriétés de masque/inset du pseudo-élément du visual wrapper. */
body.home-page #home .visual-wrapper::before {
  inset: 22px auto auto 50%;
  right: auto;
  bottom: auto;
  width: max-content;
  max-width: calc(100% - 52px);
  height: auto;
  min-height: 0;
  text-align: center;
  background: rgba(255,255,255,.94);
  background-size: auto;
  -webkit-mask-image: none;
  mask-image: none;
  transform: translateX(-50%);
  transition: none;
}

/* Correctifs de contraste sur les surfaces claires.
   Ces sélecteurs restent volontairement limités aux cartes blanches : les
   panneaux verts conservent leur texte clair. */
body.home-page #home .visual-wrapper,
.service-card:not(.card-featured),
.specialty-card,
.diagnostic-card-wrapper,
.contact-form-card {
  color: var(--theme-ink);
}

.service-card:not(.card-featured) h3,
.specialty-card :is(h3, h4),
.diagnostic-card-wrapper > .card-header h2,
.contact-form-card :is(h2, h3) {
  color: var(--theme-green-dark);
}

.service-card:not(.card-featured) > p,
.service-card:not(.card-featured) .card-list li,
.specialty-card p,
.diagnostic-step p,
.contact-form-card p,
body.home-page #home .node-details-card p {
  color: var(--theme-copy);
}

/* Respiration régulière autour de la carte interactive du hero. */
body.home-page #home .hero-visual {
  padding: 24px 14px 16px;
}

@media (max-width: 1050px) {
  body.home-page #home .hero-visual {
    margin-top: 8px;
    padding-top: 28px;
  }
}

@media (max-width: 800px) {
  body.home-page #home .hero-visual {
    margin-top: 4px;
    padding: 24px 0 10px;
  }

  body.home-page #home .visual-wrapper::before {
    top: 18px;
    max-width: calc(100% - 32px);
  }
}
