/* Acessibilidade WCAG / A11Y aprimorada */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Foco visivel reforcado */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
	outline: 3px solid var(--crq-accent) !important;
	outline-offset: 2px !important;
	border-radius: 3px;
}

/* Estado dos botoes A+ A A- contrast no modo ativo */
.crq-accessibility button.is-active { background: var(--crq-accent); color: #1c2532; }

/* ============================================================
   WIDGET DE ACESSIBILIDADE (botão flutuante + painel)
   ============================================================ */
.crq-a11y { position: fixed; left: 18px; bottom: 18px; z-index: 99990; font-family: var(--crq-font, sans-serif); }
.crq-a11y__toggle {
	width: 58px; height: 58px; border-radius: 50%; cursor: pointer;
	background: #1565c0; color: #fff; border: 3px solid #fff;
	display: flex; align-items: center; justify-content: center;
	box-shadow: 0 8px 22px rgba(13,71,161,.45); transition: transform .2s, background .2s;
}
.crq-a11y__toggle:hover { background: #0d47a1; transform: scale(1.08); }
.crq-a11y__toggle svg { width: 32px; height: 32px; fill: #fff; }
.crq-a11y__panel {
	position: absolute; left: 0; bottom: 68px; width: 320px; max-width: calc(100vw - 36px);
	background: #fff; color: #1c2532; border-radius: 16px; padding: 16px;
	box-shadow: 0 14px 44px rgba(0,0,0,.30); border: 1px solid rgba(0,0,0,.08);
}
.crq-a11y__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.crq-a11y__head strong { font-size: 1.05rem; color: var(--crq-blue-800, #003a70); }
.crq-a11y__close { background: #eef2f7; border: 0; width: 30px; height: 30px; border-radius: 50%; font-size: 20px; line-height: 1; cursor: pointer; color: #44505f; }
.crq-a11y__close:hover { background: #e0e6ee; }
.crq-a11y__fontrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: #f3f6fa; border-radius: 10px; padding: 8px 10px; margin-bottom: 12px; }
.crq-a11y__fontrow > span:first-child { font-size: .86rem; color: #44505f; flex: 1; }
.crq-a11y__fontrow button { width: 34px; height: 34px; border-radius: 8px; border: 1px solid #d4dce6; background: #fff; cursor: pointer; font-weight: 800; color: var(--crq-blue-800, #003a70); }
.crq-a11y__fontrow button:hover { background: var(--crq-blue-50, #e8f1fa); }
.crq-a11y__fontrow #crqA11yFontLevel { min-width: 46px; text-align: center; font-weight: 700; font-size: .9rem; }
.crq-a11y__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.crq-a11y__grid button {
	display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
	padding: 12px 6px; border-radius: 10px; border: 1px solid #e1e7ef; background: #fff; cursor: pointer;
	font-size: .76rem; color: #2b3949; line-height: 1.25; transition: all .15s;
}
.crq-a11y__grid button svg { width: 22px; height: 22px; fill: var(--crq-blue-800, #003a70); }
.crq-a11y__grid button:hover { border-color: var(--crq-blue-800, #003a70); background: var(--crq-blue-50, #e8f1fa); }
.crq-a11y__grid button.is-on { background: var(--crq-blue-800, #003a70); border-color: var(--crq-blue-800, #003a70); color: #fff; }
.crq-a11y__grid button.is-on svg { fill: #fff; }
.crq-a11y__reset { width: 100%; margin-top: 12px; padding: 10px; border-radius: 10px; border: 0; background: var(--crq-accent, #b8841f); color: #fff; font-weight: 700; cursor: pointer; }
.crq-a11y__reset:hover { filter: brightness(.95); }
@media (max-width: 600px) {
	.crq-a11y { left: 12px; bottom: 12px; }
	.crq-a11y__toggle { width: 50px; height: 50px; }
}

/* ============================================================
   EFEITOS DE ACESSIBILIDADE
   ============================================================ */
html.a11y-grayscale { filter: grayscale(100%); }
body.a11y-links a { text-decoration: underline !important; text-underline-offset: 2px; outline: 1px dashed currentColor; outline-offset: 2px; }
body.a11y-readable, body.a11y-readable * { font-family: Verdana, Arial, "Helvetica Neue", sans-serif !important; letter-spacing: .01em; }
body.a11y-spacing, body.a11y-spacing p, body.a11y-spacing li, body.a11y-spacing a, body.a11y-spacing span {
	line-height: 1.9 !important; letter-spacing: .06em !important; word-spacing: .14em !important;
}
body.a11y-stopmotion *, body.a11y-stopmotion *::before, body.a11y-stopmotion *::after {
	animation: none !important; transition: none !important; scroll-behavior: auto !important;
}
body.a11y-bigcursor, body.a11y-bigcursor * {
	cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 24 24'%3E%3Cpath d='M5 2l14 9-6 1 4 8-3 1-4-8-5 4z' fill='%23003a70' stroke='white' stroke-width='1.2'/%3E%3C/svg%3E") 4 2, auto !important;
}

/* Máscara de leitura: escurece acima e abaixo de uma faixa que segue o cursor */
.crq-a11y-mask { position: fixed; inset: 0; z-index: 99980; pointer-events: none; display: none; }
.crq-a11y-mask__top { position: fixed; left: 0; right: 0; top: 0; height: calc(var(--y, 50%) - 50px); background: rgba(0,0,0,.55); }
.crq-a11y-mask__bot { position: fixed; left: 0; right: 0; top: calc(var(--y, 50%) + 50px); bottom: 0; background: rgba(0,0,0,.55); }

/* O painel/efeitos não devem afetar o próprio widget */
html.a11y-grayscale .crq-a11y { filter: none; }

/* ============================================================
   AVISO DE COOKIES / LGPD (compacto + configurações)
   ============================================================ */
.crq-cookie { position: fixed; left: 0; right: 0; bottom: 0; z-index: 99995; background: var(--crq-blue-900, #002347); color: #fff; box-shadow: 0 -2px 14px rgba(0,0,0,.22); }
.crq-cookie__inner { max-width: var(--crq-container, 1200px); margin: 0 auto; padding: 10px 22px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: space-between; }
.crq-cookie__text { font-size: .78rem; line-height: 1.45; flex: 1; min-width: 240px; color: rgba(255,255,255,.85); margin: 0; }
.crq-cookie__text strong { color: #fff; }
.crq-cookie__text a { color: var(--crq-gold-500, #d9a73f); text-decoration: underline; }
.crq-cookie__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.crq-cookie__btn { border-radius: 7px; padding: 7px 14px; font-size: .78rem; font-weight: 600; cursor: pointer; border: 1px solid rgba(255,255,255,.35); background: transparent; color: #fff; transition: all .15s; }
.crq-cookie__btn--ghost:hover { background: rgba(255,255,255,.12); }
.crq-cookie__btn--accept { background: var(--crq-accent, #b8841f); border-color: var(--crq-accent, #b8841f); color: #fff; }
.crq-cookie__btn--accept:hover { filter: brightness(.95); }
@media (max-width: 600px) { .crq-cookie__inner { padding: 10px 14px; } .crq-cookie__actions { width: 100%; } .crq-cookie__btn { flex: 1; } }

/* Modal de configurações de cookies */
.crq-cookie-modal { position: fixed; inset: 0; z-index: 99996; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; padding: 16px; }
.crq-cookie-modal[hidden] { display: none; }
.crq-cookie-modal__box { background: #fff; color: #1c2532; border-radius: 14px; max-width: 460px; width: 100%; padding: 22px; box-shadow: 0 18px 50px rgba(0,0,0,.35); }
.crq-cookie-modal__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.crq-cookie-modal__head strong { font-size: 1.05rem; color: var(--crq-blue-800, #003a70); }
.crq-cookie-modal__close { background: #eef2f7; border: 0; width: 30px; height: 30px; border-radius: 50%; font-size: 20px; line-height: 1; cursor: pointer; color: #44505f; }
.crq-cookie-modal__cat { border: 1px solid #e1e7ef; border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.crq-cookie-modal__cat-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.crq-cookie-modal__cat-head strong { font-size: .92rem; }
.crq-cookie-modal__cat p { font-size: .8rem; color: #5f6b7a; margin: 0; line-height: 1.45; }
.crq-cookie-modal__always { font-size: .72rem; font-weight: 700; color: #1d9e75; text-transform: uppercase; letter-spacing: .04em; }
.crq-cookie-modal__actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.crq-cookie-modal__actions .crq-cookie__btn { flex: 1; padding: 10px; }
.crq-cookie-modal__actions .crq-cookie__btn--ghost { color: var(--crq-blue-800, #003a70); border-color: #c5d0dd; }
.crq-cookie-modal__actions .crq-cookie__btn--ghost:hover { background: var(--crq-blue-50, #e8f1fa); }
.crq-cookie-switch { position: relative; display: inline-block; width: 42px; height: 24px; cursor: pointer; }
.crq-cookie-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.crq-cookie-switch span[aria-hidden] { position: absolute; inset: 0; background: #c5d0dd; border-radius: 24px; transition: .2s; }
.crq-cookie-switch span[aria-hidden]::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.crq-cookie-switch input:checked + span[aria-hidden] { background: var(--crq-blue-600, #1565c0); }
.crq-cookie-switch input:checked + span[aria-hidden]::before { transform: translateX(18px); }

/* Enquanto o aviso de cookies está visível, sobe o botão de acessibilidade */
body.crq-has-cookie .crq-a11y { bottom: 92px; }
@media (max-width: 600px) { body.crq-has-cookie .crq-a11y { bottom: 150px; } }

/* VLibras fica no canto direito-baixo; sobe os FABs do tema p/ não cobrir a mãozinha */
.crq-fab-stack { bottom: 104px !important; }
@media (max-width: 600px) { .crq-fab-stack { bottom: 96px !important; } }

/* Selo "Acessível em Libras" no rodapé */
.crq-footer__libras { display: inline-flex; align-items: center; gap: 7px; font-size: .78rem; color: rgba(255,255,255,.8); background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); padding: 5px 12px; border-radius: 50px; }
.crq-footer__libras svg { width: 16px; height: 16px; fill: var(--crq-gold-500, #d9a73f); }
