/* ── ESTILOS DE ACCESIBILIDAD NEXUS ── */

@import url('https://cdn.jsdelivr.net/npm/opendyslexic@1.0.3/dist/opendyslexic.css');

/* Enlace de salto de página para lectores/teclado */
.skip-link {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: #f2b705;
  color: #142b4d;
  padding: 12px 24px;
  border-radius: 0 0 8px 8px;
  z-index: 999999;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
  transition: top 0.2s ease-in-out;
}
.skip-link:focus {
  top: 0;
  outline: 4px solid #142b4d;
}

/* Botón Flotante */
.accesibilidad-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #142b4d;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 24px rgba(20, 43, 77, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.05);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.2s;
}
.accesibilidad-btn:hover {
  background: #f2b705;
  color: #142b4d;
  transform: scale(1.08) rotate(5deg);
}
.accesibilidad-btn svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

/* Panel Lateral */
.accesibilidad-panel {
  position: fixed;
  top: 0;
  right: -360px;
  width: 340px;
  height: 100%;
  background: rgba(253, 251, 246, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-left: 1px solid rgba(28, 26, 20, 0.1);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.12);
  z-index: 100000;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  color: #1c1a14;
  overflow-y: auto;
}
.accesibilidad-panel.open {
  right: 0;
}
.accesibilidad-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(28, 26, 20, 0.08);
  padding-bottom: 1rem;
}
.accesibilidad-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #142b4d;
}
.accesibilidad-close {
  background: transparent;
  border: none;
  cursor: pointer;
  color: #6b6455;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 50%;
  transition: background-color 0.2s, color 0.2s;
}
.accesibilidad-close:hover {
  background: rgba(28, 26, 20, 0.06);
  color: #1c1a14;
}

/* Secciones del Panel */
.accesibilidad-grupo {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.accesibilidad-grupo h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b6455;
  font-weight: 600;
}

/* Opciones / Toggles */
.accesibilidad-opcion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(28, 26, 20, 0.08);
  padding: 0.85rem 1rem;
  border-radius: 10px;
  font-weight: 500;
  font-size: 0.95rem;
  transition: background-color 0.2s, border-color 0.2s;
}
.accesibilidad-opcion:hover {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(20, 43, 77, 0.2);
}

/* Switch UI */
.switch-control {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
  cursor: pointer;
}
.switch-control input {
  opacity: 0;
  width: 0;
  height: 0;
}
.switch-slider {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #a89f91;
  transition: .3s;
  border-radius: 34px;
}
.switch-slider:before {
  position: absolute;
  content: "";
  height: 18px; width: 18px;
  left: 3px; bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}
.switch-control input:checked + .switch-slider {
  background-color: #142b4d;
}
.switch-control input:checked + .switch-slider:before {
  transform: translateX(22px);
}

/* Controles de Tamaño de Fuente */
.fuente-controles {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.5rem;
  align-items: center;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(28, 26, 20, 0.08);
  padding: 0.75rem;
  border-radius: 10px;
}
.fuente-btn {
  background: #142b4d;
  color: #ffffff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  font-size: 0.95rem;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fuente-btn:hover {
  background: #f2b705;
  color: #142b4d;
}
.fuente-actual {
  font-size: 0.9rem;
  font-weight: 600;
  min-width: 60px;
  text-align: center;
}

/* Botón Restablecer */
.btn-resetear {
  margin-top: auto;
  background: #8f2d2d;
  color: #ffffff;
  border: none;
  padding: 0.85rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
}
.btn-resetear:hover {
  background: #ab3a3a;
}
.btn-resetear:active {
  transform: scale(0.98);
}

/* ──────────────────────────────────────────────────
   ── REGLAS DE APLICACIÓN DE ACCESIBILIDAD ──
   ────────────────────────────────────────────────── */

/* 1. MODO OSCURO */
body.modo-oscuro {
  /* Variables base.css */
  --azul-oscuro: #85b7eb;
  --azul-medio: #1e293b;
  --blanco: #0f172a;
  --crema: #1e293b;
  --texto: #f1f5f9;
  --suave: #94a3b8;
  --borde: #334155;
  --dorado: #f2b705;
  --sombra: 0 10px 30px rgba(0, 0, 0, 0.4);
  background-color: #0f172a !important;
  color: #f1f5f9 !important;

  /* Variables nexus-landing.html */
  --bg: #0f172a;
  --bg-warm: #1e293b;
  --bg-dark: #080d1a;
  --ink: #f1f5f9;
  --ink-muted: #94a3b8;
  --ink-faint: #64748b;
  --gold: #f2b705;
  --gold-light: #202b3c;
  --gold-mid: #f59e0b;
  --navy: #38bdf8;
  --navy-light: #1e293b;
  --white: #1e293b;
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.2);
}

/* Ajustes específicos de elementos en Modo Oscuro */
body.modo-oscuro,
body.modo-oscuro .pricing,
body.modo-oscuro .roles,
body.modo-oscuro .stats-bar {
  background-color: #0f172a !important;
  color: #f1f5f9 !important;
}
body.modo-oscuro nav {
  background: rgba(15, 23, 42, 0.9) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}
body.modo-oscuro .nav-links a {
  color: #94a3b8 !important;
}
body.modo-oscuro .nav-links a:hover {
  color: #f1f5f9 !important;
}
body.modo-oscuro .menu-navegacion {
  background-color: #1e293b !important;
  border-bottom: 1px solid #334155 !important;
}
body.modo-oscuro .menu-navegacion a {
  background-color: #334155 !important;
  color: #f1f5f9 !important;
}
body.modo-oscuro .menu-navegacion a:hover {
  background-color: #38bdf8 !important;
  color: #0f172a !important;
}
body.modo-oscuro .tarjeta-perfil,
body.modo-oscuro .panel-principal,
body.modo-oscuro .panel,
body.modo-oscuro .tarjeta-resumen {
  background-color: #1e293b !important;
  border: 1px solid #334155 !important;
  color: #f1f5f9 !important;
}
body.modo-oscuro .role-card,
body.modo-oscuro .plan-card {
  background: #1e293b !important;
  border-color: #334155 !important;
}
body.modo-oscuro .plan-card.destacado {
  background: #0f172a !important;
  border: 2px solid #38bdf8 !important;
}
body.modo-oscuro .entrada-texto {
  background-color: #0f172a !important;
  color: #f1f5f9 !important;
  border-color: #334155 !important;
}
body.modo-oscuro .entrada-texto::placeholder {
  color: #475569 !important;
}
body.modo-oscuro .accesibilidad-panel {
  background: rgba(15, 23, 42, 0.95) !important;
  border-left: 1px solid #334155 !important;
  color: #f1f5f9 !important;
}
body.modo-oscuro .accesibilidad-header h2 {
  color: #38bdf8 !important;
}
body.modo-oscuro .accesibilidad-opcion,
body.modo-oscuro .fuente-controles {
  background: rgba(30, 41, 59, 0.5) !important;
  border-color: #334155 !important;
}
body.modo-oscuro .accesibilidad-opcion:hover {
  background: rgba(30, 41, 59, 0.8) !important;
}
body.modo-oscuro th {
  background-color: #334155 !important;
  color: #f1f5f9 !important;
}

/* Overrides de Contraste y Lectura para Modo Oscuro en NEXUS */
body.modo-oscuro .tarjeta-info,
body.modo-oscuro .tarjeta-soporte,
body.modo-oscuro .tarjeta-faq,
body.modo-oscuro .tarjeta-accion {
  background-color: #1e293b !important;
  border: 1px solid #334155 !important;
  color: #f1f5f9 !important;
}

body.modo-oscuro .tarjeta-resumen-usuario {
  background-color: #1e293b !important;
  border: 1px solid #334155 !important;
}

body.modo-oscuro .panel-usuario-lateral,
body.modo-oscuro .tarjeta-libro {
  border: 1px solid #334155 !important;
}

body.modo-oscuro .libro-meta-item {
  background-color: #334155 !important;
  color: #f1f5f9 !important;
}

body.modo-oscuro .btn-favorito {
  background-color: #334155 !important;
  color: #94a3b8 !important;
}

body.modo-oscuro .btn-favorito:hover {
  background-color: #f43f5e !important;
  color: #ffffff !important;
}

body.modo-oscuro .btn-favorito.activo {
  background-color: rgba(244, 63, 94, 0.2) !important;
  color: #f43f5e !important;
}

body.modo-oscuro .seccion-campos-reserva {
  background-color: #1e293b !important;
  border: 1px solid #334155 !important;
}

body.modo-oscuro .area-texto {
  background-color: #0f172a !important;
  color: #f1f5f9 !important;
  border: 2px solid #334155 !important;
}

body.modo-oscuro .area-texto:focus {
  border-color: #38bdf8 !important;
}

body.modo-oscuro .faq-pregunta:hover {
  background-color: #2e3d52 !important;
}

body.modo-oscuro select,
body.modo-oscuro input,
body.modo-oscuro textarea {
  color-scheme: dark;
}


/* 2. ALTO CONTRASTE */
body.alto-contraste {
  background-color: #000000 !important;
  color: #ffffff !important;
  /* Variables base.css */
  --azul-oscuro: #ffff00;
  --azul-medio: #000000;
  --blanco: #000000;
  --crema: #000000;
  --texto: #ffffff;
  --suave: #ffffff;
  --borde: #ffffff;
  --dorado: #ffff00;
  --sombra: none;
  --sombra-hover: none;

  /* Variables nexus-landing.html */
  --bg: #000000;
  --bg-warm: #000000;
  --bg-dark: #000000;
  --ink: #ffffff;
  --ink-muted: #ffffff;
  --ink-faint: #ffffff;
  --gold: #ffff00;
  --gold-light: #000000;
  --gold-mid: #ffff00;
  --navy: #000000;
  --navy-light: #000000;
  --white: #000000;
  --border: #ffffff;
  --border-strong: #ffffff;
}

body.alto-contraste *,
body.alto-contraste .pricing,
body.alto-contraste .roles,
body.alto-contraste .stats-bar,
body.alto-contraste nav,
body.alto-contraste footer {
  background-color: #000000 !important;
  color: #ffffff !important;
  border-color: #ffffff !important;
  box-shadow: none !important;
  text-shadow: none !important;
}
body.alto-contraste a,
body.alto-contraste button,
body.alto-contraste strong,
body.alto-contraste em,
body.alto-contraste h1,
body.alto-contraste h2,
body.alto-contraste h3,
body.alto-contraste th,
body.alto-contraste label {
  color: #ffff00 !important;
}
body.alto-contraste a {
  text-decoration: underline !important;
}
body.alto-contraste input,
body.alto-contraste select,
body.alto-contraste textarea {
  border: 3px solid #ffffff !important;
  background-color: #000000 !important;
  color: #ffffff !important;
}
body.alto-contraste .btn-primary,
body.alto-contraste .btn-secondary,
body.alto-contraste .boton,
body.alto-contraste .plan-btn {
  background-color: #000000 !important;
  color: #ffff00 !important;
  border: 2px solid #ffff00 !important;
  text-decoration: none !important;
  font-weight: 900 !important;
}
body.alto-contraste .btn-primary:hover,
body.alto-contraste .btn-secondary:hover,
body.alto-contraste .boton:hover,
body.alto-contraste .plan-btn:hover {
  background-color: #ffff00 !important;
  color: #000000 !important;
}
body.alto-contraste .role-card,
body.alto-contraste .plan-card,
body.alto-contraste .usuario-card,
body.alto-contraste .tarjeta-perfil,
body.alto-contraste .panel-principal,
body.alto-contraste .panel {
  border: 3px solid #ffffff !important;
}
body.alto-contraste .accesibilidad-panel {
  border-left: 3px solid #ffffff !important;
}
body.alto-contraste .accesibilidad-opcion,
body.alto-contraste .fuente-controles {
  border: 2px solid #ffffff !important;
}

/* 3. FUENTE DYSLEXIC */
body.fuente-dislexia,
body.fuente-dislexia * {
  font-family: 'OpenDyslexic', 'Comic Sans MS', sans-serif !important;
  letter-spacing: 0.06em !important;
  word-spacing: 0.12em !important;
  line-height: 1.8 !important;
}

/* 4. RESALTAR ENFOQUE */
body.resaltar-enfoque *:focus-visible {
  outline: 4px dashed #f2b705 !important;
  outline-offset: 4px !important;
  box-shadow: 0 0 0 8px #142b4d, 0 0 0 12px #ffffff !important;
  background-color: rgba(242, 183, 5, 0.15) !important;
}
body.modo-oscuro.resaltar-enfoque *:focus-visible {
  outline: 4px dashed #38bdf8 !important;
  box-shadow: 0 0 0 8px #0f172a, 0 0 0 12px #ffffff !important;
}
body.alto-contraste.resaltar-enfoque *:focus-visible {
  outline: 6px solid #ffff00 !important;
  outline-offset: 4px !important;
}
