/* ================================================================
   DESIGN SYSTEM — Serrurerie du Mont-Blanc
   /css/style.css  —  v1.0.0  —  2026-03-18
   ================================================================
   Complète Tailwind CDN : tokens, animations, composants critiques.
   Chargé en <link rel="stylesheet"> AVANT Tailwind pour éviter FOUC.
   ================================================================ */

/* ── 1. Tokens Design System ─────────────────────────────────── */
:root {
  /* ── Tokens principaux ── */
  --navy:        #1a365d;
  --navy-dark:   #0f2240;
  --navy-mid:    #2a4a7f;
  --navy-light:  #e8eef5;
  --amber:       #ffb900;
  --amber-dark:  #e6a700;
  --amber-light: #fff8e1;
  --white:       #ffffff;
  --text:        #1e293b;
  --muted:       #64748b;
  --border:      #e2e8f0;
  --radius-sm:   6px;
  --radius-md:   12px;
  --radius-lg:   20px;
  --radius-full: 999px;
  --shadow-card: 0 4px 24px rgba(26, 54, 93, 0.09);
  --shadow-nav:  0 2px 16px rgba(26, 54, 93, 0.12);
  --shadow-cta:  0 8px 32px rgba(255, 185, 0, 0.40);
  --font-sans:   'Montserrat', system-ui, -apple-system, sans-serif;

  /* ── Aliases charte graphique ── */
  --primary-blue:  #1a365d;
  --accent-yellow: #ffb900;
  --text-dark:     #2d3748;
  --light-bg:      #f7fafc;
}

/* ── 2. Reset minimal ────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

/* ── 3. Bouton CTA — animation pulse ─────────────────────────── */
@keyframes pulse-cta {
  0%,  100% { box-shadow: 0 8px 32px rgba(255,185,0,.40); }
  50%        { box-shadow: 0 8px 48px rgba(255,185,0,.70),
                           0 0 0 10px rgba(255,185,0,.10); }
}

.btn-pulse {
  animation: pulse-cta 2.6s ease-in-out infinite;
}

/* Pause au survol — bonne pratique UX */
.btn-pulse:hover,
.btn-pulse:focus-visible {
  animation-play-state: paused;
}

/* ── 4. Sticky CTA Mobile ────────────────────────────────────── */
/*
   Rendu par le HTML inline (<div class="md:hidden fixed bottom-0…">)
   Ce bloc CSS est un filet de sécurité si Tailwind CDN tarde à charger.
*/
#sticky-cta-fallback {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  display: flex;
  background: var(--amber);
  padding: 14px 20px;
  padding-bottom: calc(14px + env(safe-area-inset-bottom));
  align-items: center;
  justify-content: center;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, .20);
}

#sticky-cta-fallback a {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--navy);
  font-weight: 900;
  font-size: 1.05rem;
  text-decoration: none;
}

@media (min-width: 768px) {
  #sticky-cta-fallback {
    display: none;
  }
}

/* ── 5. Hero ─────────────────────────────────────────────────── */
/*
   CSS critique servi inline dans <style> du <head> pour éviter FOUC.
   Ce bloc est un doublon volontaire qui s'applique même si Tailwind
   n'a pas encore initialisé.
*/
#hero {
  position: relative;
  min-height: 560px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background-color: var(--navy-dark);
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

/* ── 6. Header ───────────────────────────────────────────────── */
header[role="banner"] {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-nav);
  position: sticky;
  top: 0;
  z-index: 40;
}

/* ── 7. Cartes services ──────────────────────────────────────── */
.card-service {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
}

.card-service:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 36px rgba(26, 54, 93, .14);
}

/* ── 8. Accordéon FAQ ────────────────────────────────────────── */
.faq-answer {
  overflow: hidden;
  transition: max-height .3s ease, opacity .3s ease;
}

.faq-answer[hidden] {
  display: none;
}

/* ── 9. Focus visible (accessibilité) ───────────────────────── */
:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 2px;
}

/* ── 10. Skip link (accessibilité clavier) ───────────────────── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  background: var(--amber);
  color: var(--navy);
  font-weight: 800;
  font-size: .9rem;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  z-index: 1000;
  transition: top .2s;
}

.skip-link:focus {
  top: 16px;
}

/* ── 11. Utilitaires typographie ──────────────────────────────── */
.text-balance {
  text-wrap: balance;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ── 12. Animations section fadeIn ──────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in     { animation: fadeUp .55s ease both; }
.fade-in-d1  { animation-delay: .12s; }
.fade-in-d2  { animation-delay: .24s; }
.fade-in-d3  { animation-delay: .36s; }

/* Respect des préférences utilisateur */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ── 13. Impression ──────────────────────────────────────────── */
@media print {
  #sticky-cta-fallback,
  .btn-pulse,
  nav[aria-label="Navigation principale"],
  #hero::before {
    display: none !important;
  }

  body {
    font-size: 12pt;
    color: #000;
  }

  a[href^="tel"]::after {
    content: " (" attr(href) ")";
  }

  header[role="banner"] {
    position: static;
    box-shadow: none;
    border-bottom: 1px solid #ccc;
  }
}

/* ── 14. Composants charte graphique ─────────────────────────── */
.btn-emergency {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  background: var(--accent-yellow);
  color: var(--primary-blue);
  font-family: var(--font-sans);
  font-weight: 900;
  font-size: 1.1rem;
  padding: 1rem 2rem;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--shadow-cta);
  transition: background .2s ease, transform .15s ease;
}

.btn-emergency:hover,
.btn-emergency:focus-visible {
  background: var(--amber-dark);
  transform: translateY(-2px);
}

.section-hero {
  background: var(--primary-blue);
  color: var(--white);
  position: relative;
  overflow: hidden;
}
