/* automatisation-usine.com — design system v1 (orange sécurité + graphite), polices système, zéro dépendance */
:root {
  --ink: #1a1c1e;
  --ink-2: #232629;
  --ink-soft: #383c40;
  --text: #2d3033;
  --muted: #63666b;
  --accent: #c2410c;
  --accent-strong: #9a3412;
  --accent-soft: #fef0e7;
  --steel: #0369a1;
  --steel-soft: #e0f2fe;
  --gold: #d97706;
  --gold-soft: #fdf3e0;
  --border: #e8e6e3;
  --bg-quiet: #faf9f7;
  --max: 62rem;
  --radius: 0.9rem;
  --shadow-sm: 0 1px 2px rgba(26, 28, 30, .05), 0 1px 8px rgba(26, 28, 30, .04);
  --shadow-md: 0 6px 24px -8px rgba(26, 28, 30, .14), 0 2px 8px -2px rgba(26, 28, 30, .06);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  line-height: 1.7;
  font-size: 1.0625rem;
  background: #fff;
  -webkit-font-smoothing: antialiased;
}
.container { max-width: var(--max); margin: 0 auto; padding: 0 1.4rem; }

::selection { background: var(--accent); color: #fff; }

/* ===== Header — sticky, translucide ===== */
header.site {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}
header.site .container {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: .5rem;
  padding-top: .85rem; padding-bottom: .85rem;
}
.brand {
  font-weight: 800; color: var(--ink); text-decoration: none;
  font-size: 1.05rem; letter-spacing: .005em;
}
.brand span { color: var(--accent); }
nav.main { display: flex; gap: .35rem; flex-wrap: wrap; }
nav.main a {
  color: var(--muted); text-decoration: none; font-size: .9rem; font-weight: 500;
  padding: .35rem .65rem; border-radius: 99px;
  transition: color .15s ease, background .15s ease;
}
nav.main a:hover { color: var(--ink); background: var(--bg-quiet); }
nav.main a[aria-current="page"] { color: var(--accent-strong); background: var(--accent-soft); }

/* ===== Nav mobile : bande à défilement horizontal (≤640px) ===== */
@media (max-width: 640px) {
  header.site .container { flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: .3rem; }
  nav.main {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* min/max-width : empêche la nav (flex item) de pousser le header au-delà du viewport */
    min-width: 0;
    width: 100%;
    max-width: 100%;
    padding-bottom: .35rem;
    border-bottom: 2px solid var(--accent-soft);
  }
  nav.main::-webkit-scrollbar { display: none; }
  nav.main a { flex: 0 0 auto; }
  .brand { min-width: 0; }
}

/* ===== Hero — sombre, trame de circuit ===== */
.hero {
  position: relative;
  background:
    radial-gradient(60rem 28rem at 85% -20%, rgba(194, 65, 12, .32), transparent 60%),
    radial-gradient(40rem 22rem at 5% 120%, rgba(3, 105, 161, .18), transparent 55%),
    linear-gradient(165deg, var(--ink) 0%, var(--ink-2) 55%, #2b2118 100%);
  padding: 4.4rem 0 3.6rem;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(70rem 30rem at 50% 0%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(70rem 30rem at 50% 0%, #000 30%, transparent 75%);
  pointer-events: none;
}
.hero .container { position: relative; }
.hero h1 {
  color: #fff;
  font-size: clamp(1.8rem, 1.2rem + 2.6vw, 2.9rem);
  line-height: 1.14;
  margin: 0 0 1.1rem;
  letter-spacing: -.02em;
  font-weight: 800;
  max-width: 50rem;
  text-wrap: balance;
}
.hero p.lead {
  font-size: 1.16rem;
  color: rgba(238, 236, 232, .84);
  max-width: 44rem;
  margin: 0;
}
.hero .page-dates { font-size: .85rem; color: rgba(238, 236, 232, .55); margin: 1rem 0 0; }
/* Eyebrow auto : généré au-dessus du H1 du hero, sans toucher au HTML */
.hero h1::before {
  content: "Automatisation · Robotique · MES · Exécution";
  display: block;
  width: fit-content;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #7dd3fc;
  background: rgba(3, 105, 161, .22);
  border: 1px solid rgba(125, 211, 252, .35);
  border-radius: 99px;
  padding: .3rem .85rem;
  margin-bottom: 1.2rem;
}

/* ===== Sections ===== */
main section { padding: 3rem 0; }
main section.quiet {
  background: var(--bg-quiet);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
h2 {
  color: var(--ink);
  font-size: clamp(1.35rem, 1.1rem + 1vw, 1.7rem);
  margin: 0 0 1.1rem;
  letter-spacing: -.015em;
  font-weight: 750;
}
h3 { color: var(--ink-soft); font-size: 1.14rem; margin: 1.7rem 0 .55rem; font-weight: 700; }
p { margin: 0 0 1.05rem; }
a { color: var(--accent-strong); text-decoration-thickness: 1px; text-underline-offset: 3px; transition: color .15s ease; }
a:hover { color: var(--accent); }
ul, ol { padding-left: 1.35rem; }
li { margin-bottom: .5rem; }
li::marker { color: var(--accent); font-weight: 700; }

/* ===== Cards ===== */
.grid { display: grid; gap: 1.15rem; }
@media (min-width: 720px) { .grid.c3 { grid-template-columns: repeat(3, 1fr); } .grid.c2 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid { gap: .8rem; } }
.card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.4rem 1.3rem;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  overflow: hidden;
}
@media (max-width: 640px) { .card { padding: 1.15rem 1.05rem 1rem; } }
.card::after {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), #fbbf24);
  opacity: 0;
  transition: opacity .18s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: #ddd8d0;
}
.card:hover::after { opacity: 1; }
.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }
.card .tag {
  display: inline-block;
  font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent-strong); background: var(--accent-soft);
  border-radius: 99px; padding: .22rem .7rem; margin-bottom: .7rem;
}
.card a { font-weight: 600; text-decoration: none; }
.card a:hover { text-decoration: underline; }

/* ===== Classement ===== */
.rank-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.5rem 1.3rem;
  background: #fff;
  box-shadow: var(--shadow-sm);
  margin: 0 0 1.1rem;
}
.rank-card.top {
  border: 2px solid var(--accent);
  box-shadow: 0 10px 32px -12px rgba(194, 65, 12, .35);
}
.rank-card h3 { margin: 0 0 .35rem; font-size: 1.3rem; }
.rank-card p:last-child { margin-bottom: 0; }
.rank-num {
  display: grid; place-items: center;
  width: 3.1rem; height: 3.1rem;
  border-radius: .85rem;
  font-size: 1.35rem; font-weight: 800;
  color: var(--accent-strong); background: var(--accent-soft);
}
.rank-card.top .rank-num { color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-strong)); }
.rank-ribbon {
  position: absolute; top: -0.8rem; right: 1.2rem;
  font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  border-radius: 99px; padding: .28rem .85rem;
  box-shadow: 0 6px 16px -6px rgba(154, 52, 18, .6);
}
.rank-meta { font-size: .85rem; color: var(--muted); margin: 0 0 .6rem; }
.rank-meta strong { color: var(--ink-soft); }
@media (max-width: 640px) {
  .rank-card { grid-template-columns: 1fr; gap: .6rem; padding: 1.15rem 1.05rem 1rem; }
}

/* ===== Callouts ===== */
.callout {
  border-left: 4px solid var(--gold);
  background: var(--gold-soft);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.15rem 1.4rem;
  margin: 1.6rem 0;
  box-shadow: var(--shadow-sm);
}
.callout p:last-child { margin-bottom: 0; }
@media (max-width: 640px) { .callout { padding: .9rem 1rem; } }

/* ===== Encadré « À retenir » (GEO) ===== */
.takeaways {
  border: 1px solid #f5ddcb;
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fdf3ea, #fffdfb);
  padding: 1.4rem 1.6rem 1.2rem;
  margin: 1.6rem 0 2rem;
  box-shadow: var(--shadow-sm);
}
@media (max-width: 640px) { .takeaways { padding: 1.05rem 1.1rem .95rem; } }
.takeaways h2 {
  font-size: .82rem;
  margin-bottom: .8rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent-strong);
}
.takeaways ul { margin: 0; }
.takeaways li { margin-bottom: .55rem; }
.takeaways li:last-child { margin-bottom: 0; }

/* ===== Tables ===== */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 1.4rem 0; }
.table-wrap table { margin: 0; }
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: .95rem;
  margin: 1.4rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
th {
  text-align: left;
  color: #fff;
  background: var(--ink-soft);
  font-weight: 650;
  letter-spacing: .01em;
}
th, td { padding: .75rem .9rem; vertical-align: top; }
td { border-top: 1px solid var(--border); }
tbody tr:nth-child(even) td { background: var(--bg-quiet); }
tbody tr:hover td { background: var(--accent-soft); }

/* ===== Glossaire ===== */
dl dt {
  font-weight: 750; color: var(--ink); margin-top: 1.25rem;
  padding-left: .8rem; border-left: 3px solid var(--steel);
}
dl dd { margin: .3rem 0 0 .8rem; color: var(--text); }

/* ===== Footer — sombre ===== */
footer.site {
  border-top: none;
  background: linear-gradient(180deg, var(--ink-2), var(--ink));
  margin-top: 3rem;
  color: rgba(238, 236, 232, .65);
}
footer.site .container { padding-top: 2.2rem; padding-bottom: 2.4rem; font-size: .89rem; }
footer.site nav { display: flex; gap: .4rem 1.2rem; flex-wrap: wrap; margin-bottom: 1rem; }
footer.site a { color: rgba(238, 236, 232, .8); text-decoration: none; }
footer.site a:hover { color: #fff; text-decoration: underline; }
footer.site p { margin: 0; }

/* ===== Divers ===== */
.crumb { font-size: .85rem; color: var(--muted); margin-bottom: .8rem; }
.hero .crumb { color: rgba(238, 236, 232, .6); }
.hero .crumb a { color: rgba(238, 236, 232, .75); }
.crumb a { color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: .88rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card, .card::after, nav.main a, a { transition: none; }
  .card:hover { transform: none; }
}

/* ===== Bandeau contact (home) ===== */
.contact-band {
  background:
    radial-gradient(50rem 24rem at 15% -10%, rgba(194, 65, 12, .28), transparent 60%),
    radial-gradient(36rem 20rem at 95% 110%, rgba(3, 105, 161, .16), transparent 55%),
    linear-gradient(160deg, var(--ink) 0%, var(--ink-2) 60%, #2b2118 100%);
  padding: 4rem 0 4.4rem;
}
.contact-band h2 { color: #fff; font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.1rem); }
.contact-band .pitch { color: rgba(238, 236, 232, .84); }
.contact-band .pitch li { margin-bottom: .7rem; }
.contact-band .pitch li::marker { color: #7dd3fc; }
.contact-band .pitch a { color: #fff; }
.contact-grid { display: grid; gap: 2.2rem; align-items: start; }
@media (min-width: 860px) { .contact-grid { grid-template-columns: 1fr 1.15fr; } }

.contact-card {
  background: #fff;
  border-radius: 1.1rem;
  padding: 1.9rem 1.8rem;
  box-shadow: 0 24px 60px -24px rgba(15, 12, 8, .55);
}
@media (max-width: 640px) { .contact-card { padding: 1.3rem 1.15rem; } }
.form-2col { display: grid; gap: 0 1rem; }
@media (min-width: 560px) { .form-2col { grid-template-columns: 1fr 1fr; } }
.form-row { margin: 0 0 1.05rem; }
.form-row label { display: block; font-weight: 650; color: var(--ink); font-size: .88rem; margin-bottom: .3rem; }
.form-row input, .form-row textarea {
  width: 100%; font: inherit; color: var(--text);
  border: 1px solid var(--border); border-radius: .6rem;
  padding: .65rem .8rem; background: var(--bg-quiet);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.form-row input:focus, .form-row textarea:focus {
  outline: none; border-color: var(--accent); background: #fff;
  box-shadow: 0 0 0 3px rgba(194, 65, 12, .14);
}
.form-hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }
#lf-submit {
  width: 100%; font: inherit; font-size: 1.02rem; font-weight: 750; color: #fff; cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  border: none; border-radius: .7rem; padding: .9rem 1.6rem;
  box-shadow: 0 10px 24px -10px rgba(154, 52, 18, .55);
  transition: transform .15s ease, box-shadow .15s ease;
}
#lf-submit:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 14px 30px -10px rgba(154, 52, 18, .65); }
#lf-submit:disabled { opacity: .65; cursor: default; }
.form-legal { font-size: .78rem; color: var(--muted); margin: .8rem 0 0; }
.form-success { color: #15803d; font-weight: 650; margin-top: .8rem; }
.form-error { color: #b91c1c; font-weight: 650; margin-top: .8rem; }

/* ===== Diagnostic de maturité (page /diagnostic) ===== */
.quiz fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
  padding: 1.15rem 1.3rem 1rem;
  margin: 0 0 1rem;
}
.quiz legend {
  font-weight: 700; color: var(--ink);
  padding: 0 .4rem;
}
.quiz .q-axe {
  display: inline-block; font-size: .7rem; font-weight: 800;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--steel); background: var(--steel-soft);
  border-radius: 99px; padding: .18rem .65rem; margin-bottom: .5rem;
}
.quiz label.opt {
  display: flex; align-items: baseline; gap: .6rem;
  padding: .45rem .6rem; border-radius: .55rem; cursor: pointer;
  transition: background .12s ease;
}
.quiz label.opt:hover { background: var(--bg-quiet); }
.quiz label.opt:has(input:checked) { background: var(--accent-soft); }
.quiz input[type="radio"] { accent-color: var(--accent); flex: 0 0 auto; }
#dx-submit {
  font: inherit; font-size: 1.02rem; font-weight: 750; color: #fff; cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  border: none; border-radius: .7rem; padding: .85rem 1.8rem;
  box-shadow: 0 10px 24px -10px rgba(154, 52, 18, .55);
}
#dx-submit:disabled { opacity: .6; cursor: default; }
.dx-result {
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fdf3ea, #fffdfb);
  padding: 1.5rem 1.6rem;
  margin: 1.6rem 0;
  box-shadow: var(--shadow-md);
}
.dx-result h2 { margin-top: 0; }
.dx-score { font-size: 2.1rem; font-weight: 800; color: var(--accent-strong); }
.dx-axes { display: grid; gap: .55rem; margin: 1rem 0 1.2rem; }
.dx-axe-row { display: grid; grid-template-columns: 11rem 1fr 2.6rem; gap: .7rem; align-items: center; font-size: .9rem; }
@media (max-width: 560px) { .dx-axe-row { grid-template-columns: 1fr; gap: .15rem; } }
.dx-bar { height: .55rem; border-radius: 99px; background: var(--border); overflow: hidden; }
.dx-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #fbbf24); border-radius: 99px; }
.dx-missing { color: #b91c1c; font-weight: 650; }
