/* =========================================================
   Ma matrice de recherche d'entreprise — ARAE x USMB
   Design tokens calés sur la charte graphique USMB
   ========================================================= */

:root {
  --navy: #002542;      /* couleur institutionnelle dominante */
  --blue: #10069f;      /* accent secondaire, interactif */
  --cyan: #009cdd;      /* accent tertiaire */
  --green: #009956;     /* validation / positif */
  --red: #ef3340;       /* alerte / éliminatoire */
  --gray: #939598;      /* texte tertiaire */
  --slate: #5c6b7a;     /* texte secondaire, meilleur contraste que --gray */
  --bg: #ffffff;
  --bg-tint: #f2f5f9;
  --border: #dde4ea;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;

  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;

  --container: 640px;
  --tap: 48px; /* taille tactile minimale */
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--navy);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: var(--container);
  margin: 0 auto;
  padding: 24px 20px 48px;
}

/* ---------- topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 12px 20px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.topbar-logos {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.logo {
  display: block;
  height: 34px;
  width: auto;
  max-width: 46%;
  object-fit: contain;
}
.logo-usmb { object-position: left center; }
.logo-agence { object-position: right center; }

/* ---------- progress stepper ---------- */
.stepper {
  display: flex;
  gap: 6px;
  width: 100%;
}
.stepper i {
  flex: 1;
  height: 4px;
  border-radius: 4px;
  background: var(--border);
  overflow: hidden;
  position: relative;
}
.stepper i.done, .stepper i.active { background: var(--blue); }
.stepper i.active { background: linear-gradient(90deg, var(--blue) 50%, var(--border) 50%); }

/* ---------- screens ---------- */
.screen { display: none; animation: fadein .25s ease; }
.screen.active { display: block; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- restore banner ---------- */
.restore-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: #eaf4ff;
  border: 1.5px solid #bcdcfb;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 13.5px;
  color: var(--navy);
}
.link-btn {
  background: none;
  border: none;
  padding: 0;
  min-height: auto;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--blue);
  text-decoration: underline;
  cursor: pointer;
}

/* ---------- hero / accueil ---------- */
.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--blue);
  background: var(--bg-tint);
  border-radius: 999px;
  padding: 6px 14px;
  margin-bottom: 16px;
}
h1 {
  font-size: 30px;
  line-height: 1.15;
  margin: 0 0 12px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.lede {
  font-size: 16px;
  color: var(--slate);
  margin: 0 0 28px;
}
h2 {
  font-size: 22px;
  margin: 0 0 6px;
  font-weight: 700;
}
.step-sub {
  font-size: 14px;
  color: var(--slate);
  margin: 0 0 24px;
}

/* ---------- form elements ---------- */
.field { margin-bottom: 22px; }
.field label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--navy);
}
.field .hint {
  font-size: 12.5px;
  color: var(--gray);
  margin-top: 6px;
}
input[type="text"], select {
  width: 100%;
  min-height: var(--tap);
  padding: 12px 14px;
  font-size: 16px;
  font-family: var(--font);
  color: var(--navy);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  appearance: none;
  -webkit-appearance: none;
}
select {
  background-image: linear-gradient(45deg, transparent 50%, var(--slate) 50%), linear-gradient(135deg, var(--slate) 50%, transparent 50%);
  background-position: calc(100% - 20px) center, calc(100% - 15px) center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 40px;
}
input[type="text"]:focus, select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(16, 6, 159, 0.12);
}
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 420px) { .row2 { grid-template-columns: 1fr; } }

/* ---------- sliders (valeurs) ---------- */
.slider-field { margin-bottom: 30px; }
.slider-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}
.slider-top .dim-name { font-weight: 700; font-size: 15px; }
.slider-poles {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--gray);
  margin-bottom: 8px;
}
input[type="range"] {
  width: 100%;
  height: var(--tap);
  margin: 0;
  -webkit-appearance: none;
  background: transparent;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 4px;
  background: var(--border);
}
input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 4px;
  background: var(--border);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--blue);
  border: 3px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
  margin-top: -10px;
  cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--blue);
  border: 3px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
  cursor: pointer;
}
.mini-bar {
  height: 6px;
  border-radius: 4px;
  background: var(--bg-tint);
  margin-top: 10px;
  overflow: hidden;
}
.mini-bar > span {
  display: block;
  height: 100%;
  background: var(--cyan);
  border-radius: 4px;
  transition: width .15s ease;
}
.dim-phrase {
  font-size: 13px;
  color: var(--slate);
  margin-top: 8px;
  min-height: 18px;
}

/* ---------- checkbox lists ---------- */
.check-counter {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  color: var(--blue);
  background: var(--bg-tint);
  border-radius: 999px;
  padding: 5px 12px;
  margin-bottom: 16px;
}
.check-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.check-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  min-height: var(--tap);
  transition: border-color .15s ease, background .15s ease;
}
.check-item input { width: 20px; height: 20px; flex: none; accent-color: var(--blue); }
.check-item span { font-size: 14.5px; }
.check-item.checked { border-color: var(--blue); background: var(--bg-tint); }
.check-item.disabled { opacity: .4; pointer-events: none; }
.check-item.eliminatoire.checked { border-color: var(--red); background: #fdecec; }

/* ---------- buttons ---------- */
.actions {
  display: flex;
  gap: 12px;
  margin-top: 32px;
}
button {
  font-family: var(--font);
  font-size: 15.5px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  min-height: var(--tap);
  padding: 0 22px;
  border: none;
  cursor: pointer;
}
.btn-primary {
  background: var(--navy);
  color: #fff;
  flex: 1;
}
.btn-primary:hover { background: var(--blue); }
.btn-primary:disabled { background: var(--border); color: var(--gray); cursor: not-allowed; }
.btn-secondary {
  background: transparent;
  color: var(--navy);
  border: 1.5px solid var(--border);
}
.btn-secondary:hover { border-color: var(--navy); }
.btn-full { width: 100%; }
button:focus-visible, .check-item:has(input:focus-visible), input:focus-visible, select:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 2px;
}

/* ---------- callout / cards ---------- */
.card {
  background: var(--bg-tint);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}
.card-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--blue);
  margin: 0 0 10px;
}
.link-list-item {
  margin: 0;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.link-list-item:last-child { border-bottom: none; }
.link-list-item a {
  color: var(--navy);
  font-weight: 700;
  text-decoration: none;
}
.link-list-item a:hover { color: var(--blue); text-decoration: underline; }
.link-list-item.featured a { color: var(--blue); }
.link-list-item .link-hint {
  display: block;
  font-size: 12px;
  color: var(--gray);
  font-weight: 400;
  margin-top: 2px;
}

/* ---------- synthèse ---------- */
.summary-box {
  background: var(--bg-tint);
  border-radius: var(--radius);
  padding: 18px;
  margin: 20px 0;
}
.summary-box pre {
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--navy);
  margin: 0;
}
.mini-recap { display: flex; flex-direction: column; gap: 8px; margin: 20px 0; }
.mini-recap-row { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 10px; }
.mini-recap-row .label { font-size: 12.5px; color: var(--slate); }

.copy-feedback {
  font-size: 13px;
  color: var(--green);
  font-weight: 700;
  margin-top: 10px;
  min-height: 18px;
  opacity: 0;
  transition: opacity .2s ease;
}
.copy-feedback.show { opacity: 1; }

.status-msg { font-size: 13.5px; margin-top: 10px; min-height: 18px; }
.status-msg.error { color: var(--red); }
.status-msg.ok { color: var(--green); }

.next-step {
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-top: 24px;
}
.next-step h3 { margin: 0 0 8px; font-size: 15px; }
.next-step p { margin: 0; font-size: 13.5px; color: var(--slate); }

/* ---------- footer ---------- */
footer {
  max-width: var(--container);
  margin: 40px auto 0;
  padding: 20px 20px 0;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--gray);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
footer a { color: var(--gray); }

/* ---------- error text ---------- */
.field.invalid input, .field.invalid select { border-color: var(--red); }
.field-error { font-size: 12.5px; color: var(--red); margin-top: 6px; display: none; }
.field.invalid .field-error { display: block; }

@media (prefers-reduced-motion: reduce) {
  .screen, input[type="range"]::-webkit-slider-thumb { animation: none !important; transition: none !important; }
}
