/* Ayvu boot splash — shown until Angular mounts */

/* Soft splash atmosphere only — do NOT lock height/overflow here.
   loading.css stays loaded after Angular boots; height:100svh + overflow:hidden
   was freezing scroll on the rest of the app (e.g. public home on mobile). */
html,
body {
  margin: 0;
  min-height: 100%;
  background-color: #eef5f3;
  background-image:
    radial-gradient(90% 70% at 15% 20%, rgba(27, 153, 136, 0.14), transparent 55%),
    radial-gradient(80% 60% at 90% 80%, rgba(244, 165, 51, 0.12), transparent 50%),
    linear-gradient(165deg, #f7faf9 0%, #eef5f3 55%, #f6f1ec 100%);
  background-repeat: no-repeat;
  background-size: cover;
}

jhi-app {
  display: block;
  min-height: 100%;
}

.app-loading {
  /* inset alone sizes to the visual viewport — avoid min-height: 100vh
     which on iOS/Safari is taller than the visible area and pushes flex
     content below the true center on small screens. */
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  width: auto;
  height: auto;
  margin: 0;
  padding: max(1.25rem, env(safe-area-inset-top, 0px)) max(1.25rem, env(safe-area-inset-right, 0px))
    max(1.25rem, env(safe-area-inset-bottom, 0px)) max(1.25rem, env(safe-area-inset-left, 0px));
  box-sizing: border-box;
  overflow: hidden;
  background-color: #eef5f3;
  background-image:
    radial-gradient(90% 70% at 15% 20%, rgba(27, 153, 136, 0.14), transparent 55%),
    radial-gradient(80% 60% at 90% 80%, rgba(244, 165, 51, 0.12), transparent 50%),
    linear-gradient(165deg, #f7faf9 0%, #eef5f3 55%, #f6f1ec 100%);
  background-repeat: no-repeat;
  background-size: cover;
  font-family: 'Afacad', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  color: #134e4a;
}

.ayvu-boot-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(0.85rem, 2.5vh, 1.25rem);
  max-width: min(100%, 28rem);
  text-align: center;
}

.ayvu-boot {
  position: relative;
  width: min(42vw, 7.5rem);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.ayvu-boot__ring {
  position: absolute;
  inset: 0;
  border-radius: 28%;
  border: 2px solid transparent;
  background:
    linear-gradient(transparent, transparent) padding-box,
    linear-gradient(135deg, #f4a533, #1b9988) border-box;
  opacity: 0.4;
  animation: ayvu-boot-spin 3.2s linear infinite;
}

.ayvu-boot__ring--mid {
  inset: 12%;
  opacity: 0.6;
  animation-duration: 2.4s;
  animation-direction: reverse;
}

.ayvu-boot__ring--inner {
  inset: 24%;
  opacity: 0.85;
  animation-duration: 1.8s;
}

/* Official symbol from content/images/ayvu-logo.svg */
.ayvu-boot__logo {
  position: relative;
  z-index: 1;
  width: 46%;
  height: auto;
  display: block;
  animation: ayvu-boot-breathe 2.2s ease-in-out infinite;
}

/* Colors from ayvu-logomarca.svg: Ayvu=#F55D54, dot=#C61108, IA=#1C1C1C on light bg
   (IA is white in the SVG for dark chrome; dark fill keeps contrast on this splash.) */
.ayvu-boot__wordmark {
  margin: 0;
  font-size: clamp(1.5rem, 4.2vw, 2.15rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  animation: ayvu-boot-fade 0.8s 0.15s ease both;
}

.ayvu-boot__wordmark-ayvu {
  color: #f55d54;
}

.ayvu-boot__wordmark-dot {
  color: #c61108;
}

.ayvu-boot__wordmark-ia {
  color: #1c1c1c;
}

.ayvu-boot__caption {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #5c655f;
  animation: ayvu-boot-fade 0.8s 0.35s ease both;
}

.ayvu-boot__bar {
  width: min(12rem, 48vw);
  height: 3px;
  border-radius: 999px;
  background: rgba(19, 78, 74, 0.14);
  overflow: hidden;
  animation: ayvu-boot-fade 0.8s 0.45s ease both;
}

.ayvu-boot__bar > span {
  display: block;
  width: 40%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f4a533, #1b9988, #f55d54);
  background-size: 200% 100%;
  animation: ayvu-boot-bar 1.4s ease-in-out infinite;
}

#jhipster-error {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-width: 40rem;
  width: min(40rem, calc(100% - 2.5rem));
  max-height: min(70svh, 32rem);
  overflow: auto;
  margin: 0;
  padding: 1.25rem 1.5rem;
  border-radius: 0.75rem;
  background: #fff;
  border: 1px solid rgba(143, 143, 143, 0.28);
  color: #191a15;
  text-align: left;
  box-shadow: 0 8px 24px rgba(25, 26, 21, 0.08);
  z-index: 2;
}

.app-loading:has(#jhipster-error[style*='display: block']) .ayvu-boot__bar,
.app-loading:has(#jhipster-error[style*='display: block']) .ayvu-boot__caption {
  display: none;
}

#jhipster-error h1,
#jhipster-error h2,
#jhipster-error h3 {
  font-family: 'Afacad', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  color: #134e4a;
}

#jhipster-error code {
  color: #c61108;
}

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

@keyframes ayvu-boot-breathe {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06);
  }
}

@keyframes ayvu-boot-fade {
  from {
    opacity: 0;
    transform: translateY(0.4rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes ayvu-boot-bar {
  0% {
    transform: translateX(-120%);
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    transform: translateX(280%);
    background-position: 0% 50%;
  }
}

/* Small phones: keep mark readable but ensure stack fits visual center */
@media (max-width: 380px), (max-height: 640px) {
  .ayvu-boot {
    width: min(36vw, 6.25rem);
  }

  .ayvu-boot__caption {
    font-size: 0.85rem;
  }
}

/* Large / desktop: slightly larger mark, still centered in the viewport */
@media (min-width: 1024px) and (min-height: 720px) {
  .ayvu-boot {
    width: min(18vw, 8.5rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ayvu-boot__ring,
  .ayvu-boot__logo,
  .ayvu-boot__bar > span {
    animation: none !important;
  }

  .ayvu-boot__wordmark,
  .ayvu-boot__caption,
  .ayvu-boot__bar {
    animation: none !important;
    opacity: 1;
    transform: none;
  }
}
