/* =============================================================================
   MOZAIQ -- vitrine publique (27/08/2026, mise a jour vingt-deux services)
   Tokens de conception -- coherents avec l'app Flutter (meme palette,
   memes polices) pour la continuite de marque entre la vitrine et
   l'app visitee ensuite. Signature : la mosaique de tuiles du heros,
   qui s'assemble a l'ouverture puis redevient la grille de services.

   AJOUT (vingt-deux services) : systeme de filtres par categorie --
   avec vingt-deux cartes, un visiteur doit pouvoir se reperer
   immediatement, jamais parcourir une liste indifferenciee. Deux
   nouvelles couleurs d'accent (violet pour tourisme, indigo pour
   livres), choisies pour rester coherentes avec les couleurs deja
   utilisees dans le Flutter (0xFF00838F et 0xFF6A1B9A).
   ============================================================================= */

:root {
  /* Ancrage */
  --ancre: #16213E;
  --ancre-fonce: #0D1428;
  --ancre-clair: #3D5A99;

  /* Constellation d'accents -- utilises avec intention, jamais en vrac */
  --ambre: #E8A93E;
  --ambre-clair: #FBF0DC;
  --corail: #E8643A;
  --emeraude: #1E9C6E;
  --azur: #2470B3;
  --violet: #6A3FA0;
  --indigo: #3F5FB0;

  /* Neutres */
  --texte: #1A1D29;
  --texte-attenue: #6B7180;
  --surface: #FFFFFF;
  --fond: #FAFAFC;
  --fond-clair: #EFF1F8;
  --bordure: #E3E6F0;

  /* Echelle d'espacement */
  --esp-xs: 4px;
  --esp-s: 8px;
  --esp-m: 16px;
  --esp-l: 24px;
  --esp-xl: 32px;
  --esp-xxl: 48px;
  --esp-xxxl: 80px;

  /* Rayons */
  --rayon-s: 10px;
  --rayon-m: 14px;
  --rayon-l: 20px;
  --rayon-xl: 28px;

  /* Typographie */
  --police-affichage: 'Manrope', sans-serif;
  --police-texte: 'Inter', sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@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;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  font-family: var(--police-texte);
  color: var(--texte);
  background: var(--fond);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--police-affichage);
  margin: 0;
  line-height: 1.15;
}

p { margin: 0; }

a {
  color: inherit;
  text-decoration: none;
}

ul, ol { margin: 0; padding: 0; list-style: none; }

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

button {
  font-family: inherit;
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid var(--azur);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.lien-evitement {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ancre);
  color: white;
  padding: var(--esp-m);
  z-index: 100;
}
.lien-evitement:focus {
  left: var(--esp-m);
  top: var(--esp-m);
}

.conteneur {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 var(--esp-l);
}

/* --- En-tete --- */

.entete {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 250, 252, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--bordure);
}

.entete-interieur {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--esp-m) var(--esp-l);
}

.marque {
  display: flex;
  align-items: center;
  gap: var(--esp-s);
  font-family: var(--police-affichage);
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--ancre);
}

.marque-mosaique {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  width: 22px;
  height: 22px;
}
.marque-mosaique i {
  border-radius: 3px;
  display: block;
}
.marque-mosaique i:nth-child(1) { background: var(--ambre); }
.marque-mosaique i:nth-child(2) { background: var(--corail); }
.marque-mosaique i:nth-child(3) { background: var(--emeraude); }
.marque-mosaique i:nth-child(4) { background: var(--azur); }

.nav-principale { display: flex; align-items: center; }

.bouton-menu {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: var(--esp-s);
}
.bouton-menu span {
  width: 22px;
  height: 2px;
  background: var(--ancre);
  border-radius: 2px;
}

.liens-nav {
  display: flex;
  align-items: center;
  gap: var(--esp-xl);
}
.liens-nav a {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--texte);
}
.liens-nav a:hover { color: var(--ancre); }

.lien-cta-nav {
  background: var(--ancre);
  color: white !important;
  padding: 10px 20px;
  border-radius: var(--rayon-m);
  font-weight: 700 !important;
}
.lien-cta-nav:hover { background: var(--ancre-fonce); }

/* --- Boutons --- */

.bouton {
  display: inline-block;
  padding: 14px 28px;
  border-radius: var(--rayon-m);
  font-weight: 700;
  font-size: 1rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.bouton:hover { transform: translateY(-2px); }

.bouton-principal {
  background: var(--ambre);
  color: var(--ancre-fonce);
  box-shadow: 0 8px 24px rgba(232, 169, 62, 0.35);
}
.bouton-principal:hover { box-shadow: 0 12px 28px rgba(232, 169, 62, 0.45); }

.bouton-secondaire {
  background: transparent;
  color: var(--ancre);
  border: 2px solid var(--ancre);
}
.bouton-secondaire:hover { background: var(--ancre); color: white; }

/* --- Heros --- */

.heros {
  padding: var(--esp-xxxl) 0;
  overflow: hidden;
  position: relative;
}

.heros::before {
  content: '';
  position: absolute;
  top: -20%;
  right: -10%;
  width: 60%;
  height: 140%;
  background: radial-gradient(circle, rgba(232, 169, 62, 0.10) 0%, rgba(232, 169, 62, 0) 65%);
  pointer-events: none;
  z-index: 0;
}

.heros-grille {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--esp-xxl);
  align-items: center;
  position: relative;
  z-index: 1;
}

.heros-eyebrow {
  font-family: var(--police-affichage);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--azur);
  margin-bottom: var(--esp-m);
}

.heros-titre {
  font-size: clamp(2.4rem, 4.5vw, 3.6rem);
  font-weight: 800;
  color: var(--ancre);
  margin-bottom: var(--esp-l);
}

.heros-sous-titre {
  font-size: 1.15rem;
  color: var(--texte-attenue);
  max-width: 48ch;
  margin-bottom: var(--esp-xl);
}

.heros-actions {
  display: flex;
  gap: var(--esp-m);
  flex-wrap: wrap;
}

.heros-mosaique {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--esp-m);
  aspect-ratio: 1;
}

.tuile {
  border-radius: var(--rayon-l);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--esp-l);
  opacity: 0;
  transform: scale(0.4) rotate(-8deg);
  animation: assembler 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.tuile:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 28px rgba(22, 33, 62, 0.18);
}
.tuile svg { width: 100%; height: 100%; }

.tuile-1 { background: var(--ambre); color: var(--ancre-fonce); animation-delay: 0.05s; }
.tuile-2 { background: var(--ancre); color: var(--ambre); animation-delay: 0.12s; }
.tuile-3 { background: var(--corail); color: white; animation-delay: 0.19s; }
.tuile-4 { background: var(--fond-clair); color: var(--ancre); animation-delay: 0.26s; }
.tuile-5 { background: var(--emeraude); color: white; animation-delay: 0.33s; }
.tuile-6 { background: var(--azur); color: white; animation-delay: 0.4s; }
.tuile-7 { background: var(--fond-clair); color: var(--corail); animation-delay: 0.47s; }
.tuile-8 { background: var(--ancre); color: var(--emeraude); animation-delay: 0.54s; }
.tuile-9 { background: var(--ambre); color: var(--ancre-fonce); animation-delay: 0.61s; }

@keyframes assembler {
  to { opacity: 1; transform: scale(1) rotate(0); }
}

@media (prefers-reduced-motion: reduce) {
  .tuile { animation: none; opacity: 1; transform: none; }
}

/* --- Bande de confiance --- */

.bande-confiance {
  background: var(--ancre);
  padding: var(--esp-xl) 0;
}

.bande-confiance-grille {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--esp-l);
  text-align: center;
}

.repere { display: flex; flex-direction: column; gap: 4px; }

.repere-chiffre {
  font-family: var(--police-affichage);
  font-weight: 800;
  font-size: 1.8rem;
  color: var(--ambre);
}

.repere-libelle {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.75);
}

/* --- Sections generiques --- */

.section {
  padding: var(--esp-xxxl) 0;
}

.section-sombre {
  background: var(--ancre);
  color: white;
}

.section-eyebrow {
  font-family: var(--police-affichage);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--azur);
  margin-bottom: var(--esp-s);
}
.section-eyebrow-clair { color: var(--ambre); }

.section-titre {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 800;
  color: var(--ancre);
  margin-bottom: var(--esp-xl);
}
.section-titre-clair { color: white; }

/* --- Filtres de categorie (nouveau) --- */

.filtres-categories {
  display: flex;
  flex-wrap: wrap;
  gap: var(--esp-s);
  margin-bottom: var(--esp-xl);
}

.filtre-chip {
  background: var(--surface);
  border: 1.5px solid var(--bordure);
  color: var(--texte-attenue);
  font-family: var(--police-texte);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 10px 18px;
  border-radius: 999px;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.filtre-chip:hover {
  border-color: var(--ancre-clair);
  color: var(--ancre);
  transform: translateY(-1px);
}
.filtre-chip.filtre-actif {
  background: var(--ancre);
  border-color: var(--ancre);
  color: white;
}

/* --- Grille de services --- */

.grille-services {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--esp-l);
}

.carte-service {
  background: var(--surface);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon-l);
  padding: var(--esp-l);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.carte-service:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(22, 33, 62, 0.08);
}

.carte-service-masquee {
  display: none;
}

.carte-service-large {
  grid-column: span 2;
}

.carte-service-icone {
  width: 44px;
  height: 44px;
  border-radius: var(--rayon-s);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  margin-bottom: var(--esp-m);
}
.carte-service-icone svg { width: 100%; height: 100%; }

.accent-ambre .carte-service-icone { background: var(--ambre-clair); color: var(--ambre); }
.accent-corail .carte-service-icone { background: #FCE7E0; color: var(--corail); }
.accent-emeraude .carte-service-icone { background: #DFF3EA; color: var(--emeraude); }
.accent-azur .carte-service-icone { background: #DFEBF7; color: var(--azur); }
.accent-violet .carte-service-icone { background: #EBE2F5; color: var(--violet); }
.accent-indigo .carte-service-icone { background: #E4E9F8; color: var(--indigo); }

.carte-service h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--texte);
  margin-bottom: var(--esp-s);
}

.carte-service p {
  font-size: 0.92rem;
  color: var(--texte-attenue);
}

.grille-vide {
  text-align: center;
  color: var(--texte-attenue);
  padding: var(--esp-xxl) 0;
  font-size: 1rem;
}

/* --- Etapes --- */

.etapes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--esp-xl);
}

.etape-numero {
  display: block;
  font-family: var(--police-affichage);
  font-weight: 800;
  font-size: 1.6rem;
  color: var(--ambre);
  margin-bottom: var(--esp-m);
}

.etape h3 {
  font-size: 1.1rem;
  margin-bottom: var(--esp-s);
  color: white;
}

.etape p {
  font-size: 0.92rem;
  color: rgba(255,255,255,0.72);
}

/* --- Professionnels --- */

.professionnels-grille {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--esp-xxl);
  align-items: start;
}

.professionnels-texte {
  color: var(--texte-attenue);
  font-size: 1.05rem;
  margin-bottom: var(--esp-xl);
  max-width: 52ch;
}

.liste-avantages {
  display: flex;
  flex-direction: column;
  gap: var(--esp-l);
  background: var(--fond-clair);
  border-radius: var(--rayon-l);
  padding: var(--esp-xl);
}
.liste-avantages li {
  font-size: 0.95rem;
  color: var(--texte-attenue);
  padding-left: var(--esp-l);
  border-left: 3px solid var(--azur);
}
.liste-avantages strong { color: var(--texte); display: block; margin-bottom: 2px; }

/* --- Pied de page --- */

.pied {
  background: var(--ancre-fonce);
  color: rgba(255,255,255,0.7);
  padding-top: var(--esp-xxl);
}

.pied-grille {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: var(--esp-xl);
  padding-bottom: var(--esp-xl);
}

.marque-pied { color: white; margin-bottom: var(--esp-s); }

.pied-texte { font-size: 0.9rem; color: rgba(255,255,255,0.55); }

.pied-titre {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.5);
  margin-bottom: var(--esp-m);
  font-weight: 700;
}

.pied-liens { display: flex; flex-direction: column; gap: var(--esp-s); }
.pied-liens a { font-size: 0.92rem; }
.pied-liens a:hover { color: var(--ambre); }

.pied-bas {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: var(--esp-l) 0;
  font-size: 0.85rem;
}

.lien-dieumag {
  color: var(--ambre);
  font-weight: 700;
  text-decoration: none;
}
.lien-dieumag:hover { text-decoration: underline; }

/* --- Responsive --- */

@media (max-width: 900px) {
  .heros-grille { grid-template-columns: 1fr; }
  .heros-mosaique { max-width: 420px; margin: 0 auto; }
  .grille-services { grid-template-columns: repeat(2, 1fr); }
  .carte-service-large { grid-column: span 2; }
  .bande-confiance-grille { grid-template-columns: repeat(2, 1fr); gap: var(--esp-xl); }
  .etapes { grid-template-columns: repeat(2, 1fr); }
  .professionnels-grille { grid-template-columns: 1fr; }
  .pied-grille { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .bouton-menu { display: flex; }
  .liens-nav {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    background: var(--surface);
    padding: var(--esp-l);
    gap: var(--esp-l);
    border-bottom: 1px solid var(--bordure);
    transform: translateY(-150%);
    transition: transform 0.25s ease;
  }
  .liens-nav.ouvert { transform: translateY(0); }
  .grille-services { grid-template-columns: 1fr; }
  .carte-service-large { grid-column: span 1; }
  .etapes { grid-template-columns: 1fr; }
  .pied-grille { grid-template-columns: 1fr; }
  .filtres-categories {
    justify-content: center;
  }
  .filtre-chip {
    font-size: 0.82rem;
    padding: 8px 14px;
  }
}
