/* ==========================================================================
   Bestlog Technology — feuille de style commune
   Charte reprise de l'index.html de référence (structure, rythme, composants)
   Couleurs relevées sur les fichiers sources :
     - jaune du symbole B (logo PNG)        : #EFB31F
     - bleu marine du mot-symbole BESTLOG   : #000F34
     - bleu marine de l'icône / favicon     : #0D203A
     - fond du logo version sombre          : #052149
     - fond papier de l'index de référence  : #F5F3EE
   Police système uniquement (aucune ressource externe).
   ========================================================================== */

:root {
  --navy: #000F34;
  --navy-2: #0D203A;
  --navy-3: #16294A;
  --navy-logo: #052149;      /* fond du logo version sombre (pied de page) */
  --yellow: #EFB31F;
  --yellow-hover: #F5C443;
  --paper: #F5F3EE;
  --white: #FFFFFF;
  --text: #000F34;
  --muted: #4B5263;          /* gris de l'index assombri pour un contraste AA */
  --border: #E2DDD8;
  --on-dark: #F5F3EE;
  --on-dark-muted: #C3C9D6;
  --danger: #A11A1A;
  --success: #116637;
  --radius: 14px;
  --maxw: 1180px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--paper);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--navy); text-decoration-color: var(--yellow); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--navy); }
h1, h2, h3, h4 { line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 .6em; font-weight: 800; }
p, ul, ol, dl { margin: 0 0 1em; }
ul, ol { padding-left: 1.2em; }
strong { font-weight: 700; }

:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; border-radius: 4px; }
.on-dark :focus-visible, .site-footer :focus-visible { outline-color: var(--yellow); }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--navy); color: var(--white); padding: 10px 16px; border-radius: 8px;
  text-decoration: none; font-weight: 600;
}
.skip-link:focus { top: 12px; }

[hidden] { display: none !important; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
@media (min-width: 700px) { .container { padding: 0 32px; } }

/* --------------------------------------------------------------------------
   En-tête
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, .97);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px 16px; padding-top: 8px; padding-bottom: 8px;
}
.brand { display: inline-flex; align-items: center; text-decoration: none; }
.brand img { width: 62px; height: auto; }
@media (min-width: 900px) { .brand img { width: 74px; } }

.main-nav { order: 3; width: 100%; }
.main-nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 4px 6px;
}
.main-nav a {
  display: inline-block; padding: 8px 10px; border-radius: 8px;
  font-size: .9rem; font-weight: 600; color: var(--muted); text-decoration: none;
}
.main-nav a:hover { color: var(--navy); background: var(--paper); }
.main-nav a[aria-current="page"] { color: var(--navy); box-shadow: inset 0 -3px 0 var(--yellow); border-radius: 8px 8px 0 0; }
.main-nav a.nav-contact { background: var(--navy); color: var(--white); }
.main-nav a.nav-contact:hover { background: var(--navy-3); }
.main-nav a.nav-contact[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--yellow); }

@media (min-width: 980px) {
  .header-inner { flex-wrap: nowrap; }
  .main-nav { order: 2; width: auto; }
  .main-nav ul { gap: 2px 4px; }
  .main-nav a { padding: 9px 12px; }
}

.lang-switch { order: 2; display: flex; gap: 4px; align-items: center; margin: 0; padding: 0; list-style: none; }
@media (min-width: 980px) { .lang-switch { order: 3; } }
.lang-switch li { display: flex; }
.lang-btn {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 40px; padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px;
  font-size: .75rem; font-weight: 700; letter-spacing: .04em; line-height: 1.1; color: var(--muted);
}
.lang-btn.is-active { background: var(--navy); border-color: var(--navy); color: var(--white); }
.lang-btn.is-disabled { color: #6B7180; background: var(--paper); cursor: not-allowed; }
.lang-btn small { font-size: .58rem; font-weight: 600; letter-spacing: 0; text-transform: lowercase; }

/* --------------------------------------------------------------------------
   Héros (fond marine, trame de l'index de référence)
   -------------------------------------------------------------------------- */
.hero {
  position: relative; overflow: hidden;
  background: var(--navy-2); color: var(--on-dark);
  padding: 56px 0 64px;
}
.hero::before {
  content: ""; position: absolute; inset: 0; opacity: .05; pointer-events: none;
  background-image: linear-gradient(var(--on-dark) 1px, transparent 1px), linear-gradient(90deg, var(--on-dark) 1px, transparent 1px);
  background-size: 60px 60px;
}
.hero > .container { position: relative; }
.hero-cols { display: grid; gap: 40px; align-items: center; }
@media (min-width: 1024px) {
  .hero { padding: 96px 0 104px; }
  .hero-cols { grid-template-columns: minmax(0, 1.3fr) minmax(0, .7fr); gap: 64px; }
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 10px;
  border: 1px solid rgba(239, 179, 31, .45); background: rgba(239, 179, 31, .1);
  color: var(--yellow); padding: 6px 14px; border-radius: 100px;
  font-size: .8rem; font-weight: 600; letter-spacing: .04em; margin-bottom: 24px;
}
.hero-badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--yellow); }
.hero h1 { font-size: clamp(1.9rem, 6.5vw, 3.4rem); color: var(--white); max-width: 20ch; }
.hero h1 em { font-style: normal; color: var(--yellow); }
.hero-sub { font-size: 1.08rem; color: var(--on-dark-muted); max-width: 62ch; margin-top: 8px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero--page { padding: 48px 0 56px; }
@media (min-width: 1024px) { .hero--page { padding: 72px 0 80px; } }
.hero--page h1 { max-width: 26ch; font-size: clamp(1.8rem, 5vw, 3rem); }

.breadcrumb { font-size: .82rem; color: var(--on-dark-muted); margin-bottom: 20px; }
.breadcrumb a { color: var(--on-dark); }
.breadcrumb ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumb li + li::before { content: "/"; margin-right: 6px; opacity: .6; }

.hero-card {
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 20px; padding: 24px; display: flex; flex-direction: column; gap: 12px;
}
.hero-card-title { font-size: .74rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--yellow); margin: 0 0 4px; }
.hero-link {
  display: block; position: relative; padding: 16px 44px 16px 18px; border-radius: 12px;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1);
  text-decoration: none; color: var(--on-dark);
}
.hero-link:hover { border-color: var(--yellow); }
.hero-link strong { display: block; font-size: 1.05rem; color: var(--white); }
.hero-link span { display: block; font-size: .88rem; color: var(--on-dark-muted); }
.hero-link::after { content: "→"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); color: var(--yellow); font-weight: 700; }

/* --------------------------------------------------------------------------
   Boutons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 24px; border-radius: 8px; border: 2px solid transparent;
  font: inherit; font-weight: 700; font-size: .98rem; text-decoration: none; cursor: pointer;
  transition: background-color .2s, border-color .2s, transform .2s;
}
.btn-primary { background: var(--yellow); border-color: var(--yellow); color: var(--navy); }
.btn-primary:hover { background: var(--yellow-hover); border-color: var(--yellow-hover); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--on-dark); border-color: rgba(245, 243, 238, .4); }
.btn-ghost:hover { border-color: var(--on-dark); }
.btn-dark { background: var(--navy); color: var(--white); border-color: var(--navy); }
.btn-dark:hover { background: var(--navy-3); }
.btn[disabled], .btn[aria-busy="true"] { opacity: .65; cursor: progress; transform: none; }

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */
.section { padding: 64px 0; }
@media (min-width: 900px) { .section { padding: 96px 0; } }
.section--white { background: var(--white); }
.section--paper { background: var(--paper); }
.section--dark { background: var(--navy-2); color: var(--on-dark); }
.section--dark h2, .section--dark h3 { color: var(--white); }
.section--dark p, .section--dark li { color: var(--on-dark-muted); }
.section--dark a { color: var(--white); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--navy); margin: 0 0 14px;
}
.eyebrow::before { content: ""; width: 22px; height: 4px; border-radius: 2px; background: var(--yellow); }
.section--dark .eyebrow { color: var(--yellow); }
.section-title { font-size: clamp(1.6rem, 4.2vw, 2.5rem); max-width: 30ch; }
.section-sub { font-size: 1.05rem; color: var(--muted); max-width: 64ch; }
.section--dark .section-sub { color: var(--on-dark-muted); }
.section-head { margin-bottom: 40px; }

.prose { max-width: 72ch; }
.prose h2 { font-size: clamp(1.4rem, 3.4vw, 2rem); margin-top: 1.8em; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 1.15rem; margin-top: 1.6em; }
.prose li { margin-bottom: .4em; }

/* Grilles */
.grid { display: grid; gap: 20px; }
@media (min-width: 760px) { .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .grid { gap: 24px; } }

/* Cartes (product-card de la référence) */
.card {
  position: relative; overflow: hidden;
  background: var(--paper); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; display: flex; flex-direction: column;
}
.section--paper .card { background: var(--white); }
.card::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--yellow);
  transform: scaleX(0); transform-origin: left; transition: transform .3s;
}
.card:hover::after, .card:focus-within::after { transform: scaleX(1); }
.card h3 { font-size: 1.2rem; margin-bottom: 10px; }
.card p { color: var(--muted); font-size: .96rem; }
.card ul { color: var(--muted); font-size: .95rem; }
.card > :last-child { margin-bottom: 0; }
.card-tag {
  align-self: flex-start; display: inline-block; margin-bottom: 14px;
  background: rgba(239, 179, 31, .18); color: var(--navy);
  font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 4px;
}
.card-link { margin-top: auto; padding-top: 16px; font-weight: 700; }
.card--dark { background: var(--navy-2); border-color: var(--navy-2); color: var(--on-dark); }
.section--paper .card--dark { background: var(--navy-2); }
.card--dark h3 { color: var(--white); }
.card--dark p, .card--dark ul { color: var(--on-dark-muted); }
.card--dark .card-tag { background: rgba(239, 179, 31, .16); color: var(--yellow); }
.card--dark a { color: var(--white); }

/* Liste numérotée (expertise de la référence) */
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; border: 1px solid var(--border); border-radius: 16px; overflow: hidden; background: var(--white); counter-reset: step; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .steps--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.steps li { padding: 28px 24px; border-bottom: 1px solid var(--border); counter-increment: step; }
@media (min-width: 760px) { .steps li { border-right: 1px solid var(--border); } }
.steps li::before { content: counter(step, decimal-leading-zero); display: block; font-size: 2.2rem; font-weight: 800; color: var(--yellow); line-height: 1; margin-bottom: 16px; }
.steps h3 { font-size: 1.02rem; margin-bottom: 8px; }
.steps p { font-size: .92rem; color: var(--muted); margin: 0; }

/* Liste à puces sobre */
.check-list { list-style: none; padding: 0; }
.check-list li { position: relative; padding-left: 28px; margin-bottom: .6em; }
.check-list li::before { content: ""; position: absolute; left: 4px; top: .55em; width: 10px; height: 10px; border-radius: 2px; background: var(--yellow); }

/* Encadrés */
.callout {
  border-left: 4px solid var(--yellow); background: var(--white);
  border-radius: 0 var(--radius) var(--radius) 0; padding: 20px 24px; margin: 24px 0;
}
.section--white .callout { background: var(--paper); }
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }
.callout-title { font-weight: 800; margin-bottom: 6px; }
.callout--draft { border-left-color: var(--navy); background: #FFF6DD; }

/* FAQ (faq-list de la référence) */
.faq-list { display: flex; flex-direction: column; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.faq-item { background: var(--white); padding: 24px; }
.faq-item h3 { font-size: 1.02rem; margin-bottom: 8px; }
.faq-item p { color: var(--muted); font-size: .95rem; margin: 0; max-width: 76ch; }

/* Cas d'usage */
.usecase {
  background: var(--white); border: 1px solid var(--border); border-radius: 16px;
  padding: 24px; margin-bottom: 24px;
}
@media (min-width: 760px) { .usecase { padding: 36px; } }
.usecase-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-bottom: 18px; }
.usecase-num { font-size: 2rem; font-weight: 800; color: var(--yellow); line-height: 1; }
.usecase h2 { font-size: clamp(1.25rem, 3vw, 1.6rem); margin: 0; }
.usecase dl { display: grid; gap: 14px; margin: 0; }
@media (min-width: 900px) { .usecase dl { grid-template-columns: 200px minmax(0, 1fr); gap: 16px 24px; } }
.usecase dt { font-weight: 800; font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; color: var(--navy); }
.usecase dd { margin: 0; color: var(--muted); }
.usecase .story { color: var(--navy); font-style: italic; }

/* Bandeau d'appel à l'action */
.cta-band { background: var(--navy-2); color: var(--on-dark); padding: 56px 0; }
.cta-band-inner { display: flex; flex-direction: column; gap: 20px; align-items: flex-start; }
@media (min-width: 900px) { .cta-band-inner { flex-direction: row; align-items: center; justify-content: space-between; } }
.cta-band h2 { color: var(--white); font-size: clamp(1.4rem, 3.4vw, 2rem); margin: 0; max-width: 30ch; }
.cta-band p { color: var(--on-dark-muted); margin: 8px 0 0; }

/* --------------------------------------------------------------------------
   Formulaires
   -------------------------------------------------------------------------- */
.form-wrap { background: var(--white); border: 1px solid var(--border); border-radius: 20px; padding: 24px; }
@media (min-width: 760px) { .form-wrap { padding: 40px; } }
.form-row { display: grid; gap: 0 16px; }
@media (min-width: 760px) { .form-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; min-width: 0; }
.field label { font-weight: 700; font-size: .9rem; }
.field .hint { font-size: .82rem; color: var(--muted); margin: 0; }
.field input, .field select, .field textarea {
  width: 100%; min-width: 0; font: inherit; font-size: 1rem; color: var(--text);
  background: var(--white); border: 1px solid #A9AEBA; border-radius: 8px; padding: 12px 14px;
}
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--navy); outline: 3px solid var(--yellow); outline-offset: 1px; }
.field [aria-invalid="true"] { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: .86rem; font-weight: 600; margin: 0; min-height: 0; }
.field-error:empty { display: none; }
.req { color: var(--danger); }
.hint-inline { font-weight: 400; color: var(--muted); font-size: .85rem; }
.subhead { font-size: clamp(1.25rem, 3vw, 1.6rem); margin: 56px 0 24px; }
.hp-field { position: absolute !important; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.form-status { margin: 0 0 18px; padding: 0; border-radius: 10px; font-weight: 600; }
.form-status:empty { display: none; }
.form-status.is-success { padding: 14px 16px; background: #E7F5EC; color: var(--success); border: 1px solid #A7D7B8; }
.form-status.is-error { padding: 14px 16px; background: #FBEAEA; color: var(--danger); border: 1px solid #E8B4B4; }
.form-status.is-info { padding: 14px 16px; background: #FFF6DD; color: var(--navy); border: 1px solid #F0D58A; }
.form-notice { font-size: .85rem; color: var(--muted); margin: 20px 0 0; }
.form-notice a { color: var(--navy); }

/* --------------------------------------------------------------------------
   Pied de page
   -------------------------------------------------------------------------- */
.site-footer { background: var(--navy-logo); color: var(--on-dark-muted); padding: 56px 0 32px; font-size: .92rem; }
.footer-grid { display: grid; gap: 32px; }
@media (min-width: 900px) { .footer-grid { grid-template-columns: 1.3fr 1fr 1fr; } }
.footer-brand img { width: 120px; margin: -8px 0 12px -8px; }
.footer-brand p { max-width: 36ch; }
.site-footer h2 { font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--yellow); margin-bottom: 14px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: var(--on-dark); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; text-decoration-color: var(--yellow); }
.footer-bottom { margin-top: 40px; padding-top: 24px; border-top: 1px solid rgba(255, 255, 255, .12); font-size: .82rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media print {
  .site-header, .site-footer, .cta-band, .hero::before { display: none; }
  .hero, .section--dark { background: #fff; color: #000; }
  .hero h1, .hero-sub { color: #000; }
}

/* Sélecteur de langue : langue disponible (lien) */
a.lang-btn { text-decoration: none; background: var(--white); }
a.lang-btn:hover { border-color: var(--navy); color: var(--navy); }
