/* Hamraaz branded loader — full-screen & inline */

.hmz-load-screen,
#loading-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(ellipse 70% 55% at 50% 40%, #ffffff 0%, #f3f7f6 55%, #e8efed 100%);
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.hmz-load-screen[hidden],
#loading-screen[hidden],
.hmz-load-screen.hidden,
#loading-screen.hidden {
  display: none !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.hmz-load {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  text-align: center;
}

.hmz-load-frame {
  position: relative;
  width: min(200px, 58vw);
  aspect-ratio: 1;
  padding: 18px;
  border-radius: 28px;
  background: #fff;
  border: 1px solid rgba(2, 68, 66, 0.12);
  box-shadow:
    0 0 0 6px rgba(2, 68, 66, 0.04),
    0 18px 40px rgba(15, 62, 59, 0.1);
  animation: hmz-load-breathe 2.4s ease-in-out infinite;
}

.hmz-load-frame::before {
  content: '';
  position: absolute;
  inset: 10px;
  border-radius: 20px;
  border: 1px solid rgba(2, 68, 66, 0.08);
  pointer-events: none;
}

.hmz-load-frame img,
.hmz-load-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 14px;
}

.hmz-load-text {
  margin: 0;
  color: #024442;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  animation: hmz-load-pulse 1.8s ease-in-out infinite;
}

.hmz-load-bar {
  width: min(160px, 44vw);
  height: 3px;
  border-radius: 999px;
  background: rgba(2, 68, 66, 0.1);
  overflow: hidden;
}

.hmz-load-bar > span {
  display: block;
  width: 40%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #024442, #0a7a74);
  animation: hmz-load-slide 1.2s ease-in-out infinite;
}

/* Inline / overlay variant */
.hmz-load--inline {
  gap: 14px;
  padding: 12px;
}

.hmz-load--inline .hmz-load-frame {
  width: 96px;
  padding: 10px;
  border-radius: 18px;
  box-shadow:
    0 0 0 4px rgba(2, 68, 66, 0.04),
    0 10px 24px rgba(15, 62, 59, 0.08);
  animation: hmz-load-breathe 2.4s ease-in-out infinite;
}

.hmz-load--inline .hmz-load-frame::before {
  inset: 6px;
  border-radius: 12px;
}

.hmz-load--inline .hmz-load-text {
  font-size: 0.92rem;
}

.hmz-load--inline .hmz-load-bar {
  width: 96px;
  height: 2px;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(243, 247, 246, 0.88);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.loading-overlay.active,
.loading-overlay.is-open,
.loading-overlay[aria-hidden='false'] {
  display: flex;
}

.loading-state.hmz-load,
.hmz-load.loading-state {
  grid-column: 1 / -1;
  padding: 40px 16px;
}

@keyframes hmz-load-breathe {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-6px) scale(1.015); }
}

@keyframes hmz-load-pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

@keyframes hmz-load-slide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}

@media (prefers-reduced-motion: reduce) {
  .hmz-load-frame,
  .hmz-load-text,
  .hmz-load-bar > span {
    animation: none;
  }
}
