/* ============================================================
   Accesibilidad: tamaño de letra y tema claro / oscuro / automático
   Se carga en TODAS las pantallas (panel, portada, página del colegio
   y login). El tema se aplica con [data-theme] en <html>.
   ============================================================ */

/* ---------- Botón flotante ---------- */
.a11y {
    position: fixed;
    right: 16px;
    bottom: 18px;
    z-index: 960;
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    -webkit-tap-highlight-color: transparent;
}

.a11y-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .18);
    background: #0b1738;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 10px 26px rgba(11, 23, 56, .28);
    transition: transform .16s ease, box-shadow .2s ease, background .2s ease;
}

.a11y-btn:hover { transform: translateY(-2px); background: #14264f; box-shadow: 0 14px 32px rgba(11, 23, 56, .34); }
.a11y-btn:active { transform: none; }
.a11y-btn svg { width: 24px; height: 24px; display: block; }

.a11y-panel {
    position: absolute;
    right: 0;
    bottom: 58px;
    width: 252px;
    padding: 14px;
    border-radius: 16px;
    background: #fff;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    box-shadow: 0 24px 60px -18px rgba(11, 23, 56, .35), 0 2px 6px rgba(11, 23, 56, .06);
    animation: a11y-in .16s ease-out;
}

.a11y-panel[hidden] { display: none !important; }

@keyframes a11y-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}

.a11y-title {
    margin: 0 0 7px;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: #64748b;
}

.a11y-title + .a11y-title { margin-top: 14px; }

.a11y-row { display: flex; align-items: center; gap: 8px; }

.a11y-row button {
    flex: 1;
    height: 38px;
    border-radius: 10px;
    border: 1px solid #dbe3ee;
    background: #f8fafc;
    color: #0f172a;
    font-family: inherit;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}

.a11y-row button:hover { background: #eef2f8; border-color: #c3cfe0; }

.a11y-nivel {
    min-width: 46px;
    text-align: center;
    font-size: 12.5px;
    font-weight: 800;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
}

.a11y-temas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }

.a11y-temas button {
    height: 38px;
    padding: 0 4px;
    border-radius: 10px;
    border: 1px solid #dbe3ee;
    background: #f8fafc;
    color: #334155;
    font-family: inherit;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.a11y-temas button svg { width: 16px; height: 16px; }
.a11y-temas button:hover { background: #eef2f8; }

.a11y-temas button[aria-checked="true"] {
    background: #0b1738;
    border-color: #0b1738;
    color: #fff;
}

.a11y-reset {
    margin-top: 13px;
    width: 100%;
    padding: 8px;
    border: 1px dashed #c3cfe0;
    border-radius: 10px;
    background: transparent;
    color: #64748b;
    font-family: inherit;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
}

.a11y-reset:hover { color: #0f172a; border-color: #94a3b8; }

/* --- variante oscura del propio widget --- */
html[data-theme="dark"] .a11y-panel {
    background: #111a2e;
    border-color: #243149;
    color: #cbd5e1;
    box-shadow: 0 24px 60px -18px rgba(0, 0, 0, .7);
}

html[data-theme="dark"] .a11y-title { color: #93a2b8; }
html[data-theme="dark"] .a11y-row button,
html[data-theme="dark"] .a11y-temas button {
    background: #0f1a2e;
    border-color: #243149;
    color: #dbe4f0;
}
html[data-theme="dark"] .a11y-nivel { color: #e8eefb; }
html[data-theme="dark"] .a11y-row button:hover,
html[data-theme="dark"] .a11y-temas button:hover { background: #17233a; }
html[data-theme="dark"] .a11y-temas button[aria-checked="true"] {
    background: #dbe4f0;
    border-color: #dbe4f0;
    color: #0b1738;
}
html[data-theme="dark"] .a11y-reset { border-color: #2c3b58; color: #93a2b8; }
html[data-theme="dark"] .a11y-reset:hover { color: #e8eefb; border-color: #4b5d80; }

@media (max-width: 992px) {
    .a11y { bottom: 84px; }
}

@media (max-width: 480px) {
    .a11y { right: 12px; }
    .a11y-panel { width: 232px; }
}

@media print {
    .a11y { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
    .a11y-panel { animation: none; }
}

/* ============================================================
   PANEL ADMINISTRATIVO — tokens en modo oscuro
   ============================================================ */
html[data-theme="dark"] {
    --edu-ink: #e8eefb;
    --edu-text: #cbd5e1;
    --edu-muted: #93a2b8;
    --edu-line: #243149;
    --edu-bg: #0b1220;
    --edu-card: #111a2e;
    --edu-primary-soft: #1b2a4a;
    --edu-ok-soft: #0c2a20;
    --edu-warn-soft: #2a2110;
    --edu-danger-soft: #2a1218;
    --edu-info-soft: #0d2436;
    --edu-shadow: 0 10px 30px rgba(0, 0, 0, .45);
    --edu-shadow-sm: 0 4px 14px rgba(0, 0, 0, .35);
    color-scheme: dark;
}

html[data-theme="dark"] body { background: #0b1220 !important; color: var(--edu-text); }
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] h5 { color: var(--edu-ink); }

/* Superficies con color fijo */
html[data-theme="dark"] .edu-card-head,
html[data-theme="dark"] .card-header,
html[data-theme="dark"] .card-footer { background: #0f1a2e !important; border-color: var(--edu-line) !important; }
html[data-theme="dark"] .edu-table td,
html[data-theme="dark"] .table tbody td { border-color: #1b2740 !important; }
html[data-theme="dark"] .edu-table tbody tr:hover,
html[data-theme="dark"] .table-hover tbody tr:hover { background: #16223a !important; }
html[data-theme="dark"] .table thead th { background: #0f1a2e !important; color: var(--edu-muted) !important; border-color: var(--edu-line) !important; }
html[data-theme="dark"] .table { color: var(--edu-text); }
html[data-theme="dark"] .list-group-item { background: transparent !important; border-color: #1b2740 !important; color: var(--edu-text); }

/* Tablas: encabezados y filas siempre legibles (cualquier clase, tambien Bootstrap) */
html[data-theme="dark"] table { background-color: transparent; color: #cbd5e1; }
html[data-theme="dark"] table thead th,
html[data-theme="dark"] table thead td,
html[data-theme="dark"] thead th { background-color: #0f1a2e !important; color: #a9b7c9 !important; border-color: #223049 !important; }
html[data-theme="dark"] table tbody tr { background-color: transparent; }
html[data-theme="dark"] table tbody td,
html[data-theme="dark"] table tbody th,
html[data-theme="dark"] table tbody tr > * { background-color: transparent; border-color: #1b2740 !important; color: #cbd5e1; }
html[data-theme="dark"] table tbody tr:hover > * { background-color: #16223a !important; }
html[data-theme="dark"] table a { color: #8ab7ff; }
html[data-theme="dark"] table .text-muted,
html[data-theme="dark"] table small { color: #9fb0c6 !important; }

/* Botones con el color de la institucion: un poco mas luminosos sobre fondo oscuro */
html[data-theme="dark"] .edu-btn.primary,
html[data-theme="dark"] .btn-primary { filter: brightness(1.22) saturate(1.05); }
html[data-theme="dark"] .edu-user,
html[data-theme="dark"] .edu-logout,
html[data-theme="dark"] .edu-topbar .edu-burger { background: #111a2e; border-color: var(--edu-line); }
html[data-theme="dark"] .edu-btn.ghost { background: #111a2e; border-color: var(--edu-line); color: var(--edu-text) !important; }
html[data-theme="dark"] .edu-btn.ghost:hover { background: #16223a; border-color: #3b4a6b; }
html[data-theme="dark"] .edu-progress { background: #1e2b45; }
html[data-theme="dark"] .edu-badge.neutral { background: #1e2b45; color: #cbd5e1; }
html[data-theme="dark"] .edu-nav a.active { background: #1e2b45; color: #dbeafe !important; }
html[data-theme="dark"] .edu-tile:hover { border-color: #3b4a6b; }
html[data-theme="dark"] .edu-tile .t-ico { background: #22304f; color: #a9c1ff; }
html[data-theme="dark"] .edu-topbar { background: rgba(11, 18, 32, .88); border-bottom-color: var(--edu-line); }
html[data-theme="dark"] .edu-sidebar { border-right-color: rgba(255, 255, 255, .06); }
html[data-theme="dark"] .edu-chip { background: rgba(255, 255, 255, .12); }
html[data-theme="dark"] .edu-hero { box-shadow: 0 14px 40px rgba(0, 0, 0, .5); }

/* Formularios y modales */
html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
    background-color: #0f1a2e;
    border-color: #243149;
    color: var(--edu-text);
}
html[data-theme="dark"] .form-control::placeholder,
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder { color: #64748b; }
html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .form-select:focus { background-color: #0f1a2e; }
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .dropdown-menu { background: #111a2e; color: var(--edu-text); border-color: var(--edu-line); }
html[data-theme="dark"] .dropdown-item { color: var(--edu-text); }
html[data-theme="dark"] .dropdown-item:hover { background: #16223a; color: var(--edu-ink); }

/* Avisos de color */
html[data-theme="dark"] .alert-danger { background: #2a1218; border-color: #5b1f2c; color: #fda4af; }
html[data-theme="dark"] .alert-warning { background: #2a2110; border-color: #5c4413; color: #fcd34d; }
html[data-theme="dark"] .alert-success { background: #0c2a20; border-color: #14503a; color: #6ee7b7; }
html[data-theme="dark"] .alert-info,
html[data-theme="dark"] .alert-primary { background: #0d2436; border-color: #17415c; color: #7dd3fc; }

/* ============================================================
   PÁGINAS PÚBLICAS (Tailwind compilado)
   ============================================================ */
html[data-theme="dark"] body { background: #0b1220 !important; color: #cbd5e1; }

html[data-theme="dark"] .bg-white { background-color: #111a2e; }
html[data-theme="dark"] .bg-white\/95,
html[data-theme="dark"] .bg-white\/90 { background-color: rgba(11, 18, 32, .92); }
html[data-theme="dark"] .bg-white\/5 { background-color: rgba(255, 255, 255, .06); }
html[data-theme="dark"] .bg-slate-50 { background-color: #0b1220; }
html[data-theme="dark"] .bg-slate-100 { background-color: #17233a; }
html[data-theme="dark"] .bg-slate-50\/80 { background-color: rgba(23, 35, 58, .55); }
html[data-theme="dark"] .bg-slate-50\/70 { background-color: rgba(23, 35, 58, .5); }
html[data-theme="dark"] .bg-slate-50\/60 { background-color: rgba(23, 35, 58, .45); }
html[data-theme="dark"] .bg-white\/80 { background-color: rgba(17, 26, 46, .85); }
html[data-theme="dark"] .bg-white\/70 { background-color: rgba(17, 26, 46, .75); }

html[data-theme="dark"] .text-navy { color: #e8eefb; }
html[data-theme="dark"] .text-slate-700,
html[data-theme="dark"] .text-slate-600 { color: #a9b7c9; }
html[data-theme="dark"] .text-slate-500,
html[data-theme="dark"] .text-slate-400 { color: #8494a9; }
html[data-theme="dark"] .text-slate-300 { color: #7e8ca0; }
html[data-theme="dark"] .text-brand { color: #7ab0ff; }
html[data-theme="dark"] .text-slate-100 { color: #1e2b45; }

html[data-theme="dark"] .border-slate-200,
html[data-theme="dark"] .border-slate-200\/70,
html[data-theme="dark"] .border-slate-200\/80,
html[data-theme="dark"] .border-slate-100,
html[data-theme="dark"] .border-slate-300 { border-color: #223049; }
html[data-theme="dark"] .divide-slate-200 > :not([hidden]) ~ :not([hidden]) { border-color: #223049; }

html[data-theme="dark"] .shadow-soft,
html[data-theme="dark"] .shadow-xl,
html[data-theme="dark"] .shadow-lg,
html[data-theme="dark"] .shadow-2xl { box-shadow: 0 18px 45px rgba(0, 0, 0, .5); }

/* Tonos suaves de color (chips, iconos, avisos) */
html[data-theme="dark"] .bg-blue-50 { background-color: #152943; }
html[data-theme="dark"] .bg-emerald-50 { background-color: #0f2c23; }
html[data-theme="dark"] .bg-amber-50 { background-color: #2b2312; }
html[data-theme="dark"] .bg-sky-50 { background-color: #10293c; }
html[data-theme="dark"] .bg-indigo-50 { background-color: #1a1f42; }
html[data-theme="dark"] .bg-violet-50 { background-color: #211a40; }
html[data-theme="dark"] .bg-rose-50 { background-color: #2c1520; }
html[data-theme="dark"] .bg-teal-50 { background-color: #0e2c2b; }
html[data-theme="dark"] .bg-emerald-100 { background-color: #10382c; }
html[data-theme="dark"] .bg-blue-100 { background-color: #16304d; }
html[data-theme="dark"] .bg-violet-100 { background-color: #241a4a; }
html[data-theme="dark"] .text-emerald-700 { color: #6ee7b7; }
html[data-theme="dark"] .text-emerald-600 { color: #34d399; }
html[data-theme="dark"] .text-blue-700,
html[data-theme="dark"] .text-indigo-600 { color: #93c5fd; }
html[data-theme="dark"] .text-amber-700,
html[data-theme="dark"] .text-amber-600 { color: #fcd34d; }
html[data-theme="dark"] .text-rose-700,
html[data-theme="dark"] .text-rose-600 { color: #fda4af; }
html[data-theme="dark"] .text-sky-700,
html[data-theme="dark"] .text-teal-600 { color: #7dd3fc; }
html[data-theme="dark"] .text-violet-700 { color: #c4b5fd; }
html[data-theme="dark"] .card-art { background: radial-gradient(circle at 50% 30%, #16233d 0%, #101b30 50%, #0d1626 100%); }

/* Portada: piezas propias */
html[data-theme="dark"] .hero-glow { background: radial-gradient(circle at 82% 22%, rgba(14, 165, 233, .22), transparent 34%), linear-gradient(125deg, #07101f 0%, #0c1c38 56%, #06465c 100%); }
html[data-theme="dark"] .glass { background: rgba(255, 255, 255, .05); border-color: rgba(255, 255, 255, .10); }
html[data-theme="dark"] .galeria-item figcaption,
html[data-theme="dark"] figcaption.bg-white\/95 { background: rgba(15, 26, 46, .95) !important; color: #e8eefb !important; }

/* ============================================================
   LOGIN
   ============================================================ */
html[data-theme="dark"] .main {
    background: radial-gradient(circle at 50% 0%, rgba(37, 99, 235, .12), transparent 60%), #0b1220;
}
html[data-theme="dark"] .card {
    background: #111a2e;
    border-color: #243149;
    box-shadow: 0 24px 60px -18px rgba(0, 0, 0, .6);
}
html[data-theme="dark"] .card h2 { color: #e8eefb; }
html[data-theme="dark"] .card .hint { color: #93a2b8; }
html[data-theme="dark"] .brand-mobile strong { color: #e8eefb; }
html[data-theme="dark"] .field label { color: #c3cfdf; }
html[data-theme="dark"] .control { background: #0f1a2e; border-color: #243149; }
html[data-theme="dark"] .control:focus-within { background: #0f1a2e; border-color: #3b82f6; }
html[data-theme="dark"] .control input { color: #e8eefb; }
html[data-theme="dark"] .control input::placeholder { color: #64748b; }
html[data-theme="dark"] .toggle-pass { color: #94a3b8; }
html[data-theme="dark"] .toggle-pass:hover { background: #17233a; color: #e8eefb; }
html[data-theme="dark"] .divider { color: #8494a9; }
html[data-theme="dark"] .divider::before,
html[data-theme="dark"] .divider::after { background: #243149; }
html[data-theme="dark"] .btn-google { background: #0f1a2e; border-color: #243149; color: #dbe4f0; }
html[data-theme="dark"] .btn-google:hover { border-color: #3b4a6b; box-shadow: 0 8px 20px rgba(0, 0, 0, .4); }
html[data-theme="dark"] .register { color: #93a2b8; }
html[data-theme="dark"] .register a { color: #e8eefb; border-bottom-color: rgba(255, 255, 255, .18); }
html[data-theme="dark"] .help { background: #0f1a2e; border-color: #243149; color: #a9b7c9; }
html[data-theme="dark"] .help strong { color: #e2e8f0; }
html[data-theme="dark"] .alert { background: #2a1218; border-color: #5b1f2c; color: #fda4af; }
html[data-theme="dark"] .legal .links a { color: #94a3b8; }
html[data-theme="dark"] .legal .links a:hover { color: #e8eefb; }
html[data-theme="dark"] .legal .cookies { color: #7e8ca0; }
html[data-theme="dark"] .legal .session { color: #8494a9; }
