:root {
  --sisfo-pwa-orange: #f57c00;
  --sisfo-pwa-orange-2: #ffad1f;
  --sisfo-pwa-orange-3: #ffc64d;
  --sisfo-pwa-orange-soft: #fff6ea;
  --sisfo-pwa-ink: #3f4650;
  --sisfo-pwa-muted: #6f7781;
  --sisfo-pwa-grid: rgba(239, 133, 39, .105);
  --sisfo-pwa-grid-strong: rgba(239, 133, 39, .14);
  --sisfo-pwa-white: #fff;
}

html.sisfo-pwa-splash-required,
html.sisfo-pwa-splash-required body {
  overflow: hidden !important;
}

.sisfo-pwa-splash {
  display: none;
}

html.sisfo-pwa-splash-required .sisfo-pwa-splash {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  color: var(--sisfo-pwa-ink);
  background:
    radial-gradient(circle at 50% 32%, rgba(255,255,255,1) 0 23%, rgba(255,255,255,.92) 42%, transparent 67%),
    radial-gradient(circle at 100% 50%, rgba(255,235,211,.42), transparent 37%),
    radial-gradient(circle at 0% 55%, rgba(255,243,228,.34), transparent 35%),
    #fff;
  opacity: 1;
  visibility: visible;
  transition: opacity .34s ease, visibility .34s ease, filter .34s ease;
}

html.sisfo-pwa-splash-required .sisfo-pwa-splash.is-leaving {
  opacity: 0;
  visibility: hidden;
  filter: blur(2px);
}

/* Flat login-page grid. No circles / no tech HUD decorations. */
.sisfo-pwa-splash::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -4;
  pointer-events: none;
  background-image:
    linear-gradient(var(--sisfo-pwa-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--sisfo-pwa-grid) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.8) 0%, rgba(0,0,0,.48) 47%, rgba(0,0,0,.14) 67%, transparent 84%);
}

/* Perspective grid floor inspired by the login page. */
.sisfo-pwa-splash::after {
  content: "";
  position: absolute;
  left: -18%;
  right: -18%;
  bottom: -31%;
  height: 66%;
  z-index: -3;
  pointer-events: none;
  background-image:
    linear-gradient(var(--sisfo-pwa-grid-strong) 1px, transparent 1px),
    linear-gradient(90deg, var(--sisfo-pwa-grid-strong) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,.22) 17%, #000 54%, rgba(0,0,0,.84) 100%);
  transform: perspective(720px) rotateX(66deg) scale(1.35);
  transform-origin: 50% 100%;
}

.sisfo-pwa-splash__content {
  position: relative;
  width: min(1020px, calc(100vw - 44px));
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: clamp(24px, 4.2vh, 48px) 18px 42px;
}

.sisfo-pwa-splash__logo-stage {
  width: clamp(122px, 11vw, 156px);
  height: clamp(122px, 11vw, 156px);
  display: grid;
  place-items: center;
  margin-bottom: 22px;
}

/* Use the exact original image from public/assets/img/logo.png. */
.sisfo-pwa-splash__logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 12px 22px rgba(175, 94, 12, .13));
  animation: sisfoPwaLogoFloat 5.6s ease-in-out infinite;
}

.sisfo-pwa-splash__brand {
  display: flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  gap: .18em;
  margin: 0;
  font-size: clamp(40px, 5.5vw, 72px);
  line-height: .98;
  font-weight: 900;
  letter-spacing: -.035em;
  text-shadow: 0 6px 18px rgba(32, 39, 46, .06);
}

.sisfo-pwa-splash__brand-main {
  color: transparent;
  background:
    linear-gradient(
      105deg,
      #59626d 0%,
      #59626d 37%,
      #6b747e 44%,
      #d9dde1 49%,
      #ffffff 50%,
      #c8cdd2 52%,
      #6a7480 57%,
      #59626d 64%,
      #59626d 100%
    );
  background-size: 300% 100%;
  background-position: 120% 0;
  -webkit-background-clip: text;
  background-clip: text;
  animation: sisfoPwaBrandGlass 5.2s ease-in-out infinite;
}

.sisfo-pwa-splash__brand-accent {
  color: transparent;
  background:
    linear-gradient(
      105deg,
      #e97a00 0%,
      #e97a00 37%,
      #f99b16 44%,
      #ffd27a 49%,
      #fff4d8 50%,
      #ffcb59 52%,
      #f79200 57%,
      #e97a00 64%,
      #e97a00 100%
    );
  background-size: 300% 100%;
  background-position: 120% 0;
  -webkit-background-clip: text;
  background-clip: text;
  animation: sisfoPwaBrandGlass 5.2s ease-in-out infinite;
}

.sisfo-pwa-splash__subtitle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 18px;
  color: #424a54;
  font-size: clamp(19px, 2vw, 29px);
  line-height: 1.15;
  font-weight: 800;
}

.sisfo-pwa-splash__subtitle::before,
.sisfo-pwa-splash__subtitle::after {
  content: "";
  width: clamp(42px, 7.5vw, 108px);
  height: 1.5px;
  border-radius: 99px;
  background: linear-gradient(90deg, transparent, rgba(255,121,0,.95));
}

.sisfo-pwa-splash__subtitle::after {
  transform: scaleX(-1);
}

.sisfo-pwa-splash__university {
  margin-top: 11px;
  color: #ee7b00;
  font-size: clamp(15px, 1.55vw, 22px);
  line-height: 1.3;
  font-weight: 720;
}

.sisfo-pwa-splash__powered {
  margin-top: 8px;
  color: #525a65;
  font-size: clamp(12px, 1.15vw, 16px);
  font-weight: 620;
}

.sisfo-pwa-splash__powered strong {
  color: #e87b00;
  font-weight: 850;
}


.sisfo-pwa-splash__loader {
  position: relative;
  width: min(590px, 72vw);
  margin-top: 27px;
  padding: 0 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.sisfo-pwa-splash__loader-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 11px;
  color: #454d57;
  font-size: clamp(13px, 1.25vw, 17px);
  font-weight: 720;
}

.sisfo-pwa-splash__percent {
  color: #5f6672;
  font-size: 1.08em;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.sisfo-pwa-splash__progress {
  position: relative;
  height: 5px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #e8edf1 0%, #dfe5ea 100%);
  box-shadow:
    inset 0 1px 1px rgba(44, 51, 60, .08),
    inset 0 0 0 1px rgba(255,255,255,.72);
}

.sisfo-pwa-splash__progress::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,.35), rgba(255,255,255,0));
  pointer-events: none;
}

.sisfo-pwa-splash__bar {
  position: relative;
  width: 8%;
  height: 100%;
  overflow: hidden;
  border-radius: inherit;
  background: linear-gradient(90deg, #ef7600 0%, #f79008 42%, #ffb129 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.22),
    0 2px 10px rgba(245, 145, 0, .16);
  transition: width .42s cubic-bezier(.22,.78,.29,1);
}

.sisfo-pwa-splash__bar::before {
  content: none;
}

.sisfo-pwa-splash__bar::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 84px;
  left: -96px;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.10) 20%, rgba(255,255,255,.70) 50%, rgba(255,255,255,.10) 80%, transparent 100%);
  transform: skewX(-20deg);
  animation: sisfoPwaProgressShine 2.15s ease-in-out infinite;
}

/* Only these 3 loading dots remain; no decorative circles in the grid. */
.sisfo-pwa-splash__dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}

.sisfo-pwa-splash__dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ff7900;
  box-shadow: 0 0 0 4px rgba(255,121,0,.055);
  animation: sisfoPwaDotPulse 1.1s ease-in-out infinite;
}

.sisfo-pwa-splash__dots span:nth-child(2) { animation-delay: .14s; }
.sisfo-pwa-splash__dots span:nth-child(3) { animation-delay: .28s; }

/* Floating install button */
.sisfo-pwa-install[hidden],
body.role-workspace .sisfo-pwa-install,
body[data-active-role] .sisfo-pwa-install,
body.main-body .sisfo-pwa-install,
.role-workspace #sisfoPwaInstall,
.main-body.app #sisfoPwaInstall {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.sisfo-pwa-install {
  position: fixed;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 2147481000;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 16px 7px 8px;
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 999px;
  background: linear-gradient(135deg, #ff9d16, #ef6a00);
  color: #fff;
  box-shadow: 0 14px 34px rgba(181,83,0,.25), 0 4px 12px rgba(91,49,8,.1);
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px) scale(.96);
  transition: transform .25s ease, opacity .25s ease, box-shadow .25s ease;
  -webkit-tap-highlight-color: transparent;
}

.sisfo-pwa-install.is-visible { opacity: 1; transform: translateY(0) scale(1); }
.sisfo-pwa-install:hover { transform: translateY(-2px); box-shadow: 0 18px 40px rgba(181,83,0,.3), 0 5px 14px rgba(91,49,8,.13); }
.sisfo-pwa-install:focus-visible { outline: 3px solid rgba(255,153,0,.24); outline-offset: 3px; }

.sisfo-pwa-install__icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.22);
}

.sisfo-pwa-install__icon svg { width: 20px; height: 20px; }
.sisfo-pwa-install__copy { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.1; }
.sisfo-pwa-install__copy strong { color: #fff; font-size: 13px; font-weight: 850; }
.sisfo-pwa-install__copy span { margin-top: 3px; color: rgba(255,255,255,.84); font-size: 10.5px; font-weight: 600; }

.sisfo-pwa-install.is-ready::after {
  content: "";
  /*position: absolute;*/
  right: 8px;
  top: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255,255,255,.2);
}

/* Install-help sheet */
.sisfo-pwa-dialog {
  position: fixed;
  inset: 0;
  z-index: 2147482000;
  display: grid;
  place-items: end center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
}

.sisfo-pwa-dialog.is-open { opacity: 1; pointer-events: auto; }
.sisfo-pwa-dialog__backdrop { position: absolute; inset: 0; border: 0; background: rgba(23,29,39,.28); backdrop-filter: blur(2px); }

.sisfo-pwa-dialog__sheet {
  position: relative;
  width: min(430px, 100%);
  padding: 24px;
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 22px;
  background: rgba(255,255,255,.98);
  box-shadow: 0 28px 80px rgba(37,37,37,.23);
  transform: translateY(18px);
  transition: transform .22s ease;
  text-align: center;
}

.sisfo-pwa-dialog.is-open .sisfo-pwa-dialog__sheet { transform: translateY(0); }
.sisfo-pwa-dialog__sheet img { width: 68px; height: 68px; object-fit: contain; }
.sisfo-pwa-dialog__sheet h2 { margin: 12px 0 6px; color: #323942; font-size: 20px; font-weight: 850; }
.sisfo-pwa-dialog__message { color: #6f7782; font-size: 13px; line-height: 1.55; }

.sisfo-pwa-dialog__close {
  width: 100%;
  min-height: 44px;
  margin-top: 18px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #ff9d16, #ee6900);
  color: #fff;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}


@keyframes sisfoPwaBrandGlass {
  0%, 18% { background-position: 120% 0; }
  52% { background-position: -20% 0; }
  100% { background-position: -20% 0; }
}

@keyframes sisfoPwaLogoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

@keyframes sisfoPwaDotPulse {
  0%, 78%, 100% { transform: translateY(0) scale(.72); opacity: .28; }
  38% { transform: translateY(-3px) scale(1); opacity: 1; }
}

@keyframes sisfoPwaProgressShine {
  0% { left: -96px; opacity: 0; }
  18% { opacity: .36; }
  52% { opacity: .82; }
  100% { left: calc(100% + 96px); opacity: 0; }
}

@media (max-height: 650px) and (min-width: 681px) {
  .sisfo-pwa-splash__content { transform: scale(.86); transform-origin: center; }
}

@media (max-width: 680px) {
  .sisfo-pwa-splash::before { background-size: 32px 32px; }
  .sisfo-pwa-splash::after { background-size: 40px 40px; bottom: -34%; height: 60%; }
  .sisfo-pwa-splash__content {
    width: min(100%, calc(100vw - 18px));
    padding: 28px 10px 36px;
  }
  .sisfo-pwa-splash__logo-stage {
    width: 92px;
    height: 92px;
    margin-bottom: 16px;
  }
  .sisfo-pwa-splash__brand {
    flex-direction: column;
    align-items: center;
    gap: .06em;
    font-size: clamp(28px, 9.2vw, 44px);
    line-height: .94;
    letter-spacing: -.028em;
  }
  .sisfo-pwa-splash__subtitle {
    margin-top: 12px;
    font-size: clamp(15px, 4.4vw, 20px);
    gap: 7px;
  }
  .sisfo-pwa-splash__subtitle::before,
  .sisfo-pwa-splash__subtitle::after { width: 22px; }
  .sisfo-pwa-splash__university {
    font-size: clamp(12px, 3.8vw, 16px);
    max-width: 280px;
  }
  .sisfo-pwa-splash__powered { font-size: 11px; }
  .sisfo-pwa-splash__loader {
    width: min(78vw, 340px);
    margin-top: 20px;
    padding: 0 2px;
  }
  .sisfo-pwa-splash__loader-meta {
    margin-bottom: 9px;
    gap: 12px;
    font-size: clamp(11px, 3.7vw, 14px);
  }
  .sisfo-pwa-splash__progress { height: 5px; }
  .sisfo-pwa-splash__bar::before {
    content: none;
  }
  .sisfo-pwa-splash__dots { margin-top: 14px; gap: 8px; }
  .sisfo-pwa-splash__dots span {
    width: 8px;
    height: 8px;
  }
  .sisfo-pwa-install { right: max(14px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom)); min-height: 48px; padding-right: 13px; }
  .sisfo-pwa-install__icon { width: 34px; height: 34px; flex-basis: 34px; }
  .sisfo-pwa-install__copy span { display: none; }
  .sisfo-pwa-dialog { padding: 0; }
  .sisfo-pwa-dialog__sheet { width: 100%; border-radius: 24px 24px 0 0; padding-bottom: max(24px, calc(18px + env(safe-area-inset-bottom))); }
}

@media (prefers-reduced-motion: reduce) {
  .sisfo-pwa-splash__logo,
  .sisfo-pwa-splash__brand-main,
  .sisfo-pwa-splash__brand-accent,
  .sisfo-pwa-splash__bar::after,
  .sisfo-pwa-splash__dots span { animation: none !important; }

  .sisfo-pwa-splash,
  .sisfo-pwa-splash__bar,
  .sisfo-pwa-install,
  .sisfo-pwa-dialog,
  .sisfo-pwa-dialog__sheet { transition: none !important; }
}
