/*
 * Intro inicial: queda fuera de React para que la animación continúe
 * mientras se resuelve la sesión o se descarga la vista.
 */
body { margin: 0; }

.app-boot {
  --boot-black: #09090b;
  --boot-gold: #ffc534;
  --boot-light: #ffe88d;
  position: fixed;
  z-index: 2147483647;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  color: #fff8e9;
  background: radial-gradient(ellipse at 50% 46%, #241a0b, var(--boot-black) 58%);
  font-family: system-ui, sans-serif;
  text-align: center;
  transition: opacity 230ms ease-out;
}

.app-boot::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background-image: linear-gradient(#ffcb5010 1px, transparent 1px),
    linear-gradient(90deg, #ffcb5010 1px, transparent 1px);
  background-position: center;
  background-size: 30px 30px;
  -webkit-mask-image: radial-gradient(ellipse at center, #000, transparent 60%);
  mask-image: radial-gradient(ellipse at center, #000, transparent 60%);
  content: '';
}

.app-boot--leaving { opacity: 0; pointer-events: none; }

.app-boot__signal {
  display: grid;
  justify-items: center;
  gap: 9px;
  padding: 20px;
}

.app-boot__emblem {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(116px, 33vw, 154px);
  aspect-ratio: 1;
  margin-bottom: 9px;
}

.app-boot__emblem::before {
  position: absolute;
  inset: 0;
  border: 1px dashed #ffc53438;
  border-radius: 50%;
  content: '';
}

.app-boot__orbit {
  position: absolute;
  inset: 6px;
  border: 1px solid #e5aa3738;
  border-top-color: var(--boot-light);
  border-right-color: var(--boot-gold);
  border-radius: 50%;
  box-shadow: 0 0 18px #ffc5341c, inset 0 0 14px #ffc53410;
  animation: app-boot-orbit 1.35s linear infinite;
}

.app-boot__orbit::after {
  position: absolute;
  top: 14%;
  right: 13%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--boot-light);
  box-shadow: 0 0 9px 2px #ffc534a3;
  content: '';
}

.app-boot__mark {
  display: block;
  width: 74%;
  height: auto;
  aspect-ratio: 1;
  box-sizing: border-box;
  border: 1px solid #9c7732;
  border-radius: 50%;
  background: #080808;
  object-fit: contain;
  box-shadow: 0 0 24px #ca8e222c;
  animation: app-boot-mark-in 500ms cubic-bezier(.19, 1, .24, 1) both;
}

.app-boot__brand {
  margin: 0;
  font-size: clamp(23px, 6vw, 32px);
  font-weight: 850;
  letter-spacing: -.035em;
  line-height: 1.12;
  animation: app-boot-text-in 340ms 90ms ease-out both;
}

.app-boot__brand span { color: var(--boot-light); }

.app-boot__message,
.app-loading {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
}

.app-boot__message {
  color: #d4c9b3;
  animation: app-boot-text-in 320ms 130ms ease-out both;
}

.app-loading {
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  place-items: center;
  color: var(--text-muted);
  background: var(--bg);
}

.app-boot__progress {
  display: block;
  width: 108px;
  height: 2px;
  margin-top: 5px;
  overflow: hidden;
  border-radius: 10px;
  background: #ffc5342c;
}

.app-boot__progress::after {
  display: block;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--boot-gold) 70%, var(--boot-light));
  animation: app-boot-progress 920ms cubic-bezier(.46, .05, .55, .95) infinite;
  content: '';
}

@keyframes app-boot-mark-in {
  from { opacity: .25; transform: perspective(360px) translateY(12px) rotateX(30deg) scale(.78); }
  to { opacity: 1; transform: none; }
}

@keyframes app-boot-text-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: none; }
}

@keyframes app-boot-orbit {
  from { transform: rotate(-45deg); }
  to { transform: rotate(315deg); }
}

@keyframes app-boot-progress {
  from { transform: translateX(-100%); }
  to { transform: translateX(205%); }
}

@media (prefers-reduced-motion: reduce) {
  .app-boot,
  .app-boot *,
  .app-boot__progress::after {
    animation: none;
    transition: none;
  }
}
