/* ===== Variables de marca (ajustá a tu paleta) ===== */
:root {
  --a11y-deep: #021a53;
  --a11y-blue: #164687;
  --a11y-accent: #cfac65;
  --a11y-gray: #c1c5c8;
  --a11y-font-scale: 1;
  --a11y-font-family: "";
}

/* ===== Efectos globales aplicados por el widget ===== */
html { font-size: calc(100% * var(--a11y-font-scale)); }

html.a11y-legible-font,
html.a11y-legible-font body,
html.a11y-legible-font * {
  font-family: Verdana, Geneva, sans-serif !important;
}

/* Familia elegida por el usuario (sobrescribe legible si ambas activas) */
html[data-a11y-font="verdana"] * { font-family: Verdana, Geneva, sans-serif !important; }
html[data-a11y-font="tahoma"]  * { font-family: Tahoma, Geneva, sans-serif !important; }
html[data-a11y-font="arial"]   * { font-family: Arial, Helvetica, sans-serif !important; }
html[data-a11y-font="century"] * { font-family: "Century Gothic", CenturyGothic, AppleGothic, sans-serif !important; }

html.a11y-grayscale       { filter: grayscale(1); }
html.a11y-negative        { filter: invert(1) hue-rotate(180deg); }
html.a11y-negative img,
html.a11y-negative video,
html.a11y-negative picture { filter: invert(1) hue-rotate(180deg); }
html.a11y-grayscale.a11y-negative { filter: grayscale(1) invert(1) hue-rotate(180deg); }

html.a11y-high-contrast body { background: #000 !important; color: #fff !important; }
html.a11y-high-contrast a    { color: #ffeb3b !important; }

html.a11y-light-bg body,
html.a11y-light-bg body * {
  background: #fff !important;
  color: #111 !important;
  border-color: #333 !important;
}

    /* 1. Obliga al banner a mantener su color original del MEP */
    html.a11y-light-bg .banner-container {
        background-color: #1c2854 !important;
    }

        /* 2. Evita que la imagen y los elementos internos se rellenen de blanco */
        html.a11y-light-bg .banner-container * {
            background-color: transparent !important;
            border-color: transparent !important;
        }



html.a11y-underline-links a { text-decoration: underline !important; }

/* ===== Widget UI ===== */
.a11y-fab {
  position: fixed; left: 0; top: 50%; transform: translateY(-50%);
  z-index: 9999;
  width: 56px; height: 56px;
  border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--a11y-deep), var(--a11y-blue));
  color: #fff;
  border-radius: 0 16px 16px 0;
  box-shadow: 0 10px 30px -10px rgba(2,26,83,.65);
  display: flex; align-items: center; justify-content: center;
  transition: width .3s, box-shadow .3s;
}
.a11y-fab:hover { width: 66px; box-shadow: 0 14px 40px -8px rgba(2,26,83,.8); }
.a11y-fab:focus { outline: 3px solid var(--a11y-accent); outline-offset: 2px; }
.a11y-fab svg { width: 32px; height: 32px; }
.a11y-badge {
  position: absolute; top: -6px; right: -6px;
  min-width: 20px; height: 20px; padding: 0 5px;
  background: var(--a11y-accent); color: var(--a11y-deep);
  border-radius: 999px; font: 700 10px/20px system-ui, sans-serif;
  text-align: center; border: 2px solid #fff;
}

.a11y-panel {
  position: fixed; left: 72px; top: 50%; transform: translateY(-50%);
  z-index: 9999;
  width: 340px; max-height: 80vh; overflow: hidden;
  background: #fff; border-radius: 20px;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.4);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  display: none;
}
.a11y-panel.open { display: flex; flex-direction: column; }

.a11y-header {
  background: linear-gradient(135deg, var(--a11y-deep), var(--a11y-blue));
  color: #fff; padding: 16px 20px;
}
.a11y-header-top { display: flex; justify-content: space-between; align-items: center; }
.a11y-header h3 { margin: 0; font-size: 14px; font-weight: 700; }
.a11y-header p  { margin: 2px 0 0; font-size: 11px; opacity: .8; }
.a11y-close {
  background: transparent; border: none; color: #fff;
  cursor: pointer; padding: 6px; border-radius: 6px;
}
.a11y-close:hover { background: rgba(255,255,255,.1); }

.a11y-tabs {
  display: flex; gap: 4px; margin-top: 14px;
  background: rgba(0,0,0,.2); padding: 4px; border-radius: 10px;
}
.a11y-tab {
  flex: 1; border: none; background: transparent; color: rgba(255,255,255,.7);
  padding: 6px 8px; border-radius: 8px; font-size: 11px; font-weight: 600;
  cursor: pointer;
}
.a11y-tab.active { background: var(--a11y-accent); color: var(--a11y-deep); }

.a11y-body { padding: 16px; overflow-y: auto; }

.a11y-card {
  border: 1px solid #e5e7eb; border-radius: 14px; padding: 12px;
  margin-bottom: 10px; background: #fafafa;
}
.a11y-card-title { font-size: 12px; font-weight: 700; color: var(--a11y-deep); margin-bottom: 8px; }

.a11y-zoom-row { display: flex; align-items: center; gap: 8px; }
.a11y-zoom-btn {
  width: 34px; height: 34px; border: none; border-radius: 8px;
  background: var(--a11y-deep); color: #fff; cursor: pointer; font-size: 18px;
}
.a11y-zoom-btn:disabled { opacity: .3; cursor: not-allowed; }
.a11y-zoom-bar { flex: 1; height: 8px; background: #e5e7eb; border-radius: 999px; overflow: hidden; }
.a11y-zoom-fill { height: 100%; background: linear-gradient(90deg, var(--a11y-blue), var(--a11y-accent)); transition: width .3s; }
.a11y-zoom-val { font: 700 12px/1 ui-monospace, monospace; color: var(--a11y-accent); background: var(--a11y-deep); padding: 3px 6px; border-radius: 6px; }

.a11y-toggle {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px; border: 1px solid #e5e7eb; border-radius: 12px;
  background: #fff; cursor: pointer; margin-bottom: 8px; text-align: left;
}
.a11y-toggle:hover { border-color: var(--a11y-blue); }
.a11y-toggle.active { border-color: var(--a11y-accent); background: #fdf7e6; }
.a11y-toggle-icon {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  background: #eef2ff; color: var(--a11y-deep);
  display: flex; align-items: center; justify-content: center;
}
.a11y-toggle.active .a11y-toggle-icon { background: var(--a11y-deep); color: var(--a11y-accent); }
.a11y-toggle-text { flex: 1; }
.a11y-toggle-title { display: block; font-size: 12px; font-weight: 700; color: #111; }
.a11y-toggle-desc  { display: block; font-size: 10px; color: #6b7280; }
.a11y-switch {
  width: 34px; height: 20px; background: #d1d5db; border-radius: 999px; position: relative; flex-shrink: 0;
}
.a11y-toggle.active .a11y-switch { background: var(--a11y-accent); }
.a11y-switch::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; background: #fff; border-radius: 999px;
  transition: left .2s;
}
.a11y-toggle.active .a11y-switch::after { left: 16px; }

.a11y-font-select {
  width: 100%; padding: 8px 10px; border-radius: 8px;
  border: 1px solid #e5e7eb; background: #fff; font-size: 12px;
}

.a11y-reset {
  width: 100%; margin-top: 10px; padding: 10px;
  background: linear-gradient(90deg, var(--a11y-deep), var(--a11y-blue));
  color: #fff; border: none; border-radius: 10px; cursor: pointer;
  font-size: 13px; font-weight: 600;
}
.a11y-reset:disabled { opacity: .4; cursor: not-allowed; }

.a11y-hint { text-align: center; font-size: 10px; color: #6b7280; margin-top: 6px; }



/* --- CORRECCIÓN DE SWITCHES PARA MODO FONDO CLARO --- */

/* 1. Devuelve el color gris a la pista del interruptor apagado */
html.a11y-light-bg .a11y-switch {
    background-color: #d1d5db !important;
    border-color: #9ca3af !important;
}

/* 2. Devuelve el color verde a la pista del interruptor encendido */
html.a11y-light-bg .a11y-toggle.active .a11y-switch {
    background-color: #10b981 !important;
    border-color: #10b981 !important;
}

/* 3. Asegura que la pelotita (pomo) se vea bien */
html.a11y-light-bg .a11y-switch::after {
    background-color: #ffffff !important;
    border: 1px solid #9ca3af !important; /* Le ponemos un bordecito sutil por si acaso */
}

/* Quita el borde de la pelotita cuando está en la zona verde (encendido) */
html.a11y-light-bg .a11y-toggle.active .a11y-switch::after {
    border-color: transparent !important;
}