/* © 2026 F10. Todos los derechos reservados. */

/* Pantalla de carga de la app. Los mismos fondos que su tema (lib/interfaz/tema/),
   para que no haya fogonazo al arrancar. */

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #fff9f5;
  color: #65554b;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

#arranque {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: inherit;
  transition: opacity 0.35s ease;
}

#arranque img {
  border-radius: 22px;
  animation: latir 1.8s ease-in-out infinite;
}

#arranque h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  color: #b84300;
}

#arranque .lema {
  padding: 0 24px;
}

/* Solo para lectores de pantalla y buscadores: no ocupa sitio en pantalla. */
.oculto-visual {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

#arranque p {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
}

/* Sin JavaScript, o si la app no arranca: fuera «Cargando…» y el latido. */
.sin-js #arranque .cargando,
#arranque.con-fallo .cargando {
  display: none;
}

.sin-js #arranque img,
#arranque.con-fallo img,
#arranque.pagina-error img {
  animation: none;
  opacity: 1;
}

#arranque .sin-js-aviso,
.fallo {
  max-width: 340px;
  margin: 8px 24px 0;
  padding: 20px;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 2px 12px rgba(101, 85, 75, 0.12);
  text-align: center;
}

.fallo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.fallo[hidden] {
  display: none;
}

#arranque .fallo-titulo {
  font-size: 18px;
  font-weight: 800;
  color: #3a2e27;
}

#arranque .fallo-texto {
  font-weight: 500;
  line-height: 1.45;
}

.fallo-boton {
  margin-top: 8px;
  padding: 12px 22px;
  border: 0;
  border-radius: 14px;
  background: #b84300;
  color: #ffffff;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.fallo-boton:focus-visible {
  outline: 3px solid #ff9a5c;
  outline-offset: 2px;
}

#arranque.oculta {
  opacity: 0;
  pointer-events: none;
}

@keyframes latir {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.75;
  }
  50% {
    transform: scale(1.06);
    opacity: 1;
  }
}

/* El oscuro: el del sistema, salvo que en la app se haya elegido claro; o el
   elegido en la app (arranque.js pone «tema-oscuro» o «tema-claro»). */
@media (prefers-color-scheme: dark) {
  html:not(.tema-claro),
  html:not(.tema-claro) body {
    background: #1e1c1b;
    color: #c9c2be;
  }

  html:not(.tema-claro) #arranque h1 {
    color: #ff9a5c;
  }

  html:not(.tema-claro) #arranque .sin-js-aviso,
  html:not(.tema-claro) .fallo {
    background: #262423;
    box-shadow: none;
  }

  html:not(.tema-claro) #arranque .fallo-titulo {
    color: #f3e9e3;
  }

  html:not(.tema-claro) .fallo-boton {
    background: #ff9a5c;
    color: #1e1c1b;
  }
}

html.tema-oscuro,
html.tema-oscuro body {
  background: #1e1c1b;
  color: #c9c2be;
}

html.tema-oscuro #arranque h1 {
  color: #ff9a5c;
}

html.tema-oscuro #arranque .sin-js-aviso,
html.tema-oscuro .fallo {
  background: #262423;
  box-shadow: none;
}

html.tema-oscuro #arranque .fallo-titulo {
  color: #f3e9e3;
}

html.tema-oscuro .fallo-boton {
  background: #ff9a5c;
  color: #1e1c1b;
}

/* Quien ha pedido menos movimiento en su sistema no ve el latido. */
@media (prefers-reduced-motion: reduce) {
  #arranque img {
    animation: none;
  }
}
