/* ===================================================================
   ResidencialLink — acessibilidade e visualização
   Painel flutuante (js/a11y.js) + classes aplicadas no <html>.
   =================================================================== */

/* Link "Pular para o conteúdo" — aparece só ao navegar pelo teclado */
.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 12px; }
#conteudo:focus { outline: none; }

.a11y-svg-filters { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- Botão flutuante ---------- */
.a11y-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 70;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.85);
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(19, 36, 31, 0.35);
  transition: transform 0.2s ease, background 0.2s ease;
}
.a11y-fab:hover { transform: scale(1.07); background: var(--primary-dark); }
.a11y-fab:focus-visible { outline: 3px solid var(--kraft); outline-offset: 3px; }
.a11y-fab[aria-expanded="true"] { background: var(--primary-dark); }

/* ---------- Painel ---------- */
.a11y-panel {
  position: fixed;
  right: 20px;
  bottom: 92px;
  z-index: 70;
  width: min(340px, calc(100vw - 32px));
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  background: #16241f;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
  padding: 20px 20px 18px;
  font-family: var(--sans);
  font-size: 15px;          /* tamanho fixo: o painel não muda com o A+/A− */
  line-height: 1.4;
  letter-spacing: normal;
  word-spacing: normal;
  animation: a11y-in 0.2s ease-out;
}
.a11y-panel[hidden] { display: none; }
@keyframes a11y-in { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }

.a11y-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  margin-bottom: 14px;
}
.a11y-head h2 { margin: 0; font-family: var(--sans); font-size: 17px; font-weight: 700; color: #fff; padding: 0; }
.a11y-head h2::after { display: none; }
.a11y-close {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.a11y-close:hover { background: rgba(255, 255, 255, 0.08); }

.a11y-group { margin-bottom: 16px; }
.a11y-label {
  margin: 0 0 10px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9fb2aa;
}

.a11y-panel button:not(.a11y-close) {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  color: #e8efeb;
  background: #22332d;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  text-align: left;
  line-height: 1.25;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.a11y-panel button:not(.a11y-close):hover { background: #2a3e37; }
.a11y-panel button.is-active {
  background: rgba(15, 122, 90, 0.35) !important;
  border-color: #3fc398 !important;
  color: #fff !important;
  font-weight: 700 !important;
}
.a11y-panel button:disabled { opacity: 0.4; cursor: not-allowed; }
.a11y-panel button:focus-visible, .a11y-close:focus-visible { outline: 2px solid #f2c37f; outline-offset: 2px; }

.a11y-size { display: flex; align-items: center; gap: 8px; }
.a11y-size button { text-align: center !important; min-width: 44px; }
.a11y-size-value { margin-left: auto; color: #9fb2aa; font-size: 13px; }

.a11y-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.a11y-grid .a11y-wide { grid-column: 1 / -1; }

.a11y-reset {
  width: 100%;
  margin-top: 4px;
  text-align: center !important;
  font-weight: 700 !important;
  padding: 12px !important;
}

/* ===================================================================
   Efeitos aplicados ao site (classes no <html>)
   O filtro vai só no conteúdo, não no painel nem no botão.
   =================================================================== */
html.a11y-color-protanopia   :is(.site-header, main, .site-footer, .page-404, dialog) { filter: url(#a11y-protanopia); }
html.a11y-color-deuteranopia :is(.site-header, main, .site-footer, .page-404, dialog) { filter: url(#a11y-deuteranopia); }
html.a11y-color-tritanopia   :is(.site-header, main, .site-footer, .page-404, dialog) { filter: url(#a11y-tritanopia); }
html.a11y-color-acromatopsia :is(.site-header, main, .site-footer, .page-404, dialog) { filter: grayscale(1); }

/* Alto contraste */
html.a11y-contrast {
  --ink: #000;
  --ink-soft: #111;
  --bg: #fff;
  --paper: #fff;
  --line: #000;
  --primary: #00553c;
  --primary-dark: #003a29;
  --kraft: #8a5a17;
  --kraft-light: #fff2dc;
  --success: #00553c;
  --danger: #9b1c12;
  --on-dark: #fff;
  --on-dark-soft: #fff;
}
html.a11y-contrast .site-header { background: #fff; backdrop-filter: none; border-bottom: 2px solid #000; }
html.a11y-contrast .how, html.a11y-contrast .site-footer { background: #000; }
html.a11y-contrast .tag-tab { color: #fff; }
html.a11y-contrast .feature-group-body, html.a11y-contrast .plan-body,
html.a11y-contrast .form-card, html.a11y-contrast .team-card,
html.a11y-contrast .problem-answer, html.a11y-contrast .report-card { border-width: 2px; }
html.a11y-contrast .chip { background: #fff; border: 1.5px solid currentColor; }
html.a11y-contrast .notice { background: #fff; border: 2px solid #000; }
html.a11y-contrast .btn-primary { border-color: #000; }
html.a11y-contrast a:not(.btn):not(.brand):not(.footer-brand) { text-decoration: underline; }

/* Sublinhar links */
html.a11y-underline a:not(.btn) { text-decoration: underline !important; text-underline-offset: 3px; }
html.a11y-underline .a11y-panel a { text-decoration: none; }

/* Espaçamento de leitura */
html.a11y-spacing body { line-height: 1.9; letter-spacing: 0.03em; word-spacing: 0.12em; }
html.a11y-spacing p, html.a11y-spacing li, html.a11y-spacing dd { margin-bottom: 1.4em; }

/* Pausar animações: desliga tudo e mostra o conteúdo na hora */
html.a11y-no-motion { scroll-behavior: auto; }
html.a11y-no-motion *, html.a11y-no-motion *::before, html.a11y-no-motion *::after {
  animation: none !important;
  transition: none !important;
}
html.a11y-no-motion .reveal, html.a11y-no-motion .reveal * { opacity: 1 !important; transform: none !important; }
html.a11y-no-motion .team-photo::after { transform: scaleX(0) !important; }
html.a11y-no-motion .section-head h2::after { transform: none !important; }

@media (max-width: 480px) {
  .a11y-fab { right: 14px; bottom: 14px; width: 52px; height: 52px; }
  .a11y-panel { right: 12px; bottom: 78px; }
}
@media print { .a11y-fab, .a11y-panel, .skip-link { display: none !important; } }
