/* ═══════════════════════════════════════════════════════════════════════
   MODO OSCURO (prueba) — login y portales de estudiante/encargado.
   Archivo AUTÓNOMO: no modifica ningún otro CSS. Se carga después de login.css
   y portal.css (ver includes/modo_oscuro_publico.php). Para deshacer: borrar
   este archivo y includes/modo_oscuro_publico.php.
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  --mp-b: color-mix(in srgb,var(--portal-brand,#1976d2) 78%,#fff); --mp-b2: color-mix(in srgb,var(--portal-brand,#1976d2) 58%,#fff); --mp-b3: color-mix(in srgb,var(--portal-brand,#1976d2) 40%,#fff);
  --mp-bg: color-mix(in srgb,var(--portal-brand,#1976d2) 30%,#0a0c11); --mp-bg2: color-mix(in srgb,var(--portal-brand,#1976d2) 36%,#0a0c11);
  --mp-n0: color-mix(in srgb,var(--portal-brand,#1976d2) 18%,#07090d); --mp-n1: color-mix(in srgb,var(--portal-brand,#1976d2) 22%,#080a0f); --mp-n2: color-mix(in srgb,var(--portal-brand,#1976d2) 27%,#0a0c11);
  --mp-n3: color-mix(in srgb,var(--portal-brand,#1976d2) 31%,#0d1016); --mp-n4: color-mix(in srgb,var(--portal-brand,#1976d2) 36%,#10131a); --mp-n5: color-mix(in srgb,var(--portal-brand,#1976d2) 43%,#12151c);
}
html { color-scheme: dark; background: var(--mp-n0); }

/* 1) Variables de login.css y portal.css */
:root {
  --bg: var(--mp-n0); --ink: #ffffff; --ink-2: #eef3fa; --ink-3: #d5deec; --line: var(--mp-n4);
  --borde: var(--mp-n4); --texto: #ffffff; --texto2: #eef3fa; --texto3: #d5deec;
  --pv: #34d399; --pa: #fbbf24; --pr: #f87171; --pb: var(--mp-b3);
}
body { background: var(--mp-n0) !important; color: #fff; }

/* 2) Login */
.login-side { background: radial-gradient(900px 500px at 100% 0%, color-mix(in srgb,var(--portal-brand,#1976d2) 13%,transparent), transparent 70%), var(--mp-n0); }
.login-card { background: var(--mp-n2); border-color: var(--mp-n4); box-shadow: 0 2px 4px #0006, 0 24px 56px #0009; }
.login-wave { background: var(--mp-bg); color: var(--mp-b3); }
.input-wrap input { background: var(--mp-n1); border-color: var(--mp-n4); color: #fff; }
.input-wrap input::placeholder { color: var(--tx-4,#a8a8ae); }
.input-wrap input:hover { border-color: var(--mp-n5); }
.input-wrap input:focus { background: var(--mp-n0); border-color: var(--mp-b2); box-shadow: 0 0 0 4px color-mix(in srgb,var(--portal-brand,#1976d2) 20%,transparent); }
.toggle-pass:hover { background: var(--mp-n3); color: var(--mp-b2); }
body input:-webkit-autofill, body input:-webkit-autofill:hover, body input:-webkit-autofill:focus, body input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px var(--mp-n1) inset !important; -webkit-text-fill-color: #fff !important; caret-color: #fff;
}
.alert-error { background: #3a1a1e; border-color: #7a2a33; color: #fca5a5; }
.alert-ok { background: #10302a; border-color: #1f6b52; color: #5ee0a0; }
.login-note { border-top-color: var(--mp-n4); }
.role-grid { background: var(--mp-n1); }
.role-btn.active { background: var(--mp-n3); color: var(--mp-b3); box-shadow: 0 4px 14px #0006; }

/* 3) Portales: superficies */
.pt-card, .pt-item, .pt-stat, .pt-bloque, .pt-hijo, .pt-tabs, .pt-rej-wrap, .pt-hoja .panel, .pt-hoja .op { background: var(--mp-n2); border-color: var(--mp-n4); color: #fff; }
.pt-card, .pt-item, .pt-stat, .pt-rej-wrap, .pt-tabs { box-shadow: 0 1px 2px #0006, 0 6px 18px #0004; }
.pt-card.alerta { border-color: #7a2a33; }
.pt-hijo.on { background: var(--mp-bg); border-color: var(--mp-b); }
.pt-hijo .ini { background: var(--mp-bg); color: var(--mp-b3); }
.pt-hijo:hover { border-color: var(--mp-b); }
.pt-tab:hover { background: var(--mp-n3); }
.pt-tab .n { background: var(--mp-n3); color: var(--tx-1,#f2f2f4); }
.pt-tit i { background: var(--mp-bg); color: var(--mp-b3); }
.pt-barra { background: var(--mp-n3); }
.pt-vacio i { color: var(--mp-b); }
.pt-filtros input { background: var(--mp-n1); border-color: var(--mp-n4); color: #fff; }
.pt-filtros input:focus { border-color: var(--mp-b2); box-shadow: 0 0 0 4px color-mix(in srgb,var(--portal-brand,#1976d2) 20%,transparent); }
.pt-hoja .op.on { background: var(--portal-brand,#1976d2); border-color: var(--portal-brand,#1976d2); color: #fff; }
.pt-hoja .asa { background: var(--mp-n4); }

/* 4) Estados (píldoras) */
.pi-v { background: #10302a; color: #5ee0a0; }
.pi-a { background: #33290f; color: #fbbf24; }
.pi-r { background: #3a1a1e; color: #fca5a5; }
.pi-b { background: var(--mp-bg); color: var(--mp-b3); }
.pi-n { background: var(--mp-n3); color: var(--tx-3,#dcdce0); }

/* 5) Rejilla de horario */
.pt-rej .rej-hora { background: var(--mp-n1); }
.pt-rej .rej-descanso td { background: var(--mp-n1); color: var(--tx-1,#f2f2f4); }
.pt-rej .rej-descanso .rej-hora { background: var(--mp-n0); }
.rej-chip { background: color-mix(in srgb, var(--c, var(--portal-brand,#1976d2)) 30%, var(--mp-n2)); }
.rej-chip .rc-asig { color: #fff; }

/* 6) Textos con color fijo en línea */
[style*="color:#1d4ed8"], [style*="color: #1d4ed8"] { color: var(--mp-b3) !important; }
[style*="color:#15803d"], [style*="color: #15803d"] { color: #34d399 !important; }
[style*="color:#b45309"], [style*="color: #b45309"] { color: #fbbf24 !important; }
[style*="color:#dc2626"], [style*="color: #dc2626"] { color: #f87171 !important; }

/* 7) Cifras de color (--c) y aviso de porcentaje de asistencia */
.pt-stat .v { color: color-mix(in srgb, var(--c) 45%, #fff); }
.pt-msg[style*="#f0fdf4"] { background: #10302a !important; color: #5ee0a0 !important; }
.pt-msg[style*="#fffbeb"] { background: #33290f !important; color: #fbbf24 !important; }
.pt-msg[style*="#fef2f2"] { background: #3a1a1e !important; color: #fca5a5 !important; }
[style*="color:#b91c1c"], [style*="color: #b91c1c"] { color: #fca5a5 !important; }

/* 8) Etiquetas/botones/celdas con fondo claro (las marca assets/js/modo-oscuro.js) */
[data-mo-tinte] {
  background-color: color-mix(in srgb, var(--mo-c) 22%, var(--mp-n2)) !important;
  border-color: color-mix(in srgb, var(--mo-c) 40%, var(--mp-n2)) !important;
  color: color-mix(in srgb, var(--mo-c) 50%, #fff) !important;
}
[data-mo-tinte] :is(span, b, strong, i, small, em) { color: inherit !important; }
[data-mo-txt] { color: #ffffff !important; }
[data-mo-tinte][data-mo-borde] { border: 1px solid var(--mo-c) !important; box-shadow: 0 0 8px color-mix(in srgb, var(--mo-c) 35%, transparent); }

/* ═══ 9) Logo blanco del encabezado/login → baldosa azul muy oscura con icono brillante ═══ */
.pt-logo, .logo-icon { background: color-mix(in srgb,var(--portal-brand,#1976d2) 28%,#070d1b) !important; color: color-mix(in srgb,var(--portal-brand,#1976d2) 58%,#fff) !important; border: 1px solid color-mix(in srgb,var(--portal-brand,#1976d2) 76%,#fff) !important; box-shadow: 0 0 14px color-mix(in srgb,var(--portal-brand,#1976d2) 48%,transparent) !important; }

/* ═══ 10) Ventanas emergentes generadas por JS: cerrar sesión, ayuda del login ═══ */
dialog.edu-salir, dialog.edu-ayuda, dialog[aria-labelledby="jAvisoTit"] { background: var(--mp-n2) !important; color: var(--tx-1,#f2f2f4) !important; border: 1px solid var(--mp-n5) !important; box-shadow: 0 18px 48px #000c, 0 0 18px color-mix(in srgb,var(--portal-brand,#1976d2) 20%,transparent) !important; }
dialog.edu-salir::backdrop, dialog.edu-ayuda::backdrop, dialog[aria-labelledby="jAvisoTit"]::backdrop { background: rgba(5, 9, 18, .72) !important; }
.edu-salir-icono { background: #3a1620 !important; color: #ff8a8a !important; border: 1px solid #f87171; box-shadow: 0 0 12px #f8717155; }
.edu-salir-volver { background: var(--mp-n3) !important; color: #c4d2e8 !important; border: 1px solid var(--mp-n5) !important; }
.edu-salir-cerrar { background: #3a1620 !important; color: #ff8a8a !important; border: 1px solid #f87171 !important; box-shadow: 0 0 9px #f8717155; }
.edu-ayuda-cab { border-color: var(--mp-n4) !important; }
.edu-ayuda-x { color: var(--tx-4,#a8a8ae) !important; } .edu-ayuda-x:hover { color: #fff !important; background: var(--mp-n4) !important; }
.edu-ayuda-atras { color: var(--mp-b3) !important; }
.edu-ayuda-opc { background: var(--mp-n1) !important; border-color: var(--mp-n4) !important; color: var(--tx-1,#f2f2f4) !important; }
.edu-ayuda-opc:hover, .edu-ayuda-opc:focus-visible { background: var(--mp-bg2) !important; border-color: var(--mp-b2) !important; box-shadow: 0 0 10px color-mix(in srgb,var(--portal-brand,#1976d2) 27%,transparent); }
.edu-ayuda-opc i { background: var(--mp-bg2) !important; color: var(--mp-b3) !important; border: 1px solid color-mix(in srgb,var(--mp-b2) 40%,transparent); }
.edu-ayuda-opc small, .edu-ayuda-pie { color: var(--tx-4,#a8a8ae) !important; }
.edu-ayuda details { background: var(--mp-n1) !important; border-color: var(--mp-n4) !important; }
.edu-ayuda details[open] summary { border-color: var(--mp-n4) !important; }
.edu-ayuda ul { color: var(--tx-3,#dcdce0) !important; }
.edu-ayuda-bot { background: var(--mp-bg2) !important; color: var(--mp-b3) !important; border: 1px solid var(--mp-b2); box-shadow: 0 0 9px color-mix(in srgb,var(--portal-brand,#1976d2) 33%,transparent); }
dialog[aria-labelledby="jAvisoTit"] > div:first-child { background: var(--mp-bg2) !important; color: var(--mp-b3) !important; }
dialog[aria-labelledby="jAvisoTit"] > div:last-child { color: var(--tx-3,#dcdce0) !important; }
#jAvisoCerrar { background: var(--mp-n3) !important; color: #c4d2e8 !important; border-color: var(--mp-n5) !important; }
#jAvisoIr { background: var(--mp-bg2) !important; color: var(--mp-b3) !important; border: 1px solid var(--mp-b2); box-shadow: 0 0 9px color-mix(in srgb,var(--portal-brand,#1976d2) 33%,transparent); }

/* ═══ 11) Banners del portal (pt-top, pt-hero): degradado original un poco más oscuro + sombra brillante ═══ */
.pt-hero { background-color: color-mix(in srgb,var(--portal-brand,#1976d2) 28%,#b9c4dc); background-blend-mode: multiply; box-shadow: 0 0 0 1px color-mix(in srgb,var(--portal-brand,#1976d2) 40%,transparent), 0 10px 36px color-mix(in srgb,var(--portal-brand,#1976d2) 40%,transparent), 0 0 56px color-mix(in srgb,var(--portal-brand,#1976d2) 22%,transparent) !important; }
.pt-top { background-color: color-mix(in srgb,var(--portal-brand,#1976d2) 28%,#b9c4dc); background-blend-mode: multiply; box-shadow: 0 6px 28px color-mix(in srgb,var(--portal-brand,#1976d2) 34%,transparent); }

/* ═══ 12) Educación Física: negro en modo claro → blanco en oscuro (su color en línea es #111827) ═══ */
.rej-chip[style*="--c:#111827"] { --c: #ffffff !important; }
.pt-bloque[style*="#111827"] { border-left-color: #ffffff !important; }

/* Selectores propios (fecha-click.js) en oscuro */
:root { --au-surface: var(--mp-n2); --au-ink: #ffffff; --au-line: var(--mp-n4); --au-solid: color-mix(in srgb,var(--portal-brand,#1976d2) 70%,#000); --au-text: color-mix(in srgb,var(--portal-brand,#1976d2) 55%,#fff); }

/* Justificar: «Marcar todos» en oscuro */
#jDocTodos.pt-btn{background:color-mix(in srgb,var(--portal-brand,#1d4ed8) 22%,var(--mp-n2,#1c2230))!important;color:#fff!important;border-color:color-mix(in srgb,var(--portal-brand,#1d4ed8) 55%,var(--mp-n3,#2a3142))}

/* Banners del portal en oscuro: mismo criterio que admin (marca algo más oscura, mismo matiz) */
.pt-hero:not(#x), .pt-top:not(#x) { background-color: transparent; background-blend-mode: normal;
  background-image: linear-gradient(120deg, color-mix(in srgb,var(--portal-brand,#1976d2) 80%,#000) 0%, color-mix(in srgb,var(--portal-brand,#1976d2) 66%,var(--mp-n1,#141a26)) 100%); }
.pt-nav > div:not(#x) { background-image: linear-gradient(120deg, color-mix(in srgb,var(--portal-brand,#1976d2) 80%,#000) 0%, color-mix(in srgb,var(--portal-brand,#1976d2) 66%,var(--mp-n1,#141a26)) 100%); }
