/* ==========================================================================
   tema.css · CAMBIO SUAVE DE COLORES ENTRE VALTERA Y CADA APP
   --------------------------------------------------------------------------
   Al entrar a la página de una app (#/app/wuff), main.js pone los colores de
   esa app (campo "tema" en apps.js) y la página pasa de los colores de Valtera
   a los de la app con una transición suave. Al salir, vuelve sola.
   @property permite que el navegador "anime" los colores de las variables.
   ========================================================================== */
@property --fondo      { syntax: '<color>'; inherits: true; initial-value: #07110D; }
@property --fondo-2    { syntax: '<color>'; inherits: true; initial-value: #0D1B15; }
@property --fondo-3    { syntax: '<color>'; inherits: true; initial-value: #10271E; }
@property --texto      { syntax: '<color>'; inherits: true; initial-value: #F2F6F3; }
@property --suave      { syntax: '<color>'; inherits: true; initial-value: #A7B7AF; }
@property --linea      { syntax: '<color>'; inherits: true; initial-value: #1E382D; }
@property --linea-2    { syntax: '<color>'; inherits: true; initial-value: #2A4A3C; }
@property --barra      { syntax: '<color>'; inherits: true; initial-value: #07110DEB; }
@property --barra-texto{ syntax: '<color>'; inherits: true; initial-value: #A7B7AF; }
@property --activo     { syntax: '<color>'; inherits: true; initial-value: #F2B35A; }
@property --borde-app  { syntax: '<color>'; inherits: true; initial-value: #F2B35A88; }

:root {
  --barra: #07110DEB; --barra-texto: #A7B7AF; --activo: #F2B35A; --borde-app: #F2B35A88;
  transition: --fondo .8s ease, --fondo-2 .8s ease, --fondo-3 .8s ease, --texto .8s ease, --suave .8s ease,
              --linea .8s ease, --linea-2 .8s ease, --barra .8s ease, --barra-texto .8s ease, --activo .8s ease, --borde-app .8s ease;
}
body, .app, .barra { transition: background-color .8s ease, color .8s ease; }
body { color: var(--texto); }
.app { background-color: var(--fondo); }

/* Barra inferior con los colores del tema */
.barra { background: var(--barra); border-top-color: var(--linea); }
.barra__item { color: var(--barra-texto); }
.barra__item[aria-current="page"] {
  color: var(--activo);
  background: radial-gradient(80% 100% at 50% 100%, color-mix(in srgb, var(--activo) 22%, transparent), color-mix(in srgb, var(--activo) 6%, transparent));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--activo) 25%, transparent);
}
.barra__item[aria-current="page"] [data-icono] { filter: drop-shadow(0 0 6px color-mix(in srgb, var(--activo) 70%, transparent)); }

/* Las luces doradas de Valtera se apagan dentro de la página de una app */
.app::before, .app::after { transition: opacity .8s ease; }
html.tema-app .app::before, html.tema-app .app::after { opacity: 0; }

/* Fondo del computador: una capa con los colores de la app que aparece suave */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: var(--fondo-escritorio, transparent); opacity: 0; transition: opacity .8s ease;
}
html.tema-app body::before { opacity: 1; }
@media (min-width: 520px) {
  .app {
    background:
      linear-gradient(var(--fondo), var(--fondo)) padding-box,
      linear-gradient(160deg, var(--borde-app), var(--linea) 35%, var(--linea) 65%, color-mix(in srgb, var(--borde-app) 70%, transparent)) border-box;
  }
}

/* Tema claro (por ejemplo Wuff): formularios y textos que se lean bien sobre blanco */
html.tema-claro { color-scheme: light; }
html.tema-claro .volver:hover { color: var(--texto); }
html.tema-claro .pie { color: var(--suave); }
