/* ==========================================================================
   Accessibility Panel Redesign
   - Compact, non-scrollable modern card layout (matching reference image)
   - Proper typography hierarchy, crisp icons, switches, steppers
   - Site palette: #01224e (primary) and #EFAF00 (accent)
   - Sticky button & panel position restored to top: 260px / 300px on the right
   ========================================================================== */

:root {
    --asb-primary: var(--color-primary, #01224e);
    --asb-secondary: var(--color-secondary, #EFAF00);
    --asb-card-bg: #ffffff;
    --asb-text-main: #0b1a30;
    --asb-text-muted: #5e6d82;
    --asb-section-bg: #eef3f9;
    --asb-section-title: #4b627f;
    --asb-border: #e2e8f0;
    --asb-switch-bg: #cbd5e1;
}

/* Floating Launch Button on Screen Edge - Positioned Above Enquiry Now Button */
#universalAccessBtn {
    position: fixed !important;
    top: 80px !important;
    right: 0 !important;
    transform: none !important;
    width: 44px !important;
    height: 44px !important;
    background: var(--asb-primary) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 8px 0 0 8px !important;
    box-shadow: -3px 4px 18px rgba(1, 34, 78, 0.35) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    z-index: 1000001 !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    padding: 0 !important;
    outline: none !important;
}

#universalAccessBtn:hover {
    background: #022f6c !important;
    box-shadow: -4px 6px 20px rgba(1, 34, 78, 0.45) !important;
    transform: scale(1.05) !important;
}

#universalAccessBtn .asb-launch-icon {
    font-size: 22px;
    line-height: 1;
    color: #ffffff;
}

/* Tooltip appearing on hover */
#universalAccessBtn .asb-launch-tooltip {
    position: absolute;
    right: 115%;
    top: 50%;
    transform: translateY(-50%) translateX(6px);
    background: var(--asb-primary);
    color: #ffffff;
    font-family: var(--font-primary, "Poppins", sans-serif);
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.3px;
    padding: 6px 12px;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 14px rgba(1, 34, 78, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

#universalAccessBtn .asb-launch-tooltip::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 100%;
    transform: translateY(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent transparent var(--asb-primary);
}

#universalAccessBtn:hover .asb-launch-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}

/* Accessibility Card Modal - Aligns with Trigger Button with Premium Spring Transition */
#accessibilityBar {
    position: fixed !important;
    top: 80px !important;
    right: 18px !important;
    transform: translateX(18px) scale(0.92) !important;
    transform-origin: top right !important;
    width: 334px !important;
    max-width: calc(100vw - 24px) !important;
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border-radius: 16px !important;
    box-shadow: 0 20px 50px rgba(1, 34, 78, 0.22), 0 6px 18px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(1, 34, 78, 0.08) !important;
    z-index: 1000002 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    font-family: var(--font-primary, "Poppins", "Inter", sans-serif) !important;
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
    transition: opacity 0.32s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.34s cubic-bezier(0.34, 1.56, 0.64, 1), visibility 0.32s !important;
    border: 1px solid rgba(255, 255, 255, 0.6) !important;
    box-sizing: border-box !important;
}

#accessibilityBar * {
    box-sizing: border-box !important;
}

#accessibilityBar.active {
    opacity: 1 !important;
    pointer-events: auto !important;
    visibility: visible !important;
    transform: translateX(0) scale(1) !important;
}

/* Header Section with Deep Navy Gradient and Gold Accent Accentuation */
.asb-header {
    background: linear-gradient(135deg, #01224e 0%, #063168 100%);
    color: #ffffff;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    border-bottom: 2px solid rgba(239, 175, 0, 0.35);
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(1, 34, 78, 0.15);
}

.asb-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.asb-header-badge {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0.08) 100%);
    color: #ffffff;
    font-size: 19px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    transition: transform 0.3s ease;
}

#accessibilityBar:hover .asb-header-badge {
    transform: rotate(10deg);
}

.asb-header-badge i {
    line-height: 1;
}

.asb-header-text {
    display: flex;
    flex-direction: column;
}

.asb-header-title {
    font-size: 16.5px;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    line-height: 1.2;
    letter-spacing: -0.2px;
}

.asb-header-subtitle {
    font-size: 10.5px;
    color: rgba(255, 255, 255, 0.9);
    margin: 2px 0 0;
    line-height: 1.15;
    font-weight: 400;
}

.asb-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-size: 15px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.95;
    padding: 0;
    outline: none !important;
}

.asb-close-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    opacity: 1;
    transform: rotate(90deg) scale(1.08);
}

/* Compact Non-Scrollable Content Body */
.asb-body {
    padding: 8px 12px 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 3px;
    background: #ffffff;
}

/* Section Tag Pills */
.asb-section-tag {
    background: #edf3fa;
    color: #3b5372;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    padding: 4px 9px;
    border-radius: 6px;
    margin: 4px 0 2px;
    display: flex;
    align-items: center;
    line-height: 1.1;
    border-left: 2.5px solid var(--asb-primary);
}

.asb-section-tag:first-child {
    margin-top: 1px;
}

/* Row Item */
.asb-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 8px;
    border-radius: 10px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    gap: 8px;
    background: #ffffff;
    user-select: none;
    min-height: 39px;
    border: 1px solid transparent;
}

.asb-row:hover {
    background-color: #f7faff;
    border-color: rgba(1, 34, 78, 0.08);
    transform: translateX(-2px);
}

.asb-row-clickable {
    cursor: pointer;
}

.asb-row-clickable:hover {
    background-color: #f0f5fc;
}

.asb-row.asb-active-voice {
    background-color: #e8f0fe;
    border-color: rgba(1, 34, 78, 0.15);
}

.asb-row-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.asb-icon-wrap {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--asb-primary);
    font-size: 16px;
    flex-shrink: 0;
    line-height: 1;
}

.asb-row-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.asb-row-title {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--asb-text-main);
    margin: 0;
    line-height: 1.15;
}

.asb-row-desc {
    font-size: 10px;
    color: var(--asb-text-muted);
    margin: 1px 0 0;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Toggle Switch Control */
.asb-switch {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 20px;
    flex-shrink: 0;
    margin: 0;
    cursor: pointer;
}

.asb-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
    pointer-events: none;
}

.asb-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--asb-switch-bg);
    transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 20px;
}

.asb-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
}

.asb-switch input:checked + .asb-slider {
    background-color: var(--asb-primary);
}

.asb-switch input:checked + .asb-slider:before {
    transform: translateX(18px);
}

/* Stepper Control for Text Size */
.asb-stepper {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.asb-step-btn {
    width: 24px;
    height: 24px;
    border-radius: 5px;
    border: 1px solid #cfd8dc;
    background: #ffffff;
    color: var(--asb-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
    line-height: 1;
    outline: none !important;
}

.asb-step-btn:hover {
    background: var(--asb-primary);
    color: #ffffff;
    border-color: var(--asb-primary);
}

.asb-step-val {
    font-size: 11px;
    font-weight: 700;
    color: #1f2937;
    min-width: 38px;
    text-align: center;
    padding: 2px 4px;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    background: #f8fafc;
    line-height: 1.2;
}

/* Chevron Arrow Navigation for Drill-Down / Action Items */
.asb-chevron-btn {
    background: transparent;
    border: none;
    color: #4b627f;
    font-size: 13px;
    padding: 2px 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
    outline: none !important;
}

.asb-row-clickable:hover .asb-chevron-btn {
    color: var(--asb-primary);
    transform: translateX(2px);
    transition: transform 0.15s ease;
}

/* Reset Button Row */
.asb-reset-row {
    border-top: 1px solid var(--asb-border);
    margin-top: 4px;
    padding-top: 7px;
    padding-bottom: 3px;
}

.asb-reset-row:hover .asb-icon-wrap i {
    transform: rotate(-120deg);
    transition: transform 0.25s ease;
}

/* Language Box (compact inline expandable) */
.asb-language-box {
    margin: 2px 0 4px;
    padding: 6px 6px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    display: none;
}

.asb-language-box.open {
    display: block;
}

.asb-lang-buttons {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.asb-lang-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 4px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none !important;
}

.asb-lang-btn:hover {
    border-color: var(--asb-primary);
    background: #f0f4f9;
}

.asb-lang-btn.active {
    background: var(--asb-primary);
    border-color: var(--asb-primary);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(1, 34, 78, 0.25);
}

.asb-lang-code {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    line-height: 1;
    opacity: 0.75;
}

.asb-lang-btn.active .asb-lang-code {
    opacity: 0.9;
    color: var(--asb-secondary);
}

.asb-lang-name {
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    margin-top: 2px;
}

.asb-lang-btn.active .asb-lang-name {
    color: #ffffff;
}

/* Prevent styling conflicts on Accessibility Bar during Contrast/Grayscale */
body.pagina-acessivel #accessibilityBar,
body.pagina-acessivel #universalAccessBtn,
body.grayscale #accessibilityBar,
body.grayscale #universalAccessBtn {
    filter: none !important;
}

body.pagina-acessivel #accessibilityBar {
    background-color: #ffffff !important;
    color: #0b1a30 !important;
    border: 1px solid rgba(1, 34, 78, 0.2) !important;
}

body.pagina-acessivel #accessibilityBar .asb-row-title {
    color: #0b1a30 !important;
}

body.pagina-acessivel #accessibilityBar .asb-row-desc {
    color: #5e6d82 !important;
}

body.pagina-acessivel #accessibilityBar .asb-header {
    background-color: var(--asb-primary) !important;
    color: #ffffff !important;
}

body.pagina-acessivel #accessibilityBar .asb-section-tag {
    background-color: #eef3f9 !important;
    color: #4b627f !important;
}

body.pagina-acessivel #universalAccessBtn {
    background-color: var(--asb-primary) !important;
    color: #ffffff !important;
}

/* Mobile Adjustments */
@media (max-width: 576px) {
    #universalAccessBtn {
        top: auto !important;
        bottom: 75px !important;
        transform: none !important;
        border-radius: 8px 0 0 8px !important;
        width: 40px !important;
        height: 40px !important;
    }

    #accessibilityBar {
        top: auto !important;
        bottom: 12px !important;
        right: 8px !important;
        left: 8px !important;
        width: calc(100vw - 16px) !important;
        max-width: 100% !important;
        transform: translateY(15px) scale(0.96) !important;
    }

    #accessibilityBar.active {
        transform: translateY(0) scale(1) !important;
    }
}