/* Freestay CMS — the one loading look for every page (dashboard.html, m.html,
   reset.html). Any <div class="loading">Message…</div> shows a spinner, the
   message and three shimmering placeholder lines. The fallbacks cover m.html,
   which has its own, smaller set of colour tokens. */

@keyframes cms-spin { to { transform: rotate(360deg); } }
@keyframes cms-shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

.loading {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 10px;
  row-gap: 14px;
  padding: 8px 0;
  text-align: left;
  color: var(--text-2, #a3aec0);
  font-size: 14px;
  font-weight: 400;
}

.loading::before {
  content: '';
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--grid, rgba(241,245,249,.1));
  border-top-color: var(--accent, #f97316);
  animation: cms-spin .8s linear infinite;
}

/* Three placeholder lines of falling width, cut out of one shimmering band. */
.loading::after {
  content: '';
  grid-column: 1 / -1;
  height: 74px;
  border-radius: 6px;
  background: linear-gradient(90deg,
    var(--grid, rgba(241,245,249,.07)) 0%,
    var(--grid, rgba(241,245,249,.07)) 35%,
    var(--panel-2, #1a1a2a) 50%,
    var(--grid, rgba(241,245,249,.07)) 65%,
    var(--grid, rgba(241,245,249,.07)) 100%);
  background-size: 300% 100%;
  animation: cms-shimmer 1.4s ease-in-out infinite;
  -webkit-mask-image: linear-gradient(#000, #000), linear-gradient(#000, #000), linear-gradient(#000, #000);
  -webkit-mask-size: 100% 12px, 82% 12px, 58% 12px;
  -webkit-mask-position: 0 0, 0 31px, 0 62px;
  -webkit-mask-repeat: no-repeat;
  mask-image: linear-gradient(#000, #000), linear-gradient(#000, #000), linear-gradient(#000, #000);
  mask-size: 100% 12px, 82% 12px, 58% 12px;
  mask-position: 0 0, 0 31px, 0 62px;
  mask-repeat: no-repeat;
}

/* A one-line version for small spots (a button, a header, a table cell). */
.loading.compact { padding: 0; row-gap: 0; }
.loading.compact::after { display: none; }

/* The spinner alone, e.g. inside a busy button. */
.load-spin {
  display: inline-block;
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--grid, rgba(241,245,249,.1));
  border-top-color: var(--accent, #f97316);
  animation: cms-spin .8s linear infinite;
  vertical-align: -1px;
}

@media (prefers-reduced-motion: reduce) {
  .loading::before, .loading::after, .load-spin { animation: none; }
}
