/* ════════════════════════════════════════════════════════════════════════
   MYFNGroup accessibility widget — shared by the main site and all demos.
   Injected markup lives in a11y.js; this file styles the trigger, panel,
   and the body-level states each option toggles.
   Picks up each page's --accent / --accent-soft so demos stay on-brand.
   ══════════════════════════════════════════════════════════════════════ */

/* ── Trigger button ── */
.mfna-fab {
  position: fixed; left: 20px; bottom: 20px; z-index: 100000;
  width: 54px; height: 54px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--accent, #1E3A8A); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 12px 30px -8px rgba(0,0,0,0.45);
  transition: transform 0.18s;
}
.mfna-fab:hover { transform: scale(1.07); }
.mfna-fab:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
@media (max-width: 720px) { .mfna-fab { bottom: 86px; } }

/* ── Panel ── */
.mfna-panel {
  position: fixed; left: 20px; bottom: 86px; z-index: 100001;
  width: 320px; max-height: min(72vh, 640px); overflow-y: auto;
  background: #F2F5FA; border-radius: 20px;
  box-shadow: 0 30px 80px -20px rgba(15,23,42,0.55);
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  font-family: Inter, system-ui, -apple-system, sans-serif;
}
.mfna-panel.open { opacity: 1; visibility: visible; transform: none; }
@media (max-width: 720px) { .mfna-panel { bottom: 150px; width: min(320px, calc(100vw - 32px)); } }
@media (prefers-reduced-motion: reduce) { .mfna-panel, .mfna-fab { transition: none; } }

.mfna-head {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; gap: 10px;
  background: var(--accent, #1E3A8A); color: #fff;
  padding: 16px 18px; border-radius: 20px 20px 0 0;
  font-size: 17px; font-weight: 700;
}
.mfna-head svg { flex: none; }
.mfna-head-actions { margin-left: auto; display: flex; gap: 4px; }
.mfna-iconbtn {
  background: transparent; border: none; color: #fff; cursor: pointer;
  width: 34px; height: 34px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
}
.mfna-iconbtn:hover { background: rgba(255,255,255,0.15); }
.mfna-iconbtn:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }

.mfna-body { padding: 14px; }
.mfna-cat {
  font-size: 13px; font-weight: 700; color: #334155;
  margin: 12px 4px 8px; letter-spacing: 0.01em;
}
.mfna-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Option cards */
.mfna-opt {
  background: #fff; border: 2px solid transparent; border-radius: 14px;
  padding: 14px 12px; cursor: pointer; text-align: left;
  display: flex; flex-direction: column; gap: 8px;
  font-family: inherit; font-size: 13.5px; font-weight: 600; color: #0F172A;
  box-shadow: 0 2px 8px -2px rgba(15,23,42,0.08);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.mfna-opt:hover { box-shadow: 0 6px 16px -4px rgba(15,23,42,0.16); }
.mfna-opt:focus-visible { outline: 3px solid var(--accent, #1E3A8A); outline-offset: 2px; }
.mfna-opt.on { border-color: #0F172A; }
.mfna-opt .ic {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1.6px solid #0F172A; color: #0F172A;
  display: flex; align-items: center; justify-content: center;
}
/* level pills for multi-level options */
.mfna-lv { display: none; gap: 4px; }
.mfna-opt[data-max] .mfna-lv { display: flex; }
.mfna-lv i { flex: 1; height: 6px; border-radius: 4px; background: #D8DFEA; }
.mfna-lv i.f { background: #0F172A; }

.mfna-reset {
  width: 100%; margin-top: 14px; padding: 12px;
  background: transparent; border: 1.6px solid #C3CEDD; border-radius: 12px;
  font-family: inherit; font-size: 13.5px; font-weight: 700; color: #334155; cursor: pointer;
}
.mfna-reset:hover { background: #E8EEF6; }
.mfna-foot {
  display: block; text-align: center; padding: 12px 16px 16px;
  font-size: 12px; font-weight: 700; color: var(--accent, #1E3A8A); text-decoration: none;
}
.mfna-foot:hover { text-decoration: underline; }

/* ── Reading mask overlays ── */
.mfna-mask-top, .mfna-mask-bottom {
  position: fixed; left: 0; right: 0; z-index: 99998;
  background: rgba(10, 22, 40, 0.6); pointer-events: none;
}
.mfna-mask-top { top: 0; }
.mfna-mask-bottom { bottom: 0; }

/* ── Page-structure overlay ── */
.mfna-struct {
  position: fixed; left: 20px; bottom: 86px; z-index: 100002;
  width: 320px; max-height: min(66vh, 560px); overflow-y: auto;
  background: #fff; border-radius: 18px; padding: 16px;
  box-shadow: 0 30px 80px -20px rgba(15,23,42,0.55);
}
.mfna-struct h3 { font-size: 15px; margin: 0 0 10px; color: #0F172A; display: flex; justify-content: space-between; align-items: center; }
.mfna-struct button.mfna-iconbtn { color: #334155; }
.mfna-struct a {
  display: block; padding: 8px 10px; border-radius: 8px;
  font-size: 13.5px; color: #1E293B; text-decoration: none;
}
.mfna-struct a:hover { background: #EEF3FA; }
.mfna-struct a.lv2 { padding-left: 24px; }
.mfna-struct a.lv3 { padding-left: 40px; color: #475569; }

/* ══ Body states ═══════════════════════════════════════════════════════ */

/* Line height (two levels) */
body.mfna-lh-1 p, body.mfna-lh-1 li, body.mfna-lh-1 span, body.mfna-lh-1 a,
body.mfna-lh-1 h1, body.mfna-lh-1 h2, body.mfna-lh-1 h3 { line-height: 1.9 !important; }
body.mfna-lh-2 p, body.mfna-lh-2 li, body.mfna-lh-2 span, body.mfna-lh-2 a,
body.mfna-lh-2 h1, body.mfna-lh-2 h2, body.mfna-lh-2 h3 { line-height: 2.3 !important; }

/* Readable font */
body.mfna-readable, body.mfna-readable p, body.mfna-readable h1, body.mfna-readable h2,
body.mfna-readable h3, body.mfna-readable h4, body.mfna-readable a, body.mfna-readable span,
body.mfna-readable li, body.mfna-readable label, body.mfna-readable button:not(.mfna-opt):not(.mfna-reset),
body.mfna-readable input, body.mfna-readable textarea, body.mfna-readable select {
  font-family: Verdana, Tahoma, Arial, sans-serif !important; letter-spacing: 0.012em;
}

/* Left align */
body.mfna-left p, body.mfna-left h1, body.mfna-left h2, body.mfna-left h3,
body.mfna-left li, body.mfna-left figcaption, body.mfna-left .section-sub {
  text-align: left !important;
}

/* Contrast / grayscale — applied per top-level region so sticky/fixed UI
   (mobile bars, this widget) keeps working. */
body.mfna-contrast > *:not(.mfna-fab):not(.mfna-panel):not(.mfna-struct):not(.mfna-mask-top):not(.mfna-mask-bottom):not(.mobile-cta):not(.mobile-bar):not(.built-badge) {
  filter: contrast(1.2) saturate(1.05);
}
body.mfna-gray > *:not(.mfna-fab):not(.mfna-panel):not(.mfna-struct):not(.mfna-mask-top):not(.mfna-mask-bottom):not(.mobile-cta):not(.mobile-bar):not(.built-badge) {
  filter: grayscale(1);
}
body.mfna-contrast.mfna-gray > *:not(.mfna-fab):not(.mfna-panel):not(.mfna-struct):not(.mfna-mask-top):not(.mfna-mask-bottom):not(.mobile-cta):not(.mobile-bar):not(.built-badge) {
  filter: grayscale(1) contrast(1.2);
}

/* Hide images */
body.mfna-noimg img { visibility: hidden !important; }

/* Pause animations */
body.mfna-pause *, body.mfna-pause *::before, body.mfna-pause *::after {
  animation-play-state: paused !important;
  transition: none !important;
}
body.mfna-pause { scroll-behavior: auto; }

/* Highlight links */
body.mfna-links a:not(.mfna-foot) {
  text-decoration: underline !important; text-underline-offset: 3px;
  outline: 1.5px dashed currentColor; outline-offset: 2px;
}

/* Strong focus outline */
body.mfna-focus :focus {
  outline: 4px solid var(--accent, #1E3A8A) !important; outline-offset: 3px !important;
}
