@import url("tokens.css");

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  font-size: 1rem;
}
h1, h2, h3, h4, h5 { font-family: var(--font-display); line-height: 1.25; }
a { color: var(--color-primary); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { padding-left: 1.25rem; }

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

/* ---- Header ---- */
header {
  background: var(--color-bg);
  border-bottom: 3px solid var(--color-primary);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--color-primary) 12%, transparent);
}
header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}
.logo-link { display: inline-flex; }
.logo { height: 42px; width: auto; }

/* ---- Hamburger ---- */
.nav-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-primary);
  transition: transform 0.25s, opacity 0.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); }

/* ---- Nav ---- */
#main-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-secondary);
  padding: 1rem 1.25rem;
}
#main-nav.open { display: block; }
#main-nav ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
#main-nav a {
  color: var(--color-text);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
  padding: 0.25rem 0;
  display: block;
}
#main-nav a:hover,
#main-nav a[aria-current="page"] { color: var(--color-primary); }

/* ---- Sections ---- */
section { padding: 3rem 0; }

/* ---- Hero ---- */
.hero {
  background: linear-gradient(160deg,
    color-mix(in srgb, var(--color-primary) 6%, var(--color-bg)) 0%,
    var(--color-bg) 100%
  );
  padding: 3rem 0;
}
.hero .container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.hero-content { flex: 1; }
.hero-content h1 {
  font-size: clamp(1.75rem, 5vw, 3rem);
  color: var(--color-primary);
  margin-bottom: 1rem;
}
.hero-content h1 span { color: var(--color-accent); }
.hero-intro {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  max-width: 560px;
}
.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ---- Buttons ---- */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-family: var(--font-display);
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: opacity 0.2s, box-shadow 0.2s, background 0.2s;
  border: 2px solid transparent;
}
.btn-primary {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}
.btn-primary:hover {
  opacity: 0.9;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--color-primary) 35%, transparent);
}
.btn-secondary {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}
.btn-secondary:hover { opacity: 0.9; }
.btn-outline {
  background: transparent;
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.btn-outline:hover {
  background: var(--color-primary);
  color: #fff;
}

/* ---- Services preview ---- */
.services-preview {
  background: color-mix(in srgb, var(--color-secondary) 12%, var(--color-bg));
}
.services-preview h2 {
  text-align: center;
  font-size: clamp(1.4rem, 3vw, 2rem);
  color: var(--color-primary);
  margin-bottom: 2rem;
}
.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
.service-card {
  background: var(--color-bg);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 10px color-mix(in srgb, var(--color-text) 8%, transparent);
  border-top: 3px solid var(--color-primary);
}
.service-card h3 {
  color: var(--color-primary);
  margin-bottom: 0.75rem;
  font-size: 1.05rem;
}
.service-card p { margin-bottom: 1rem; font-size: 0.95rem; }
.link-arrow {
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}
.link-arrow:hover { text-decoration: underline; }

/* ---- Social proof ---- */
.social-proof {
  background: var(--color-primary);
  color: #fff;
  text-align: center;
  padding: 3rem 0;
}
.social-proof .rating-badge { margin-bottom: 1rem; }
.social-proof .rating-stars {
  font-size: 1.75rem;
  display: block;
  margin-bottom: 0.5rem;
  letter-spacing: 4px;
  color: #FFD700;
}
.social-proof p { font-size: 1rem; }
.social-proof strong { color: #fff; }
.social-proof blockquote {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid color-mix(in srgb, #fff 25%, transparent);
}
.social-proof blockquote p {
  font-style: italic;
  opacity: 0.85;
  max-width: 600px;
  margin: 0 auto;
}

/* ---- CTA section ---- */
.cta-section {
  text-align: center;
  background: color-mix(in srgb, var(--color-accent) 6%, var(--color-bg));
}
.cta-section h2 {
  color: var(--color-primary);
  margin-bottom: 0.75rem;
  font-size: clamp(1.35rem, 3vw, 2rem);
}
.cta-section p { margin-bottom: 1.5rem; }
.cta-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
}

/* ---- Page hero ---- */
.page-hero { padding: 2.5rem 0; }
.page-hero h1 {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  color: var(--color-primary);
  margin-bottom: 1.5rem;
}

/* ---- Services detail (prestations.html) ---- */
.services-list .container {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}
.service-detail {
  border-bottom: 1px solid color-mix(in srgb, var(--color-secondary) 60%, var(--color-bg));
  padding-bottom: 2.5rem;
}
.service-detail:last-child { border-bottom: none; }
.service-header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
  align-items: flex-start;
}
.service-detail h2 {
  color: var(--color-primary);
  font-size: clamp(1.2rem, 3vw, 1.6rem);
}
.service-detail .visual-placeholder { margin-bottom: 1rem; }
.service-detail p { margin-bottom: 1rem; }
.service-detail ul { margin-bottom: 1.5rem; }
.service-detail li { margin-bottom: 0.4rem; }
.badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.2rem 0.7rem;
  border-radius: 99px;
}
.badge-remboursé {
  background: color-mix(in srgb, var(--color-accent) 12%, var(--color-bg));
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
}

/* ---- About page ---- */
.about-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding: 2.5rem 0;
}
.about-text p { margin-bottom: 1.1rem; }
.about-highlight {
  background: color-mix(in srgb, var(--color-secondary) 15%, var(--color-bg));
  border-left: 4px solid var(--color-primary);
  padding: 1rem 1.25rem;
  border-radius: 0 6px 6px 0;
  margin: 1.5rem 0;
}

/* ---- Contact page ---- */
.contact-grid {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  padding: 2.5rem 0;
}
.contact-info { }
.contact-info h2 {
  color: var(--color-primary);
  margin-bottom: 1rem;
  font-size: 1.3rem;
}
.contact-table { width: 100%; border-collapse: collapse; margin-bottom: 1.5rem; }
.contact-table td { padding: 0.5rem 0; vertical-align: top; }
.contact-table td:first-child {
  font-weight: 700;
  color: var(--color-primary);
  width: 120px;
  font-size: 0.9rem;
}
.contact-map { margin-top: 1.5rem; }
.contact-map h2 {
  color: var(--color-primary);
  margin-bottom: 0.75rem;
  font-size: 1.2rem;
}
.contact-map iframe {
  width: 100%;
  height: 300px;
  border: none;
  border-radius: 8px;
  display: block;
}
.contact-form h2 {
  color: var(--color-primary);
  margin-bottom: 1.25rem;
  font-size: 1.3rem;
}
form { display: flex; flex-direction: column; gap: 1.1rem; }
.form-group { display: flex; flex-direction: column; gap: 0.35rem; }
.form-group label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-text);
}
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1.5px solid var(--color-secondary);
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 1rem;
  background: var(--color-bg);
  color: var(--color-text);
  transition: border-color 0.2s, outline 0.2s;
}
.form-group textarea { min-height: 130px; resize: vertical; }
.form-group input:focus,
.form-group textarea:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-color: var(--color-primary);
}
.rgpd-mention {
  font-size: 0.8rem;
  opacity: 0.65;
  margin-top: 0.5rem;
}

/* ---- Footer ---- */
footer {
  background: var(--color-primary);
  color: #fff;
  padding: 3rem 0 1.5rem;
  margin-top: 2rem;
}
footer a { color: color-mix(in srgb, var(--color-secondary) 70%, #fff); }
footer a:hover { color: #fff; text-decoration: underline; }
.footer-grid {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-bottom: 2rem;
}
.footer-logo {
  filter: brightness(0) invert(1);
  margin-bottom: 0.75rem;
  height: 36px;
  width: auto;
}
.footer-brand p { opacity: 0.8; font-size: 0.9rem; line-height: 1.6; }
.footer-nav ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.footer-nav a {
  font-weight: 600;
  font-size: 0.95rem;
}
footer address { font-style: normal; font-size: 0.9rem; line-height: 1.8; opacity: 0.85; }
.footer-copy {
  text-align: center;
  opacity: 0.55;
  font-size: 0.82rem;
  border-top: 1px solid color-mix(in srgb, #fff 20%, transparent);
  padding-top: 1.5rem;
  margin-top: 1rem;
}

/* ---- 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));
}

/* ---- Responsive: tablet ---- */
@media (min-width: 640px) {
  .hero-actions { flex-direction: row; }
  .cta-actions { flex-direction: row; justify-content: center; }
}

@media (min-width: 768px) {
  .nav-toggle { display: none; }
  #main-nav {
    display: block;
    position: static;
    border: none;
    padding: 0;
    background: transparent;
  }
  #main-nav ul {
    flex-direction: row;
    gap: 2rem;
    align-items: center;
  }
  #main-nav a { padding: 0; }

  .hero .container { flex-direction: row; align-items: center; }
  .hero .visual-placeholder { flex: 1; max-width: 50%; }
  .hero-content { flex: 1; padding-right: 2rem; }

  .services-grid { grid-template-columns: repeat(2, 1fr); }

  .service-header { flex-direction: row; align-items: center; gap: 1rem; }

  .about-content { flex-direction: row; align-items: flex-start; }
  .about-text { flex: 1.5; }
  .about-image { flex: 1; }

  .contact-grid { flex-direction: row; }
  .contact-info { flex: 1; }
  .contact-form { flex: 1.2; }

  .footer-grid { flex-direction: row; justify-content: space-between; }
}

/* ---- Responsive: desktop ---- */
@media (min-width: 1024px) {
  .services-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ================================================================
   ANIMATION PASS — WEB-1876 · CERIAC Nahémy · Podologue Le Gosier
   Template médical : sobre, rassurant, bleu institutionnel + teal
   ================================================================ */

/* --- Keyframes --- */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: none; }
}
@keyframes fadeSlideLeft {
  from { opacity: 0; transform: translateX(-22px); }
  to   { opacity: 1; transform: none; }
}
@keyframes placeholderShimmer {
  from { transform: translateX(-100%); }
  to   { transform: translateX(100%); }
}
@keyframes subtlePulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.028); }
}

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

  /* ---- 1. Hero : entrée slide-in à l'ouverture de page ---- */
  .hero-content h1 {
    animation: fadeSlideLeft 0.5s ease both;
  }
  .hero-intro {
    animation: fadeSlideLeft 0.5s 0.1s ease both;
  }
  .hero-actions {
    animation: fadeSlideLeft 0.5s 0.2s ease both;
  }

  /* ---- 2. Visual placeholders : shimmer doux (dégradé glissant) ---- */
  .visual-placeholder {
    position: relative;
    overflow: hidden;
  }
  .visual-placeholder::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
      90deg,
      transparent 0%,
      color-mix(in srgb, #fff 28%, transparent) 50%,
      transparent 100%
    );
    transform: translateX(-100%);
    animation: placeholderShimmer 2.8s ease-in-out infinite;
    pointer-events: none;
  }

  /* ---- 3. Service cards : hover lift (micro-interaction) ---- */
  .service-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-top-color 0.2s ease;
    will-change: transform;
  }
  .service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 28px color-mix(in srgb, var(--color-primary) 16%, transparent);
    border-top-color: var(--color-accent);
  }
  .service-card:focus-within {
    border-top-color: var(--color-accent);
  }

  /* ---- 4. Nav : soulignement animé au survol ---- */
  #main-nav a {
    position: relative;
  }
  #main-nav a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    height: 2px;
    width: 0;
    background: var(--color-primary);
    border-radius: 1px;
    transition: width 0.22s ease;
  }
  #main-nav a:hover::after,
  #main-nav a[aria-current="page"]::after {
    width: 100%;
  }

  /* ---- 5. CTA : pulse doux sur le bouton principal ---- */
  .cta-section .btn-primary {
    animation: subtlePulse 3.2s ease-in-out 0.8s infinite;
  }
  .cta-section .btn-primary:hover,
  .cta-section .btn-primary:focus {
    animation-play-state: paused;
  }

  /* ---- 6. Scroll reveal : CSS scroll-driven (Chromium 115+) ---- */
  @supports (animation-timeline: view()) {
    .services-preview,
    .social-proof,
    .cta-section,
    .page-hero,
    .services-list,
    .contact-grid {
      animation: fadeSlideUp 0.65s ease both;
      animation-timeline: view();
      animation-range: entry 0% entry 30%;
    }
    .about-content {
      animation: fadeSlideUp 0.65s ease both;
      animation-timeline: view();
      animation-range: entry 0% entry 30%;
    }
    .service-detail {
      animation: fadeSlideUp 0.6s ease both;
      animation-timeline: view();
      animation-range: entry 0% entry 25%;
    }
  }

  /* ---- 6b. Scroll reveal : fallback IntersectionObserver (Firefox / Safari) ---- */
  @supports not (animation-timeline: view()) {
    [data-reveal="pending"] {
      opacity: 0;
      transform: translateY(20px);
      transition: opacity 0.65s ease, transform 0.65s ease;
    }
    [data-reveal="done"] {
      opacity: 1;
      transform: none;
    }
  }

  /* ---- Focus visible : ring teal distinctif ---- */
  :focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 3px;
    transition: outline-offset 0.15s ease;
  }
}

/* ---- Accessibilité : désactivation complète des animations ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
