/* a11y-plugin.css — Accessibility widget styles + applied-state styles */

/* ===== Applied states ===== */
html { font-size: calc(16px * var(--a11y-text-scale, 1)); }

/* Wide letter spacing */
html[data-a11y-spacing="wide"] body,
html[data-a11y-spacing="wide"] body * { letter-spacing: 0.06em !important; word-spacing: 0.12em !important; }

/* Dyslexia-friendly font (system Atkinson-Hyperlegible-style fallback chain) */
html[data-a11y-dyslexia="on"] body,
html[data-a11y-dyslexia="on"] body * {
  font-family: "Atkinson Hyperlegible", "OpenDyslexic", "Comic Sans MS", system-ui, sans-serif !important;
  font-feature-settings: "ss01" off, "liga" off !important;
}

/* Underline links */
html[data-a11y-underline="on"] a { text-decoration: underline !important; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }

/* High contrast: amplify text/background contrast site-wide */
html[data-a11y-contrast="high"] body {
  background: #ffffff !important; color: #000000 !important;
}
html[data-a11y-contrast="high"] .hero,
html[data-a11y-contrast="high"] .match-section,
html[data-a11y-contrast="high"] .cta-section,
html[data-a11y-contrast="high"] .stats {
  background: #000000 !important;
}
html[data-a11y-contrast="high"] h1,
html[data-a11y-contrast="high"] h2,
html[data-a11y-contrast="high"] h3,
html[data-a11y-contrast="high"] p,
html[data-a11y-contrast="high"] li,
html[data-a11y-contrast="high"] span,
html[data-a11y-contrast="high"] a {
  color: inherit !important;
}
html[data-a11y-contrast="high"] .hero h1,
html[data-a11y-contrast="high"] .hero p,
html[data-a11y-contrast="high"] .match-section h2,
html[data-a11y-contrast="high"] .match-section p,
html[data-a11y-contrast="high"] .cta-section h2,
html[data-a11y-contrast="high"] .cta-section p,
html[data-a11y-contrast="high"] .stats * {
  color: #ffff00 !important;
}
html[data-a11y-contrast="high"] a { color: #00BFFF !important; text-decoration: underline !important; }
html[data-a11y-contrast="high"] .btn,
html[data-a11y-contrast="high"] .nav__cta,
html[data-a11y-contrast="high"] button {
  background: #ffff00 !important; color: #000 !important; border: 2px solid #000 !important;
}

/* Dark mode */
html[data-a11y-contrast="dark"] body { background: #0a0a0a !important; color: #f5f5f5 !important; }
html[data-a11y-contrast="dark"] .section,
html[data-a11y-contrast="dark"] .partners,
html[data-a11y-contrast="dark"] .trust-band { background: #121212 !important; color: #f5f5f5 !important; }
html[data-a11y-contrast="dark"] .price-card,
html[data-a11y-contrast="dark"] .step-card,
html[data-a11y-contrast="dark"] .listing-card { background: #1a1a1a !important; color: #f5f5f5 !important; border-color: #2a2a2a !important; }
html[data-a11y-contrast="dark"] h1, html[data-a11y-contrast="dark"] h2, html[data-a11y-contrast="dark"] h3,
html[data-a11y-contrast="dark"] h4, html[data-a11y-contrast="dark"] h5, html[data-a11y-contrast="dark"] p,
html[data-a11y-contrast="dark"] li { color: inherit !important; }

/* Pause animations */
html[data-a11y-animations="off"] *,
html[data-a11y-animations="off"] *::before,
html[data-a11y-animations="off"] *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
}
html[data-a11y-animations="off"] .hero__photo { animation: none !important; }
html[data-a11y-animations="off"] #hero-data-canvas { display: none !important; }

/* Larger cursor */
html[data-a11y-cursor="large"] body, html[data-a11y-cursor="large"] body * {
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'><polygon points='4,2 4,26 11,21 14,30 18,29 15,21 25,21' fill='black' stroke='white' stroke-width='1.5'/></svg>") 0 0, auto !important;
}
html[data-a11y-cursor="large"] a, html[data-a11y-cursor="large"] button, html[data-a11y-cursor="large"] [role="button"] {
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'><path d='M14 4 L14 18 L10 18 L16 26 L22 18 L18 18 L18 4 Z' fill='black' stroke='white' stroke-width='1.5'/></svg>") 4 4, pointer !important;
}

/* Reading guide */
.a11y-guide {
  position: fixed; left: 0; right: 0; height: 28px;
  background: rgba(255, 235, 59, 0.18);
  border-top: 1px solid rgba(0,0,0,0.4);
  border-bottom: 1px solid rgba(0,0,0,0.4);
  pointer-events: none; z-index: 99998;
  top: 50%;
}

/* ===== FAB ===== */
.a11y-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 99999;
  width: 56px; height: 56px; border-radius: 50%;
  background: #0A1A33; color: #fff; border: 2px solid #3DD46E;
  box-shadow: 0 12px 32px rgba(0,0,0,0.35), 0 4px 12px rgba(10,26,51,0.4);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.a11y-fab:hover { transform: scale(1.06); box-shadow: 0 14px 36px rgba(0,0,0,0.42); }
.a11y-fab:focus-visible { outline: 3px solid #3DD46E; outline-offset: 3px; }

/* ===== Panel ===== */
.a11y-panel {
  position: fixed; right: 22px; bottom: 92px; z-index: 99999;
  width: 340px; max-width: calc(100vw - 44px);
  background: #fff; color: #0A1A33;
  border-radius: 14px; border: 1px solid #DCE0E7;
  box-shadow: 0 24px 60px rgba(0,0,0,0.25), 0 8px 24px rgba(0,0,0,0.12);
  font-family: Inter, system-ui, sans-serif; font-size: 14px;
  opacity: 0; transform: translateY(8px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  max-height: calc(100vh - 120px); overflow-y: auto;
}
.a11y-panel.is-open { opacity: 1; transform: none; pointer-events: auto; }
.a11y-panel__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border-bottom: 1px solid #F0F1ED;
  position: sticky; top: 0; background: #fff; border-radius: 14px 14px 0 0;
}
.a11y-panel__head strong { font-size: 15px; font-weight: 700; color: #0A1A33; }
.a11y-close { background: transparent; border: 0; cursor: pointer; padding: 6px; color: #4F5A70; border-radius: 6px; }
.a11y-close:hover { background: #F0F1ED; color: #0A1A33; }
.a11y-panel__body { padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 14px; }
.a11y-row label { display: block; font-size: 12px; font-weight: 600; color: #4F5A70; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px; }
.a11y-stepper { display: flex; align-items: center; gap: 8px; }
.a11y-stepper button {
  width: 36px; height: 36px; border-radius: 8px; border: 1px solid #DCE0E7;
  background: #fff; cursor: pointer; font-size: 16px; font-weight: 600; color: #0A1A33;
}
.a11y-stepper button:hover { background: #F0F1ED; border-color: #1E8A3C; }
.a11y-stepper [data-out] {
  flex: 1; text-align: center; font-variant-numeric: tabular-nums;
  font-weight: 600; font-size: 14px;
}
.a11y-stepper .a11y-reset {
  width: auto; padding: 0 12px; font-size: 12px;
}
.a11y-seg {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  gap: 0; border: 1px solid #DCE0E7; border-radius: 8px; overflow: hidden;
}
.a11y-seg button {
  border: 0; border-right: 1px solid #DCE0E7; background: #fff;
  padding: 9px 8px; font-size: 13px; font-weight: 500; color: #4F5A70; cursor: pointer;
}
.a11y-seg button:last-child { border-right: 0; }
.a11y-seg button:hover { background: #F8F8F4; color: #0A1A33; }
.a11y-seg button.is-active { background: #0A1A33; color: #fff; }
.a11y-toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0; border-top: 1px solid #F0F1ED;
}
.a11y-toggle-row:first-of-type { border-top: 0; padding-top: 4px; }
.a11y-toggle-row label { font-size: 13px; font-weight: 500; color: #0A1A33; cursor: pointer; }
.a11y-switch {
  position: relative; width: 38px; height: 22px; border-radius: 999px;
  border: 0; background: #DCE0E7; cursor: pointer; padding: 0;
  transition: background 0.18s;
}
.a11y-switch span {
  position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  transition: transform 0.18s;
}
.a11y-switch.is-on { background: #1E8A3C; }
.a11y-switch.is-on span { transform: translateX(16px); }
.a11y-resetall {
  margin-top: 4px; padding: 10px;
  background: transparent; border: 1px solid #DCE0E7;
  border-radius: 8px; font-size: 13px; font-weight: 500; color: #4F5A70; cursor: pointer;
}
.a11y-resetall:hover { background: #F0F1ED; color: #0A1A33; border-color: #4F5A70; }

@media (max-width: 480px) {
  .a11y-panel { right: 12px; left: 12px; width: auto; bottom: 80px; }
  .a11y-fab { right: 16px; bottom: 16px; width: 50px; height: 50px; }
}
