/* AccesON - widget de accesibilitate | (c) artON media */

#acceson-root {
    position: fixed;
    bottom: var(--acceson-y, 24px);
    z-index: 2147483000;
    font-family: var(--acceson-font, inherit);
    line-height: 1.4;
}
#acceson-root.acceson-pos-left  { left: var(--acceson-x, 24px); }
#acceson-root.acceson-pos-right { right: var(--acceson-x, 24px); }

/* Butonul plutitor */
#acceson-btn {
    width: var(--acceson-size, 56px); height: var(--acceson-size, 56px);
    border: none; border-radius: 50%;
    background: linear-gradient(135deg, var(--acceson-accent, #4F46E5), var(--acceson-accent2, #06B6D4));
    color: #fff; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 6px 24px rgba(0,0,0,.28);
    transition: transform .2s ease, box-shadow .2s ease;
    padding: 0;
}
#acceson-btn svg { width: 60%; height: 60%; }
#acceson-btn:hover, #acceson-btn:focus-visible { transform: scale(1.08); box-shadow: 0 10px 30px rgba(0,0,0,.35); }
#acceson-btn:focus-visible { outline: 3px solid var(--acceson-accent2, #06B6D4); outline-offset: 3px; }

/* Panoul */
#acceson-panel {
    position: absolute;
    bottom: calc(var(--acceson-size, 56px) + 14px);
    width: 380px;
    max-width: calc(100vw - 24px);
    max-height: min(78vh, 660px);
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 30px 80px rgba(15, 23, 42, .38), 0 4px 18px rgba(15, 23, 42, .12);
    display: flex; flex-direction: column;
    overflow: hidden;
    color: #0f172a;
    animation: acceson-pop .22s cubic-bezier(.2, .9, .3, 1.15);
}
@keyframes acceson-pop {
    from { transform: translateY(12px) scale(.98); }
    to   { transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) { #acceson-panel { animation: none; } }
.acceson-body::-webkit-scrollbar { width: 8px; }
.acceson-body::-webkit-scrollbar-track { background: transparent; }
.acceson-body::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; border: 2px solid #fff; }
.acceson-body::-webkit-scrollbar-thumb:hover { background: var(--acceson-accent, #4F46E5); }
#acceson-panel[hidden] { display: none !important; }
.acceson-pos-left  #acceson-panel { left: 0; }
.acceson-pos-right #acceson-panel { right: 0; }

.acceson-head {
    background: linear-gradient(135deg, var(--acceson-accent, #4F46E5), var(--acceson-accent2, #06B6D4));
    color: #fff;
    padding: 14px 16px;
    display: flex; align-items: center; justify-content: space-between;
    flex: 0 0 auto;
}
.acceson-head strong { font-size: 15px; font-weight: 700; letter-spacing: .01em; display: flex; align-items: center; gap: 8px; }
.acceson-head-mark { width: 24px; height: 24px; border-radius: 6px; display: block; }
.acceson-head-actions { display: flex; gap: 8px; }
.acceson-head-actions button {
    border: 1px solid rgba(255,255,255,.45);
    background: rgba(255,255,255,.14);
    color: #fff; border-radius: 8px;
    font-size: 12.5px; padding: 5px 10px; cursor: pointer;
    transition: background .15s;
}
.acceson-head-actions button:hover, .acceson-head-actions button:focus-visible { background: rgba(255,255,255,.3); }
#acceson-close { font-size: 13px; line-height: 1; padding: 6px 9px; }

.acceson-body { overflow-y: auto; padding: 6px 14px 14px; flex: 1 1 auto; overscroll-behavior: contain; }
.acceson-body h3 {
    font-size: 11px; text-transform: uppercase; letter-spacing: .09em;
    color: #64748b; margin: 18px 2px 9px; font-weight: 700;
    display: flex; align-items: center; gap: 7px;
}
.acceson-body h3::before {
    content: ''; width: 14px; height: 3.5px; border-radius: 3px;
    background: linear-gradient(90deg, var(--acceson-accent, #4F46E5), var(--acceson-accent2, #06B6D4));
}

.acceson-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.acceson-grid-2 { grid-template-columns: repeat(2, 1fr); }

.acceson-tile {
    position: relative;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 6px;
    min-height: 74px;
    padding: 10px 6px;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    color: #334155;
    font-size: 12px; font-weight: 600; text-align: center;
    cursor: pointer;
    transition: border-color .15s, background .15s, color .15s, transform .1s;
}
.acceson-tile:hover { border-color: var(--acceson-accent, #4F46E5); transform: translateY(-1px); }
.acceson-tile:focus-visible { outline: 3px solid var(--acceson-accent2, #06B6D4); outline-offset: 2px; }
.acceson-tile[aria-pressed="true"] {
    background: linear-gradient(135deg, var(--acceson-accent, #4F46E5), var(--acceson-accent2, #06B6D4));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 6px 18px color-mix(in srgb, var(--acceson-accent, #4F46E5) 40%, transparent);
}
.acceson-tile[aria-pressed="true"] .acceson-steps i { background: rgba(255,255,255,.45); }
.acceson-tile[data-step="1"][aria-pressed="true"] .acceson-steps i:nth-child(1),
.acceson-tile[data-step="2"][aria-pressed="true"] .acceson-steps i:nth-child(-n+2),
.acceson-tile[data-step="3"][aria-pressed="true"] .acceson-steps i { background: #fff; }
.acceson-tile-ico svg { width: 24px; height: 24px; display: block; }
.acceson-tile-label { line-height: 1.25; }

/* pasii pentru marirea textului */
.acceson-steps { display: flex; gap: 3px; position: absolute; top: 7px; right: 8px; }
.acceson-steps i { width: 6px; height: 6px; border-radius: 50%; background: #cbd5e1; }
.acceson-tile[data-step="1"] .acceson-steps i:nth-child(1),
.acceson-tile[data-step="2"] .acceson-steps i:nth-child(-n+2),
.acceson-tile[data-step="3"] .acceson-steps i { background: var(--acceson-accent, #4F46E5); }

/* bara TTS */
#acceson-tts-bar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
    background: #f1f5f9; border-radius: 10px; padding: 8px 10px; margin-top: 8px;
    font-size: 12px;
}
#acceson-tts-bar[hidden] { display: none; }
#acceson-tts-bar button {
    border: 1.5px solid #e2e8f0; background: #fff; color: #334155;
    border-radius: 8px; padding: 5px 10px; font-size: 12px; font-weight: 600; cursor: pointer;
}
#acceson-tts-bar button:hover { border-color: var(--acceson-accent, #4F46E5); color: var(--acceson-accent, #4F46E5); }
#acceson-tts-bar label { margin-left: auto; color: #64748b; display: flex; align-items: center; gap: 5px; }
#acceson-tts-bar select { border: 1.5px solid #e2e8f0; border-radius: 8px; padding: 3px 6px; font-size: 12px; }

.acceson-foot {
    flex: 0 0 auto;
    padding: 10px 16px;
    background: #f8fafc; border-top: 1px solid #e2e8f0;
    font-size: 11.5px; color: #64748b; text-align: center;
}
.acceson-foot a { color: var(--acceson-accent, #4F46E5); text-decoration: none; }
.acceson-foot a:hover { text-decoration: underline; }

/* pe mobil panoul devine bottom-sheet fix, independent de pozitia butonului */
@media (max-width: 560px) {
    #acceson-panel {
        position: fixed;
        left: 8px !important;
        right: 8px !important;
        width: auto;
        max-width: none;
        bottom: calc(var(--acceson-y, 24px) + var(--acceson-size, 56px) + 10px);
        max-height: min(72vh, calc(100dvh - var(--acceson-y, 24px) - var(--acceson-size, 56px) - 24px));
        border-radius: 14px;
    }
    .acceson-grid { grid-template-columns: repeat(2, 1fr); }
    .acceson-grid-2 { grid-template-columns: repeat(2, 1fr); }
    .acceson-tile { min-height: 66px; font-size: 11.5px; }
    #acceson-magnifier { font-size: 20px; max-width: calc(100vw - 24px); }
}

/* ==========================================================================
 * EFECTELE PE PAGINA (clase pe <html>)
 * Filtrele se aplica pe copiii lui <body>, EXCEPTND widgetul.
 * ========================================================================== */
/* contrast intunecat: suprascriere de culori (predictibil pe site-uri cu imagini) */
html.acceson-dark-contrast body,
html.acceson-dark-contrast body *:not(#acceson-root):not(#acceson-root *):not(img):not(video):not(iframe):not(svg):not(picture) {
    background-color: #0d1117 !important;
    color: #e6edf3 !important;
    border-color: #30363d !important;
    text-shadow: none !important;
    box-shadow: none !important;
}
html.acceson-dark-contrast body a:not(#acceson-root a) { color: #79c0ff !important; }
html.acceson-dark-contrast body h1, html.acceson-dark-contrast body h2, html.acceson-dark-contrast body h3,
html.acceson-dark-contrast body h4, html.acceson-dark-contrast body h5, html.acceson-dark-contrast body h6 { color: #ffffff !important; }
html.acceson-dark-contrast body *:not(#acceson-root):not(#acceson-root *) { background-image: none !important; }

/* contrast luminos: fundal alb, text negru */
html.acceson-light-contrast body,
html.acceson-light-contrast body *:not(#acceson-root):not(#acceson-root *):not(img):not(video):not(iframe):not(svg):not(picture) {
    background-color: #ffffff !important;
    color: #111827 !important;
    border-color: #d1d5db !important;
    text-shadow: none !important;
}
html.acceson-light-contrast body a:not(#acceson-root a) { color: #1d4ed8 !important; text-decoration: underline !important; }
html.acceson-light-contrast body *:not(#acceson-root):not(#acceson-root *) { background-image: none !important; }
html.acceson-high-contrast body > *:not(#acceson-root)      { filter: contrast(1.45); }
html.acceson-high-saturation body > *:not(#acceson-root)    { filter: saturate(2.2); }
html.acceson-low-saturation body > *:not(#acceson-root)     { filter: saturate(.45); }
html.acceson-monochrome body > *:not(#acceson-root)         { filter: grayscale(1); }
html.acceson-invert body > *:not(#acceson-root)             { filter: invert(1); }
html.acceson-invert body > *:not(#acceson-root) img,
html.acceson-invert body > *:not(#acceson-root) video       { filter: invert(1); }
html.acceson-invert body .acceson-reinvert                  { filter: invert(1) !important; }

/* spatiere si inaltime rand */
html.acceson-letter-spacing body *:not(#acceson-root):not(#acceson-root *) { letter-spacing: .12em !important; word-spacing: .18em !important; }
html.acceson-line-height body *:not(#acceson-root):not(#acceson-root *)    { line-height: 1.9 !important; }

/* fonturi */
html.acceson-readable-font body *:not(#acceson-root):not(#acceson-root *) {
    font-family: Arial, Helvetica, 'Segoe UI', sans-serif !important;
}
html.acceson-dyslexia body *:not(#acceson-root):not(#acceson-root *) {
    font-family: Verdana, 'Trebuchet MS', Arial, sans-serif !important;
    letter-spacing: .1em !important; word-spacing: .25em !important; line-height: 1.8 !important;
}

/* aliniere */
html.acceson-align-left body *:not(#acceson-root):not(#acceson-root *)   { text-align: left !important; }
html.acceson-align-center body *:not(#acceson-root):not(#acceson-root *) { text-align: center !important; }
html.acceson-align-right body *:not(#acceson-root):not(#acceson-root *)  { text-align: right !important; }

/* evidentiere focus / hover */
html.acceson-highlight-focus body *:focus:not(#acceson-root *) {
    outline: 4px solid #f59e0b !important;
    outline-offset: 2px !important;
}
html.acceson-highlight-hover body a:hover:not(#acceson-root a),
html.acceson-highlight-hover body button:hover:not(#acceson-root button),
html.acceson-highlight-hover body input:hover, html.acceson-highlight-hover body select:hover,
html.acceson-highlight-hover body [role="button"]:hover, html.acceson-highlight-hover body label:hover {
    outline: 3px solid var(--acceson-accent2, #06B6D4) !important;
    outline-offset: 2px !important;
}

/* evidentieri */
html.acceson-highlight-links body a:not(#acceson-root a) {
    outline: 2px solid #f59e0b !important; outline-offset: 1px;
    background: rgba(245, 158, 11, .18) !important;
    text-decoration: underline !important;
}
html.acceson-highlight-titles body h1:not(#acceson-root h1), html.acceson-highlight-titles body h2:not(#acceson-root h2),
html.acceson-highlight-titles body h3:not(#acceson-root h3), html.acceson-highlight-titles body h4:not(#acceson-root h4),
html.acceson-highlight-titles body h5:not(#acceson-root h5), html.acceson-highlight-titles body h6:not(#acceson-root h6) {
    outline: 2px dashed var(--acceson-accent, #4F46E5) !important; outline-offset: 2px;
    background: color-mix(in srgb, var(--acceson-accent, #4F46E5) 10%, transparent) !important;
}

/* ascunde imagini */
html.acceson-hide-images body img:not(#acceson-root img),
html.acceson-hide-images body picture,
html.acceson-hide-images body video,
html.acceson-hide-images body figure iframe { visibility: hidden !important; }
html.acceson-hide-images body *:not(#acceson-root):not(#acceson-root *) { background-image: none !important; }

/* opreste animatiile */
html.acceson-stop-animations body *:not(#acceson-root):not(#acceson-root *) {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
}

/* cursor mare (SVG-uri desenate de artON media) */
html.acceson-big-cursor-white, html.acceson-big-cursor-white body * {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="42" height="42" viewBox="0 0 24 24"><path d="m5 2 15 8.6-6.6 1.7 3.2 7-3.3 1.6-3.1-7-5.2 4V2z" fill="white" stroke="black" stroke-width="1.4"/></svg>') 4 2, auto !important;
}
html.acceson-big-cursor-black, html.acceson-big-cursor-black body * {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="42" height="42" viewBox="0 0 24 24"><path d="m5 2 15 8.6-6.6 1.7 3.2 7-3.3 1.6-3.1-7-5.2 4V2z" fill="black" stroke="white" stroke-width="1.4"/></svg>') 4 2, auto !important;
}

/* navigare tastatura: focus foarte vizibil */
html.acceson-keyboard-nav body *:focus {
    outline: 4px solid #f59e0b !important;
    outline-offset: 2px !important;
}
#acceson-skip-link {
    position: fixed; top: -60px; left: 12px;
    background: var(--acceson-accent, #4F46E5); color: #fff;
    padding: 10px 16px; border-radius: 8px; z-index: 2147483001;
    transition: top .2s; text-decoration: none; font-weight: 600;
}
#acceson-skip-link:focus { top: 12px; }

/* ghid de citire */
#acceson-guide {
    position: fixed; left: 0; right: 0; height: 10px;
    background: var(--acceson-accent, #4F46E5);
    opacity: .55; border-radius: 5px;
    pointer-events: none; z-index: 2147482998;
    box-shadow: 0 0 0 2px rgba(255,255,255,.6);
}

/* masca de citire */
#acceson-mask-top, #acceson-mask-bottom {
    position: fixed; left: 0; right: 0;
    background: rgba(2, 6, 23, .62);
    pointer-events: none; z-index: 2147482997;
}
#acceson-mask-top { top: 0; }
#acceson-mask-bottom { bottom: 0; }

/* regiunea aria-live pentru cititoarele de ecran (vizual ascunsa) */
#acceson-live {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px; padding: 0; border: 0;
    clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

/* ascunde GIF-urile animate (profil epilepsie) */
html.acceson-no-gif body img[src$=".gif" i]:not(#acceson-root img),
html.acceson-no-gif body img[src*=".gif?" i] { visibility: hidden !important; }

/* evidentierea elementului citit de TTS */
.acceson-tts-reading { outline: 3px solid var(--acceson-accent2, #06B6D4) !important; outline-offset: 2px; }
html.acceson-tts-click body { cursor: context-menu; }

/* culori personalizate - randuri cu pickere */
#acceson-colors {
    display: flex; flex-direction: column; gap: 6px;
    background: #f1f5f9; border-radius: 10px; padding: 10px 12px; margin-top: 8px;
}
#acceson-colors[hidden] { display: none; }
.acceson-color-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: #334155; font-weight: 600; }
.acceson-color-row span { flex: 1; }
.acceson-color-row input[type=color] { width: 34px; height: 26px; border: 1.5px solid #e2e8f0; border-radius: 6px; padding: 1px; background: #fff; cursor: pointer; }
.acceson-color-row button { border: 1.5px solid #e2e8f0; background: #fff; border-radius: 6px; font-size: 11px; padding: 3px 8px; cursor: pointer; color: #64748b; }
.acceson-color-row button:hover { border-color: #dc2626; color: #dc2626; }

/* lupa de text */
#acceson-magnifier {
    position: fixed; z-index: 2147483002;
    max-width: 420px;
    background: #0f172a; color: #fff;
    font-size: 26px; line-height: 1.45; font-weight: 600;
    padding: 12px 16px; border-radius: 12px;
    box-shadow: 0 14px 40px rgba(0,0,0,.4);
    pointer-events: none;
}

/* status navigare vocala */
#acceson-voice-status {
    position: fixed; top: 14px; left: 50%; transform: translateX(-50%);
    background: #0f172a; color: #fff;
    font-size: 13px; font-weight: 600;
    padding: 9px 18px; border-radius: 99px;
    box-shadow: 0 8px 24px rgba(0,0,0,.35);
    z-index: 2147483002;
}

/* tastatura virtuala */
#acceson-vkbd {
    position: fixed; left: 50%; bottom: 12px; transform: translateX(-50%);
    background: #0f172a; border-radius: 14px; padding: 10px;
    display: flex; flex-direction: column; gap: 6px;
    box-shadow: 0 16px 48px rgba(0,0,0,.45);
    z-index: 2147483001;
    max-width: calc(100vw - 16px);
}
#acceson-vkbd[hidden] { display: none; }
.acceson-vkbd-row { display: flex; gap: 5px; justify-content: center; }
.acceson-vkbd-row button {
    min-width: 40px; height: 42px;
    border: none; border-radius: 8px;
    background: #1e293b; color: #f1f5f9;
    font-size: 16px; font-weight: 600; cursor: pointer;
    transition: background .12s;
}
.acceson-vkbd-row button:hover { background: var(--acceson-accent, #4F46E5); }
.acceson-vkbd-row button.acceson-vkbd-special { min-width: 64px; font-size: 13px; background: #334155; }
#acceson-vkbd.acceson-vkbd-shift .acceson-vkbd-row button:not(.acceson-vkbd-special) { text-transform: uppercase; }
@media (max-width: 640px) {
    .acceson-vkbd-row button { min-width: 30px; height: 38px; font-size: 14px; }
}
