/* ==========================================================================
   LEGACI — Système de design (mobile-first)
   Palette : rouge lion (marque), bleu institutionnel (marque), argile (terroir),
   sable (fond), charbon (texte). Le sceau de certification est l'élément
   signature — il porte une vraie information (vendeur/produit vérifié).
   ========================================================================== */

:root {
  --legaci-red: #C41E2A;
  --legaci-red-dark: #8F1620;
  --legaci-blue: #16305C;
  --legaci-blue-light: #2A4A82;

  --clay: #B8622C;
  --clay-light: #E0B98C;
  --sand: #F3ECE0;
  --sand-deep: #E8DCC8;

  --charcoal: #201C18;
  --ink-soft: #4A423A;
  --white: #FFFFFF;
  --line: rgba(32, 28, 24, 0.12);

  --success: #2E6B44;
  --pending: #B8862C;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'IBM Plex Sans', -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  /* Échelle d'espacement fluide — s'adapte à la largeur de l'écran */
  --space-1: clamp(0.4rem, 1.2vw, 0.5rem);
  --space-2: clamp(0.85rem, 2.2vw, 1rem);
  --space-3: clamp(1.25rem, 3.5vw, 1.75rem);
  --space-4: clamp(1.75rem, 5vw, 2.75rem);
  --space-5: clamp(2.5rem, 7vw, 4.5rem);
  --space-6: clamp(3.5rem, 9vw, 7rem);

  /* Marge latérale du conteneur — jamais moins de 20px, même sur petit écran */
  --gutter: clamp(1.25rem, 5vw, 3rem);

  --radius: 10px;
  --radius-sm: 6px;
  --shadow-card: 0 2px 16px rgba(32, 28, 24, 0.08);
  --shadow-lift: 0 12px 32px rgba(32, 28, 24, 0.14);
}

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

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

body {
  font-family: var(--font-body);
  background: var(--sand);
  color: var(--charcoal);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  width: 100%;
}

img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h1 { font-size: clamp(2rem, 8vw, 4rem); }
h2 { font-size: clamp(1.6rem, 5.5vw, 2.6rem); }
h3 { font-size: clamp(1.15rem, 3.5vw, 1.6rem); }
p { font-size: clamp(0.95rem, 2vw, 1rem); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--legaci-red);
  font-weight: 600;
}

/* Conteneur — le point le plus important : jamais de texte collé au bord */
.container {
  max-width: 1240px;
  margin: 0 auto;
  padding-inline: var(--gutter);
  width: 100%;
}

/* Boutons — cible tactile confortable (min 44px de hauteur) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 1.5rem;
  min-height: 46px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.92rem;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 2px solid var(--legaci-blue); outline-offset: 2px; }

.btn-primary { background: var(--legaci-red); color: var(--white); box-shadow: 0 4px 14px rgba(196,30,42,0.28); }
.btn-primary:hover { background: var(--legaci-red-dark); }

.btn-secondary { background: var(--legaci-blue); color: var(--white); box-shadow: 0 4px 14px rgba(22,48,92,0.28); }
.btn-secondary:hover { background: var(--legaci-blue-light); }

.btn-outline { background: transparent; border-color: var(--charcoal); color: var(--charcoal); }
.btn-outline:hover { background: var(--charcoal); color: var(--white); }

.btn-block { width: 100%; }

/* Sceau de certification — élément signature.
   Utilisé sur : hero, fiches produit vérifiées, profils vendeurs validés. */
.seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(72px, 18vw, 88px);
  height: clamp(72px, 18vw, 88px);
  border-radius: 50%;
  border: 2px solid var(--legaci-blue);
  position: relative;
  font-family: var(--font-mono);
  text-align: center;
  color: var(--legaci-blue);
  flex-shrink: 0;
}
.seal::before {
  content: '';
  position: absolute;
  inset: 6px;
  border: 1px dashed var(--legaci-blue);
  border-radius: 50%;
  opacity: 0.5;
}
.seal-text {
  font-size: clamp(0.5rem, 1.6vw, 0.55rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.3;
  font-weight: 700;
}
.seal.seal-pending { border-color: var(--pending); color: var(--pending); }
.seal.seal-pending::before { border-color: var(--pending); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-verified { background: rgba(46, 107, 68, 0.14); color: var(--success); }
.badge-pending { background: rgba(184, 134, 44, 0.16); color: var(--pending); }

.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

/* Bande de chiffres — 2 colonnes sur mobile, jamais moins */
.stat-band {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3) var(--space-2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: var(--space-3) 0;
}
.stat { text-align: left; min-width: 0; }
.stat-value { font-family: var(--font-display); font-size: clamp(1.5rem, 4vw, 2rem); font-weight: 600; }
.stat-label { font-family: var(--font-mono); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); }

@media (min-width: 560px) {
  .stat-band { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
  .stat-band { grid-template-columns: repeat(6, 1fr); }
}

.stat-value.compte-anime { font-variant-numeric: tabular-nums; }

/* Logo — toujours en cercle, header comme footer */
.site-logo {
  height: 44px;
  width: 44px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 1px 6px rgba(0,0,0,0.18);
  border: 2px solid var(--white);
  flex-shrink: 0;
}
.site-logo.footer-logo {
  height: 54px;
  width: 54px;
  border: 2px solid rgba(255,255,255,0.6);
}

/* Apparition progressive au scroll */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.in-view { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

.live-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #4ADE80;
  margin-right: 0.4rem;
  animation: pulse-dot 1.6s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }

:focus-visible { outline: 2px solid var(--legaci-blue); outline-offset: 2px; }

/* Preloader — écran de chargement à la marque LEGACI */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--charcoal);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1rem;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}
#preloader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.preloader-spinner {
  position: relative;
  width: 76px;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.preloader-spinner::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.15);
  border-top-color: var(--legaci-red);
  animation: preloader-spin 0.9s linear infinite;
}
.preloader-logo {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
  position: relative;
  z-index: 1;
  border: 2px solid var(--white);
}
.preloader-word {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
}
@keyframes preloader-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .preloader-spinner::before { animation: none; }
  #preloader { transition: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
