/* ===========================================================
   IFPA Poitiers — Module accessibilité visuelle
   Toggles : contraste élevé, mode sombre, texte agrandi,
             police lisible (dyslexie), animations réduites,
             liens soulignés. Conforme RGAA 4.1.
   =========================================================== */

/* ---------- Bouton flottant ---------- */
.a11y-fab {
  position: fixed;
  bottom: 1.25rem;
  left: 1.25rem;
  z-index: 9998;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--c-accent, #E71B5B);
  color: #fff;
  border: 3px solid #fff;
  box-shadow: 0 8px 24px rgba(7,19,34,.35), 0 0 0 1px rgba(7,19,34,.1);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform .2s ease, box-shadow .2s ease;
}
.a11y-fab:hover, .a11y-fab:focus-visible {
  transform: scale(1.08);
  outline: 3px solid #FFD60A;
  outline-offset: 3px;
}
.a11y-fab svg { width: 28px; height: 28px; }

/* ---------- Panneau ---------- */
.a11y-panel {
  position: fixed;
  bottom: 5.5rem;
  left: 1.25rem;
  z-index: 9999;
  width: min(340px, calc(100vw - 2.5rem));
  background: #fff;
  color: #071322;
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(7,19,34,.45), 0 0 0 1px rgba(7,19,34,.1);
  padding: 1.2rem;
  display: none;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}
.a11y-panel[aria-hidden="false"] { display: block; }
.a11y-panel h2 {
  font-size: 1.05rem; font-weight: 800;
  margin: 0 0 .8rem; color: #071322;
  display: flex; align-items: center; gap: .5rem;
}
.a11y-panel ul { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-direction: column; gap: .5rem; }
.a11y-panel li { margin: 0; }
.a11y-toggle {
  display: flex; align-items: center; justify-content: space-between;
  gap: .8rem;
  padding: .55rem .7rem;
  border-radius: 8px;
  background: #f6f7fb;
  cursor: pointer;
  transition: background .15s ease;
}
.a11y-toggle:hover { background: #ecedf5; }
.a11y-toggle:focus-within { outline: 2px solid #E71B5B; outline-offset: 2px; }
.a11y-toggle .label { font-weight: 600; color: #071322; flex: 1; }
.a11y-toggle .switch {
  position: relative; width: 38px; height: 22px;
  flex-shrink: 0;
  background: #cfd2dd; border-radius: 999px;
  transition: background .2s ease;
}
.a11y-toggle .switch::before {
  content: ""; position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  background: #fff; border-radius: 50%;
  transition: transform .2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.a11y-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.a11y-toggle input:checked ~ .switch { background: #E71B5B; }
.a11y-toggle input:checked ~ .switch::before { transform: translateX(16px); }
.a11y-reset {
  width: 100%;
  padding: .6rem;
  background: #f6f7fb; color: #071322;
  border: 1px solid rgba(7,19,34,.15);
  border-radius: 8px;
  font-weight: 700; font-size: .9rem;
  cursor: pointer;
  transition: background .15s;
}
.a11y-reset:hover { background: #ecedf5; }
.a11y-panel .a11y-note { font-size: .8rem; color: #5a627a; margin: .8rem 0 0; }

/* ---------- Mode CONTRASTE ÉLEVÉ ---------- */
html.a11y-contrast {
  --c-ink: #000;
  --c-accent: #d10046;
  --c-accent-2: #d10046;
}
html.a11y-contrast body { background: #fff !important; color: #000 !important; }
html.a11y-contrast h1, html.a11y-contrast h2, html.a11y-contrast h3,
html.a11y-contrast h4, html.a11y-contrast p, html.a11y-contrast li,
html.a11y-contrast span, html.a11y-contrast div { color: inherit !important; }
html.a11y-contrast a { color: #0000ee !important; text-decoration: underline !important; }
html.a11y-contrast a:visited { color: #551a8b !important; }
html.a11y-contrast .btn-primary { background: #000 !important; color: #fff !important; border: 2px solid #000 !important; }
html.a11y-contrast .btn-ghost { background: #fff !important; color: #000 !important; border: 2px solid #000 !important; }
html.a11y-contrast .pill, html.a11y-contrast .pill-accent, html.a11y-contrast .pill-dark { background: #000 !important; color: #fff !important; border: 1px solid #000 !important; }
html.a11y-contrast .livenow-band, html.a11y-contrast .signature-band, html.a11y-contrast .cta-band { background: #fff !important; color: #000 !important; }
html.a11y-contrast .livenow-head h2, html.a11y-contrast .livenow-head .lead, html.a11y-contrast .livenow-list strong, html.a11y-contrast .livenow-list span { color: #000 !important; }
html.a11y-contrast .livenow-list li { background: #fff !important; border: 2px solid #000 !important; }

/* ---------- Mode SOMBRE ---------- */
html.a11y-dark body { background: #0e1424 !important; color: #e8e9ee !important; }
html.a11y-dark h1, html.a11y-dark h2, html.a11y-dark h3, html.a11y-dark h4,
html.a11y-dark p, html.a11y-dark li, html.a11y-dark span:not(.pill):not(.livenow-code):not(.facility-num):not(.facility-unit) {
  color: #e8e9ee !important;
}
html.a11y-dark a { color: #ff7ba8 !important; }
html.a11y-dark .site-header { background: #0e1424 !important; border-bottom: 1px solid #2a3147 !important; }
html.a11y-dark .nav-menu a { color: #e8e9ee !important; }
html.a11y-dark .formation-card, html.a11y-dark .value-card, html.a11y-dark .facility-card,
html.a11y-dark .upcoming-card, html.a11y-dark .channel-card, html.a11y-dark .quick-card,
html.a11y-dark .actu-card, html.a11y-dark .reality-tile, html.a11y-dark .faq-item,
html.a11y-dark .testi-card {
  background: #1a2238 !important; color: #e8e9ee !important;
  border: 1px solid #2a3147 !important;
}
html.a11y-dark .page-content, html.a11y-dark .facilities-band, html.a11y-dark .reality-band,
html.a11y-dark .location-band, html.a11y-dark .upcoming-sessions, html.a11y-dark .contact-quick,
html.a11y-dark .contact-faq, html.a11y-dark .testimonials, html.a11y-dark .actus-band {
  background: #0e1424 !important;
}
html.a11y-dark .breadcrumb { background: #1a2238 !important; }
html.a11y-dark .breadcrumb a { color: #ff7ba8 !important; }
html.a11y-dark .a11y-panel { background: #1a2238; color: #e8e9ee; }
html.a11y-dark .a11y-toggle { background: #232c46; }
html.a11y-dark .a11y-toggle:hover { background: #2c3651; }
html.a11y-dark .a11y-toggle .label { color: #e8e9ee; }
html.a11y-dark .a11y-reset { background: #232c46; color: #e8e9ee; border-color: #2a3147; }
html.a11y-dark input, html.a11y-dark textarea, html.a11y-dark select {
  background: #1a2238 !important; color: #e8e9ee !important;
  border-color: #2a3147 !important;
}

/* ---------- TEXTE AGRANDI ---------- */
html.a11y-large { font-size: 118%; }
html.a11y-large h1 { font-size: 2.6rem !important; }
html.a11y-large h2 { font-size: 2rem !important; }
html.a11y-large h3 { font-size: 1.5rem !important; }
html.a11y-large p, html.a11y-large li, html.a11y-large a, html.a11y-large span { line-height: 1.7 !important; }

/* ---------- POLICE LISIBLE (interlettre + interligne aérés) ---------- */
html.a11y-readable body, html.a11y-readable * {
  font-family: 'Atkinson Hyperlegible', 'Verdana', 'Inter', sans-serif !important;
  letter-spacing: .03em !important;
  word-spacing: .08em !important;
  line-height: 1.75 !important;
}
html.a11y-readable h1, html.a11y-readable h2, html.a11y-readable h3, html.a11y-readable h4 {
  letter-spacing: .01em !important;
  line-height: 1.3 !important;
}

/* ---------- ANIMATIONS RÉDUITES ---------- */
html.a11y-no-motion *, html.a11y-no-motion *::before, html.a11y-no-motion *::after {
  animation-duration: .001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .001ms !important;
  scroll-behavior: auto !important;
}

/* ---------- LIENS SOULIGNÉS ---------- */
html.a11y-underline a:not(.btn):not(.brand):not(.channel-card):not(.upcoming-card):not(.formation-card):not(.actu-card) {
  text-decoration: underline !important;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
}

/* ---------- Mobile FAB plus discret ---------- */
@media (max-width: 600px) {
  .a11y-fab { width: 48px; height: 48px; bottom: 1rem; left: 1rem; }
  .a11y-fab svg { width: 24px; height: 24px; }
  .a11y-panel { bottom: 4.5rem; left: 1rem; }
}

/* ---------- Imprimer : on cache ---------- */
@media print {
  .a11y-fab, .a11y-panel { display: none !important; }
}
