/* =============================================
   Accessibility Widget — Pure CSS, no library
   ============================================= */

#acc-launcher {
    position: fixed;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #185FA5;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    transition: transform 0.15s, background 0.15s;
}
#acc-launcher:hover { background: #0c447c; transform: scale(1.07); }
#acc-launcher:focus-visible { outline: 3px solid #93c5fd; outline-offset: 3px; }
#acc-launcher svg { width: 26px; height: 26px; fill: #ffffff; }

#acc-panel {
    position: fixed;
    width: 320px;
    max-height: 80vh;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    z-index: 9998;
    display: none;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    color: #111827;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
#acc-panel.acc-open { display: flex; }

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    #acc-panel {
        background: #1f2937;
        border-color: #374151;
        color: #f9fafb;
    }
    .acc-header { border-color: #374151; }
    .acc-divider { background: #374151; }
    .acc-profile-btn, .acc-color-btn { background: #111827; border-color: #374151; color: #9ca3af; }
    .acc-profile-btn:hover, .acc-color-btn:hover { border-color: #3b82f6; color: #93c5fd; }
    .acc-profile-btn.active, .acc-color-btn.active { background: #1e3a5f; border-color: #3b82f6; color: #93c5fd; }
    .acc-toggle-row:hover { background: #111827; }
    .acc-switch-track { background: #4b5563; }
    .acc-stepper { border-color: #374151; }
    .acc-step-btn:hover { background: #111827; }
    .acc-step-btn { color: #f9fafb; }
    .acc-step-val { border-color: #374151; color: #f9fafb; }
    .acc-reset { border-color: #374151; color: #9ca3af; }
    .acc-reset:hover { background: #111827; color: #f9fafb; }
    .acc-section-title { color: #6b7280; }
    .acc-label-text { color: #f9fafb; }
    .acc-close { color: #6b7280; }
    .acc-header h2 { color: #f9fafb; }
}

.acc-header {
    padding: 14px 16px 12px;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    background: inherit;
    z-index: 1;
}
.acc-header h2 {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    color: inherit;
}
.acc-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #6b7280;
    font-size: 22px;
    line-height: 1;
    padding: 0 2px;
    display: flex;
    align-items: center;
    transition: color 0.1s;
}
.acc-close:hover { color: #111827; }
.acc-close:focus-visible { outline: 2px solid #185FA5; border-radius: 4px; }

.acc-section-title {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #6b7280;
    padding: 12px 16px 6px;
}

.acc-profiles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 0 16px 12px;
}
.acc-profile-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 6px 8px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
    cursor: pointer;
    font-size: 12px;
    color: #6b7280;
    line-height: 1.3;
    text-align: center;
    transition: all 0.15s;
    font-family: inherit;
}
.acc-profile-btn:hover { border-color: #185FA5; color: #185FA5; background: #eff6ff; }
.acc-profile-btn.active { background: #dbeafe; border-color: #185FA5; color: #185FA5; font-weight: 600; }
.acc-profile-btn:focus-visible { outline: 2px solid #185FA5; }
.acc-profile-btn svg { width: 22px; height: 22px; }

.acc-toggles {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 16px 12px;
}
.acc-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.1s;
}
.acc-toggle-row:hover { background: #f9fafb; }
.acc-toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: inherit;
    font-size: 13px;
    user-select: none;
}
.acc-toggle-label svg { color: #6b7280; flex-shrink: 0; }

.acc-switch {
    position: relative;
    width: 38px;
    height: 22px;
    flex-shrink: 0;
}
.acc-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.acc-switch-track {
    position: absolute;
    inset: 0;
    background: #d1d5db;
    border-radius: 22px;
    transition: background 0.2s;
    cursor: pointer;
}
.acc-switch input:checked + .acc-switch-track { background: #185FA5; }
.acc-switch input:focus-visible + .acc-switch-track { outline: 2px solid #93c5fd; outline-offset: 2px; }
.acc-switch-track::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    top: 3px;
    left: 3px;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.acc-switch input:checked + .acc-switch-track::after { transform: translateX(16px); }

.acc-stepper-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
}
.acc-label-text {
    font-size: 13px;
    color: #111827;
}
.acc-stepper {
    display: flex;
    align-items: center;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}
.acc-step-btn {
    background: none;
    border: none;
    width: 32px;
    height: 30px;
    cursor: pointer;
    color: #111827;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.1s;
    line-height: 1;
    font-family: inherit;
}
.acc-step-btn:hover { background: #f3f4f6; }
.acc-step-btn:focus-visible { outline: 2px solid #185FA5; }
.acc-step-val {
    font-size: 12px;
    font-weight: 600;
    min-width: 42px;
    text-align: center;
    color: #111827;
    border-left: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
    height: 30px;
    line-height: 30px;
}

.acc-colors {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    padding: 0 16px 12px;
}
.acc-color-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 8px 4px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
    cursor: pointer;
    font-size: 11px;
    color: #6b7280;
    transition: all 0.15s;
    font-family: inherit;
}
.acc-color-btn:hover { border-color: #185FA5; color: #185FA5; }
.acc-color-btn.active { border-color: #185FA5; color: #185FA5; background: #dbeafe; font-weight: 600; }
.acc-color-btn:focus-visible { outline: 2px solid #185FA5; }
.acc-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
}

.acc-divider {
    height: 1px;
    background: #f3f4f6;
    margin: 0;
}

.acc-reset {
    margin: 8px 16px 14px;
    padding: 9px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: none;
    cursor: pointer;
    font-size: 13px;
    color: #6b7280;
    transition: background 0.1s, color 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: inherit;
    width: calc(100% - 32px);
}
.acc-reset:hover { background: #f9fafb; color: #111827; }
.acc-reset:focus-visible { outline: 2px solid #185FA5; }

/* Scrollbar tipis di panel */
#acc-panel::-webkit-scrollbar { width: 4px; }
#acc-panel::-webkit-scrollbar-track { background: transparent; }
#acc-panel::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }
