/* ===================================================================
   Agence Informatique — feuille de style principale
   Design system adapté de Teram : couleurs, typographie, layout,
   composants communs, méga-menu et FAQ.
   =================================================================== */

:root {
  --color-bg: #F8F7F4;
  --color-surface: #FFFFFF;
  --color-navy: #172B3A;
  --color-petrol: #0E6E78;
  --color-accent-blue: #1D5FD6;
  --color-btn-blue: #2F6FFF;
  --color-ocre: #C8852E;
  --color-text: #1E2933;
  --color-text-muted: #4C5A63;
  --color-border: #E3DFD6;

  --font-system: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 3px rgba(23, 43, 58, 0.08);
  --shadow-md: 0 6px 20px rgba(23, 43, 58, 0.10);

  --container-width: 1180px;
}

/* ---------- Reset minimal ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-system);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  font-size: 16px;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--color-petrol); text-decoration-thickness: 1.5px; }
a:hover { color: var(--color-navy); }
h1, h2, h3, h4 { color: var(--color-navy); line-height: 1.25; margin-top: 0; }
p { margin-top: 0; }
ul, ol { padding-left: 1.3em; }
button { font-family: inherit; }

/* Respect des préférences de mouvement réduit */
@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;
  }
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-navy);
  color: #fff;
  padding: 0.75em 1.25em;
  z-index: 1000;
  border-radius: 0 0 var(--radius-md) 0;
}
.skip-link:focus {
  left: 0;
}

/* ---------- Focus visible ---------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--color-ocre);
  outline-offset: 2px;
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

main { display: block; }
main:focus { outline: none; }

/* ---------- Header / Navigation ---------- */
.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 0.9rem 1.5rem;
  max-width: var(--container-width);
  margin: 0 auto;
  gap: 1rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-navy);
  text-decoration: none;
}
.brand:hover { color: var(--color-petrol); }
.brand svg { width: 32px; height: 32px; flex-shrink: 0; }

.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.5rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.9rem;
  cursor: pointer;
  color: var(--color-navy);
  font-weight: 600;
}
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: inline; }

.main-nav {
  flex: 1 1 auto;
  order: 3;
  flex-basis: 100%;
}
.main-nav > ul,
.mega-menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 1.6rem;
  flex-wrap: wrap;
}
.main-nav a {
  color: var(--color-text);
  text-decoration: none;
  font-weight: 600;
  padding: 0.4rem 0.1rem;
  border-bottom: 2px solid transparent;
}
.main-nav a:hover,
.main-nav a:focus-visible,
.main-nav a[aria-current="page"] {
  color: var(--color-petrol);
  border-bottom-color: var(--color-petrol);
}

/* ---------- Méga-menu ---------- */
.mega-menu-item { position: relative; }
.mega-menu-trigger {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  color: var(--color-text);
  padding: 0.4rem 0.1rem;
  border-bottom: 2px solid transparent;
}
.mega-menu-trigger:hover,
.mega-menu-trigger:focus-visible,
.mega-menu-trigger[aria-expanded="true"] {
  color: var(--color-petrol);
  border-bottom-color: var(--color-petrol);
}
.mega-menu-caret { transition: transform 0.15s ease; flex-shrink: 0; }
.mega-menu-trigger[aria-expanded="true"] .mega-menu-caret { transform: rotate(180deg); }

.mega-menu-panel {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 0.6rem;
  min-width: 300px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 0.7rem;
  z-index: 110;
}
.mega-menu-panel ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.mega-menu-panel a {
  display: block;
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius-md);
  color: var(--color-text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  border-bottom: none;
}
.mega-menu-panel a:hover,
.mega-menu-panel a:focus-visible {
  background: var(--color-bg);
  color: var(--color-petrol);
}

@media (min-width: 861px) {
  .mega-menu-item:hover .mega-menu-panel,
  .mega-menu-item:focus-within .mega-menu-panel,
  .mega-menu-panel.is-open {
    display: block;
  }
}

.header-cta { flex-shrink: 0; order: 2; align-self: flex-start; }

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; order: 2; }
  .header-cta { order: 2; margin-left: auto; }
  .main-nav {
    display: none;
    width: 100%;
    order: 4;
    border-top: 1px solid var(--color-border);
    background: var(--color-surface);
    flex: 1 1 100%;
  }
  .main-nav.is-open { display: block; }
  .main-nav ul,
  .mega-menu {
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 1.5rem 1rem;
  }
  .main-nav li,
  .mega-menu-item { border-bottom: 1px solid var(--color-border); }
  .main-nav li:last-child,
  .mega-menu-item:last-child { border-bottom: none; }
  .main-nav a { display: block; padding: 0.75rem 0.2rem; }

  .mega-menu-trigger { width: 100%; justify-content: space-between; padding: 0.75rem 0.2rem; }
  .mega-menu-panel {
    position: static;
    display: none;
    margin: 0 0 0.5rem;
    padding: 0 0 0 0.8rem;
    border: none;
    box-shadow: none;
    border-radius: 0;
    background: transparent;
  }
  .mega-menu-panel.is-open { display: block; }
  .mega-menu-panel a { padding: 0.5rem 0.4rem; font-weight: 500; }
}

/* ---------- Fil d'Ariane ---------- */
.breadcrumb {
  padding: 0.9rem 0;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}
.breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
}
.breadcrumb li:not(:last-child)::after {
  content: "›";
  margin-left: 0.4rem;
  color: var(--color-border);
}
.breadcrumb a { color: var(--color-text-muted); text-decoration: underline; }
.breadcrumb [aria-current="page"] { color: var(--color-navy); font-weight: 600; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(180deg, #EFEAE0 0%, var(--color-bg) 100%);
  padding: 3.5rem 0;
  border-bottom: 1px solid var(--color-border);
}
.hero-inner { max-width: 760px; }
.hero .eyebrow {
  display: inline-block;
  color: var(--color-petrol);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.85rem;
  margin-bottom: 0.8rem;
}
.hero h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); margin-bottom: 1rem; }
.hero p.lead { font-size: 1.15rem; color: var(--color-text-muted); margin-bottom: 1.8rem; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

.page-hero {
  background: var(--color-navy);
  color: #fff;
  padding: 2.6rem 0;
}
.page-hero h1 { color: #fff; margin-bottom: 0.6rem; }
.page-hero p { color: #CBD8DE; max-width: 700px; margin: 0; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1.2;
}
.btn-primary { background: linear-gradient(180deg, #4C82FF 0%, var(--color-btn-blue) 100%); color: #fff; }
.btn-primary:hover { background: linear-gradient(180deg, #3A70F0 0%, #1F55E0 100%); color: #fff; }
.btn-secondary { background: transparent; border-color: var(--color-navy); color: var(--color-navy); }
.btn-secondary:hover { background: var(--color-navy); color: #fff; }
.btn-accent { background: var(--color-accent-blue); color: #fff; }
.btn-accent:hover { background: #1750B5; color: #fff; }
.btn-ocre { background: #9E641A; color: #fff; }
.btn-ocre:hover { background: #8A5817; color: #fff; }
.btn-ghost { background: transparent; color: var(--color-btn-blue); border-color: var(--color-border); }
.btn-ghost:hover { border-color: var(--color-btn-blue); }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.9rem; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.btn-cta { white-space: nowrap; }
@media (max-width: 480px) {
  .btn-cta { padding: 0.6rem 0.9rem; font-size: 0.9rem; }
}

/* ---------- Sections ---------- */
section { padding: 3rem 0; }
.section-head { max-width: 680px; margin: 0 auto 2.2rem; text-align: center; }
.section-head h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
.section-head p { color: var(--color-text-muted); }
.bg-surface { background: var(--color-surface); }
.bg-navy { background: var(--color-navy); color: #fff; }
.bg-navy h2, .bg-navy h3 { color: #fff; }

/* ---------- Grilles / Cartes ---------- */
.grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid-4 { grid-template-columns: 1fr; } }

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.6rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.card-link {
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.card-link:hover, .card-link:focus-visible {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: #E7F1F1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-petrol);
}
.card-icon svg { width: 24px; height: 24px; }
.card h3 { font-size: 1.15rem; margin-bottom: 0.2rem; }
.card p { color: var(--color-text-muted); margin: 0; font-size: 0.96rem; }
.card .tag {
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: #EFEAE0;
  color: var(--color-navy);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}

/* ---------- Listes "pourquoi" ---------- */
.reasons-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 1.4rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.reasons-list li { display: flex; gap: 0.9rem; align-items: flex-start; }
.reasons-list .r-icon {
  flex-shrink: 0;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--color-navy);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.reasons-list .r-icon svg { width: 20px; height: 20px; }
.reasons-list strong { display: block; color: var(--color-navy); margin-bottom: 0.15rem; }

/* ---------- Bloc confidentialité ---------- */
.privacy-banner {
  background: #EAF3F1;
  border: 1px solid #CFE3DE;
  border-radius: var(--radius-lg);
  padding: 1.6rem 1.8rem;
  display: flex;
  gap: 1.1rem;
  align-items: flex-start;
}
.privacy-banner svg { flex-shrink: 0; width: 32px; height: 32px; color: var(--color-petrol); }
.privacy-banner h3 { margin-bottom: 0.3rem; }
.privacy-banner p { margin: 0; color: var(--color-text-muted); }

/* ---------- Avertissement contenu informatif ---------- */
.notice {
  border-left: 4px solid var(--color-ocre);
  background: #FBF3E7;
  padding: 1rem 1.2rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 0.94rem;
  color: var(--color-text);
}
.notice strong { color: var(--color-navy); }

/* ---------- CTA bandeau ---------- */
.cta-band {
  background: var(--color-navy);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 2.4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.cta-band h2 { color: #fff; margin-bottom: 0.4rem; }
.cta-band p { color: #CBD8DE; margin: 0; }

/* ---------- Formulaires ---------- */
.field { margin-bottom: 1.2rem; }
.field label { display: block; font-weight: 600; margin-bottom: 0.35rem; color: var(--color-navy); }
.field .hint { font-size: 0.85rem; color: var(--color-text-muted); margin-top: 0.3rem; }
.field .error { font-size: 0.85rem; color: #B3261E; margin-top: 0.3rem; font-weight: 600; }
.field input[type="text"],
.field input[type="email"],
.field input[type="number"],
.field input[type="tel"],
.field select,
.field textarea {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
  font-size: 1rem;
  color: var(--color-text);
  font-family: inherit;
}
.field textarea { resize: vertical; min-height: 120px; }
.field-honeypot {
  display: none;
}
fieldset { border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 1rem 1.2rem; margin: 0 0 1.2rem; }
legend { font-weight: 700; color: var(--color-navy); padding: 0 0.4rem; }

/* ---------- Tableaux ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--color-border); }
th { color: var(--color-navy); }

/* ---------- FAQ (accordéon) ---------- */
.faq-accordion { display: flex; flex-direction: column; gap: 0.8rem; }
.faq-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}
.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 1rem 1.2rem;
  font-weight: 700;
  color: var(--color-navy);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--color-petrol);
  flex-shrink: 0;
}
.faq-item[open] summary::after { content: "\2212"; }
.faq-item summary:focus-visible {
  outline: 3px solid var(--color-ocre);
  outline-offset: -2px;
  border-radius: var(--radius-md);
}
.faq-answer { padding: 0 1.2rem 1.1rem; color: var(--color-text-muted); }
.faq-answer p:last-child { margin-bottom: 0; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--color-navy);
  color: #CBD8DE;
  margin-top: 3rem;
  padding: 3rem 0 1.5rem;
}
.footer-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: 2fr 1fr 1fr;
}
@media (max-width: 780px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h2, .site-footer h3 { color: #fff; }
.site-footer .footer-brand { font-weight: 700; font-size: 1.2rem; color: #fff; margin-bottom: 0.6rem; display: flex; align-items: center; gap: 0.5rem; }
.site-footer .footer-brand svg { width: 26px; height: 26px; }
.site-footer p { color: #A9BAC3; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 0.5rem; }
.site-footer a { color: #CBD8DE; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  margin-top: 2.2rem;
  padding-top: 1.2rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: #93A5AF;
}

/* ---------- Retour en haut ---------- */
.back-to-top {
  position: fixed;
  right: 1.2rem;
  bottom: 1.2rem;
  background: var(--color-navy);
  color: #fff;
  border: none;
  border-radius: 999px;
  width: 46px;
  height: 46px;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  z-index: 90;
}
.back-to-top.is-visible { display: flex; }
.back-to-top svg { width: 20px; height: 20px; }

/* ---------- Utilitaires ---------- */
.text-muted { color: var(--color-text-muted); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.center { text-align: center; }
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0; padding: 0; margin: -1px;
}
.stack { display: flex; flex-direction: column; gap: 1rem; }

/* ---------- 404 ---------- */
.error-page { text-align: center; padding: 4rem 0; }
.error-page .error-code { font-size: 5rem; font-weight: 800; color: var(--color-petrol); margin: 0; }

/* ---------- Plan du site ---------- */
.sitemap-category { margin-bottom: 2.4rem; scroll-margin-top: 5.5rem; }
.sitemap-category h2 { border-bottom: 2px solid var(--color-border); padding-bottom: 0.5rem; }
.sitemap-pillar { margin-bottom: 1.4rem; }
.sitemap-pillar h3 { font-size: 1.05rem; margin-bottom: 0.4rem; }
.sitemap-pillar ul { columns: 2; column-gap: 2rem; margin: 0; }
@media (max-width: 640px) { .sitemap-pillar ul { columns: 1; } }
.sitemap-pillar li { margin-bottom: 0.3rem; break-inside: avoid; }
