﻿/* =========================================================
   malfacon.pro — main.css
   Design: institutional, calm, accessible (WCAG AA)
   Palette:
     Navy      #1a3a5c
     White     #ffffff
     Light BG  #f5f7fa
     Amber     #f59e0b  (warnings only — never red)
     Text dark #1a1a2e
     Text muted #5a6a7a
     Border    #d1dbe8
     Active    #2e7d32 (green — sufficient contrast on white)
   ========================================================= */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
  background-color: #ffffff; color: #1a1a2e; line-height: 1.6;
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: #1a3a5c; text-decoration: underline; }
a:hover, a:focus { color: #0d2540; outline: 2px solid #1a3a5c; outline-offset: 2px; border-radius: 2px; }

/* Skip link */
.skip-link { position: absolute; top: -100%; left: 0; background: #1a3a5c; color: #fff;
  padding: 0.5rem 1rem; z-index: 1000; font-weight: 600; text-decoration: none; border-radius: 0 0 4px 0; }
.skip-link:focus { top: 0; outline: 3px solid #f59e0b; outline-offset: 2px; }

/* Layout */
.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 1.25rem; }
.container--narrow { max-width: 760px; }
main { flex: 1; }

/* Header */
.site-header { background-color: #1a3a5c; color: #fff; border-bottom: 3px solid #f59e0b; }
.site-header__inner { display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 64px; padding: 0.75rem 1.25rem; max-width: 1100px; margin: 0 auto; }
.site-header__logo { display: flex; flex-direction: column; text-decoration: none; color: #fff; line-height: 1.1; }
.site-header__logo:hover, .site-header__logo:focus { outline-color: #f59e0b; }
.logo__name { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.02em; }
.logo__tld { color: #f59e0b; }
.logo__tagline { font-size: 0.72rem; opacity: 0.85; }
.site-nav { display: flex; align-items: center; gap: 0.25rem; flex-wrap: wrap; }
.site-nav a { color: #d1dbe8; text-decoration: none; font-size: 0.875rem; font-weight: 500;
  padding: 0.4rem 0.75rem; border-radius: 4px; transition: background-color 0.15s, color 0.15s; white-space: nowrap; }
.site-nav a:hover, .site-nav a:focus { background-color: rgba(255,255,255,0.12); color: #fff;
  outline: 2px solid #f59e0b; outline-offset: 2px; }
.site-nav a[aria-current="page"] { color: #fff; background-color: rgba(255,255,255,0.15); }

/* Hero */
.hero { background: linear-gradient(160deg, #1a3a5c 0%, #24527a 100%);
  color: #fff; padding: 4rem 1.25rem 4.5rem; text-align: center; }
.hero__eyebrow { display: inline-block; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; background-color: rgba(245,158,11,0.2); color: #fbbf24;
  border: 1px solid rgba(245,158,11,0.4); border-radius: 20px; padding: 0.25rem 0.85rem; margin-bottom: 1.25rem; }
.hero__title { font-size: clamp(1.75rem, 4vw, 2.6rem); font-weight: 700; line-height: 1.2;
  margin-bottom: 1rem; max-width: 700px; margin-left: auto; margin-right: auto; }
.hero__subtitle { font-size: clamp(1rem, 2vw, 1.15rem); color: rgba(255,255,255,0.85);
  max-width: 620px; margin: 0 auto 2.5rem; line-height: 1.65; }

/* Search form */
.search-form {
  display: flex;
  align-items: stretch;
  max-width: 680px;
  margin: 0 auto;
  box-shadow: 0 6px 28px rgba(0,0,0,0.30);
  border-radius: 10px;
  /* NO overflow:hidden — it clips the autocomplete dropdown */
}
.search-input-wrapper {
  position: relative;
  flex: 1;
  min-width: 0;
  background: #fff;
  border-radius: 10px 0 0 10px;
  display: flex;
  align-items: center;
}
.search-form__input {
  width: 100%;
  border: none;
  padding: 1rem 1.2rem;
  font-size: 1.05rem;
  font-family: inherit;
  color: #1a1a2e;
  background: transparent;
  outline: none;
  border-radius: 10px 0 0 10px;
}
.search-form__input::placeholder { color: #8fa3b1; }
.search-input-wrapper:focus-within {
  box-shadow: inset 0 0 0 3px #f59e0b;
  border-radius: 10px 0 0 10px;
}
.search-form__button {
  flex-shrink: 0;
  border: none;
  background-color: #f59e0b;
  color: #1a1a2e;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  padding: 1rem 1.75rem;
  cursor: pointer;
  white-space: nowrap;
  border-radius: 0 10px 10px 0;
  transition: background-color 0.15s;
}
.search-form__button:hover { background-color: #d97706; }
.search-form__button:focus { outline: 3px solid #fff; outline-offset: -3px; }
.search-form__hint { font-size: 0.8rem; color: rgba(255,255,255,0.65); margin-top: 0.85rem; text-align: center; }

/* Stats */
.stats-section { background-color: #f5f7fa; border-top: 1px solid #d1dbe8;
  border-bottom: 1px solid #d1dbe8; padding: 2.5rem 1.25rem; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem;
  max-width: 860px; margin: 0 auto; text-align: center; }
.stat-card { background: #fff; border: 1px solid #d1dbe8; border-radius: 8px;
  padding: 1.5rem 1rem; box-shadow: 0 1px 4px rgba(26,58,92,0.06); }
.stat-card__number { display: block; font-size: 2rem; font-weight: 700;
  color: #1a3a5c; line-height: 1; margin-bottom: 0.35rem; }
.stat-card__label { font-size: 0.875rem; color: #5a6a7a; font-weight: 500; }

/* How-it-works */
.how-section { padding: 4rem 1.25rem; }
.section-title { font-size: clamp(1.3rem, 3vw, 1.75rem); font-weight: 700;
  color: #1a3a5c; text-align: center; margin-bottom: 2.5rem; }
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem;
  max-width: 900px; margin: 0 auto; }
.step-card { text-align: center; }
.step-card__number { display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; background-color: #1a3a5c; color: #fff;
  font-weight: 700; font-size: 1.2rem; border-radius: 50%; margin-bottom: 1rem; }
.step-card__title { font-weight: 600; color: #1a3a5c; margin-bottom: 0.5rem; font-size: 1rem; }
.step-card__text { font-size: 0.9rem; color: #5a6a7a; line-height: 1.55; }

/* Info banner */
.info-banner { background-color: #fffbeb; border: 1px solid #fde68a;
  border-left: 4px solid #f59e0b; border-radius: 6px; padding: 1rem 1.25rem;
  margin: 0 auto 3rem; max-width: 860px; font-size: 0.9rem; color: #78350f; line-height: 1.55; }

/* Page hero (inner pages) */
.page-hero { background-color: #1a3a5c; color: #fff; padding: 2.5rem 1.25rem;
  border-bottom: 3px solid #f59e0b; }
.page-hero__container { max-width: 1100px; margin: 0 auto; }
.page-hero__label { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: #f59e0b; margin-bottom: 0.5rem; }
.page-hero__title { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 700;
  line-height: 1.2; margin-bottom: 0.5rem; }
.page-hero__subtitle { font-size: 0.95rem; color: rgba(255,255,255,0.8); max-width: 600px; }

/* Search bar inline */
.search-bar-inline { background-color: #f5f7fa; border-bottom: 1px solid #d1dbe8; padding: 1rem 1.25rem; }
.search-bar-inline .search-form { max-width: 720px; margin: 0; box-shadow: 0 2px 10px rgba(0,0,0,0.08); }
.search-bar-inline .search-input-wrapper { background: #fff; border: 1px solid #d1dbe8; border-right: none; border-radius: 8px 0 0 8px; }
.search-bar-inline .search-form__input { border-radius: 8px 0 0 8px; font-size: 0.97rem; padding: 0.8rem 1rem; }
.search-bar-inline .search-form__button { border-radius: 0 8px 8px 0; padding: 0.8rem 1.4rem; font-size: 0.95rem; }
.search-bar-inline .search-input-wrapper:focus-within { box-shadow: inset 0 0 0 2px #f59e0b; border-color: transparent; border-radius: 8px 0 0 8px; }

/* Results layout */
.results-layout { max-width: 900px; margin: 2rem auto; padding: 0 1.25rem; }

/* Company card */
.company-card { background: #fff; border: 1px solid #d1dbe8; border-radius: 8px;
  padding: 1.5rem; margin-bottom: 1.5rem; box-shadow: 0 1px 4px rgba(26,58,92,0.06); }
.company-card__header { display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.company-card__name { font-size: 1.4rem; font-weight: 700; color: #1a3a5c; line-height: 1.2; }
.badge { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.8rem;
  font-weight: 600; padding: 0.3rem 0.75rem; border-radius: 20px; white-space: nowrap; flex-shrink: 0; }
.badge--active { background-color: #dcfce7; color: #166534; border: 1px solid #86efac; }
.badge--active::before { content: ""; display: inline-block; width: 8px; height: 8px;
  background-color: #22c55e; border-radius: 50%; }
.badge--neutral { background-color: #e0f2fe; color: #0c4a6e; border: 1px solid #7dd3fc; }
.company-card__meta { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem 1.5rem; }
.meta-item { display: flex; flex-direction: column; gap: 0.1rem; }
.meta-item__label { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: #5a6a7a; }
.meta-item__value { font-size: 0.95rem; color: #1a1a2e; font-weight: 500; }

/* Clean result */
.result-clean { background-color: #f0fdf4; border: 1px solid #86efac;
  border-left: 4px solid #22c55e; border-radius: 6px; padding: 1.25rem 1.5rem; margin-bottom: 1.5rem; }
.result-clean__title { font-weight: 700; color: #166534; margin-bottom: 0.35rem; font-size: 1rem; }
.result-clean__text { font-size: 0.9rem; color: #166534; }

/* Warning banner (amber) */
.warning-banner { background-color: #fffbeb; border: 1px solid #fde68a;
  border-left: 4px solid #f59e0b; border-radius: 6px; padding: 1.25rem 1.5rem; margin-bottom: 1.5rem; }
.warning-banner__title { font-weight: 700; color: #92400e; margin-bottom: 0.35rem;
  font-size: 1rem; display: flex; align-items: center; gap: 0.4rem; }
.warning-banner__text { font-size: 0.9rem; color: #78350f; line-height: 1.55; }

/* Data table */
.table-section { margin-bottom: 1.5rem; }
.table-section__title { font-size: 1rem; font-weight: 700; color: #1a3a5c;
  margin-bottom: 0.75rem; padding-bottom: 0.5rem; border-bottom: 2px solid #d1dbe8; }
.data-table-wrapper { overflow-x: auto; border: 1px solid #d1dbe8; border-radius: 8px;
  box-shadow: 0 1px 4px rgba(26,58,92,0.06); }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; min-width: 520px; }
.data-table thead { background-color: #f5f7fa; }
.data-table th { padding: 0.75rem 1rem; text-align: left; font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase; color: #5a6a7a;
  border-bottom: 2px solid #d1dbe8; white-space: nowrap; }
.data-table td { padding: 0.85rem 1rem; border-bottom: 1px solid #e8eef5;
  color: #1a1a2e; vertical-align: top; line-height: 1.4; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background-color: #f9fafc; }
.data-table .source-link { font-size: 0.8rem; color: #1a3a5c; white-space: nowrap; }

/* Criticality tag */
.criticality-tag {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-size: 0.82rem; font-weight: 700; letter-spacing: 0.03em;
  padding: 0.4rem 0.9rem; border-radius: 20px; border: 1.5px solid transparent;
  white-space: nowrap; flex-shrink: 0;
}
.criticality-tag__dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.criticality-tag--fiable    { background: #dcfce7; color: #14532d; border-color: #86efac; }
.criticality-tag--fiable    .criticality-tag__dot { background: #16a34a; }
.criticality-tag--surveiller { background: #fef9c3; color: #713f12; border-color: #fde047; }
.criticality-tag--surveiller .criticality-tag__dot { background: #ca8a04; }
.criticality-tag--prudence  { background: #ffedd5; color: #7c2d12; border-color: #fb923c; }
.criticality-tag--prudence  .criticality-tag__dot { background: #ea580c; }
.criticality-tag--eviter    { background: #ffe4e6; color: #7f1d1d; border-color: #fda4af; }
.criticality-tag--eviter    .criticality-tag__dot { background: #be123c; }

.criticality-block {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px;
  padding: 0.85rem 1.1rem; margin-bottom: 1.25rem;
}
.criticality-block__label { font-size: 0.82rem; color: #5a6a7a; font-weight: 500; }
.criticality-block__methodology { font-size: 0.78rem; color: #5a6a7a; margin-left: auto; }
.criticality-block__methodology a { color: #1a3a5c; }

/* Confidence */
.confidence-indicator { display: inline-flex; align-items: center; gap: 0.5rem;
  background-color: #f5f7fa; border: 1px solid #d1dbe8; border-radius: 6px;
  padding: 0.6rem 1rem; font-size: 0.875rem; margin-bottom: 1.5rem; }
.confidence-indicator__label { color: #5a6a7a; font-weight: 500; }
.confidence-indicator__value { font-weight: 700; color: #1a3a5c; }
.confidence-indicator--high .confidence-indicator__value { color: #166534; }
.confidence-indicator--possible .confidence-indicator__value { color: #92400e; }

/* Autocomplete */
.search-input-wrapper { position: relative; flex: 1; min-width: 0; }
.ac-dropdown { position: absolute; top: 100%; left: 0; right: 0; z-index: 200;
  background: #fff; border: 1px solid #d1dbe8; border-top: none;
  border-radius: 0 0 8px 8px; box-shadow: 0 8px 24px rgba(26,58,92,0.14);
  list-style: none; margin: 0; padding: 0; max-height: 360px; overflow-y: auto; }
.ac-item { display: flex; flex-direction: column; padding: 0.75rem 1rem;
  cursor: pointer; border-bottom: 1px solid #f0f4f8; gap: 0.15rem; }
.ac-item:last-child { border-bottom: none; border-radius: 0 0 8px 8px; }
.ac-item:hover, .ac-item--active { background-color: #edf2f8; }
.ac-name { font-size: 0.9rem; font-weight: 600; color: #1a1a2e; line-height: 1.3; }
.ac-sub  { font-size: 0.78rem; color: #5a6a7a; }
.ac-tag  { display: inline-block; font-size: 0.68rem; font-weight: 700;
  padding: 0.1rem 0.45rem; border-radius: 10px; margin-left: 0.35rem;
  vertical-align: middle; }
.ac-tag--ceased { background: #fee2e2; color: #991b1b; }

/* Spin animation for loading */
@keyframes spin { to { transform: rotate(360deg); } }

/* Network section (RBE / associés) */
.network-section { margin-bottom: 1.5rem; }
.network-section__toggle { display: flex; align-items: center; justify-content: space-between;
  width: 100%; background: #f5f7fa; border: 1px solid #d1dbe8; border-radius: 8px;
  padding: 1rem 1.25rem; cursor: pointer; font-family: inherit; font-size: 0.95rem;
  font-weight: 600; color: #1a3a5c; text-align: left; gap: 0.5rem; }
.network-section__toggle:hover { background: #edf2f8; }
.network-section__toggle:focus { outline: 2px solid #1a3a5c; outline-offset: 2px; border-radius: 8px; }
.network-section__toggle-icon { font-size: 1rem; transition: transform 0.2s; flex-shrink: 0; }
.network-section__toggle[aria-expanded="true"] .network-section__toggle-icon { transform: rotate(180deg); }
.network-section__body { border: 1px solid #d1dbe8; border-top: none; border-radius: 0 0 8px 8px;
  padding: 1.25rem; background: #fff; }
.network-section__source { font-size: 0.8rem; color: #5a6a7a; margin-bottom: 1rem; font-style: italic; }
.network-section__disclaimer { font-size: 0.8rem; color: #5a6a7a; margin-top: 1rem;
  padding-top: 0.75rem; border-top: 1px solid #e8eef5; line-height: 1.55; }

/* Source note & disclaimer */
.source-note { font-size: 0.8rem; color: #5a6a7a; padding: 0.75rem 0;
  border-top: 1px solid #e8eef5; margin-top: 0.5rem; }
.source-note strong { color: #1a1a2e; }
.disclaimer-box { background-color: #f5f7fa; border: 1px solid #d1dbe8; border-radius: 6px;
  padding: 1rem 1.25rem; font-size: 0.82rem; color: #5a6a7a; line-height: 1.6; margin-bottom: 1.5rem; }
.disclaimer-box strong { color: #1a1a2e; display: block; margin-bottom: 0.25rem; font-size: 0.85rem; }

/* No results */
.no-results { text-align: center; padding: 4rem 1.25rem; max-width: 500px; margin: 0 auto; }
.no-results__icon { font-size: 3rem; margin-bottom: 1rem; display: block; }
.no-results__title { font-size: 1.3rem; font-weight: 700; color: #1a3a5c; margin-bottom: 0.5rem; }
.no-results__text { color: #5a6a7a; font-size: 0.95rem; }

/* Prose pages */
.prose-layout { max-width: 760px; margin: 2.5rem auto; padding: 0 1.25rem 4rem; }
.prose-layout h2 { font-size: 1.35rem; font-weight: 700; color: #1a3a5c;
  margin-top: 2.5rem; margin-bottom: 0.85rem; padding-bottom: 0.4rem; border-bottom: 2px solid #e8eef5; }
.prose-layout h3 { font-size: 1.05rem; font-weight: 700; color: #1a3a5c;
  margin-top: 1.5rem; margin-bottom: 0.5rem; }
.prose-layout p { margin-bottom: 1rem; line-height: 1.7; color: #2d3a4a; font-size: 0.95rem; }
.prose-layout ul, .prose-layout ol { margin-bottom: 1rem; padding-left: 1.5rem; }
.prose-layout li { margin-bottom: 0.4rem; line-height: 1.6; color: #2d3a4a; font-size: 0.95rem; }
.info-card { background: #f5f7fa; border: 1px solid #d1dbe8; border-radius: 8px; padding: 1.25rem 1.5rem; margin-bottom: 1.5rem; }
.info-card__title { font-weight: 700; color: #1a3a5c; margin-bottom: 0.5rem; font-size: 0.95rem; }
.info-card p, .info-card li { font-size: 0.875rem; color: #3d4e5e; }
.confidence-table { width: 100%; border-collapse: collapse; font-size: 0.875rem;
  margin-bottom: 1.5rem; border: 1px solid #d1dbe8; border-radius: 8px; overflow: hidden; }
.confidence-table th { background-color: #f5f7fa; padding: 0.75rem 1rem; text-align: left;
  font-weight: 700; color: #1a3a5c; font-size: 0.82rem; text-transform: uppercase;
  letter-spacing: 0.05em; border-bottom: 2px solid #d1dbe8; }
.confidence-table td { padding: 0.75rem 1rem; border-bottom: 1px solid #e8eef5;
  color: #2d3a4a; font-size: 0.875rem; vertical-align: top; }
.confidence-table tr:last-child td { border-bottom: none; }
.level-high { font-weight: 700; color: #166534; }
.level-possible { font-weight: 700; color: #92400e; }
.limitation-list { list-style: none; padding: 0; }
.limitation-list li { padding: 0.6rem 0 0.6rem 1.5rem; border-bottom: 1px solid #e8eef5;
  position: relative; font-size: 0.9rem; }
.limitation-list li::before { content: "!"; position: absolute; left: 0; top: 0.65rem;
  width: 18px; height: 18px; background: #f59e0b; color: #1a1a2e; font-weight: 900;
  font-size: 0.7rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.limitation-list li:last-child { border-bottom: none; }

/* Footer */
.site-footer { background-color: #1a3a5c; color: rgba(255,255,255,0.75);
  padding: 2rem 1.25rem; margin-top: auto; font-size: 0.85rem; }
.site-footer__inner { max-width: 1100px; margin: 0 auto; display: grid;
  grid-template-columns: 1fr auto; gap: 1.5rem; align-items: center; }
.site-footer__sources { line-height: 1.6; }
.site-footer__sources strong { color: #fff; display: block; margin-bottom: 0.25rem; }
.site-footer__links { display: flex; flex-direction: column; gap: 0.4rem; text-align: right; }
.site-footer__links a { color: rgba(255,255,255,0.75); text-decoration: none;
  font-size: 0.82rem; transition: color 0.15s; }
.site-footer__links a:hover, .site-footer__links a:focus { color: #f59e0b; outline-color: #f59e0b; }
.site-footer__bottom { max-width: 1100px; margin: 1.5rem auto 0; padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.12); font-size: 0.78rem; color: rgba(255,255,255,0.5);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; }

/* Utilities */
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.text-center { text-align: center; }

/* Responsive */
@media (max-width: 680px) {
  .site-header__inner { flex-direction: column; align-items: flex-start; gap: 0.75rem; min-height: auto; }
  .site-nav a { padding: 0.35rem 0.55rem; font-size: 0.82rem; }
  .hero { padding: 2.5rem 1.25rem 3rem; }
  .search-form { flex-direction: column; border-radius: 10px; }
  .search-input-wrapper { border-radius: 10px 10px 0 0; }
  .search-form__input { border-radius: 10px 10px 0 0; border-bottom: 1px solid #e8eef5; }
  .search-form__button { border-radius: 0 0 10px 10px; text-align: center; padding: 0.9rem; }
  .stats-grid { grid-template-columns: 1fr; max-width: 320px; }
  .steps-grid { grid-template-columns: 1fr; max-width: 380px; margin: 0 auto; }
  .company-card__header { flex-direction: column; gap: 0.5rem; }
  .site-footer__inner { grid-template-columns: 1fr; }
  .site-footer__links { text-align: left; flex-direction: row; flex-wrap: wrap; gap: 0.5rem 1rem; }
}
@media (max-width: 420px) {
  .company-card__meta { grid-template-columns: 1fr; }
}
