/*
 * Pantalla de carga de Talencer (KAN-33). La usan el HTML inicial (public/index.html, visible antes de que
 * cargue el JavaScript) y components/Layouts/Preloader.vue (mientras la app termina de arrancar), con el
 * mismo marcado: el paso de una a otra no se nota.
 *
 * Logo del encabezado: ícono (img/brand/talencer-icono.svg) que gira + palabra "talencer"
 * (img/brand/talencer-palabra.png), pintados con máscara CSS para tomar el color del tema.
 * El tema lo decide public/theme-boot.js (clase .dark-theme en <html>) con la misma regla que la app.
 * Colores: tokens de src/assets/css/theme/tokens.css (aquí todavía no están cargados).
 */
.app-splash {
  --splash-bg: #eef3f2;
  --splash-brand: #2f7888;
  --splash-text: #526a75;
  --splash-strong: #1c2b33;
  --splash-accent: #2f7888;
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  padding: 24px;
  text-align: center;
  background: var(--splash-bg);
  color: var(--splash-brand);
  font-family: "Rubik", system-ui, -apple-system, "Segoe UI", sans-serif;
}

html.dark-theme .app-splash {
  --splash-bg: #101b20;
  --splash-brand: #e8f2f1;
  --splash-text: #93a9ad;
  --splash-strong: #e8f2f1;
  --splash-accent: #2f8fa3;
}

.app-splash__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(62vw, 240px);
}

.app-splash__mark,
.app-splash__word {
  display: block;
  background: currentColor;
}

.app-splash__mark {
  flex: 0 0 auto;
  width: 26%;
  aspect-ratio: 1;
  -webkit-mask: url(/img/brand/talencer-icono.svg) no-repeat center / contain;
  mask: url(/img/brand/talencer-icono.svg) no-repeat center / contain;
  animation: app-splash-spin 1.6s cubic-bezier(.6, .1, .4, .9) infinite;
}

.app-splash__word {
  flex: 1 1 auto;
  aspect-ratio: 357 / 71;
  -webkit-mask: url(/img/brand/talencer-palabra.png) no-repeat center / contain;
  mask: url(/img/brand/talencer-palabra.png) no-repeat center / contain;
}

/* "Cargando…" y el aviso de los 10 s ocupan la misma celda; se alternan con visibility (compatible con
   cualquier navegador), solo con CSS: también funciona si el JavaScript no llega a cargar. Preloader.vue
   ajusta animation-delay para contar desde el inicio de la página y no desde que montó Vue. */
.app-splash__status {
  display: grid;
  justify-items: center;
  align-items: start;
}

.app-splash__label,
.app-splash__slow {
  grid-area: 1 / 1;
}

.app-splash__label {
  margin: 0;
  font-size: .9rem;
  letter-spacing: .02em;
  color: var(--splash-text);
  animation: app-splash-hide 0s linear 10s forwards;
}

.app-splash__slow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  color: var(--splash-text);
  font-size: .9rem;
  line-height: 1.45;
  visibility: hidden;
  animation: app-splash-show 0s linear 10s forwards;
}

.app-splash__slow p {
  margin: 0;
  display: grid;
  gap: 4px;
}

.app-splash__slow strong {
  color: var(--splash-strong);
  font-weight: 600;
}

.app-splash__retry {
  display: inline-block;
  padding: 9px 22px;
  border-radius: 8px;
  border: 1.5px solid var(--splash-accent);
  color: var(--splash-strong);
  font-weight: 600;
  text-decoration: none;
}

.app-splash__retry:hover {
  background: var(--splash-accent);
  color: #ffffff;
}

.app-splash__retry:focus-visible {
  outline: 3px solid var(--splash-accent);
  outline-offset: 3px;
}

.app-splash__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@keyframes app-splash-spin {
  to { transform: rotate(360deg); }
}

@keyframes app-splash-show {
  to { visibility: visible; }
}

@keyframes app-splash-hide {
  to { visibility: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  .app-splash__mark { animation: none; }
}
