@import url("fonts.css");
@import url("variables.css");

/* ============================================
   Reset & base
   ============================================ */

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: clamp(1rem, 0.95rem + 0.2vw, 1.125rem);
  line-height: 1.65;
  color: var(--ink-soft);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--blue-500);
  text-decoration: none;
  transition: color var(--duration) var(--ease);
}

a:hover {
  color: var(--blue-600);
}

ul {
  list-style: none;
}

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

/* ============================================
   Typography
   ============================================ */

h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

h1 {
  font-size: clamp(2.25rem, 4vw + 1rem, 3.75rem);
}

h2 {
  font-size: clamp(1.75rem, 2.5vw + 0.75rem, 2.75rem);
}

h3 {
  font-size: clamp(1.25rem, 1.5vw + 0.5rem, 1.75rem);
}

.prose {
  max-width: 68ch;
}

.eyebrow {
  display: block;
  margin-bottom: 0.75rem;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--blue-500);
}

/* ============================================
   Layout
   ============================================ */

.container {
  width: min(100% - 2.5rem, var(--container));
  margin-inline: auto;
}

.band-white,
.band-blue {
  padding-block: clamp(64px, 8vw, 120px);
}

.band-white {
  background: var(--white);
}

.band-blue {
  background: var(--blue-50);
}

.band-blue--alt {
  background: var(--blue-100);
}

.section-placeholder {
  min-height: 120px;
  border: 1px dashed var(--blue-200);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.5);
}

/* ============================================
   Divider ECG — signature graphique
   ============================================ */

.divider-ecg {
  width: 100%;
  height: 48px;
  overflow: visible;
  color: var(--blue-200);
}

.divider-ecg__line {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
  transition: stroke-dashoffset 1.2s var(--ease);
}

.divider-ecg.is-visible .divider-ecg__line {
  stroke-dashoffset: 0;
}

/* ============================================
   Buttons
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  transition:
    background-color var(--duration) var(--ease),
    border-color var(--duration) var(--ease),
    color var(--duration) var(--ease),
    transform var(--duration) var(--ease),
    box-shadow var(--duration) var(--ease);
}

.btn-primary {
  background: var(--blue-500);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--blue-600);
  color: var(--white);
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  border-color: var(--blue-200);
  color: var(--ink);
}

.btn-ghost:hover {
  border-color: var(--blue-400);
  color: var(--ink);
  transform: translateY(-2px);
}

/* ============================================
   Cards
   ============================================ */

.card {
  background: var(--white);
  border: 1px solid var(--blue-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition:
    transform var(--duration) var(--ease),
    box-shadow var(--duration) var(--ease);
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
}

.card__body {
  padding: 1.75rem;
}

/* ============================================
   Reveal au scroll
   ============================================ */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.6s var(--ease),
    transform 0.6s var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
}

.reveal.is-revealed {
  opacity: 1;
  transform: none;
}

/* ============================================
   Header
   ============================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--blue-100);
  backdrop-filter: blur(12px);
  transition: height var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}

.site-header.is-compact {
  height: calc(var(--header-height) - 14px);
  box-shadow: 0 4px 20px rgba(18, 48, 92, 0.06);
}

.site-header.is-compact .site-logo {
  font-size: 1.1rem;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  height: 100%;
}

.site-logo {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.site-logo:hover {
  color: var(--blue-600);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.site-nav a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink-soft);
}

.site-nav a:hover {
  color: var(--blue-600);
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.site-header__phone {
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}

.site-header__phone:hover {
  color: var(--blue-600);
}

.site-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 44px;
  height: 44px;
  padding: 0;
  background: none;
  border: 1px solid var(--blue-200);
  border-radius: 999px;
  cursor: pointer;
}

.site-burger span {
  display: block;
  width: 18px;
  height: 2px;
  margin-inline: auto;
  background: var(--ink);
  transition: transform var(--duration) var(--ease), opacity var(--duration) var(--ease);
}

.site-burger.is-open span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.site-burger.is-open span:nth-child(2) {
  opacity: 0;
}

.site-burger.is-open span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* ============================================
   Footer
   ============================================ */

.site-footer {
  background: var(--ink);
  color: rgba(255, 255, 255, 0.82);
  padding-block: clamp(48px, 6vw, 80px) 2rem;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.92);
}

.site-footer a:hover {
  color: rgba(255, 255, 255, 0.95);
}

.site-footer__eyebrow {
  color: rgba(255, 255, 255, 0.55);
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

.site-footer__brand {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  color: var(--white);
  margin-bottom: 0.75rem;
}

.site-footer__poles {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.site-footer__social {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.site-footer__social a {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  transition:
    background-color var(--duration) var(--ease),
    border-color var(--duration) var(--ease),
    transform var(--duration) var(--ease);
}

.site-footer__social a:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.35);
  transform: translateY(-2px);
}

.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.65);
}

/* ============================================
   Formulaire de contact (commun)
   ============================================ */

.vb-contact-form {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--blue-50);
  border-radius: var(--radius);
  border: 1px solid var(--blue-200);
}

.vb-contact-form h3 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.vb-form-pole {
  margin-bottom: 1rem;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.vb-form-pole strong {
  color: var(--ink);
}

.vb-form-row {
  margin-bottom: 1rem;
}

.vb-form-row label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--ink);
}

.vb-form-row input,
.vb-form-row textarea,
.vb-form-row select {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  border: 1px solid var(--blue-200);
  border-radius: calc(var(--radius) / 2);
  background: var(--white);
  transition: border-color var(--duration) var(--ease);
}

.vb-form-row input:focus,
.vb-form-row textarea:focus,
.vb-form-row select:focus {
  border-color: var(--blue-400);
  outline: none;
}

.vb-form-row input[aria-invalid="true"],
.vb-form-row textarea[aria-invalid="true"] {
  border-color: var(--ember);
}

.vb-form-row textarea {
  min-height: 120px;
  resize: vertical;
}

.vb-form-row--checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.vb-form-row--checkbox input {
  width: auto;
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.vb-form-row--checkbox label {
  font-weight: 400;
  font-size: 0.875rem;
  line-height: 1.5;
  margin-bottom: 0;
}

.vb-form-error {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.8rem;
  color: var(--ember);
  min-height: 1.1em;
}

.vb-form-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.vb-form-status {
  padding: 0.85rem 1rem;
  border-radius: calc(var(--radius) / 2);
  font-size: 0.925rem;
  margin-bottom: 1rem;
}

.vb-form-status--success {
  background: rgba(111, 178, 232, 0.15);
  border: 1px solid var(--blue-300);
  color: var(--ink);
}

.vb-form-status--error {
  background: rgba(232, 111, 111, 0.1);
  border: 1px solid var(--ember);
  color: var(--ink);
}

.vb-contact-form button[type="submit"].is-loading {
  opacity: 0.7;
  cursor: wait;
}

/* ============================================
   Lightbox galerie
   ============================================ */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(18, 48, 92, 0.88);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--duration) var(--ease), visibility var(--duration) var(--ease);
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox__inner {
  position: relative;
  max-width: min(960px, 100%);
  max-height: 90vh;
}

.lightbox__img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.lightbox__caption {
  margin-top: 0.75rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.925rem;
}

.lightbox__close {
  position: absolute;
  top: -2.75rem;
  right: 0;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  background: transparent;
  color: var(--white);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  transition: background var(--duration) var(--ease);
}

.lightbox__nav:hover {
  background: rgba(255, 255, 255, 0.2);
}

.lightbox__nav--prev {
  left: 1rem;
}

.lightbox__nav--next {
  right: 1rem;
}

/* ============================================
   Bande réseaux sociaux
   ============================================ */

.social-band {
  background: linear-gradient(135deg, var(--blue-50) 0%, var(--blue-100) 50%, var(--blue-50) 100%);
  padding-block: clamp(56px, 7vw, 96px);
}

.social-band__head {
  text-align: center;
  margin-bottom: 2.5rem;
}

.social-band__head .prose {
  margin-inline: auto;
  color: var(--ink-soft);
}

.social-band__cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.social-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 2rem 1.5rem;
  background: var(--white);
  border: 1px solid var(--blue-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
  color: var(--ink);
  transition:
    transform var(--duration) var(--ease),
    box-shadow var(--duration) var(--ease),
    border-color var(--duration) var(--ease);
}

.social-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
  border-color: var(--blue-400);
  color: var(--ink);
}

.social-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: var(--blue-50);
  color: var(--blue-500);
  transition: transform var(--duration) var(--ease), background var(--duration) var(--ease);
}

.social-card:hover .social-card__icon {
  transform: scale(1.12);
  background: var(--blue-100);
}

.social-card__label {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 600;
}

.social-card__cta {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--blue-500);
}

.social-card--facebook .social-card__icon { color: #1877f2; }
.social-card--instagram .social-card__icon { color: #e4405f; }
.social-card--linkedin .social-card__icon { color: #0a66c2; }

/* Rail sticky réseaux (desktop) */
.social-rail {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem 0.5rem;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--blue-100);
  border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
  box-shadow: -4px 0 20px rgba(18, 48, 92, 0.06);
  backdrop-filter: blur(8px);
}

.social-rail a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  color: var(--ink-soft);
  transition: color var(--duration) var(--ease), background var(--duration) var(--ease);
}

.social-rail a:hover {
  background: var(--blue-50);
  color: var(--blue-600);
}

/* Bouton d'appel flottant (mobile) */
.call-fab {
  display: none;
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 95;
  width: 56px;
  height: 56px;
  align-items: center;
  justify-content: center;
  background: var(--blue-500);
  color: var(--white);
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(18, 48, 92, 0.25);
  transition: transform var(--duration) var(--ease), background var(--duration) var(--ease);
}

.call-fab:hover {
  background: var(--blue-600);
  color: var(--white);
  transform: scale(1.05);
}

.site-footer__social-block {
  grid-column: 1 / -1;
  padding-top: 1.5rem;
  margin-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.site-footer__social-heading {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 1rem;
}

/* Skip link (complète le CSS critique inline) */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 1000;
  padding: 0.75rem 1.25rem;
  background: var(--ink);
  color: var(--white);
  font-weight: 600;
  border-radius: 999px;
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
  outline: 2px solid var(--blue-500);
  outline-offset: 2px;
}

/* Lisibilité au zoom 200 % */
@media (min-width: 1px) {
  .container {
    max-width: 100%;
  }

  .prose,
  p,
  li {
    overflow-wrap: anywhere;
  }
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 900px) {
  .site-nav {
    position: fixed;
    inset: var(--header-height) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 1rem 1.25rem 1.5rem;
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid var(--blue-100);
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    transition:
      transform var(--duration) var(--ease),
      opacity var(--duration) var(--ease);
  }

  .site-nav.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .site-nav a {
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--blue-100);
  }

  .site-burger {
    display: flex;
  }

  .site-header__phone {
    display: none;
  }

  .call-fab {
    display: flex;
  }

  .social-rail {
    display: none;
  }

  .social-band__cards {
    grid-template-columns: 1fr;
  }

  .lightbox__nav--prev {
    left: 0.25rem;
  }

  .lightbox__nav--next {
    right: 0.25rem;
  }

  .site-footer__grid {
    grid-template-columns: 1fr;
  }
}

@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;
  }

  .divider-ecg__line {
    stroke-dashoffset: 0;
  }

  .card:hover,
  .btn-primary:hover,
  .btn-ghost:hover,
  .site-footer__social a:hover {
    transform: none;
  }

  .social-card:hover .social-card__icon {
    transform: none;
  }

  .call-fab {
    display: none !important;
  }
}
