@import url('tokens.css');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Lato:wght@400;700&display=swap');

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ── Visual placeholders ────────────────────────────────────── */
.visual-placeholder {
  display: block;
  width: 100%;
  border-radius: 12px;
  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) 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));
}

/* ── Typography ─────────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-primary);
}
h1 { font-size: clamp(1.75rem, 5vw, 2.8rem); }
h2 { font-size: clamp(1.35rem, 3.5vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.4rem); }
p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }
strong { font-weight: 700; }

/* ── Utility ─────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1100px;
  margin-inline: auto;
  padding-inline: 1.25rem;
}
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .8rem 1.6rem;
  border-radius: 8px;
  font-family: var(--font-display);
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background .2s, color .2s, border-color .2s;
  text-decoration: none;
}
.btn-primary {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}
.btn-primary:hover, .btn-primary:focus-visible {
  background: color-mix(in srgb, var(--color-accent) 85%, #000);
  border-color: color-mix(in srgb, var(--color-accent) 85%, #000);
}
.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.btn-outline:hover, .btn-outline:focus-visible {
  background: var(--color-primary);
  color: #fff;
}
.btn-phone {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
  font-size: 1.05rem;
}
.btn-phone:hover, .btn-phone:focus-visible {
  background: color-mix(in srgb, var(--color-primary) 85%, #000);
}

/* ── Header / Nav ────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid color-mix(in srgb, var(--color-primary) 12%, #fff);
  box-shadow: 0 1px 6px rgba(0,0,0,.06);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: .75rem;
}
.site-logo img {
  height: 44px;
  width: auto;
}
.header-phone {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-primary);
  white-space: nowrap;
}
.header-phone svg { flex-shrink: 0; }

/* Nav */
.nav-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: .4rem;
  border-radius: 6px;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-primary);
  border-radius: 2px;
  transition: transform .25s, opacity .25s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}
.site-nav {
  display: none;
  flex-direction: column;
  background: #fff;
  border-top: 1px solid color-mix(in srgb, var(--color-primary) 10%, #fff);
  padding: 1rem 1.25rem 1.5rem;
}
.site-nav.open { display: flex; }
.site-nav a {
  padding: .6rem 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  color: var(--color-text);
  border-bottom: 1px solid color-mix(in srgb, var(--color-secondary) 25%, transparent);
  transition: color .15s;
}
.site-nav a:hover, .site-nav a[aria-current="page"] {
  color: var(--color-primary);
}

/* ── Hero ────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(
    160deg,
    color-mix(in srgb, var(--color-primary) 8%, var(--color-bg)) 0%,
    var(--color-bg) 60%
  );
  padding-block: 3rem 2.5rem;
}
.hero-inner {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.hero-content { order: 1; }
.hero-creole {
  display: inline-block;
  font-size: .85rem;
  font-style: italic;
  color: var(--color-secondary);
  margin-bottom: 1rem;
  padding: .35rem .75rem;
  background: color-mix(in srgb, var(--color-secondary) 12%, var(--color-bg));
  border-radius: 20px;
  border-left: 3px solid var(--color-secondary);
}
.hero h1 { margin-bottom: 1.25rem; }
.hero-desc {
  font-size: 1.05rem;
  color: color-mix(in srgb, var(--color-text) 80%, #fff);
  margin-bottom: 1.75rem;
  max-width: 52ch;
}
.hero-cta {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.hero-visual { order: 2; }

/* ── Trust bar ───────────────────────────────────────────────── */
.trust-bar {
  background: var(--color-primary);
  color: #fff;
  padding-block: 1.25rem;
}
.trust-items {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.trust-item {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: .9rem;
  font-weight: 600;
}
.trust-item svg { flex-shrink: 0; opacity: .85; }

/* ── Section base ────────────────────────────────────────────── */
.section { padding-block: 3.5rem; }
.section-alt { background: color-mix(in srgb, var(--color-secondary) 8%, var(--color-bg)); }
.section-dark {
  background: var(--color-primary);
  color: #fff;
}
.section-dark h2, .section-dark h3 { color: #fff; }

.section-header {
  margin-bottom: 2.25rem;
}
.section-label {
  display: inline-block;
  font-family: var(--font-display);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: .5rem;
}
.section-dark .section-label { color: var(--color-secondary); }
.section-header h2 { margin-bottom: .6rem; }
.section-header p { color: color-mix(in srgb, var(--color-text) 70%, #fff); font-size: 1.05rem; }

/* ── Service cards ───────────────────────────────────────────── */
.services-grid {
  display: grid;
  gap: 1.25rem;
}
.service-card {
  background: #fff;
  border: 1px solid color-mix(in srgb, var(--color-secondary) 25%, transparent);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.service-icon {
  width: 48px;
  height: 48px;
  background: color-mix(in srgb, var(--color-primary) 12%, var(--color-bg));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  flex-shrink: 0;
}
.service-card h3 { color: var(--color-primary); font-size: 1.1rem; }
.service-card p { font-size: .92rem; color: color-mix(in srgb, var(--color-text) 75%, #fff); margin: 0; }
.service-card ul {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.service-card li {
  font-size: .88rem;
  padding-left: 1.1rem;
  position: relative;
  color: color-mix(in srgb, var(--color-text) 80%, #fff);
}
.service-card li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--color-primary);
  font-weight: 700;
  font-size: .85rem;
}

/* ── Remboursement steps ─────────────────────────────────────── */
.steps {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  counter-reset: step;
}
.step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.step-num {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: var(--color-accent);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .9rem;
}
.step-body h3 { font-size: 1rem; margin-bottom: .3rem; }
.step-body p { font-size: .9rem; margin: 0; }

.remb-rates {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
}
.remb-rate {
  background: #fff;
  border-radius: 10px;
  padding: 1.25rem;
  border-left: 4px solid var(--color-primary);
}
.remb-rate .rate-pct {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1;
  margin-bottom: .3rem;
}
.remb-rate p { font-size: .9rem; margin: 0; }

/* ── CTA band ────────────────────────────────────────────────── */
.cta-band {
  background: var(--color-accent);
  color: #fff;
  text-align: center;
  padding-block: 2.5rem;
}
.cta-band h2 { color: #fff; margin-bottom: .75rem; }
.cta-band p { color: rgba(255,255,255,.9); margin-bottom: 1.5rem; }
.cta-band .btn-phone {
  background: #fff;
  color: var(--color-accent);
  border-color: #fff;
  font-size: 1.15rem;
}
.cta-band .btn-phone:hover { background: rgba(255,255,255,.9); }

/* ── Contact form ────────────────────────────────────────────── */
.contact-grid {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.contact-info {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.contact-item {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
}
.contact-item svg { flex-shrink: 0; margin-top: .15rem; color: var(--color-primary); }
.contact-item h3 { font-size: .95rem; margin-bottom: .2rem; }
.contact-item p { font-size: .9rem; margin: 0; color: color-mix(in srgb, var(--color-text) 75%, #fff); }
.contact-item a { color: var(--color-primary); font-weight: 700; }

form { display: flex; flex-direction: column; gap: 1rem; }
.form-group { display: flex; flex-direction: column; gap: .4rem; }
label {
  font-family: var(--font-display);
  font-size: .85rem;
  font-weight: 600;
  color: var(--color-text);
}
input, textarea, select {
  width: 100%;
  padding: .7rem .9rem;
  border: 1.5px solid color-mix(in srgb, var(--color-secondary) 50%, transparent);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: .95rem;
  color: var(--color-text);
  background: #fff;
  transition: border-color .2s;
  outline: none;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 15%, transparent);
}
textarea { min-height: 120px; resize: vertical; }
.form-note {
  font-size: .8rem;
  color: color-mix(in srgb, var(--color-text) 55%, #fff);
}

/* ── A-propos ────────────────────────────────────────────────── */
.about-intro {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.about-content p { font-size: 1.02rem; }
.about-highlight {
  background: color-mix(in srgb, var(--color-primary) 6%, var(--color-bg));
  border-left: 4px solid var(--color-primary);
  border-radius: 0 10px 10px 0;
  padding: 1.25rem 1.5rem;
  margin-block: 1rem;
}
.about-highlight p { font-style: italic; font-size: .95rem; margin: 0; }

/* ── Page hero (inner pages) ─────────────────────────────────── */
.page-hero {
  background: linear-gradient(
    145deg,
    color-mix(in srgb, var(--color-primary) 90%, #000) 0%,
    color-mix(in srgb, var(--color-primary) 70%, var(--color-secondary)) 100%
  );
  color: #fff;
  padding-block: 3rem 2.5rem;
}
.page-hero h1, .page-hero p { color: #fff; }
.page-hero p { color: rgba(255,255,255,.85); font-size: 1.05rem; max-width: 52ch; }
.breadcrumb {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .82rem;
  color: rgba(255,255,255,.65);
  margin-bottom: 1rem;
}
.breadcrumb a { color: rgba(255,255,255,.65); transition: color .15s; }
.breadcrumb a:hover { color: #fff; }
.breadcrumb span { color: rgba(255,255,255,.4); }

/* ── Footer ──────────────────────────────────────────────────── */
.site-footer {
  background: color-mix(in srgb, var(--color-primary) 95%, #000);
  color: rgba(255,255,255,.85);
  padding-block: 2.5rem 1.5rem;
}
.footer-grid {
  display: grid;
  gap: 2rem;
  margin-bottom: 2rem;
}
.footer-brand .site-logo img { filter: brightness(0) invert(1); height: 40px; }
.footer-brand p {
  font-size: .88rem;
  color: rgba(255,255,255,.65);
  margin-top: .75rem;
}
.footer-links h4 {
  font-family: var(--font-display);
  font-size: .85rem;
  font-weight: 700;
  color: rgba(255,255,255,.55);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: .75rem;
}
.footer-links ul { display: flex; flex-direction: column; gap: .5rem; }
.footer-links a {
  font-size: .88rem;
  color: rgba(255,255,255,.8);
  transition: color .15s;
}
.footer-links a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.12);
  padding-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  font-size: .8rem;
  color: rgba(255,255,255,.45);
}

/* ── Mentions légales ────────────────────────────────────────── */
.legal-content { max-width: 72ch; }
.legal-content h2 { margin-top: 2rem; margin-bottom: .6rem; }
.legal-content p, .legal-content ul { font-size: .95rem; }
.legal-content ul { padding-left: 1.25rem; list-style: disc; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (min-width: 640px) {
  .hero-cta { flex-direction: row; flex-wrap: wrap; }
  .trust-items { flex-direction: row; flex-wrap: wrap; gap: 1.5rem; }
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .remb-rates { grid-template-columns: repeat(2, 1fr); }
  .steps { gap: 1.75rem; }
}

@media (min-width: 900px) {
  .site-nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: .25rem;
    background: none;
    border: none;
    padding: 0;
    position: static;
  }
  .site-nav a {
    padding: .4rem .75rem;
    border-bottom: none;
    border-radius: 6px;
    font-size: .92rem;
  }
  .site-nav a:hover, .site-nav a[aria-current="page"] {
    background: color-mix(in srgb, var(--color-primary) 8%, transparent);
  }
  .nav-toggle { display: none; }
  .hero-inner {
    flex-direction: row;
    align-items: center;
    gap: 3rem;
  }
  .hero-content { order: 1; flex: 1; }
  .hero-visual { order: 2; flex: 1; }
  .hero h1 { margin-bottom: 1.5rem; }
  .services-grid { grid-template-columns: repeat(3, 1fr); }
  .contact-grid { flex-direction: row; gap: 3rem; }
  .contact-info { min-width: 260px; }
  .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
  .footer-bottom { flex-direction: row; justify-content: space-between; }
  .about-intro { flex-direction: row; align-items: flex-start; gap: 3rem; }
  .about-content { flex: 2; }
  .about-visual { flex: 1; }
}

/* ════════════════════════════════════════════════════════════════
   Animation Pass — Template Domicile Care [WEB-4220]
   CSS-first · GPU-friendly · no external lib · a11y-safe
════════════════════════════════════════════════════════════════ */

/* reduced-motion guard — WCAG 2.3.1 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (prefers-reduced-motion: no-preference) {

  /* keyframes */
  @keyframes kd-fade-up {
    from { opacity: 0; transform: translateY(22px); }
    to   { opacity: 1; transform: none; }
  }
  @keyframes kd-slide-left {
    from { opacity: 0; transform: translateX(-14px); }
    to   { opacity: 1; transform: none; }
  }

  /* 1. Hero entrance — staggered children, time-based */
  .hero-creole { animation: kd-slide-left .4s ease-out both; }
  .hero h1     { animation: kd-fade-up .55s .12s ease-out both; }
  .hero-desc   { animation: kd-fade-up .5s .22s ease-out both; }
  .hero-cta    { animation: kd-fade-up .5s .34s ease-out both; }
  .hero-visual { animation: kd-fade-up .6s .1s ease-out both; }

  /* 2. Scroll-driven reveals — Chromium 115+ progressive enhancement */
  @supports (animation-timeline: view()) {
    .section-header {
      animation: kd-fade-up .55s ease-out both;
      animation-timeline: view();
      animation-range: entry 0% entry 55%;
    }
    .trust-item {
      animation: kd-fade-up .45s ease-out both;
      animation-timeline: view();
      animation-range: entry 0% entry 70%;
    }
    .about-content {
      animation: kd-fade-up .5s ease-out both;
      animation-timeline: view();
      animation-range: entry 0% entry 50%;
    }
    .about-visual {
      animation: kd-fade-up .55s ease-out both;
      animation-timeline: view();
      animation-range: entry 5% entry 60%;
    }
    .cta-band .container {
      animation: kd-fade-up .5s ease-out both;
      animation-timeline: view();
      animation-range: entry 0% entry 60%;
    }
  }

  /* 3. Service card hover — icon lift + border glow */
  /* (avoid transform conflict with existing main.js inline styles) */
  .service-icon {
    transition: translate .22s ease, background .22s ease;
  }
  .service-card:hover .service-icon {
    translate: 0 -3px;
    background: color-mix(in srgb, var(--color-primary) 20%, var(--color-bg));
  }
  .service-card:hover {
    border-color: color-mix(in srgb, var(--color-primary) 40%, transparent);
  }

  /* 4. Remboursement rate card hover */
  .remb-rate:hover {
    background: color-mix(in srgb, var(--color-primary) 4%, #fff);
  }

  /* 5. Visual placeholder shimmer on hover */
  .visual-placeholder {
    background-size: 200% 200%;
    transition: background-position .65s ease;
  }
  .visual-placeholder:hover {
    background-position: 100% 100%;
  }

  /* 6. Button enhanced hover */
  .btn {
    transition: background .22s ease, color .22s ease, border-color .22s ease,
                box-shadow .22s ease, translate .15s ease;
  }
  .btn:hover {
    translate: 0 -1px;
    box-shadow: 0 4px 14px rgba(0,0,0,.11);
  }
  .btn:active {
    translate: 0;
    box-shadow: none;
  }
  .cta-band .btn-phone:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,.14);
  }

}

/* 7. Focus ring — always active, not motion-gated */
:focus-visible {
  outline: 2.5px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 4px;
}
.btn:focus-visible {
  outline: 2.5px solid var(--color-primary);
  outline-offset: 4px;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-primary) 18%, transparent);
}
.btn-primary:focus-visible,
.btn-phone:focus-visible {
  outline-color: var(--color-accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-accent) 18%, transparent);
}
.site-nav a:focus-visible,
.footer-links a:focus-visible {
  outline-color: var(--color-primary);
  outline-offset: 2px;
}
