@import url('tokens.css');

/* ── Reset ─────────────────────────────────────────── */
*, *::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;
}

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

a { color: var(--color-primary); }

/* ── Skip link ─────────────────────────────────────── */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--color-primary);
  color: #fff;
  padding: 0.5rem 1rem;
  text-decoration: none;
  z-index: 1000;
  border-radius: 0 0 6px 0;
}
.skip-link:focus { left: 0; }

/* ── Typography ─────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.2;
  color: var(--color-primary);
}
h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); margin-bottom: 1rem; }
h2 { font-size: clamp(1.3rem, 3vw, 1.8rem); margin-bottom: 0.75rem; }
h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
p  { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

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

.section      { padding: 3rem 0; }
.section-alt  { background: #EEF2FF; }
.section-dark { background: var(--color-primary); color: #fff; }
.section-dark h2, .section-dark h3 { color: #fff; }

/* ── Header ─────────────────────────────────────────── */
.site-header {
  background: var(--color-bg);
  border-bottom: 3px solid var(--color-primary);
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 8px rgba(30,58,138,0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  gap: 1rem;
}

.logo-link { flex-shrink: 0; }
.logo { width: 170px; height: auto; }

/* ── Mobile nav toggle ──────────────────────────────── */
.nav-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-primary);
  border-radius: 2px;
  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); }

/* ── Navigation ─────────────────────────────────────── */
.main-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--color-bg);
  border-top: 1px solid #E5E7EB;
  box-shadow: 0 4px 12px rgba(30,58,138,0.1);
}
.main-nav.open { display: block; }
.main-nav ul { list-style: none; padding: 0.5rem 0; }
.main-nav li a {
  display: block;
  padding: 0.75rem 1.5rem;
  color: var(--color-text);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  border-left: 3px solid transparent;
}
.main-nav li a:hover,
.main-nav li a.active {
  color: var(--color-primary);
  border-left-color: var(--color-accent);
  background: #EEF2FF;
}

/* ── Buttons ─────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  border: 2px solid transparent;
  line-height: 1.2;
}
.btn:hover  { opacity: 0.88; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary  { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.btn-accent   { background: var(--color-accent);  color: #fff; border-color: var(--color-accent);  }
.btn-outline  { background: transparent; color: var(--color-primary); border-color: var(--color-primary); }

/* ── Hero ────────────────────────────────────────────── */
.hero {
  background: linear-gradient(140deg, #1E3A8A 0%, #1a4fd8 100%);
  color: #fff;
  padding: 2.5rem 0 2rem;
}
.hero h1, .hero p { color: #fff; }
.hero-inner {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.hero-content { flex: 1; }
.hero-visual  { flex: 1; }
.hero-tagline {
  font-family: var(--font-display);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #93C5FD;
  margin-bottom: 0.5rem;
}
.hero-lead { font-size: 1.1rem; opacity: 0.9; margin: 1rem 0 1.5rem; }
.hero em    { font-style: italic; color: #BAE6FD; }

.cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.phones-hero {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.2);
}
.phones-hero a {
  color: #BAE6FD;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
}
.phones-hero a:hover { color: #fff; text-decoration: underline; }
.phone-label { font-size: 0.8rem; opacity: 0.7; }

/* ── Service cards ───────────────────────────────────── */
.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin: 2rem 0;
}
.card {
  background: var(--color-bg);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 16px rgba(30,58,138,0.09);
  transition: box-shadow 0.2s;
}
.card:hover { box-shadow: 0 6px 24px rgba(30,58,138,0.16); }
.card-body { padding: 1.25rem; }
.card-body h3 { color: var(--color-primary); }
.card-body p  { color: #374151; font-size: 0.95rem; }

/* ── Two-cabinets strip ──────────────────────────────── */
.cabinets-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin: 2rem 0;
}
.cabinet-card {
  background: var(--color-bg);
  border-radius: 10px;
  padding: 1.75rem;
  box-shadow: 0 2px 16px rgba(30,58,138,0.09);
  border-left: 4px solid var(--color-accent);
}
.cabinet-card h3 { margin-bottom: 0.5rem; }
.cabinet-card address { font-style: normal; color: #374151; margin-bottom: 1.25rem; line-height: 1.8; }

/* ── Services list page ──────────────────────────────── */
.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin: 2rem 0;
}
.service-block {
  background: var(--color-bg);
  border-radius: 10px;
  padding: 1.5rem;
  box-shadow: 0 2px 12px rgba(30,58,138,0.07);
}
.service-block h3 {
  font-size: 1.15rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #EEF2FF;
  margin-bottom: 0.75rem;
}
.service-block ul { padding-left: 1.25rem; color: #374151; }
.service-block ul li { margin-bottom: 0.3rem; }
.service-block p { color: #374151; }

/* ── About page ──────────────────────────────────────── */
.about-layout {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.about-body h2 { margin-top: 2rem; }
.about-body h2:first-child { margin-top: 0; }
.about-body p { color: #374151; }
.about-badge {
  display: inline-block;
  background: #EEF2FF;
  color: var(--color-primary);
  font-family: var(--font-display);
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  font-size: 0.85rem;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
}
.about-badges { margin: 1rem 0; }

/* ── Contact page ────────────────────────────────────── */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin: 2rem 0;
}
.contact-block { }
.contact-block h3 { margin-bottom: 0.75rem; }
.contact-block address {
  font-style: normal;
  line-height: 1.9;
  color: #374151;
  margin-bottom: 1rem;
}
.contact-block address a { color: var(--color-primary); text-decoration: none; }
.contact-block address a:hover { text-decoration: underline; }

.map-frame {
  width: 100%;
  height: 280px;
  border: 0;
  border-radius: 8px;
  margin-top: 1rem;
  box-shadow: 0 2px 8px rgba(30,58,138,0.1);
}

/* ── Contact form ────────────────────────────────────── */
.contact-form-section { max-width: 680px; }
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  margin-top: 1.5rem;
}
.form-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.form-row label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--color-primary);
}
.form-row input,
.form-row textarea {
  border: 2px solid #D1D5DB;
  border-radius: 6px;
  padding: 0.65rem 0.85rem;
  font-family: var(--font-body);
  font-size: 1rem;
  width: 100%;
  color: var(--color-text);
  background: #FAFAFA;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-row input:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(14,165,233,0.15);
  background: var(--color-bg);
}
.form-row textarea { min-height: 130px; resize: vertical; }
.rgpd-notice {
  font-size: 0.8rem;
  color: #6B7280;
  line-height: 1.5;
  padding-top: 0.5rem;
}

/* ── Mentions légales ────────────────────────────────── */
.legal-page { max-width: 780px; margin: 0 auto; }
.legal-page h2 { margin: 2.5rem 0 0.75rem; font-size: 1.2rem; border-bottom: 2px solid #EEF2FF; padding-bottom: 0.35rem; }
.legal-page p  { color: #374151; margin-bottom: 0.75rem; }

/* ── Page hero (inner pages) ─────────────────────────── */
.page-hero {
  background: linear-gradient(140deg, #1E3A8A 0%, #1a4fd8 100%);
  color: #fff;
  padding: 2.5rem 0;
}
.page-hero h1 { color: #fff; margin-bottom: 0.5rem; }
.page-hero p  { color: #BAE6FD; max-width: 640px; }

/* ── CTA strip ───────────────────────────────────────── */
.cta-strip {
  background: var(--color-accent);
  padding: 2rem 0;
  text-align: center;
}
.cta-strip h2 { color: #fff; margin-bottom: 1rem; }
.cta-strip .phone-big {
  display: block;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  margin-bottom: 0.35rem;
}
.cta-strip .phone-big:hover { text-decoration: underline; }
.cta-strip .phone-label { font-size: 0.85rem; color: rgba(255,255,255,0.75); margin-bottom: 0.75rem; }

/* ── Footer ─────────────────────────────────────────── */
.site-footer {
  background: var(--color-primary);
  color: rgba(255,255,255,0.85);
  padding: 2.5rem 0 0;
  margin-top: 0;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding-bottom: 2rem;
}
.footer-col { font-size: 0.9rem; line-height: 1.9; }
.footer-col strong { color: #fff; display: block; margin-bottom: 0.25rem; }
.footer-col a { color: rgba(255,255,255,0.75); text-decoration: none; }
.footer-col a:hover { color: #fff; text-decoration: underline; }
.footer-nav { margin-top: 0.5rem; display: flex; flex-direction: column; gap: 0.25rem; }
.footer-bottom {
  background: rgba(0,0,0,0.25);
  padding: 1rem 1.25rem;
  text-align: center;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.55);
}

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

/* ── Tablet (≥ 768px) ────────────────────────────────── */
@media (min-width: 768px) {
  .nav-toggle { display: none; }
  .main-nav {
    display: block;
    position: static;
    background: none;
    border: none;
    box-shadow: none;
  }
  .main-nav ul {
    display: flex;
    flex-direction: row;
    padding: 0;
    gap: 0.1rem;
  }
  .main-nav li a {
    padding: 0.5rem 1rem;
    border-left: none;
    border-bottom: 3px solid transparent;
    border-radius: 4px 4px 0 0;
  }
  .main-nav li a:hover,
  .main-nav li a.active {
    background: none;
    border-left-color: transparent;
    border-bottom-color: var(--color-accent);
    color: var(--color-primary);
  }

  .hero-inner { flex-direction: row; align-items: center; }
  .hero-content { padding-right: 2rem; }

  .cards          { grid-template-columns: repeat(3, 1fr); }
  .cabinets-row   { grid-template-columns: repeat(2, 1fr); }
  .services-grid  { grid-template-columns: repeat(2, 1fr); }
  .contact-grid   { grid-template-columns: repeat(2, 1fr); }

  .about-layout { flex-direction: row; gap: 3rem; }
  .about-visual { flex: 0 0 260px; }
  .about-body   { flex: 1; }

  .footer-inner { grid-template-columns: repeat(4, 1fr); }

  .phones-hero { flex-direction: row; gap: 2rem; }
}

/* ── Desktop (≥ 1024px) ──────────────────────────────── */
@media (min-width: 1024px) {
  .container { padding: 0 2rem; }
  .section   { padding: 4rem 0; }
  .hero      { padding: 4rem 0 3rem; }
  .page-hero { padding: 3.5rem 0; }
  .services-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ===== ANIMATIONS — WEB-4255 (AnimationDesigner) ===== */

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

  /* 1. Hero index — fade + slide-up (stagger 0.2s) */
  @keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .hero-text   { animation: fadeSlideUp 0.6s ease both; }
  .hero-visual { animation: fadeSlideUp 0.6s ease 0.2s both; }

  /* 2. Pages internes — cascade hero */
  @keyframes cascadeIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .page-hero .hero-eyebrow { animation: cascadeIn 0.5s ease both; }
  .page-hero h1             { animation: cascadeIn 0.5s ease 0.1s both; }
  .page-hero .hero-lead     { animation: cascadeIn 0.5s ease 0.2s both; }

  /* 3. Placeholders visuels — lift on hover */
  .visual-placeholder {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
  }
  .visual-placeholder:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  }

  /* 4. Focus visible — outline-offset animé */
  :focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 0px;
    transition: outline-offset 0.15s ease;
  }
  :focus-visible:focus-within {
    outline-offset: 3px;
  }

  /* 5. Nav desktop — border-bottom transition */
  .main-nav a:not(.btn-nav) {
    border-bottom: 2px solid transparent;
    transition: border-bottom-color 0.25s ease;
  }
  .main-nav a:not(.btn-nav):hover,
  .main-nav a:not(.btn-nav):focus {
    border-bottom-color: var(--color-accent);
  }

  /* 6. Scroll reveals (animation-timeline: view()) */
  @keyframes revealUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  @supports (animation-timeline: view()) {
    .section-title,
    .section-lead,
    .about-preview-text,
    .cta-band > *,
    .check-list li {
      animation: revealUp 0.5s ease both;
      animation-timeline: view();
      animation-range: entry 0% entry 40%;
    }
    .check-list li:nth-child(2) { animation-delay: 0.1s; }
    .check-list li:nth-child(3) { animation-delay: 0.2s; }
    .check-list li:nth-child(4) { animation-delay: 0.3s; }
  }
}

/* prefers-reduced-motion: disable all */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
