/* Formation IA — feuille de style commune
   Thème sobre B2B/TPE-PME. Pas de framework CSS. */

:root {
  --color-bg: #f7f8fa;
  --color-surface: #ffffff;
  --color-border: #e2e5ea;
  --color-text: #1c2430;
  --color-text-muted: #5b6472;
  --color-primary: #1f4b99;
  --color-primary-dark: #163a78;
  --color-primary-light: #eaf0fb;
  --color-accent: #0f8a5f;
  --color-danger: #b3261e;
  --color-warning: #8a6d1f;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(20, 30, 50, 0.06), 0 2px 8px rgba(20, 30, 50, 0.04);
  --max-width: 1080px;
  font-size: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  /* Fond animé : dégradés colorés ancrés au viewport (background-attachment:
     fixed) qui dérivent lentement. Contrairement à des blobs en pseudo-
     élément positionnés dans les coins (masqués par le hero/footer opaques),
     ce fond appartient à body lui-même : il reste visible partout où les
     sections au-dessus sont transparentes ou translucides (marges, section,
     hero/footer en verre). */
  background:
    radial-gradient(circle at 15% 20%, rgba(31, 75, 153, 0.30) 0%, transparent 45%),
    radial-gradient(circle at 85% 75%, rgba(15, 138, 95, 0.28) 0%, transparent 45%),
    var(--color-bg);
  background-size: 200% 200%, 200% 200%, auto;
  background-attachment: fixed, fixed, scroll;
  animation: bgDrift 22s ease-in-out infinite alternate;
  color: var(--color-text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  position: relative;
}
@keyframes bgDrift {
  0% { background-position: 0% 0%, 100% 100%, 0 0; }
  50% { background-position: 25% 15%, 75% 85%, 0 0; }
  100% { background-position: 10% 30%, 90% 65%, 0 0; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 0.5em; font-weight: 700; }
h1 { font-size: 2.1rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

main { position: relative; z-index: 1; }

/* --- Header / nav --- */
.site-header {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--color-text);
  letter-spacing: -0.01em;
}
.brand span { color: var(--color-primary); }
.brand:hover { text-decoration: none; }

.main-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.main-nav a {
  position: relative;
  color: var(--color-text-muted);
  font-weight: 500;
  font-size: 0.95rem;
}
.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -4px;
  height: 2px;
  background: var(--color-primary);
  transition: right 0.25s ease;
}
.main-nav a:hover { color: var(--color-primary); text-decoration: none; }
.main-nav a:hover::after,
.main-nav a.active::after { right: 0; }
.main-nav a.active { color: var(--color-primary); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.4rem 0.6rem;
  font-size: 1.1rem;
  cursor: pointer;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0.65rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 1px 2px rgba(31, 75, 153, 0.25);
  transition: background 0.15s ease, box-shadow 0.2s ease, transform 0.15s ease;
}
.btn-primary:hover {
  background: var(--color-primary-dark);
  box-shadow: 0 6px 18px rgba(31, 75, 153, 0.35);
  transform: translateY(-2px);
}
.btn-primary:active { transform: translateY(0); box-shadow: 0 1px 2px rgba(31, 75, 153, 0.25); }
.btn-primary:disabled { background: #9db3d6; cursor: not-allowed; box-shadow: none; transform: none; }
.btn-outline {
  background: transparent;
  border-color: var(--color-primary);
  color: var(--color-primary);
  transition: background 0.15s ease, transform 0.15s ease;
}
.btn-outline:hover { background: var(--color-primary-light); transform: translateY(-2px); }
.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.85rem; }
.btn-block { width: 100%; }

/* --- Hero --- */
.hero {
  position: relative;
  padding: 4rem 0 3rem;
  text-align: center;
  /* Translucide (pas blanc plein) : laisse le fond animé de body bleeder
     légèrement à travers, tout en gardant le texte parfaitement lisible. */
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55) 0%, rgba(247, 248, 250, 0.55) 100%);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, var(--color-primary-light) 0%, transparent 45%, var(--color-primary-light) 100%);
  opacity: 0.45;
  z-index: 0;
}
.hero .container { position: relative; z-index: 1; }
.hero h1 {
  max-width: 720px;
  margin: 0 auto 0.75rem;
  animation: fadeInUp 0.6s ease both;
}
.hero .lead {
  max-width: 620px;
  margin: 0 auto 2rem;
  color: var(--color-text-muted);
  font-size: 1.1rem;
  animation: fadeInUp 0.6s ease 0.1s both;
}
.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  animation: fadeInUp 0.6s ease 0.2s both;
}

/* --- Sections / cards --- */
.section { padding: 3rem 0; }
.section-title { text-align: center; margin-bottom: 2rem; }
.section-title p { color: var(--color-text-muted); max-width: 600px; margin: 0 auto; }

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

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  animation: fadeInUp 0.5s ease both;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 28px rgba(20, 30, 50, 0.12), 0 2px 8px rgba(20, 30, 50, 0.08);
  border-color: var(--color-primary);
}
.grid-3 > *:nth-child(1) { animation-delay: 0.05s; }
.grid-3 > *:nth-child(2) { animation-delay: 0.15s; }
.grid-3 > *:nth-child(3) { animation-delay: 0.25s; }

.step-card { text-align: center; }
.step-number {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--color-primary-light);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  margin: 0 auto 1rem;
}

/* --- Module cards --- */
.module-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.module-card:hover .module-price { color: var(--color-primary-dark); }
.module-price {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--color-primary);
}
.module-price small { font-size: 0.9rem; color: var(--color-text-muted); font-weight: 500; }
.module-card .desc { color: var(--color-text-muted); flex-grow: 1; }
.module-code-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-accent);
  background: #e6f5ee;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  width: fit-content;
}

/* --- Forms --- */
.form-card {
  max-width: 480px;
  margin: 0 auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  animation: fadeInUp 0.5s ease both;
}
label { display: block; font-weight: 600; margin-bottom: 0.4rem; font-size: 0.92rem; }
input[type="text"], input[type="email"] {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 1rem;
  margin-bottom: 1.25rem;
  font-family: inherit;
}
input:focus { outline: 2px solid var(--color-primary); outline-offset: 1px; }

.help-text { font-size: 0.85rem; color: var(--color-text-muted); }
.notice {
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}
.notice-info { background: var(--color-primary-light); color: var(--color-primary-dark); border: 1px solid #cdddf5; }
.notice-warning { background: #fbf4e0; color: var(--color-warning); border: 1px solid #f0e0ad; }
.notice-error { background: #fbe9e8; color: var(--color-danger); border: 1px solid #f3c8c5; }
.notice-success { background: #e6f5ee; color: var(--color-accent); border: 1px solid #bfe6d3; }

/* --- Audit questionnaire --- */
.progress-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--color-border);
  overflow: hidden;
  margin-bottom: 2rem;
}
.progress-bar-fill {
  height: 100%;
  background: var(--color-primary);
  transition: width 0.25s ease;
}
.axe-group {
  margin-bottom: 2.5rem;
}
.axe-group h3 {
  color: var(--color-primary);
  border-bottom: 2px solid var(--color-primary-light);
  padding-bottom: 0.5rem;
  margin-bottom: 1.25rem;
}
.question-block {
  margin-bottom: 1.75rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--color-border);
}
.question-block:last-child { border-bottom: none; }
.question-text { font-weight: 600; margin-bottom: 0.85rem; }
.options-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.option-label {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 400;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.option-label:hover { border-color: var(--color-primary); background: var(--color-primary-light); }
.option-label input { margin-top: 0.2rem; }
.option-label.checked { border-color: var(--color-primary); background: var(--color-primary-light); }

/* --- Results / radar --- */
.results-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}
.radar-canvas-wrap {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  text-align: center;
}
.scores-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}
.scores-table th, .scores-table td {
  text-align: left;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.9rem;
}
.scores-table th { color: var(--color-text-muted); font-weight: 600; }
.reco-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-primary);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1rem;
}
.reco-axe {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-primary);
  font-weight: 700;
  margin-bottom: 0.35rem;
}

/* --- Footer --- */
.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--color-border);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  margin-top: 3rem;
  padding: 2rem 0;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}
.site-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-links { display: flex; gap: 1.25rem; }

/* --- Utilities --- */
.text-center { text-align: center; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-0 { margin-bottom: 0; }
.hidden { display: none !important; }
.spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255,255,255,0.5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Responsive --- */
@media (max-width: 800px) {
  .grid-3 { grid-template-columns: 1fr; }
  .results-layout { grid-template-columns: 1fr; }
  .hero { padding: 2.5rem 0 2rem; }
  h1 { font-size: 1.6rem; }
}

@media (max-width: 640px) {
  .main-nav { position: fixed; top: 64px; left: 0; right: 0; background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(10px); border-bottom: 1px solid var(--color-border); flex-direction: column; align-items: flex-start; padding: 1rem 1.25rem; gap: 0.9rem; display: none; }
  .main-nav.open { display: flex; }
  .nav-toggle { display: inline-block; }
  .site-footer .container { flex-direction: column; text-align: center; }
}

/* --- Accessibilité : respecte la préférence utilisateur pour réduire les animations --- */
@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;
  }
  body { animation: none; background-position: 0 0, 0 0, 0 0; }
}
