@import url('tokens.css');

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.65;
}

/* Skip nav */
.skip-nav {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-nav:focus {
  position: static;
  width: auto;
  height: auto;
  padding: 0.5rem 1rem;
  background: var(--color-primary);
  color: #fff;
  z-index: 9999;
  text-decoration: none;
}

/* Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Typography */
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.25; color: var(--color-primary); }
h1 { font-size: clamp(1.75rem, 4vw, 2.75rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3vw, 2.125rem); font-weight: 600; }
h3 { font-size: clamp(1.0625rem, 2vw, 1.25rem); font-weight: 600; }
p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }
a { color: var(--color-primary); text-decoration: underline; }
a:hover, a:focus { color: var(--color-accent); }
address { font-style: normal; }
ul { list-style: none; }

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
  border: 2px solid transparent;
}
.btn-primary { background-color: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.btn-primary:hover, .btn-primary:focus { background-color: #162d6e; color: #fff; border-color: #162d6e; }
.btn-secondary { background-color: transparent; color: var(--color-primary); border-color: var(--color-primary); }
.btn-secondary:hover, .btn-secondary:focus { background-color: var(--color-primary); color: #fff; }
.btn-white { background-color: #fff; color: var(--color-primary); border-color: #fff; }
.btn-white:hover, .btn-white:focus { background-color: #f0f4ff; color: var(--color-primary); }
.btn-outline-white { background-color: transparent; color: #fff; border-color: rgba(255,255,255,0.7); }
.btn-outline-white:hover, .btn-outline-white:focus { background-color: rgba(255,255,255,0.1); color: #fff; border-color: #fff; }
.btn-accent { background-color: var(--color-accent); color: #fff; border-color: var(--color-accent); }
.btn-accent:hover, .btn-accent:focus { background-color: #0b7a70; color: #fff; }

/* Section layout */
section { padding: 3.5rem 0; }
.section-title { text-align: center; margin-bottom: 0.75rem; }
.section-intro { text-align: center; max-width: 640px; margin: 0 auto 2.5rem; color: #374151; }
.section-cta { text-align: center; margin-top: 2rem; }

/* Header */
.site-header {
  background-color: var(--color-bg);
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
  gap: 1rem;
}
.logo-link { display: flex; align-items: center; text-decoration: none; }
.logo { height: 38px; width: auto; }

/* Nav toggle */
.nav-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
}
.hamburger,
.hamburger::before,
.hamburger::after {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--color-primary);
  border-radius: 2px;
  transition: all 0.25s;
}
.hamburger { position: relative; }
.hamburger::before, .hamburger::after { content: ''; position: absolute; left: 0; }
.hamburger::before { top: -7px; }
.hamburger::after  { top: 7px; }
.nav-toggle[aria-expanded="true"] .hamburger { background-color: transparent; }
.nav-toggle[aria-expanded="true"] .hamburger::before { transform: rotate(45deg) translate(5px, 5px); }
.nav-toggle[aria-expanded="true"] .hamburger::after  { transform: rotate(-45deg) translate(5px, -5px); }

/* Main nav */
.main-nav {
  display: none;
  flex-direction: column;
  gap: 0.5rem;
  position: absolute;
  top: 4rem;
  left: 0;
  right: 0;
  background-color: var(--color-bg);
  border-bottom: 1px solid #e5e7eb;
  padding: 1rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.main-nav.is-open { display: flex; }
.nav-list { display: flex; flex-direction: column; gap: 0.25rem; }
.nav-link {
  display: block;
  padding: 0.5rem 0.75rem;
  text-decoration: none;
  color: var(--color-text);
  border-radius: 4px;
  font-weight: 500;
}
.nav-link:hover, .nav-link:focus, .nav-link.active { color: var(--color-primary); background-color: #f0f4ff; }
.nav-cta { margin-top: 0.5rem; text-align: center; }

/* Hero */
.hero {
  background: linear-gradient(150deg,
    color-mix(in srgb, var(--color-primary) 7%, var(--color-bg)) 0%,
    var(--color-bg) 60%
  );
  padding: 3rem 0 2.5rem;
}
.hero-inner { display: flex; flex-direction: column; gap: 2rem; }
.hero-content h1 { margin-bottom: 1rem; }
.hero-lead { font-size: 1.125rem; color: #374151; margin-bottom: 1.5rem; }
.hero-actions { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1.25rem; }
.phone-link {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--color-accent);
  text-decoration: none;
}
.phone-link:hover { color: var(--color-primary); }

/* Atouts */
.atouts { background-color: #f8faff; }
.atouts-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; margin-top: 2.5rem; }
.atout-card {
  background-color: var(--color-bg);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.atout-icon { margin-bottom: 1rem; }
.atout-card h3 { margin-bottom: 0.5rem; }
.atout-card p { color: #374151; font-size: 0.9375rem; }

/* Services preview */
.services-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
.service-card {
  background-color: var(--color-bg);
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}
.service-card .visual-placeholder { border-radius: 0; }
.service-card h3 { padding: 1rem 1.25rem 0.375rem; }
.service-card p { padding: 0 1.25rem 1.25rem; color: #374151; font-size: 0.9375rem; }
.service-card a { display: block; padding: 0 1.25rem 1.25rem; font-weight: 600; font-size: 0.9375rem; }

/* CTA band */
.cta-band {
  background-color: var(--color-primary);
  text-align: center;
  padding: 3.5rem 0;
}
.cta-band h2 { color: #fff; margin-bottom: 0.75rem; }
.cta-band p { color: rgba(255,255,255,0.85); margin-bottom: 1.5rem; }
.cta-band .btn + .btn { margin-top: 0.75rem; }
.cta-sub { font-size: 0.9375rem; color: rgba(255,255,255,0.75) !important; margin-bottom: 0.75rem !important; }

/* Page header */
.page-header {
  background: linear-gradient(150deg,
    color-mix(in srgb, var(--color-primary) 7%, var(--color-bg)) 0%,
    var(--color-bg) 60%
  );
  padding: 2.5rem 0 2rem;
  border-bottom: 1px solid #e5e7eb;
}
.page-header h1 { margin-bottom: 0.625rem; }
.page-header .lead { font-size: 1.125rem; color: #374151; }

/* Services list */
.services-list { display: flex; flex-direction: column; gap: 3.5rem; padding: 3.5rem 0; }
.service-detail { display: flex; flex-direction: column; gap: 1.5rem; }
.service-detail-content h2 { text-align: left; margin-bottom: 0.75rem; font-size: 1.5rem; }
.service-detail-content p { color: #374151; }
.service-features { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1rem; }
.service-features li {
  padding-left: 1.375rem;
  position: relative;
  color: #374151;
  font-size: 0.9375rem;
}
.service-features li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--color-accent);
}
.service-divider { border: none; border-top: 1px solid #e5e7eb; }

/* About */
.about-intro { display: flex; flex-direction: column; gap: 2rem; }
.about-values { background-color: #f8faff; padding: 3.5rem 0; }
.values-grid { display: grid; grid-template-columns: 1fr; gap: 1.25rem; margin-top: 2rem; }
.value-card {
  background-color: var(--color-bg);
  border-radius: 8px;
  padding: 1.25rem 1.25rem 1.25rem 1.5rem;
  border-left: 3px solid var(--color-accent);
}
.value-card h3 { font-size: 1rem; margin-bottom: 0.375rem; }
.value-card p { color: #374151; font-size: 0.9375rem; }
.about-quote {
  background-color: color-mix(in srgb, var(--color-primary) 6%, var(--color-bg));
  border-left: 4px solid var(--color-primary);
  padding: 1.25rem 1.5rem;
  border-radius: 0 8px 8px 0;
  margin-top: 1.5rem;
}
.about-quote p { font-style: italic; color: var(--color-primary); font-size: 1.0625rem; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1fr; gap: 2.5rem; padding: 3.5rem 0; }
.contact-info h2 { font-size: 1.375rem; margin-bottom: 1.25rem; text-align: left; }
.contact-detail { display: flex; align-items: flex-start; gap: 0.875rem; margin-bottom: 1.25rem; }
.contact-icon {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: color-mix(in srgb, var(--color-primary) 10%, var(--color-bg));
  border-radius: 50%;
}
.contact-detail-text { flex: 1; }
.contact-detail-text strong { display: block; font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.05em; color: #6b7280; margin-bottom: 0.25rem; }
.contact-detail-text p { color: var(--color-text); font-size: 0.9375rem; }
.contact-detail-text a { color: var(--color-primary); font-weight: 600; text-decoration: none; }
.contact-detail-text a:hover { color: var(--color-accent); }
.contact-map { border-radius: 8px; overflow: hidden; border: 1px solid #e5e7eb; margin-top: 1.5rem; }
.contact-map iframe { display: block; width: 100%; height: 280px; border: none; }

/* Contact form */
.contact-form-section h2 { font-size: 1.375rem; margin-bottom: 1.5rem; text-align: left; }
.form-group { margin-bottom: 1.25rem; }
label { display: block; font-weight: 600; font-size: 0.9375rem; margin-bottom: 0.375rem; color: var(--color-text); }
input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1.5px solid #d1d5db;
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-text);
  background-color: var(--color-bg);
  transition: border-color 0.2s;
  -webkit-appearance: none;
}
input:focus, textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 15%, transparent);
}
textarea { min-height: 150px; resize: vertical; }
.form-privacy { font-size: 0.8125rem; color: #6b7280; margin-bottom: 1.25rem; }

/* Visual placeholders */
.visual-placeholder {
  display: block;
  width: 100%;
  border-radius: 8px;
  aspect-ratio: 16 / 9;
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--color-primary) 22%, var(--color-bg)) 0%,
      color-mix(in srgb, var(--color-primary) 10%, var(--color-bg)) 55%,
      color-mix(in srgb, var(--color-secondary) 18%, var(--color-bg)) 100%
    );
}
.visual-placeholder[data-aspect="4:3"]  { aspect-ratio: 4 / 3; }
.visual-placeholder[data-aspect="1:1"]  { aspect-ratio: 1 / 1; }
.visual-placeholder[data-aspect="3:4"]  { aspect-ratio: 3 / 4; }
.visual-placeholder[data-aspect="21:9"] { aspect-ratio: 21 / 9; }
.visual-placeholder[data-tone="secondary"] {
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--color-secondary) 22%, var(--color-bg)) 0%,
      color-mix(in srgb, var(--color-secondary) 10%, var(--color-bg)) 55%,
      color-mix(in srgb, var(--color-primary) 16%, var(--color-bg)) 100%
    );
}
.visual-placeholder[data-tone="accent"] {
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--color-accent, var(--color-primary)) 22%, var(--color-bg)) 0%,
      color-mix(in srgb, var(--color-primary) 12%, var(--color-bg)) 60%,
      color-mix(in srgb, var(--color-secondary) 16%, var(--color-bg)) 100%
    );
}
.visual-placeholder[data-tone="muted"] {
  background: color-mix(in srgb, var(--color-text) 8%, var(--color-bg));
}

/* Footer */
.site-footer { background-color: #0f1e4f; color: #e2e8f0; padding-top: 3rem; }
.footer-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.footer-logo { height: 36px; width: auto; filter: brightness(0) invert(1); }
.footer-tagline { color: rgba(255,255,255,0.6); font-size: 0.9375rem; margin-top: 0.5rem; }
.footer-heading {
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: rgba(255,255,255,0.45);
  margin-bottom: 0.875rem;
}
.footer-links-list { display: flex; flex-direction: column; gap: 0.5rem; }
.footer-links-list a { color: rgba(255,255,255,0.8); text-decoration: none; font-size: 0.9375rem; }
.footer-links-list a:hover { color: var(--color-accent); }
.footer-contact-info p { font-size: 0.9375rem; color: rgba(255,255,255,0.8); margin-bottom: 0.375rem; }
.footer-contact-info a { color: rgba(255,255,255,0.8); text-decoration: none; }
.footer-contact-info a:hover { color: var(--color-accent); }
.footer-bottom { background-color: rgba(0,0,0,0.2); padding: 1rem 0; }
.footer-bottom-inner {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  text-align: center;
}
.footer-bottom p { font-size: 0.8125rem; color: rgba(255,255,255,0.45); }
.footer-bottom a { color: rgba(255,255,255,0.55); text-decoration: none; }
.footer-bottom a:hover { color: rgba(255,255,255,0.8); }

/* Cookie banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #1a2444;
  padding: 1rem;
  z-index: 200;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: none;
}
.cookie-banner.is-visible { display: block; }
.cookie-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.cookie-banner p { font-size: 0.875rem; color: rgba(255,255,255,0.85); margin: 0; }
.cookie-close {
  padding: 0.5rem 1.25rem;
  background-color: var(--color-accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-display);
  align-self: flex-start;
}

/* ─── Tablet 768px+ ─── */
@media (min-width: 768px) {
  section { padding: 4.5rem 0; }
  .nav-toggle { display: none; }
  .main-nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.375rem;
    position: static;
    background: none;
    border: none;
    padding: 0;
    box-shadow: none;
  }
  .nav-list { flex-direction: row; gap: 0; }
  .nav-cta { margin-top: 0; padding: 0.5rem 1.125rem; font-size: 0.9375rem; margin-left: 0.5rem; }
  .hero { padding: 4.5rem 0 4rem; }
  .hero-inner { flex-direction: row; align-items: center; gap: 3rem; }
  .hero-content { flex: 1; }
  .hero-visual { flex: 1; }
  .hero-actions { flex-direction: row; flex-wrap: wrap; }
  .atouts-grid { grid-template-columns: repeat(3, 1fr); }
  .services-grid { grid-template-columns: repeat(3, 1fr); }
  .values-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr 1fr; align-items: start; }
  .contact-map iframe { height: 320px; }
  .footer-inner { grid-template-columns: 2fr 1fr 1fr; }
  .footer-bottom-inner { flex-direction: row; justify-content: space-between; }
  .cookie-inner { flex-direction: row; align-items: center; justify-content: space-between; }
  .cookie-close { align-self: auto; }
}

/* ─── Desktop 1024px+ ─── */
@media (min-width: 1024px) {
  .hero { padding: 5.5rem 0 5rem; }
  .service-detail { flex-direction: row; align-items: flex-start; gap: 3.5rem; }
  .service-detail .visual-placeholder { order: 0; flex: 0 0 42%; }
  .service-detail:nth-child(even) .visual-placeholder { order: 1; }
  .service-detail:nth-child(even) .service-detail-content { order: 0; }
  .service-detail-content { flex: 1; }
}

/* ─── Motion — template E « diptyque salon » ────────────────────
   Pass animations discrètes santé : entrées douces, hover mesuré,
   dégradés qui glissent. Tout est encapsulé sous prefers-reduced-
   motion: no-preference. Le kill-switch reduce est en fin de fichier.
*/
@media (prefers-reduced-motion: no-preference) {

  /* 1. Scroll reveal — .fade-in (utilisée dans le HTML WebBuilder)
     Fallback JS via .is-visible pour navigateurs sans view() timelines. */
  .fade-in {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 620ms cubic-bezier(.2,.7,.2,1), transform 620ms cubic-bezier(.2,.7,.2,1);
    will-change: opacity, transform;
  }
  .fade-in.is-visible,
  .no-js .fade-in {
    opacity: 1;
    transform: none;
  }
  @supports (animation-timeline: view()) {
    .fade-in {
      opacity: 1;
      transform: none;
      animation: kb-reveal linear both;
      animation-timeline: view();
      animation-range: entry 5% cover 22%;
    }
  }
  @keyframes kb-reveal {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: none; }
  }

  /* 2. Cartes — lift discret + bordure teal au survol/focus */
  .card,
  .atout-card,
  .service-card,
  .value-card {
    transition:
      transform 260ms cubic-bezier(.2,.7,.2,1),
      box-shadow 260ms cubic-bezier(.2,.7,.2,1),
      border-color 260ms ease;
  }
  .card:hover,
  .atout-card:hover,
  .service-card:hover,
  .value-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px -14px color-mix(in srgb, var(--color-primary) 55%, transparent);
  }
  .service-card:hover,
  .value-card:hover { border-color: var(--color-accent); }

  /* 3. Boutons — micro-lift + halo au survol/focus */
  .btn {
    transition:
      background-color 220ms ease,
      color 220ms ease,
      border-color 220ms ease,
      transform 220ms cubic-bezier(.2,.7,.2,1),
      box-shadow 220ms ease;
    will-change: transform;
  }
  .btn:hover { transform: translateY(-1px); }
  .btn:active { transform: translateY(0); }
  .btn-primary:hover { box-shadow: 0 8px 20px -10px color-mix(in srgb, var(--color-primary) 65%, transparent); }
  .btn-accent:hover  { box-shadow: 0 8px 20px -10px color-mix(in srgb, var(--color-accent) 65%, transparent); }

  /* 4. Visual placeholders — dégradé qui glisse doucement au survol.
     N'altère jamais l'aspect-ratio (pas de CLS). */
  .visual-placeholder {
    background-size: 180% 180%;
    background-position: 0% 0%;
    transition: background-position 900ms ease, transform 500ms cubic-bezier(.2,.7,.2,1);
  }
  .hero-inner:hover .visual-placeholder,
  .two-col:hover .visual-placeholder,
  .service-card:hover .visual-placeholder {
    background-position: 100% 100%;
  }
  .service-card:hover .visual-placeholder { transform: scale(1.015); }

  /* 5. Focus visible — halo teal soigné, jamais coupé */
  a:focus-visible,
  button:focus-visible,
  .btn:focus-visible,
  input:focus-visible,
  textarea:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 3px;
    border-radius: 4px;
    transition: outline-offset 160ms ease;
  }
  .btn:focus-visible { outline-offset: 4px; }

  /* 6. Bandeau téléphone — battement d'attention discret (santé/urgence douce) */
  .phone-banner {
    position: relative;
    overflow: hidden;
  }
  .phone-banner::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg,
      transparent 0%,
      color-mix(in srgb, var(--color-accent) 20%, transparent) 45%,
      transparent 90%);
    transform: translateX(-100%);
    animation: kb-phone-shine 7s ease-in-out 2s infinite;
    pointer-events: none;
  }
  @keyframes kb-phone-shine {
    0%, 15%   { transform: translateX(-100%); }
    45%, 100% { transform: translateX(100%); }
  }

  /* Liens nav — soulignement animé bottom */
  nav a {
    background-image: linear-gradient(currentColor, currentColor);
    background-size: 0% 1.5px;
    background-position: 0 100%;
    background-repeat: no-repeat;
    transition: background-size 260ms ease, color 200ms ease;
    text-decoration: none;
  }
  nav a:hover,
  nav a:focus-visible,
  nav a[aria-current="page"] {
    background-size: 100% 1.5px;
  }
}

/* Kill-switch a11y — respecte impérativement le choix utilisateur.
   WCAG 2.3.3 + honore prefers-reduced-motion.               */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .fade-in { opacity: 1 !important; transform: none !important; }
  .phone-banner::after { display: none !important; }
}
