/* ============================================
   Painel de Acessibilidade - CSS
   CRM Pedro Ribeiro
   ============================================ */

/* ── Botao flutuante ── */
.a11y-floating-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99990;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    background: #F40044;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(244, 0, 68, .4);
    transition: transform .2s, opacity .2s, box-shadow .2s;
}
.a11y-floating-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(244, 0, 68, .55);
}
.a11y-floating-btn.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(.7);
}

/* ── Painel lateral ── */
.a11y-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    width: 380px;
    max-width: 95vw;
    transform: translateX(100%);
    transition: transform .3s cubic-bezier(.4, 0, .2, 1), visibility 0s linear .3s;
    pointer-events: none;
    visibility: hidden;
    overflow: hidden;
}
.a11y-panel.open {
    transform: translateX(0);
    pointer-events: auto;
    visibility: visible;
    transition: transform .3s cubic-bezier(.4, 0, .2, 1), visibility 0s linear 0s;
}
.a11y-panel-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #1a1a24;
    color: #e8e8ef;
    border-left: 1px solid rgba(255,255,255,.12);
    box-shadow: -8px 0 40px rgba(0,0,0,.9);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
}

/* ── Header ── */
.a11y-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    background: #0d0d14;
    flex-shrink: 0;
}
.a11y-panel-title {
    font-weight: 700;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
}
.a11y-panel-title i {
    color: #F40044;
    font-size: 20px;
}
.a11y-panel-close {
    background: none;
    border: none;
    color: #888;
    font-size: 18px;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    transition: color .2s, background .2s;
}
.a11y-panel-close:hover {
    color: #fff;
    background: rgba(255,255,255,.08);
}

/* ── Body (scrollable) ── */
.a11y-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}
.a11y-panel-body::-webkit-scrollbar { width: 5px; }
.a11y-panel-body::-webkit-scrollbar-track { background: transparent; }
.a11y-panel-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 10px; }

/* ── Secoes ── */
.a11y-section {
    margin-bottom: 20px;
}
.a11y-section-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: #a0a0b0;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.a11y-section-title i {
    color: #F40044;
    font-size: 14px;
}

/* ── Grid de visao cromatica ── */
.a11y-vision-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}
.a11y-vision-btn {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1.5px solid rgba(255,255,255,.1);
    background: rgba(255,255,255,.04);
    color: #c0c0cc;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all .2s;
    text-align: center;
}
.a11y-vision-btn:hover {
    border-color: rgba(244, 0, 68, .4);
    background: rgba(244, 0, 68, .08);
    color: #fff;
}
.a11y-vision-btn.active {
    border-color: #F40044;
    background: rgba(244, 0, 68, .15);
    color: #fff;
    box-shadow: 0 0 12px rgba(244, 0, 68, .2);
}

/* ── Dark mode btn ── */
.a11y-dark-mode-btn {
    width: 100%;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1.5px solid rgba(255,255,255,.1);
    background: rgba(255,255,255,.04);
    color: #c0c0cc;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all .2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.a11y-dark-mode-btn:hover {
    border-color: rgba(244, 0, 68, .4);
    color: #fff;
}
.a11y-dark-mode-btn.active {
    border-color: #F40044;
    background: rgba(244, 0, 68, .15);
    color: #fff;
}

/* ── Opcao (linha) ── */
.a11y-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,.05);
}
.a11y-option:last-child {
    border-bottom: none;
}
.a11y-option-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 500;
    color: #d0d0dc;
}
.a11y-option-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(244, 0, 68, .12);
    color: #F40044;
    font-weight: 800;
    font-size: 14px;
    flex-shrink: 0;
}
.a11y-option-icon-fa {
    width: 28px;
    text-align: center;
    color: #F40044;
    font-size: 14px;
    flex-shrink: 0;
}

/* ── Toggle switch ── */
.a11y-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}
.a11y-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}
.a11y-toggle-slider {
    position: absolute;
    inset: 0;
    cursor: pointer;
    background: rgba(255,255,255,.12);
    border-radius: 24px;
    transition: background .25s;
}
.a11y-toggle-slider::before {
    content: '';
    position: absolute;
    left: 3px;
    top: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    transition: transform .25s;
}
.a11y-toggle input:checked + .a11y-toggle-slider {
    background: #F40044;
}
.a11y-toggle input:checked + .a11y-toggle-slider::before {
    transform: translateX(20px);
}

/* ── Level dots ── */
.a11y-level-dots {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}
.a11y-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,.15);
    background: transparent;
    cursor: pointer;
    transition: all .2s;
}
.a11y-dot:hover {
    border-color: rgba(244, 0, 68, .5);
}
.a11y-dot.active {
    border-color: #F40044;
    background: #F40044;
}

/* ── Botoes de alinhamento ── */
.a11y-align-btns {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.a11y-align-btns button {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1.5px solid rgba(255,255,255,.1);
    background: transparent;
    color: #888;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
}
.a11y-align-btns button:hover {
    border-color: rgba(244, 0, 68, .4);
    color: #fff;
}
.a11y-align-btns button.active {
    border-color: #F40044;
    background: rgba(244, 0, 68, .15);
    color: #F40044;
}

/* ── Footer ── */
.a11y-panel-footer {
    display: flex;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,.08);
    background: #0d0d14;
    flex-shrink: 0;
}
.a11y-btn-reset,
.a11y-btn-close {
    flex: 1;
    padding: 12px;
    border-radius: 10px;
    border: none;
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all .2s;
}
.a11y-btn-reset {
    background: rgba(255,255,255,.06);
    color: #c0c0cc;
    border: 1.5px solid rgba(255,255,255,.1);
}
.a11y-btn-reset:hover {
    background: rgba(255,255,255,.1);
    color: #fff;
}
.a11y-btn-close {
    background: #F40044;
    color: #fff;
}
.a11y-btn-close:hover {
    background: #d6003b;
}

/* ── Mascara de leitura ── */
.a11y-reading-mask {
    position: fixed;
    left: 0;
    right: 0;
    z-index: 99980;
    background: rgba(0, 0, 0, .6);
    pointer-events: none;
    transition: none;
}
.a11y-reading-mask-top {
    top: 0;
    height: 0;
}
.a11y-reading-mask-bottom {
    top: 100vh;
    bottom: 0;
}

/* ============================================
   Classes utilitarias de acessibilidade
   (aplicadas ao <body>)
   ============================================ */

/* Fonte dislexia */
.a11y-dyslexia,
.a11y-dyslexia * {
    font-family: 'OpenDyslexic', 'Comic Sans MS', 'Arial', sans-serif !important;
    word-spacing: .12em;
}

/* Altura da linha */
.a11y-line-height-1,
.a11y-line-height-1 * { line-height: 1.8 !important; }
.a11y-line-height-2,
.a11y-line-height-2 * { line-height: 2.4 !important; }

/* Sem animacoes */
.a11y-no-animations,
.a11y-no-animations * {
    animation: none !important;
    transition: none !important;
}

/* Tamanho do texto */
.a11y-text-size-1 { font-size: 110% !important; }
.a11y-text-size-2 { font-size: 125% !important; }
.a11y-text-size-3 { font-size: 145% !important; }

/* Espacamento de letras */
.a11y-letter-spacing-1,
.a11y-letter-spacing-1 * { letter-spacing: .08em !important; }
.a11y-letter-spacing-2,
.a11y-letter-spacing-2 * { letter-spacing: .16em !important; }

/* Alinhamento */
.a11y-align-left,
.a11y-align-left * { text-align: left !important; }
.a11y-align-center,
.a11y-align-center * { text-align: center !important; }
.a11y-align-right,
.a11y-align-right * { text-align: right !important; }
.a11y-align-justify,
.a11y-align-justify * { text-align: justify !important; }

/* Saturacao */
.a11y-saturation-1 { filter: saturate(.5) !important; }
.a11y-saturation-2 { filter: saturate(0) !important; }

/* Inverter cores */
.a11y-invert { filter: invert(1) hue-rotate(180deg) !important; }

/* Links destacados */
.a11y-highlight-links a {
    outline: 2px solid #F40044 !important;
    outline-offset: 2px;
    text-decoration: underline !important;
    color: #F40044 !important;
}

/* ── Responsivo ── */
@media (max-width: 480px) {
    .a11y-panel { width: 100%; }
    .a11y-floating-btn { bottom: 16px; right: 16px; width: 46px; height: 46px; font-size: 20px; }
    .a11y-vision-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
    .a11y-vision-btn { padding: 8px 8px; font-size: 11px; }
}
