/* SISUNESC — Ferramentas de acessibilidade (global) */

:root {
    --a11y-font-scale: 1;
    --a11y-skip-bg: #0d47a1;
    --a11y-panel-bg: #fff;
    --a11y-panel-border: #dee2e6;
    --a11y-accent: #1565c0;
}

html {
    font-size: calc(100% * var(--a11y-font-scale));
}

html.a11y-font-1 { --a11y-font-scale: 1.0625; }
html.a11y-font-2 { --a11y-font-scale: 1.125; }
html.a11y-font-3 { --a11y-font-scale: 1.1875; }
html.a11y-font-4 { --a11y-font-scale: 1.25; }

/* Skip link */
.a11y-skip-link {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
    z-index: 100000;
    padding: 0.75rem 1.25rem;
    background: var(--a11y-skip-bg);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    border-radius: 0 0 0.375rem 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.a11y-skip-link:focus {
    left: 0;
    top: 0;
    width: auto;
    height: auto;
    overflow: visible;
    outline: 3px solid #ffbf00;
    outline-offset: 2px;
}

/* Botão lateral direita — compacto, só ícone */
.a11y-fab-wrap {
    position: fixed;
    right: 0;
    top: 40%;
    transform: translateY(-50%);
    z-index: 1080;
    max-width: calc(100vw - 0.5rem);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.a11y-fab-wrap.is-collapsed {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-50%) translateX(100%);
}

.a11y-fab-stack {
    position: relative;
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    gap: 0;
    pointer-events: auto;
}

.a11y-fab-toggle-wrap {
    position: relative;
    flex-shrink: 0;
}

.a11y-fab-dismiss {
    position: absolute;
    top: -0.2rem;
    right: -0.2rem;
    z-index: 3;
    width: 0.95rem;
    height: 0.95rem;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.88);
    color: rgba(21, 101, 192, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
    line-height: 1;
    opacity: 0;
    transform: scale(0.85);
    transition:
        opacity 0.2s ease,
        transform 0.2s ease,
        color 0.2s ease,
        background 0.2s ease,
        box-shadow 0.2s ease;
}

.a11y-fab-toggle-wrap:hover .a11y-fab-dismiss,
.a11y-fab-dismiss:focus-visible {
    opacity: 1;
    transform: scale(1);
}

.a11y-fab-dismiss .material-symbols-outlined {
    font-size: 0.7rem !important;
    font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 20;
}

.a11y-fab-dismiss:hover {
    color: #64748b;
    background: #fff;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.14);
}

.a11y-fab-dismiss:active {
    transform: scale(0.92);
}

.a11y-fab-toggle {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 0.65rem 0 0 0.65rem;
    background: linear-gradient(165deg, #1e88e5 0%, #1565c0 100%);
    color: #fff;
    cursor: pointer;
    box-shadow: -2px 0 12px rgba(13, 71, 161, 0.28);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.a11y-fab-toggle:hover,
.a11y-fab-toggle:focus-visible {
    transform: translateX(-2px);
    box-shadow: -4px 0 16px rgba(13, 71, 161, 0.35);
    outline: 2px solid #ffbf00;
    outline-offset: 1px;
}

.a11y-fab-toggle[aria-expanded="true"] {
    transform: translateX(-2px);
    background: linear-gradient(165deg, #1976d2 0%, #0d47a1 100%);
}

.a11y-fab-icon {
    font-size: 1.35rem !important;
}

/* Faixa fina na lateral para reexibir o atalho */
.a11y-fab-restore {
    position: fixed;
    right: 0;
    top: 40%;
    transform: translateY(-50%);
    z-index: 1079;
    display: none;
    align-items: stretch;
    justify-content: flex-end;
    width: 1.125rem;
    height: 3.75rem;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: width 0.2s ease;
}

.a11y-fab-restore.is-visible {
    display: flex;
    pointer-events: auto;
}

.a11y-fab-restore-bar {
    display: block;
    width: 4px;
    height: 100%;
    margin-left: auto;
    border-radius: 3px 0 0 3px;
    background: linear-gradient(
        180deg,
        rgba(30, 136, 229, 0.45) 0%,
        rgba(21, 101, 192, 0.72) 50%,
        rgba(13, 71, 161, 0.55) 100%
    );
    box-shadow: -1px 0 6px rgba(13, 71, 161, 0.2);
    transition: width 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    opacity: 0.82;
}

.a11y-fab-restore:hover .a11y-fab-restore-bar,
.a11y-fab-restore:focus-visible .a11y-fab-restore-bar {
    width: 6px;
    opacity: 1;
    box-shadow: -2px 0 10px rgba(13, 71, 161, 0.28);
}

.a11y-fab-restore:hover,
.a11y-fab-restore:focus-visible {
    width: 1.35rem;
    outline: none;
}

.a11y-fab-restore:focus-visible .a11y-fab-restore-bar {
    outline: 2px solid #ffbf00;
    outline-offset: 2px;
}

html.a11y-fab-collapsed .a11y-fab-wrap {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

html.a11y-fab-collapsed .a11y-fab-restore {
    display: flex;
    pointer-events: auto;
}

.a11y-panel {
    display: none;
    width: min(17.5rem, calc(100vw - 4.5rem));
    max-height: none;
    overflow: visible;
    margin-right: 0.25rem;
    background: var(--a11y-panel-bg);
    border: 1px solid var(--a11y-panel-border);
    border-right: none;
    border-radius: 0.75rem 0 0 0.75rem;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.14);
    padding: 0;
    animation: a11y-panel-in 0.22s ease;
}

@keyframes a11y-panel-in {
    from {
        opacity: 0;
        transform: translateX(12px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.a11y-panel.is-open {
    display: block;
}

.a11y-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.45rem 0.6rem;
    border-bottom: 1px solid var(--a11y-panel-border);
    background: linear-gradient(135deg, #f8fafc 0%, #eef4fc 100%);
    border-radius: 0.75rem 0 0 0;
}

.a11y-panel-header h2 {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 700;
    color: #212529;
}

.a11y-panel-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.65rem;
    height: 1.65rem;
    padding: 0;
    border: none;
    line-height: 1;
    cursor: pointer;
    color: #94a3b8;
    border-radius: 50%;
    background: transparent;
    transition: color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}

.a11y-panel-close .material-symbols-outlined {
    font-size: 1.1rem !important;
    font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
}

.a11y-panel-close:hover {
    color: #1565c0;
    background: rgba(21, 101, 192, 0.08);
}

.a11y-panel-close:active {
    transform: scale(0.94);
}

.a11y-panel-close:focus-visible {
    outline: 2px solid var(--a11y-accent);
    outline-offset: 2px;
}

.a11y-panel-body {
    padding: 0.4rem 0.55rem 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.a11y-group-label {
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #6c757d;
    margin: 0.1rem 0 0;
    line-height: 1.2;
}

.a11y-btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.a11y-btn-row--grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.25rem;
}

.a11y-btn-row--grid-2 .a11y-btn {
    min-width: 0;
}

.a11y-btn {
    flex: 1 1 auto;
    min-width: 2rem;
    min-height: 1.65rem;
    padding: 0.2rem 0.35rem;
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1.15;
    border: 1px solid var(--a11y-panel-border);
    border-radius: 0.375rem;
    background: #fff;
    color: #212529;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.a11y-btn:hover {
    background: #f1f3f5;
}

.a11y-btn:focus-visible {
    outline: 2px solid var(--a11y-accent);
    outline-offset: 2px;
}

.a11y-btn.is-active {
    background: var(--a11y-accent);
    border-color: var(--a11y-accent);
    color: #fff;
}

.a11y-btn-reset,
.a11y-btn-hide-fab {
    background: #f8f9fa;
    color: #495057;
}

.a11y-btn .material-symbols-outlined {
    font-size: 0.85rem !important;
    vertical-align: middle;
}

.a11y-btn--icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
}

.a11y-btn-speak-stop:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.a11y-btn.is-speaking {
    outline: 2px solid var(--a11y-accent);
    outline-offset: 1px;
}

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

/* Destaque suave do elemento lido ao passar o mouse */
html.a11y-ler-ao-passar #conteudo-principal a:hover,
html.a11y-ler-ao-passar #conteudo-principal button:hover,
html.a11y-ler-ao-passar #conteudo-principal label:hover,
html.a11y-ler-ao-passar #conteudo-principal p:hover,
html.a11y-ler-ao-passar #conteudo-principal li:hover,
html.a11y-ler-ao-passar #conteudo-principal h1:hover,
html.a11y-ler-ao-passar #conteudo-principal h2:hover,
html.a11y-ler-ao-passar #conteudo-principal h3:hover,
html.a11y-ler-ao-passar #conteudo-principal h4:hover,
html.a11y-ler-ao-passar #conteudo-principal th:hover,
html.a11y-ler-ao-passar #conteudo-principal td:hover,
html.a11y-ler-ao-passar #conteudo-principal input:hover,
html.a11y-ler-ao-passar #conteudo-principal textarea:hover,
html.a11y-ler-ao-passar #conteudo-principal select:hover,
html.a11y-ler-ao-passar #conteudo-principal .list-group-item:hover {
    outline: 1px dashed rgba(21, 101, 192, 0.55) !important;
    outline-offset: 2px;
}

/* Alto contraste */
html.a11y-alto-contraste {
    --a11y-panel-bg: #000;
    --a11y-panel-border: #fff;
    --a11y-accent: #ff0;
}

html.a11y-alto-contraste,
html.a11y-alto-contraste body {
    background-color: #000 !important;
    color: #fff !important;
}

html.a11y-alto-contraste a {
    color: #ff0 !important;
    text-decoration: underline !important;
}

html.a11y-alto-contraste .btn,
html.a11y-alto-contraste button:not(.a11y-btn):not(.a11y-fab-toggle):not(.a11y-panel-close) {
    background-color: #ff0 !important;
    color: #000 !important;
    border-color: #fff !important;
}

html.a11y-alto-contraste .bg-white,
html.a11y-alto-contraste #content,
html.a11y-alto-contraste .card,
html.a11y-alto-contraste .modal-content {
    background-color: #000 !important;
    color: #fff !important;
    border-color: #fff !important;
}

html.a11y-alto-contraste .text-muted,
html.a11y-alto-contraste .text-white-50 {
    color: #e0e0e0 !important;
}

html.a11y-alto-contraste .a11y-panel-header {
    background: #000;
    color: #fff;
}

html.a11y-alto-contraste .a11y-panel-header h2 {
    color: #fff;
}

html.a11y-alto-contraste .a11y-btn {
    background: #000;
    color: #fff;
    border-color: #fff;
}

html.a11y-alto-contraste .a11y-btn.is-active {
    background: #ff0;
    color: #000;
}

html.a11y-alto-contraste .a11y-fab-toggle {
    background: #ff0 !important;
    color: #000 !important;
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.45) !important;
}

html.a11y-reduzir-movimento .a11y-panel {
    animation: none !important;
}

html.a11y-reduzir-movimento .a11y-fab-toggle {
    transition: none !important;
}

/* Tema escuro (sem alto contraste) */
html.a11y-tema-escuro:not(.a11y-alto-contraste) body {
    background-color: #121212 !important;
    color: #e8e8e8 !important;
}

html.a11y-tema-escuro:not(.a11y-alto-contraste) .bg-white,
html.a11y-tema-escuro:not(.a11y-alto-contraste) #content,
html.a11y-tema-escuro:not(.a11y-alto-contraste) .card,
html.a11y-tema-escuro:not(.a11y-alto-contraste) .modal-content,
html.a11y-tema-escuro:not(.a11y-alto-contraste) .shadow-sm {
    background-color: #1e1e1e !important;
    color: #ececec !important;
}

html.a11y-tema-escuro:not(.a11y-alto-contraste) .text-muted {
    color: #adb5bd !important;
}

html.a11y-tema-escuro:not(.a11y-alto-contraste) .a11y-panel {
    --a11y-panel-bg: #1e1e1e;
    --a11y-panel-border: #444;
}

html.a11y-tema-escuro:not(.a11y-alto-contraste) .a11y-panel-header {
    background: #2a2a2a;
}

html.a11y-tema-escuro:not(.a11y-alto-contraste) .a11y-panel-header h2 {
    color: #f5f5f5;
}

/* Destacar links */
html.a11y-destacar-links a:not(.btn):not(.btn-close):not(.page-link) {
    text-decoration: underline !important;
    text-underline-offset: 3px;
    text-decoration-thickness: 2px !important;
}

/* Destacar foco */
html.a11y-destacar-foco *:focus-visible {
    outline: 3px solid #ffbf00 !important;
    outline-offset: 3px !important;
}

/* Espaçamento ampliado */
html.a11y-espacamento body {
    line-height: 1.7 !important;
    letter-spacing: 0.02em;
}

html.a11y-espacamento p,
html.a11y-espacamento li,
html.a11y-espacamento label,
html.a11y-espacamento .form-label,
html.a11y-espacamento td,
html.a11y-espacamento th {
    line-height: 1.85 !important;
}

/* Reduzir movimento */
html.a11y-reduzir-movimento *,
html.a11y-reduzir-movimento *::before,
html.a11y-reduzir-movimento *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
}

@media (prefers-reduced-motion: reduce) {
    html:not(.a11y-reduzir-movimento-off) .a11y-fab-toggle {
        transition: none;
    }
}

/* VLibras — botão oficial à direita, acima do conteúdo */
div[vw].enabled {
    display: block !important;
    z-index: 2147483640 !important;
}

div[vw] [vw-access-button].active {
    display: flex !important;
}

@media (max-width: 768px) {
    .a11y-fab-dismiss {
        opacity: 0.85;
        transform: scale(1);
    }

    .a11y-fab-wrap,
    .a11y-fab-restore {
        top: auto;
        bottom: 5rem;
        transform: none;
    }

    .a11y-fab-wrap.is-collapsed {
        transform: translateX(100%);
    }

    .a11y-fab-restore {
        width: 1.5rem;
        height: 3.25rem;
    }

    .a11y-fab-restore-bar {
        width: 5px;
        opacity: 0.9;
    }

    .a11y-fab-restore:hover .a11y-fab-restore-bar,
    .a11y-fab-restore:focus-visible .a11y-fab-restore-bar {
        width: 7px;
    }

    .a11y-fab-toggle {
        width: 2.35rem;
        height: 2.35rem;
    }

    .a11y-panel {
        width: min(16.5rem, calc(100vw - 3.25rem));
    }
}

.a11y-fab-toggle .material-symbols-outlined,
.a11y-panel .material-symbols-outlined {
    font-family: 'Material Symbols Outlined', sans-serif !important;
    font-weight: normal;
    font-style: normal;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.app-conteudos-ia-main {
    min-height: 100vh;
    width: 100%;
}
