/* ==========================================================================
   OPTIMA LABS — Base : reset, typographie, boutons, formulaires, utilitaires
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  /* Clip horizontal : `clip` (contrairement à `hidden`) ne crée pas de
     conteneur de défilement et ne casse donc PAS position:sticky dans
     Safari. Le `hidden` précédent est conservé en repli pour les très
     anciens navigateurs (la déclaration suivante l'écrase si supportée). */
  overflow-x: hidden;
  overflow-x: clip;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--text-2);
  background-color: var(--bg-0);
  min-height: 100vh;
}

img, svg { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
  color: var(--text-1);
  line-height: 1.2;
  margin: 0 0 var(--sp-4);
  font-weight: 700;
  letter-spacing: -0.015em;
}
/* Titres display condensés (Anton, graisse unique) : uniquement h1/h2,
   en capitales — h3/h4 restent en Inter pour la lisibilité des composants */
h1, h2 {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.015em;
  line-height: 1.08;
}
h1 { font-size: var(--fs-hero); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-md); }
p { margin: 0 0 var(--sp-4); }

a {
  color: var(--violet-300);
  text-decoration: none;
  transition: color var(--t-fast);
}
a:hover { color: var(--violet-200); }

ul, ol { padding-left: 1.2em; }

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: 0;
  background: none;
  color: inherit;
}

/* ----- Focus visible (accessibilité) ----- */
:focus-visible {
  outline: 2px solid var(--violet-400);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ----- Lien d'évitement ----- */
.skip-link {
  position: absolute;
  top: -48px;
  left: var(--sp-4);
  z-index: 300;
  padding: var(--sp-2) var(--sp-4);
  background: var(--violet-600);
  color: #fff;
  border-radius: var(--r-sm);
  transition: top var(--t-fast);
}
.skip-link:focus { top: var(--sp-2); color: #fff; }

/* ----- Conteneurs ----- */
.container {
  width: 100%;
  max-width: var(--w-max);
  margin-inline: auto;
  padding-inline: clamp(1rem, 0.5rem + 2.5vw, 2rem);
}
.container--narrow { max-width: var(--w-narrow); }
.container--text { max-width: var(--w-text); }

/* Chaque .section correspond à un futur conteneur Elementor */
.section { padding-block: var(--sp-section); }
.section--alt { background: var(--bg-1); }

.section-head { max-width: 640px; margin-bottom: var(--sp-6); }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head .kicker {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--violet-300);
  margin-bottom: var(--sp-3);
}
.section-head p { color: var(--text-3); margin-bottom: 0; }

/* ----- Boutons ----- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 0.7rem 1.5rem;
  border-radius: var(--r-full);
  font-weight: 600;
  font-size: var(--fs-sm);
  line-height: 1.2;
  transition: transform var(--t-fast), box-shadow var(--t-fast), background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
  text-align: center;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
/* Icônes inline dans les boutons/liens : taille contrainte */
.btn svg, .btn [data-icon] svg { width: 1.15em; height: 1.15em; flex-shrink: 0; }
.btn [data-icon] { display: inline-flex; }
a [data-icon] { display: inline-flex; vertical-align: middle; }
a [data-icon] svg { width: 1.1em; height: 1.1em; }

.btn--primary {
  background: var(--grad-accent);
  color: #fff;
  box-shadow: var(--shadow-glow);
}
.btn--primary:hover { color: #fff; box-shadow: 0 6px 32px rgba(132, 96, 222, 0.45); transform: translateY(-1px); }

.btn--ghost {
  background: transparent;
  color: var(--text-1);
  border: 1px solid var(--line-2);
}
.btn--ghost:hover { border-color: var(--line-3); background: rgba(185, 166, 242, 0.06); color: var(--text-1); }

.btn--soft {
  background: rgba(132, 96, 222, 0.14);
  color: var(--violet-200);
}
.btn--soft:hover { background: rgba(132, 96, 222, 0.24); color: var(--violet-200); }

.btn--sm { padding: 0.45rem 1rem; font-size: var(--fs-xs); }
.btn--lg { padding: 0.85rem 2rem; font-size: var(--fs-base); }
.btn--block { width: 100%; }

/* ----- Formulaires ----- */
.field { margin-bottom: var(--sp-4); }
.field label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: var(--sp-2);
}
.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 0.65rem 0.9rem;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  color: var(--text-1);
  font-family: inherit;
  font-size: var(--fs-sm);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--violet-400);
  box-shadow: 0 0 0 3px rgba(132, 96, 222, 0.18);
}
.field textarea { min-height: 130px; resize: vertical; }
.field .hint { font-size: var(--fs-xs); color: var(--text-3); margin-top: var(--sp-1); }

/* ----- Badges ----- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  padding: 0.22em 0.7em;
  border-radius: var(--r-full);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.badge--violet { background: rgba(132, 96, 222, 0.16); color: var(--violet-200); }
.badge--success { background: var(--success-soft); color: var(--success); }
.badge--outline { border: 1px solid var(--line-2); color: var(--text-3); }

/* ----- Notice recherche (réutilisée sur plusieurs pages) ----- */
.research-notice {
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
  padding: var(--sp-4);
  background: rgba(224, 183, 106, 0.07);
  border: 1px solid rgba(224, 183, 106, 0.22);
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  color: var(--text-2);
}
.research-notice strong { color: var(--warning); }
.research-notice [data-icon] { flex-shrink: 0; color: var(--warning); }
.research-notice [data-icon] svg { width: 20px; height: 20px; }

/* ----- Grille utilitaire ----- */
.grid { display: grid; gap: var(--sp-5); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .grid--2, .grid--3 { grid-template-columns: 1fr; }
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
}

/* ----- Apparition au scroll ----- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 600ms cubic-bezier(0.22, 1, 0.36, 1), transform 600ms cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* ----- Écran seulement (lecteurs d'écran) ----- */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ----- Mouvement réduit ----- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
