/* RubricMark boot loader — single source for HTML overlay + React BootScreen.
   Linked from index.html / index.student.html before the JS bundle. */

:root,
html[data-app-variant='teacher'] {
  --boot-loader-canvas: #faf9f6;
  --boot-loader-accent: #f5b924;
  --boot-loader-accent-deep: #fdcb45;
  --boot-loader-accent-soft: #ffe08a;
  --boot-loader-track: rgba(253, 203, 69, 0.18);
  --boot-loader-logo-glow: rgba(253, 203, 69, 0.35);
  --boot-loader-logo-glow-dark: rgba(253, 203, 69, 0.22);
}

html[data-app-variant='student'] {
  --boot-loader-canvas: #fff;
  --boot-loader-accent: #1aafe8;
  --boot-loader-accent-deep: #1aafe8;
  --boot-loader-accent-soft: #7ad2f1;
  --boot-loader-track: rgba(26, 175, 232, 0.16);
  --boot-loader-logo-glow: rgba(26, 175, 232, 0.28);
  --boot-loader-logo-glow-dark: rgba(26, 175, 232, 0.22);
}

html {
  scrollbar-gutter: stable;
}

html.boot-overlay-active {
  overflow: hidden;
}

html.boot-overlay-active,
html.boot-overlay-active body {
  background: var(--boot-loader-canvas);
  overflow: hidden;
}

html[data-theme='dark'].boot-overlay-active,
html[data-theme='dark'].boot-overlay-active body {
  background: #121214;
}

.boot-overlay,
.boot-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: min(100dvh, 100vh);
  padding: max(1.5rem, env(safe-area-inset-top, 0px)) 1.25rem max(1.5rem, env(safe-area-inset-bottom, 0px));
  background: transparent;
}

.boot-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  height: 100dvh;
  background: var(--boot-loader-canvas);
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.boot-overlay--exit {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.boot-screen--fixed {
  position: fixed;
  inset: 0;
  z-index: 9999;
  height: 100dvh;
  background: var(--boot-loader-canvas);
}

.boot-overlay__card {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  width: 15.5rem;
  max-width: 100%;
  min-height: 11.75rem;
  flex-shrink: 0;
  padding: 1.4rem 1.25rem 1.2rem;
  text-align: center;
  background: #fff;
  border: 1px solid rgba(7, 6, 20, 0.06);
  border-radius: 24px;
  box-shadow:
    0 4px 20px -4px rgba(7, 6, 20, 0.06),
    0 18px 40px -12px rgba(7, 6, 20, 0.1);
}

.boot-overlay__logo-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.6rem;
  height: 3.6rem;
  flex-shrink: 0;
}

.boot-overlay__logo {
  width: 3.6rem;
  height: 3.6rem;
  flex-shrink: 0;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px var(--boot-loader-logo-glow));
}

.boot-overlay__brand {
  margin: 0.15rem 0 0;
  font:
    700 1.15rem/1.15 'Outfit',
    'Inter',
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Roboto,
    sans-serif;
  letter-spacing: -0.025em;
  color: #070614;
}

.boot-overlay__accent {
  color: var(--boot-loader-accent);
}

.boot-overlay__message {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 2.65rem;
  margin: 0;
  font:
    500 0.9rem/1.45 'Inter',
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Roboto,
    sans-serif;
  color: rgba(7, 6, 20, 0.6);
}

.boot-overlay__progress {
  width: 100%;
  height: 4px;
  margin-top: 0.45rem;
  overflow: hidden;
  background: var(--boot-loader-track);
  border-radius: 999px;
}

.boot-overlay__progress-bar {
  display: block;
  width: 42%;
  height: 100%;
  background: linear-gradient(90deg, var(--boot-loader-accent-deep), var(--boot-loader-accent-soft));
  border-radius: inherit;
  animation: boot-loader-progress 1.1s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .boot-overlay__progress-bar {
    animation: none !important;
  }
}

@keyframes boot-loader-progress {
  0% {
    transform: translateX(-120%);
  }

  100% {
    transform: translateX(320%);
  }
}

html[data-theme='dark'] .boot-overlay,
html[data-theme='dark'] .boot-screen--fixed {
  background: #121214;
}

html[data-theme='dark'] .boot-overlay__card {
  background: #1e1e22;
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow:
    0 4px 20px -4px rgba(0, 0, 0, 0.35),
    0 18px 40px -12px rgba(0, 0, 0, 0.45);
}

html[data-theme='dark'] .boot-overlay__brand {
  color: #f2f2f5;
}

html[data-theme='dark'] .boot-overlay__message {
  color: rgba(242, 242, 245, 0.5);
}

html[data-theme='dark'] .boot-overlay__logo {
  filter: drop-shadow(0 8px 18px var(--boot-loader-logo-glow-dark));
}
