/* =========================================================
   ACESSIBILIDADE — botão flutuante + painel de opções
   Anexe DEPOIS do style.css:
   <link rel="stylesheet" href="css/acessibilidade.css">
   Tamanhos do painel em px de propósito: ele não deve crescer
   junto com a opção "aumentar texto".
========================================================= */

/* ---------- BOTÃO FLUTUANTE ---------- */
.a11y-btn {
    position: fixed;
    right: 24px;
    bottom: 96px;               /* logo acima do botão do WhatsApp (58px + 24px) */
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #1b5e5e;
    color: #fff;
    border: 3px solid #fff;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .28);
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1200;
    transition: background .3s ease, transform .3s ease;
}

.a11y-btn:hover {
    background: #2c7a7b;
    transform: scale(1.08);
}

.a11y-btn:focus-visible,
.a11y-painel button:focus-visible {
    outline: 3px solid #ffb300;
    outline-offset: 2px;
}

/* ---------- PAINEL ---------- */
.a11y-painel {
    position: fixed;
    right: 24px;
    bottom: 160px;
    width: 330px;
    max-height: calc(100vh - 190px);
    overflow-y: auto;
    background: #fff;
    color: #222;
    border-radius: 15px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, .25);
    z-index: 1210;
    font-family: Arial, sans-serif;
    font-size: 15px;
    line-height: 1.4;
    animation: a11y-abre .2s ease;
}

.a11y-painel[hidden] {
    display: none;
}

@keyframes a11y-abre {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.a11y-topo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: #2c7a7b;
    color: #fff;
    border-radius: 15px 15px 0 0;
}

.a11y-topo h2 {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.a11y-fechar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, .2);
    color: #fff;
    font-size: 15px;
    cursor: pointer;
    transition: background .3s ease;
}

.a11y-fechar:hover {
    background: rgba(255, 255, 255, .35);
}

.a11y-corpo {
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* tamanho do texto */
.a11y-tamanho {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f9f9f9;
    border-radius: 12px;
    padding: 10px 12px;
}

.a11y-tamanho-rotulo {
    flex: 1;
    font-weight: 600;
    font-size: 14px;
}

.a11y-tamanho-rotulo small {
    display: block;
    font-weight: 400;
    font-size: 12px;
    color: #666;
}

.a11y-passo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #2c7a7b;
    background: #fff;
    color: #2c7a7b;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background .3s ease, color .3s ease;
}

.a11y-passo:hover:not(:disabled) {
    background: #2c7a7b;
    color: #fff;
}

.a11y-passo:disabled {
    opacity: .35;
    cursor: not-allowed;
}

/* opções liga/desliga */
.a11y-grade {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.a11y-opcao {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 82px;
    padding: 10px 8px;
    background: #f9f9f9;
    color: #333;
    border: 2px solid transparent;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: background .3s ease, border-color .3s ease;
}

.a11y-opcao i {
    font-size: 20px;
    color: #2c7a7b;
}

.a11y-opcao:hover {
    border-color: #e0f2f1;
}

.a11y-opcao[aria-pressed="true"] {
    background: #e0f2f1;
    border-color: #2c7a7b;
}

.a11y-opcao-largura {
    grid-column: 1 / -1;
}

.a11y-restaurar {
    width: 100%;
    padding: 11px;
    border-radius: 25px;
    border: 2px solid #2c7a7b;
    background: #fff;
    color: #2c7a7b;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background .3s ease, color .3s ease;
}

.a11y-restaurar:hover {
    background: #2c7a7b;
    color: #fff;
}

.a11y-nota {
    font-size: 12px;
    color: #666;
    text-align: center;
}

.a11y-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

@media (max-width: 480px) {
    .a11y-btn {
        right: 16px;
        bottom: 78px;           /* acima do WhatsApp de 50px */
        width: 46px;
        height: 46px;
        font-size: 21px;
    }

    .a11y-painel {
        right: 12px;
        left: 12px;
        width: auto;
        bottom: 134px;
        max-height: calc(100vh - 160px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .a11y-painel { animation: none; }
    .a11y-btn, .a11y-opcao, .a11y-passo { transition: none; }
}

@media print {
    .a11y-root { display: none !important; }
}

/* =========================================================
   MODOS APLICADOS AO SITE (classes colocadas no <html>)
   O painel (.a11y-root) e o VLibras ([vw]) ficam de fora.
========================================================= */

/* ---------- TAMANHO DO TEXTO (escala o rem e o texto herdado) ---------- */
html.a11y-fs-1 { font-size: 112.5%; }
html.a11y-fs-2 { font-size: 125%; }
html.a11y-fs-3 { font-size: 150%; }
html.a11y-fs-4 { font-size: 175%; }

/* ---------- TONS DE CINZA ---------- */
html.a11y-cinza {
    filter: grayscale(1);
}

/* ---------- ALTO CONTRASTE ---------- */
html.a11y-contraste body *:not(.a11y-root):not(.a11y-root *):not([vw]):not([vw] *) {
    background-color: #000 !important;
    background-image: none !important;
    color: #fff !important;
    border-color: #fff !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

html.a11y-contraste body {
    background: #000 !important;
}

html.a11y-contraste a:not(.a11y-root *),
html.a11y-contraste a:not(.a11y-root *) * {
    color: #ffeb3b !important;
}

html.a11y-contraste button:not(.a11y-root *),
html.a11y-contraste .btn-ajude,
html.a11y-contraste input,
html.a11y-contraste textarea,
html.a11y-contraste select {
    border: 2px solid #ffeb3b !important;
}

html.a11y-contraste .wave-path {
    fill: #000 !important;
}

html.a11y-contraste .icones-flutuantes {
    display: none !important;
}

/* ---------- DESTACAR LINKS ---------- */
html.a11y-links a:not(.a11y-root *) {
    text-decoration: underline !important;
    text-underline-offset: 3px;
    text-decoration-thickness: 2px;
    outline: 2px solid #ffb300;
    outline-offset: 2px;
}

/* ---------- FONTE LEGÍVEL (não mexe nos ícones Font Awesome) ---------- */
html.a11y-fonte body,
html.a11y-fonte body *:not(i):not([class*="fa-"]):not(.a11y-root *) {
    font-family: Verdana, Tahoma, "Trebuchet MS", sans-serif !important;
}

/* ---------- ESPAÇAMENTO DO TEXTO ---------- */
html.a11y-espaco body,
html.a11y-espaco body *:not(i):not([class*="fa-"]):not(.a11y-root *) {
    line-height: 1.8 !important;
    letter-spacing: .05em !important;
    word-spacing: .12em !important;
}

/* ---------- PAUSAR ANIMAÇÕES ---------- */
html.a11y-sem-animacao *:not(.a11y-root *),
html.a11y-sem-animacao *:not(.a11y-root *)::before,
html.a11y-sem-animacao *:not(.a11y-root *)::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
}

html.a11y-sem-animacao .icones-flutuantes {
    display: none !important;
}

/* ---------- VLIBRAS (escondido quando a opção é desligada) ---------- */
html.a11y-sem-libras [vw] {
    display: none !important;
}
