/*
 * Fleap's quiet boot state.
 * The SVG remains the single source of truth for the official mark; the mask
 * lets the same silhouette be used for both the resting and progress layers.
 */
.fleap-loading {
  --fleap-loading-mark-size: 96px;
  --fleap-loading-color: #00ce7c;
  --fleap-loading-silhouette: rgba(29, 29, 27, 0.09);

  position: relative;
  display: grid;
  min-height: 60vh;
  place-items: center;
  background-color: #fff;
}

#app-loading.fleap-loading {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: none;
  min-height: 100vh;
  min-height: 100dvh;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 200ms ease-out;
}

html.js #app-loading.fleap-loading {
  display: grid;
}

.fleap-loading__error { display: none; }
#app-loading[data-state="error"] > .fleap-loading__mark,
#app-loading[data-state="error"] > .fleap-loading__label { display: none; }
#app-loading[data-state="error"] .fleap-loading__error {
  display: block;
  max-width: 32rem;
  padding: 24px;
  color: #1a2230;
  text-align: center;
  font: 16px/1.625 system-ui, sans-serif;
}
.fleap-loading__error button {
  min-height: 44px;
  margin-top: 16px;
  padding: 8px 24px;
  border: 0;
  border-radius: 9999px;
  background: #00ce7c;
  color: #1d1d1b;
  font: inherit;
  cursor: pointer;
}
.fleap-loading__error button:focus-visible { outline: 2px solid #007a4b; outline-offset: 4px; }

.fleap-loading__mark {
  position: relative;
  display: block;
  width: var(--fleap-loading-mark-size);
  aspect-ratio: 186.6 / 140.4;
  overflow: hidden;
}

.fleap-loading__mark > span {
  position: absolute;
  inset: 0;
  display: block;
  overflow: hidden;
  color: transparent;
  font-size: 0;
}

.fleap-loading__mark > span::before,
.fleap-loading__mark > span::after {
  position: absolute;
  inset: 0;
  display: block;
  content: "";
  background-color: var(--fleap-loading-silhouette);
  -webkit-mask-image: url("/fleap/logos/fleap-marchio.svg");
  mask-image: url("/fleap/logos/fleap-marchio.svg");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.fleap-loading__mark > span::after {
  background-color: var(--fleap-loading-color);
  clip-path: inset(100% 0 0);
  animation: fleap-loading-fill 1.8s cubic-bezier(0.4, 0, 0.2, 1) 1 forwards;
}

.fleap-loading__label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#app-loading[data-state="leaving"] {
  opacity: 0;
  pointer-events: none;
}

html[data-fleap-boot="loading"] #root {
  visibility: hidden;
}

html[data-fleap-boot="loading"] .fleap-loading:not(#app-loading) {
  visibility: hidden;
}

@keyframes fleap-loading-fill {
  0%,
  8% {
    clip-path: inset(100% 0 0);
  }

  72%,
  100% {
    clip-path: inset(0 0 0);
  }
}

@media (max-width: 767px) {
  .fleap-loading {
    --fleap-loading-mark-size: 80px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fleap-loading__mark > span::after {
    animation: none;
    clip-path: inset(0);
  }

  #app-loading.fleap-loading {
    transition: none;
  }
}
