/**
 * Centre d'accessibilité MaxZero : couche de personnalisation.
 * Référencé par app/lib/a11y-inject.js (href="/a11y-center.css"), injecté
 * dans le HTML servi par app/server.js. Aucun fichier de données.
 * Les styles natifs (focus, skip link, prefers-reduced-motion) restent dans
 * tokens.css, style.css et landing.css.
 */

#mzA11yRoot {
  position: relative;
  z-index: 130;
}

.mz-a11y-launcher {
  position: fixed;
  z-index: 130;
  left: auto;
  right: calc(max(10px, env(safe-area-inset-right, 0px)) + 52px);
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-height: 44px;
  min-width: 44px;
  padding: 0;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: #0f172a;
  font: 700 0.95rem/1.2 "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  letter-spacing: 0;
  box-shadow: none;
  cursor: pointer;
}

.mz-a11y-launcher::before {
  content: '';
  position: absolute;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(15, 23, 42, .2);
  background: #fff;
  box-shadow: 0 2px 7px rgba(15, 23, 42, .1);
}
html.dark .mz-a11y-launcher::before,
html[data-a11y-theme="dark"] .mz-a11y-launcher::before {
  background: #0f172a;
  border-color: rgba(255, 255, 255, .35);
}

.mz-a11y-launcher-mark {
  display: block;
  position: relative;
  z-index: 1;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

html.dark .mz-a11y-launcher,
html[data-a11y-theme="dark"] .mz-a11y-launcher {
  color: #ffffff;
}

/* Icon-only controls keep their accessible names and full touch targets. */
.mz-a11y-launcher-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.mz-a11y-contrast {
  right: max(10px, env(safe-area-inset-right, 0px));
}
.mz-a11y-contrast[aria-pressed="true"]::before {
  border-color: #b34700;
  box-shadow: inset 0 0 0 1px #b34700;
}

.mz-a11y-launcher:focus-visible {
  outline: 3px solid #ff6a00;
  outline-offset: 3px;
}

.mz-a11y-dialog {
  position: fixed;
  inset: 0;
  margin: auto;
  margin-top: auto;
  margin-right: auto;
  margin-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  margin-left: max(12px, env(safe-area-inset-left, 0px));
  padding: 0;
  border: 1px solid rgba(15, 23, 42, 0.16);
  width: min(440px, calc(100vw - 24px));
  height: fit-content;
  max-height: min(78dvh, 760px);
  border-radius: 20px;
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.28);
  overflow: hidden;
}

.mz-a11y-dialog::backdrop {
  background: rgba(15, 23, 42, 0.48);
}

.mz-a11y-dialog[open] {
  display: flex;
  flex-direction: column;
}

.mz-a11y-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 8px;
}

.mz-a11y-title {
  margin: 0;
  font: 700 1.15rem/1.3 "Outfit", "Plus Jakarta Sans", system-ui, sans-serif;
  letter-spacing: -0.02em;
}

.mz-a11y-close {
  flex: 0 0 auto;
  min-width: 48px;
  min-height: 48px;
  border-radius: 12px;
  border: 2px solid #0f172a;
  background: #ffffff;
  color: #0f172a;
  font: 700 0.95rem/1 system-ui, sans-serif;
  cursor: pointer;
}

.mz-a11y-body {
  overflow: auto;
  padding: 4px 16px 20px;
  -webkit-overflow-scrolling: touch;
}

.mz-a11y-note,
.mz-a11y-help {
  margin: 0 0 12px;
  color: #1e293b;
  font: 500 0.9rem/1.45 system-ui, sans-serif;
}

.mz-a11y-profiles,
.mz-a11y-choices,
.mz-a11y-stack {
  display: grid;
  gap: 8px;
}

.mz-a11y-profiles,
.mz-a11y-choices {
  grid-template-columns: 1fr 1fr;
  margin: 0 0 12px;
}

.mz-a11y-profile,
.mz-a11y-choice,
.mz-a11y-switch,
.mz-a11y-reset,
.mz-a11y-step button {
  min-height: 48px;
  border-radius: 12px;
  border: 2px solid rgba(15, 23, 42, 0.55);
  background: #ffffff;
  color: #0f172a;
  font: 600 0.95rem/1.25 "Plus Jakarta Sans", system-ui, sans-serif;
  text-align: left;
  padding: 10px 12px;
  cursor: pointer;
}

.mz-a11y-profile[aria-pressed="true"],
.mz-a11y-choice[aria-checked="true"] {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

.mz-a11y-section {
  margin: 0 0 16px;
  padding: 0;
  border: 0;
}

.mz-a11y-section legend {
  font: 700 0.78rem/1.2 system-ui, sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #1e293b;
  padding: 0;
  margin-bottom: 8px;
}

.mz-a11y-step {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mz-a11y-step button {
  width: 64px;
  text-align: center;
  font-weight: 800;
  padding: 0;
}

.mz-a11y-step-value {
  flex: 1;
  text-align: center;
  font: 700 1rem/1.2 system-ui, sans-serif;
}

.mz-a11y-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.mz-a11y-switch-ui {
  flex: 0 0 auto;
  width: 48px;
  height: 28px;
  border-radius: 999px;
  border: 2px solid #0f172a;
  background: #e8eaee;
  position: relative;
}

.mz-a11y-switch-ui::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #0f172a;
}

.mz-a11y-switch[aria-checked="true"] .mz-a11y-switch-ui {
  background: #ff6a00;
  border-color: #9a3412;
}

.mz-a11y-switch[aria-checked="true"] .mz-a11y-switch-ui::after {
  left: 22px;
  background: #0f172a;
}

.mz-a11y-from {
  display: block;
  font: 500 0.75rem/1.3 system-ui, sans-serif;
  color: #334155;
}

.mz-a11y-reset {
  width: 100%;
  text-align: center;
  background: #f7f8fa;
  margin-top: 4px;
}

.mz-a11y-status {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html[data-a11y-text="-2"] { zoom: 0.875; }
html[data-a11y-text="-1"] { zoom: 0.9375; }
html[data-a11y-text="1"] { zoom: 1.125; }
html[data-a11y-text="2"] { zoom: 1.25; }
html[data-a11y-text="3"] { zoom: 1.5; }

html[data-a11y-contrast="more"] {
  --mz-ink: #000000;
  --mz-ink-2: #000000;
  --mz-muted: #1a1a1a;
  --mz-hint: #1a1a1a;
  --mz-border: #000000;
  --mz-border-strong: #000000;
}

html[data-a11y-contrast="more"] body {
  background: #ffffff;
  color: #000000;
}

html[data-a11y-gray="1"] body > :not(#mzA11yRoot) {
  filter: grayscale(1);
}

html[data-a11y-leading="1"] :is(p, li, dd, .mk-lead, .cms-prose, label, button, a) {
  line-height: 1.75 !important;
}

html[data-a11y-tracking="1"] body {
  letter-spacing: 0.045em !important;
  word-spacing: 0.08em !important;
}

html[data-a11y-font="readable"] body,
html[data-a11y-font="readable"] button,
html[data-a11y-font="readable"] input,
html[data-a11y-font="readable"] select,
html[data-a11y-font="readable"] textarea {
  font-family: Verdana, "Trebuchet MS", "Segoe UI", sans-serif !important;
}

html[data-a11y-links="1"] a[href]:not(.mz-a11y-launcher) {
  text-decoration: underline !important;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.18em;
}

html[data-a11y-read="1"] :is(p, li, .mk-lead, .cms-prose p) {
  line-height: 1.7;
  max-width: 68ch;
}

html[data-a11y-motion="reduce"] *,
html[data-a11y-motion="reduce"] *::before,
html[data-a11y-motion="reduce"] *::after,
html[data-a11y-motion="off"] *,
html[data-a11y-motion="off"] *::before,
html[data-a11y-motion="off"] *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
  scroll-behavior: auto !important;
}

html[data-a11y-motion="off"] *,
html[data-a11y-motion="off"] *::before,
html[data-a11y-motion="off"] *::after {
  animation: none !important;
  transition: none !important;
}

html[data-a11y-parallax="off"] :is(.hero-orb, .hero-mesh, .hero-light, .hero-rail, .hero-atmosphere) {
  animation: none !important;
  transform: none !important;
}

html[data-a11y-focus="strong"] :focus-visible {
  outline: 4px solid #ff6a00 !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 7px #0f172a !important;
}

html[data-a11y-cues="1"] a[href] {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

html[data-a11y-cues="1"] :is(.is-error, .error, .field-error, [aria-invalid="true"]) {
  outline: 2px dashed #9f1239;
  outline-offset: 2px;
}

html[data-a11y-cues="1"] :is(.is-success, .success, [data-state="success"]) {
  outline: 2px solid #14532d;
  outline-offset: 2px;
}

html[data-a11y-cues="1"] :is([aria-selected="true"], [aria-current="page"]) {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

@media (max-width: 700px) {
  .mz-a11y-dialog {
    inset: 0;
    margin: 0;
    margin-top: auto;
    margin-right: 0;
    margin-bottom: 0;
    margin-left: 0;
    width: 100%;
    max-height: min(92dvh, 100%);
    border-radius: 20px 20px 0 0;
  }
  .mz-a11y-profiles,
  .mz-a11y-choices {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mz-a11y-dialog,
  .mz-a11y-launcher {
    transition: none;
  }
}

@media (prefers-contrast: more) {
  html:not([data-a11y-contrast="off"]) {
    --mz-ink: #000000;
    --mz-muted: #1a1a1a;
    --mz-border-strong: #000000;
  }
}

@media (forced-colors: active) {
  .mz-a11y-launcher,
  .mz-a11y-profile,
  .mz-a11y-choice,
  .mz-a11y-switch,
  .mz-a11y-reset,
  .mz-a11y-close {
    border: 2px solid ButtonText;
  }
}
