/* לואדר משותף, לוגו MGROUP קטן בתוך טבעת מסתובבת (01/10). ההתנהגות: web/loader.js.
   תנועה ב-CSS בלבד; ב-prefers-reduced-motion הטבעת עומדת והטקסט מספיק. */
:root {
  --mg-ld-bg: #ffffff;
  --mg-ld-fg: #1c2230;
  --mg-ld-border: #d0d6e0;
  --mg-ld-accent: #2563eb;
}
@media (prefers-color-scheme: dark) {
  :root {
    --mg-ld-bg: #172033;
    --mg-ld-fg: #eef2f8;
    --mg-ld-border: #34405a;
    --mg-ld-accent: #7aa5ff;
  }
}

/* The mark: ring + logo. Size from --mg-ld-size; color = currentColor (white on a primary button). */
.mg-ld {
  position: relative;
  display: inline-block;
  flex: none;
  width: var(--mg-ld-size, 22px);
  height: var(--mg-ld-size, 22px);
  vertical-align: middle;
}
.mg-ld-ring {
  position: absolute;
  inset: 0;
  box-sizing: border-box;
  border-radius: 50%;
  /* the faint track: a light version of the same color */
  border: var(--mg-ld-stroke, 2px) solid rgba(128, 128, 128, .3);
  border: var(--mg-ld-stroke, 2px) solid color-mix(in srgb, currentColor 28%, transparent);
}
.mg-ld-ring::after {
  content: "";
  position: absolute;
  inset: calc(-1 * var(--mg-ld-stroke, 2px));
  box-sizing: border-box;
  border-radius: 50%;
  border: var(--mg-ld-stroke, 2px) solid transparent;
  border-top-color: currentColor;
  border-inline-start-color: currentColor;
  animation: mg-ld-spin .9s linear infinite;
}
.mg-ld img {
  position: absolute;
  inset: 20%;
  width: 60%;
  height: 60%;
  border-radius: 22%;
  object-fit: cover;
  background: #fff;
}
@keyframes mg-ld-spin { to { transform: rotate(360deg); } }

/* Inside a busy button: the mark, then the short text. The button keeps its width. */
/* busy is not "unavailable": the faded disabled look (opacity .5) made the white text fail AA */
button.mg-busy, button.mg-busy:disabled { cursor: progress; opacity: 1; }
button.mg-busy .mg-ld { --mg-ld-size: 20px; margin-inline-end: 8px; }
button.mg-busy .mg-ld-label { vertical-align: middle; }

/* Floating label for a tab / the first load. Never blocks a click (pointer-events: none). */
.mg-ld-pill {
  position: fixed;
  z-index: 9000;
  /* bottom centre: never covers the header, the tabs or the environment banner */
  bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
  left: 50%;
  transform: translateX(-50%);
  display: none;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 24px);
  padding: 6px 16px 6px 10px;
  border: 1px solid var(--mg-ld-border);
  border-radius: 999px;
  background: var(--mg-ld-bg);
  color: var(--mg-ld-fg);
  box-shadow: 0 4px 16px rgba(15, 23, 42, .14);
  font-size: 14px;
  line-height: 1.4;
  white-space: nowrap;
  pointer-events: none;
}
.mg-ld-pill .mg-ld { --mg-ld-size: 28px; color: var(--mg-ld-accent); }
.mg-ld-pill.mg-ld-on { display: inline-flex; animation: mg-ld-in .15s ease-out; }
.mg-ld-pill.mg-ld-boot {
  top: 50%;
  bottom: auto;
  transform: translate(-50%, -50%);
  flex-direction: column;
  gap: 12px;
  padding: 20px 28px;
  border-radius: 16px;
  font-size: 15px;
  font-weight: 600;
}
.mg-ld-pill.mg-ld-boot .mg-ld { --mg-ld-size: 56px; --mg-ld-stroke: 3px; }
@keyframes mg-ld-in { from { opacity: 0; } to { opacity: 1; } }

/* The spoken text: one role=status region, visually hidden. */
.mg-ld-sr {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .mg-ld-ring::after { animation: none; }
  .mg-ld-pill.mg-ld-on { animation: none; }
}
