/* Only what must look right before Blazor boots, plus the framework's fatal-error bar and the
   ErrorBoundary fallback. Hand-written and versioned; Tailwind output lives in tailwind.css. */

#blazor-error-ui {
  color-scheme: light only;
  background: var(--destructive, #dc2626);
  color: #fff;
  font-weight: 700;
  bottom: 0;
  box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
  box-sizing: border-box;
  display: none;
  left: 0;
  padding: 0.6rem 1.25rem 0.7rem 1.25rem;
  position: fixed;
  width: 100%;
  z-index: 1000;
}

#blazor-error-ui button {
  background: none;
  border: 0;
  color: inherit;
  cursor: pointer;
  font: inherit;
  padding: 0;
}

#blazor-error-ui .reload {
  margin-left: 0.75rem;
  text-decoration: underline;
}

#blazor-error-ui .dismiss {
  position: absolute;
  right: 0.75rem;
  top: 0.5rem;
}

.blazor-error-boundary {
  background: #b32121;
  padding: 1rem;
  color: white;
}

.blazor-error-boundary::after {
  content: "Ocurrió un error. Recarga la página si el problema continúa.";
}

/* The screen shown while the app downloads: a barbell turning inside a ring that fills with the percentage
   Blazor reports. It uses the theme colours, so it matches light and dark before any component exists. */

.boot {
  /* The first line is for browsers without dynamic viewport units; the second leaves out the address bar of a phone, so there is nothing to scroll. */
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  color: var(--foreground);
  font-family: var(--font-sans);
}

.boot-visual {
  position: relative;
  width: 9rem;
  height: 9rem;
}

.boot-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.boot-ring circle {
  fill: none;
  stroke-width: 5;
}

.boot-ring-track {
  stroke: var(--border);
}

/* The circle is 326.7 units around and its dash lengths are measured as a share of the 120-unit box, so each
   percent of loading is 2.7225 units of the ring. */
.boot-ring-bar {
  stroke: var(--primary);
  stroke-dasharray: calc(var(--blazor-load-percentage, 0%) * 2.7225) 500%;
  transition: stroke-dasharray 0.15s ease-out;
}

/* The logo of the app stays still in the middle; what turns is the ring around it. */
.boot-glyph {
  fill: var(--primary);
}

.boot-glyph {
  position: absolute;
  inset: 1.75rem;
  width: calc(100% - 3.5rem);
  height: calc(100% - 3.5rem);
}

/* The ring of the "loading" screen: no percentage to show, so an arc that turns. */
.spin-ring circle {
  fill: none;
  stroke-width: 5;
}

.spin-ring-track {
  stroke: var(--border);
}

.spin-ring-arc {
  stroke: var(--primary);
  stroke-linecap: round;
  stroke-dasharray: 84 243;
  transform-origin: center;
  animation: spin-ring 1.1s linear infinite;
}

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

.boot-percent {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.boot-percent::after {
  content: var(--blazor-load-percentage-text, "0%");
}

.boot-percent-space {
  height: 1.75rem;
}

.boot-label {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

@media (prefers-reduced-motion: reduce) {
  .spin-ring-arc {
    animation: none;
  }
}

/* FocusOnNavigate moves the focus to the page's h1 so screen readers announce it; the focus is for them, not a
   control to type in, so it needs no outline. */
h1[tabindex="-1"]:focus {
  outline: none;
}
