/* The ready screen is already rendered. During startup it shares the frame
   with the PCB; at rest the decoration does not paint or receive input. */
.cheve-encendido { display: none; }
@media screen and (prefers-reduced-motion: no-preference) and (forced-colors: none) {
  html[data-cheve-bienvenida] body.cheve-login > .cheve-encendido {
    --encendido: 3500ms;
    display: block; position: fixed; inset: 0; z-index: 2147483000;
    contain: strict; isolation: isolate; overflow: hidden; visibility: hidden;
    animation: cheve-encendido-activo var(--encendido) linear;
  }
  .cheve-encendido svg { width: 100%; height: 100%; display: block; pointer-events: none; }
  .cheve-encendido::before, .cheve-encendido::after {
    content: ''; position: absolute; z-index: 1; left: 0; right: 0; height: calc(50% + .5px);
    background: #101318 linear-gradient(90deg, transparent, #547793 18%, #c6e5fb 50%, #547793 82%, transparent) center / 0 1.5px no-repeat;
    animation: cheve-abrir-pantalla var(--encendido) both;
  }
  .cheve-encendido::before { top: 0; transform-origin: top; background-position: bottom; }
  .cheve-encendido::after { bottom: 0; transform-origin: bottom; background-position: top; }
  .cheve-encendido .cheve-sustrato { animation: cheve-a-opaco var(--encendido) linear both; }
  .cheve-encendido .cheve-pulsos use {
    stroke: #aee6ff; stroke-width: 3.8; stroke-dasharray: .55 104;
    filter: drop-shadow(0 0 3px #76bdf7);
    animation: cheve-pulso var(--encendido) linear both;
  }
  .cheve-pulsos use:nth-child(2) { animation-delay: 210ms; }
  .cheve-pulsos use:nth-child(3) { animation-delay: -260ms; }
  .cheve-pulsos use:nth-child(4) { animation-delay: 370ms; }
  .cheve-pulsos use:nth-child(5) { animation-delay: -90ms; }
  .cheve-pulsos use:nth-child(6) { animation-delay: 80ms; }
  .cheve-encendido .cheve-pulsos use:nth-child(3n) { stroke: #ffdf9b; filter: drop-shadow(0 0 3px #d2ad71); }
  .cheve-nucleo { stroke: #c1e2ea; stroke-width: 1.8; filter: drop-shadow(0 0 4px #7cc4dd); animation: cheve-nucleo var(--encendido) linear both; }
  @keyframes cheve-encendido-activo { from, 99.99% { visibility: visible; } to { visibility: hidden; } }
  @keyframes cheve-abrir-pantalla {
    0%, 4% { transform: scaleY(1); background-size: 0 1.5px; }
    19% { transform: scaleY(1); background-size: 88% 1.5px; animation-timing-function: cubic-bezier(.4,0,.2,1); }
    75%, 100% { transform: scaleY(0); background-size: 100% 1.5px; }
  }
  @keyframes cheve-a-opaco {
    0%, 22% { opacity: .81; } 44% { opacity: .63; } 69% { opacity: .44; }
    83% { opacity: .28; } 100% { opacity: 0; }
  }
  @keyframes cheve-pulso {
    0%, 17% { stroke-dashoffset: 1.5; opacity: 0; } 24% { opacity: 1; }
    76% { stroke-dashoffset: -99; opacity: 1; } 83%, 100% { stroke-dashoffset: -102; opacity: 0; }
  }
  @keyframes cheve-nucleo {
    0%, 49% { opacity: 0; } 73% { opacity: .85; } 84% { opacity: .55; } 100% { opacity: 0; }
  }
}

@media screen {
  /* The PCB is painted on the sidebar. Each control covers it edge to edge. */
  body.cheve-brand #appSidebar nav :is(a, button) {
    position: relative; background: #191e22; opacity: 1;
  }
  body.cheve-brand #appSidebar nav :is(a, button):is(:hover, :focus-visible) {
    background: #21272d;
  }
  body.cheve-brand #appSidebar nav .sidebar-item.active {
    background: linear-gradient(100deg, #39362f, #242626);
  }
  body.cheve-brand #appSidebar nav :disabled { color: #abb1b7; }
}
