/* BioMimic · diseño institucional de la UBO, común a todas las vistas: inicio, simuladores, panel docente, administración
   y sus pantallas de ingreso. Sigue DISENO-HEADER-FOOTER-UBO.txt (cabecera y pie, valores exactos) y
   DISENO-LOGIN-USUARIOS-UBO.txt (fondo, ingreso, cambio de contraseña y barra de usuario). Contenido propio de SAPIA.
   Lo institucional no cambia con el tema (cabecera blanca, pie oscuro, tarjeta de ingreso blanca); en el tema oscuro solo
   se oscurece el velo sobre la foto de fondo. Las variables llevan el prefijo --ubo- porque los simuladores ya usan --navy.
   Se publica en /ubo/ (ubo.css, ubo.js e img/) dentro de cada simulador; ubo.js oculta la cabecera al bajar. */
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 400; font-display: swap; src: url("/docente/fuentes/poppins-400.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 500; font-display: swap; src: url("/docente/fuentes/poppins-500.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 600; font-display: swap; src: url("/docente/fuentes/poppins-600.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 700; font-display: swap; src: url("/docente/fuentes/poppins-700.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("/docente/fuentes/inter-var.woff2") format("woff2"); }

:root {
  --ubo-navy: #16244C; --ubo-navy-400: #3A5490; --ubo-blue: #5C9BE6; --ubo-footer-bg: #0E0E10;
  --ubo-fac-verde: #81D742; --ubo-fac-azul: #1E73BE; --ubo-fac-rojo: #DD3333; --ubo-fac-morado: #51509D;   /* orden de la norma */
  --ubo-azul: #002C77; --ubo-azul-claro: #1e5a96; --ubo-2985c: #0066CC; --ubo-celeste: #5BC2E7;
  --ubo-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ubo-poppins: "Poppins", system-ui, -apple-system, sans-serif;
  --ubo-velo: rgba(244, 241, 236, .93);                 /* foto tenue detrás del contenido (93 % en claro, 97 % en oscuro) */
  --ubo-ease: cubic-bezier(.2, .8, .2, 1);
  --ubo-cab: 0px;                                       /* alto visible de la cabecera (lo escribe ubo.js) */
}
@media (prefers-color-scheme: dark) { :root:not([data-tema="claro"]) { --ubo-velo: rgba(10, 16, 28, .97); } }
:root[data-tema="oscuro"] { --ubo-velo: rgba(10, 16, 28, .97); }

/* ============ fondo institucional: foto /ubo/img/fondo-ubo.webp con un velo muy opaco ============ */
/* Una capa fija aparte (no background-attachment: fixed, que repinta todo al desplazarse en equipos sin aceleración). */
body.ubo-fondo { background: transparent; }
body.ubo-fondo::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; will-change: transform;
  background: linear-gradient(var(--ubo-velo), var(--ubo-velo)), url("img/fondo-ubo.webp") center / cover no-repeat; }

/* ============ cabecera ============ */
.site-header { position: sticky; top: 0; z-index: 30; flex: none; background: #fff; font-family: var(--ubo-poppins); will-change: transform;
  box-shadow: 0 2px 16px -10px rgba(22, 36, 76, .5); transition: transform .4s var(--ubo-ease), box-shadow .4s var(--ubo-ease); }
.site-header.ubo-oculta { transform: translateY(-100%); box-shadow: none; }   /* al bajar se va hacia arriba; vuelve al subir */
.topbar-accent { display: flex; height: 3px; width: 100%; }
.topbar-accent span { flex: 1; }
.topbar-accent span:nth-child(1) { background: var(--ubo-fac-verde); }
.topbar-accent span:nth-child(2) { background: var(--ubo-fac-azul); }
.topbar-accent span:nth-child(3) { background: var(--ubo-fac-rojo); }
.topbar-accent span:nth-child(4) { background: var(--ubo-fac-morado); }
.header-bar { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 12px 40px 12px 32px; }
/* el logo lleva al inicio de BioMimic (en /admin/, a la administración: ubo.js) */
.header-bar .brand { display: flex; align-items: center; user-select: none; border-radius: 8px; text-decoration: none; transition: opacity .2s ease; }
.header-bar a.brand:hover { opacity: .82; }
.header-bar a.brand:focus-visible { outline: 2px solid var(--ubo-2985c); outline-offset: 4px; }
/* logo de SAPIA: más bajo que los 94 px de la norma (pedido del responsable) */
.header-bar .brand img { height: 66px; width: auto; display: block; user-select: none; -webkit-user-drag: none; pointer-events: none; }
/* nombre del ecosistema: centrado respecto de la página, no del espacio libre */
.header-ecosistema { position: absolute; left: 50%; transform: translateX(-50%); max-width: min(38vw, 460px); margin: 0; text-align: center; text-wrap: balance;
  font-family: var(--ubo-poppins); font-size: 1.35rem; font-weight: 600; color: var(--ubo-navy); letter-spacing: -.01em; line-height: 1.25; user-select: none; pointer-events: none; }
/* bloque derecho: barra navy, nombre de la sección y subdirección; corta solo en varias líneas, con ancho para que respire */
.header-tag { display: flex; flex-direction: column; align-items: flex-end; text-align: right; gap: 5px; padding-left: 18px; border-left: 3px solid var(--ubo-navy);
  max-width: 440px; flex: 0 1 auto; }
.header-tag .ht-main { font-size: .9rem; font-weight: 600; color: var(--ubo-navy); line-height: 1.35; text-wrap: balance; }
.header-tag .ht-sub { font-size: .8rem; font-weight: 500; color: var(--ubo-navy-400); letter-spacing: .01em; line-height: 1.3; text-wrap: balance; }

/* ============ pie ============ */
.footer { flex: none; background: var(--ubo-footer-bg); color: #fff; text-align: center; padding: 50px 24px 32px; display: flex; flex-direction: column; align-items: center;
  font-family: var(--ubo-poppins); }
.footer-logo-main { width: 140px; height: auto; margin-bottom: 20px; opacity: .96; }
.footer h3 { margin: 0; font-family: inherit; font-size: 18px; font-weight: 600; letter-spacing: .01em; line-height: 1.35; color: #fff; text-wrap: balance; }
.footer h4 { margin: 7px 0 0; font-family: inherit; font-size: 14px; font-weight: 400; line-height: 1.4; color: rgba(255, 255, 255, .62); }
.footer-divider { width: min(860px, 88%); border: none; border-top: 1px solid rgba(255, 255, 255, .14); margin: 30px 0 24px; }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 22px; flex-wrap: wrap; width: min(860px, 88%);
  color: rgba(255, 255, 255, .62); font-size: 13px; }
.footer-bottom img { height: 64px; width: auto; opacity: .9; }
.footer-bottom span { text-align: right; max-width: 340px; white-space: normal; overflow-wrap: break-word; text-wrap: balance; line-height: 1.45; }

/* ============ barra de usuario bajo la cabecera (inicio) ============ */
.actionbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 14px 46px; font-family: var(--ubo-sans); }
.ab-user { display: inline-flex; align-items: center; gap: 10px; background: #fff; border: 1px solid #e3e8f2; border-radius: 999px; padding: 7px 14px 7px 18px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .05); min-width: 0; }
.ab-user-name { font-size: .88rem; font-weight: 600; color: var(--ubo-azul); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ab-role { font-size: .63rem; font-weight: 700; letter-spacing: .06em; padding: 3px 9px; border-radius: 999px; color: #fff; flex: none; }
.ab-role-docente { background: var(--ubo-2985c); }
.ab-role-estudiante { background: #6B7689; }
.ab-actions { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ab-btn { display: inline-flex; align-items: center; gap: 8px; background: #fff; border: 1px solid #e3e8f2; border-radius: 10px; padding: 9px 16px;
  font: 500 .85rem/1.2 var(--ubo-sans); color: var(--ubo-azul); text-decoration: none; cursor: pointer; box-shadow: 0 1px 4px rgba(0, 0, 0, .05);
  transition: background .18s ease, border-color .18s ease, box-shadow .18s ease, color .18s ease; }
.ab-btn:hover { background: #fff; border-color: var(--ubo-azul-claro); box-shadow: 0 4px 14px rgba(15, 40, 80, .12); }
.ab-btn:active { transform: translateY(1px); }
.ab-ico { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ab-btn-exit:hover { border-color: rgba(192, 57, 43, .45); color: #c0392b; }   /* «Salir» se tiñe de rojo */

/* ============ ingreso y cambio de contraseña ============ */
/* Pantalla completa con la foto de fondo: tarjeta blanca al centro y el pie institucional debajo. */
.ubo-acceso { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; color: #1a1a1a; font-family: var(--ubo-sans);
  background: linear-gradient(var(--ubo-velo), var(--ubo-velo)), url("img/fondo-ubo.webp") center / cover no-repeat; }
.login-main { flex: 1 0 auto; display: flex; align-items: center; justify-content: center; padding: 60px 20px; }
.login-card { background: #fff; border-radius: 14px; padding: 48px 56px 40px; box-shadow: 0 8px 32px rgba(30, 60, 100, .10); width: 100%; max-width: 440px; text-align: center; }
.login-logo { width: 130px; height: auto; margin: 0 auto 22px; display: block; }
.login-title { font-family: var(--ubo-sans); font-size: 2.4rem; font-weight: 800; letter-spacing: .06em; line-height: 1.15; color: var(--ubo-azul); margin: 0 0 10px; }
.login-rainbow { display: flex; gap: 0; justify-content: center; margin-bottom: 32px; }
.login-rainbow span { width: 50px; height: 3px; display: block; }
.login-rainbow span:first-child { border-radius: 2px 0 0 2px; }
.login-rainbow span:last-child { border-radius: 0 2px 2px 0; }
.login-rainbow span:nth-child(1) { background: #81D742; }
.login-rainbow span:nth-child(2) { background: #1E73BE; }
.login-rainbow span:nth-child(3) { background: #DD3333; }
.login-rainbow span:nth-child(4) { background: #51509D; }
.login-contexto { margin: -18px 0 22px; font-size: .85rem; color: #555; }
.login-error { background: #fdecea; color: #c0392b; border: 1px solid #f5c6cb; border-radius: 8px; padding: 10px 12px; font-size: .82rem; margin-bottom: 14px; text-align: left; }
.login-error:empty { display: none; }
.login-form { display: flex; flex-direction: column; gap: 14px; margin: 0; }
.login-form[hidden] { display: none; }
.login-field { position: relative; }
.login-field input { width: 100%; padding: 13px 16px; font-family: var(--ubo-sans); font-size: .95rem; border: 1px solid #d5dce4; border-radius: 8px;
  background: #fff; color: #1a1a1a; outline: none; transition: border-color .2s, box-shadow .2s; }
.login-field input:focus { border-color: var(--ubo-2985c); box-shadow: 0 0 0 3px rgba(0, 102, 204, .12); }
.login-field-password input { padding-right: 44px; }
.login-eye { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: transparent; border: none; color: #7a7a7a; width: 32px; height: 32px;
  cursor: pointer; display: flex; align-items: center; justify-content: center; border-radius: 4px; transition: background .15s, color .15s; }
.login-eye:hover { background: rgba(0, 0, 0, .05); color: var(--ubo-azul); }
.login-eye svg, .pwd-eye svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.login-btn { margin-top: 10px; padding: 14px; background: #22c55e; color: #fff; border: none; border-radius: 10px; font-family: var(--ubo-sans); font-size: .92rem;
  font-weight: 700; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; transition: background .2s, transform .1s; }
.login-btn:hover:not(:disabled) { background: #16a34a; }
.login-btn:active { transform: translateY(1px); }
.login-btn:disabled { opacity: .7; cursor: progress; }
.login-salir { align-self: center; border: 0; background: none; padding: 4px 8px; font: 500 .82rem var(--ubo-sans); color: #6b7689; cursor: pointer; text-decoration: underline;
  text-underline-offset: 3px; }
.login-salir:hover { color: var(--ubo-azul); }
/* cambio de contraseña */
.login-card-clave .login-logo { width: 100px; }
.login-card-clave .login-title { font-size: 1.5rem; }
.login-texto { text-align: center; font-size: .85rem; color: #555; margin: 0 0 22px; }
.pwd-field { margin-bottom: 0; text-align: left; }
.pwd-field label { display: block; font-size: .75rem; font-weight: 600; color: var(--ubo-azul); margin-bottom: 6px; letter-spacing: .02em; text-transform: uppercase; }
.pwd-field-inner { position: relative; }
.pwd-field-inner input { width: 100%; padding: 11px 42px 11px 14px; font-family: var(--ubo-sans); font-size: .92rem; border: 1.5px solid #d5dce4; border-radius: 10px; outline: none;
  color: #1a1a1a; background: #fff; transition: border-color .22s ease, box-shadow .22s ease; box-sizing: border-box; }
.pwd-field-inner input:focus { border-color: var(--ubo-2985c); box-shadow: 0 0 0 4px rgba(0, 102, 204, .14); }
.pwd-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: transparent; border: none; color: #9aa0a6; cursor: pointer; padding: 6px;
  border-radius: 6px; display: flex; transition: color .18s, background .18s; }
.pwd-eye:hover { color: var(--ubo-azul); background: rgba(0, 102, 204, .08); }
.pwd-eye-on { color: var(--ubo-2985c); }
.pwd-strength { min-height: 20px; margin-top: 8px; display: flex; align-items: center; gap: 8px; }
.pwd-bars { display: inline-flex; gap: 3px; flex: 1; max-width: 160px; }
.pwd-bar { height: 4px; flex: 1; background: #e5e7eb; border-radius: 2px; transition: background .3s ease; }
.pwd-bar-on.pwd-bar-weak { background: #ef4444; }
.pwd-bar-on.pwd-bar-medium { background: #f59e0b; }
.pwd-bar-on.pwd-bar-good { background: #22c55e; }
.pwd-bar-on.pwd-bar-strong { background: #16a34a; }
.pwd-strength-txt { font-size: .72rem; font-weight: 600; letter-spacing: .02em; }
.pwd-strength-weak { color: #ef4444; }
.pwd-strength-medium { color: #f59e0b; }
.pwd-strength-good { color: #22c55e; }
.pwd-strength-strong { color: #16a34a; }
.pwd-match { min-height: 20px; margin-top: 8px; font-size: .78rem; font-weight: 500; transition: color .25s ease, opacity .25s ease; display: flex; align-items: center; gap: 6px; }
.pwd-match-ok { color: #16a34a; }
.pwd-match-err { color: #dc2626; }
.pwd-check, .pwd-cross { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; font-size: .72rem; font-weight: 700; color: #fff; }
.pwd-check { background: #16a34a; }
.pwd-cross { background: #dc2626; }

/* ============ adaptable ============ */
@media (max-width: 1280px) {
  .header-tag { max-width: 360px; }
}
@media (max-width: 1100px) {
  .header-bar { padding: 12px 24px 12px 24px; }
  .header-tag { max-width: 290px; }
}
@media (max-width: 760px) {
  .header-bar { padding: 10px 20px; }
  .header-bar .brand img { height: 46px; }
  .header-ecosistema { position: static; transform: none; flex: 1; max-width: none; text-align: center; font-size: 1rem; }
  .header-tag { padding-left: 12px; max-width: 180px; }
  .header-tag .ht-main { font-size: 10.5px; }
  .header-tag .ht-sub { font-size: 9px; }
  .actionbar { padding: 12px 20px; }
}
@media (max-width: 560px) {
  .header-tag { display: none; }
  .header-ecosistema { font-size: .95rem; }
  .footer-bottom { flex-direction: column; justify-content: center; text-align: center; gap: 16px; }
  .footer-bottom span { text-align: center; max-width: 100%; }
  .actionbar { flex-wrap: nowrap; gap: 10px; }
}
@media (max-width: 480px) {
  .login-card { padding: 32px 24px 28px; }
  .login-logo { width: 100px; }
}
@media (prefers-reduced-motion: reduce) {
  .site-header, .login-btn, .ab-btn, .pwd-bar { transition: none; }
}
@media print {
  .site-header, .actionbar, .footer { display: none !important; }
}
