/* UCN-FMRC signature loader v3 — refined, gently floating 3D emblem.
   Shared by Customer, Admin, Staff, authentication and the redirect splash.
   Request lifetime remains controlled by each caller. Only transforms and
   opacity animate; reduced motion keeps the logo and status still. */

.fmrc-load-core {
  --fmrc-seal-size: clamp(112px, 30vw, 148px);
  --fmrc-depth: calc(var(--fmrc-seal-size) / 440);
  --fmrc-float: calc(var(--fmrc-seal-size) / 37);
  --fmrc-cycle: 6s;
  --fmrc-tilt: 10deg;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: min(360px, 100%);
  min-width: 0;
  padding: 28px 20px;
  color: #382c2a;
  font-family: "Montserrat", "Segoe UI", system-ui, sans-serif;
  text-align: center;
  overflow-wrap: anywhere;
}

.fmrc-load-core *,
.fmrc-load-core *::before,
.fmrc-load-core *::after,
.fmrc-load-inline,
.fmrc-load-inline::before,
.fmrc-load-inline::after { box-sizing: border-box; }

/* All medallion dimensions, including depth, scale with the face size. */
.fmrc-load-mark {
  position: relative;
  flex: none;
  width: calc(var(--fmrc-seal-size) * 1.62);
  height: calc(var(--fmrc-seal-size) * 1.52);
  perspective: 900px;
}

.fmrc-load-shadow {
  position: absolute;
  left: 28%;
  bottom: 7%;
  width: 44%;
  height: 5%;
  border-radius: 50%;
  background: radial-gradient(ellipse, #513a3029, #513a300e 45%, #513a3000 74%);
  animation: fmrcLoadShadow var(--fmrc-cycle) ease-in-out infinite;
}

.fmrc-load-float {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  animation: fmrcLoadFloat var(--fmrc-cycle) ease-in-out infinite;
}

.fmrc-load-assembly {
  position: absolute;
  top: 12%;
  left: calc(50% - var(--fmrc-seal-size) / 2);
  width: var(--fmrc-seal-size);
  height: var(--fmrc-seal-size);
  transform-style: preserve-3d;
  transform: rotateX(8deg) rotateY(-10deg);
  animation: fmrcLoadTilt var(--fmrc-cycle) ease-in-out infinite;
}

.fmrc-load-edge,
.fmrc-load-face {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

.fmrc-load-edge {
  transform: translateZ(calc(var(--layer) * var(--fmrc-depth)));
  background: linear-gradient(135deg, #ead8b4, #b29565 32%, #806342 55%, #d8c39c 80%, #a08459);
  border: 1px solid #b29565;
}

.fmrc-load-face {
  display: grid;
  place-items: center;
  padding: 2%;
  transform: translateZ(calc(8 * var(--fmrc-depth)));
  backface-visibility: hidden;
  overflow: hidden;
  background: linear-gradient(140deg, #f5e7cb, #c3a46d 30%, #a18150 55%, #e8d7b6 80%, #b99a63);
  box-shadow: inset 0 0 0 1px #fff8e4b3;
}

.fmrc-load-face::after {
  content: "";
  position: absolute;
  inset: -25%;
  pointer-events: none;
  background: linear-gradient(110deg, #fffaf000 34%, #fffaf00a 43%, #fffaf057 50%, #fffaf00a 57%, #fffaf000 66%);
  transform: translateX(-110%);
  opacity: 0;
  animation: fmrcLoadLight var(--fmrc-cycle) ease-in-out infinite;
}

.fmrc-load-logo-bed {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 1.4%;
  border-radius: 50%;
  background: #fdfaf6;
  box-shadow: inset 0 0 0 1px #7953331f;
}

.fmrc-load-logo {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: url("../images/FMRC%20Brand%20Logo.png") center / contain no-repeat;
}

.fmrc-load-orbit {
  position: absolute;
  inset: -13.5%;
  border: 1px solid #b2956526;
  border-radius: 50%;
  transform: translateZ(calc(3 * var(--fmrc-depth)));
  transform-style: preserve-3d;
}

.fmrc-load-orbit-track {
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  animation: fmrcLoadOrbit 3.6s linear infinite;
}

.fmrc-load-orbit-track::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(#b2956500 170deg, #b295653d 240deg, #a58650 320deg, #ddc79d 358deg, #b2956500 360deg);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 1.5px), #000 calc(100% - 1px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 1.5px), #000 calc(100% - 1px));
}

.fmrc-load-orbit-track::after {
  content: "";
  position: absolute;
  top: -1px;
  left: calc(50% - 1.5px);
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #af8d53;
  box-shadow: 0 0 5px #d5b36940;
}

/* Retain compatibility with static boot markup and the shared mark builder. */
.fmrc-load-satellite { display: none; }

.fmrc-load-brand {
  margin: 0;
  padding-left: 0.13em;
  color: #6b202b;
  font-size: clamp(20px, 4.7vw, 22px);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.13em;
}

.fmrc-load-name {
  margin: 8px 0 0;
  max-width: 290px;
  color: #71635e;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.65;
  letter-spacing: 0.015em;
}

.fmrc-load-caption {
  margin: 22px 0 0;
  max-width: 30ch;
  color: #5f4945;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
}

.fmrc-load-hint {
  margin: 6px 0 0;
  max-width: 34ch;
  color: #71635e;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
}

.fmrc-load-hint:empty { display: none; }

.fmrc-load-rail {
  position: relative;
  flex: none;
  width: 96px;
  height: 2px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #6b202b0e;
}

.fmrc-load-rail > span {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #6b202b00, #6b202bb3 45%, #b2956580 70%, #b2956500);
  animation: fmrcLoadRail 2.4s cubic-bezier(.4, 0, .2, 1) infinite;
}

/* Boot cleanup stays inline in each page, independent of the action script. */
.fmrc-load-boot,
.fmrc-load-veil {
  --fmrc-overlay-padding: 24px;
  box-sizing: border-box;
  position: fixed;
  inset: 0;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  align-items: safe center;
  padding: var(--fmrc-overlay-padding);
  padding-top: max(var(--fmrc-overlay-padding), env(safe-area-inset-top, 0px));
  padding-right: max(var(--fmrc-overlay-padding), env(safe-area-inset-right, 0px));
  padding-bottom: max(var(--fmrc-overlay-padding), env(safe-area-inset-bottom, 0px));
  padding-left: max(var(--fmrc-overlay-padding), env(safe-area-inset-left, 0px));
  overflow-y: auto;
  overscroll-behavior: contain;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.fmrc-load-boot {
  z-index: 200001;
  transition: opacity .28s ease, visibility 0s linear .28s;
  background: var(--fmrc-boot-field, radial-gradient(ellipse at 50% 38%, #fffdf8, #fffdf800 56%), #fdfaf6);
}

html.fmrc-booting .fmrc-load-boot {
  opacity: 1;
  visibility: visible;
  transition: none;
}

.fmrc-load-veil {
  z-index: 200000;
  background: var(--ux-dlg-scrim, #2019188c);
  transition: opacity .18s ease, visibility 0s linear .18s;
}

.fmrc-load-veil.is-on {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity .18s ease;
}

.fmrc-load-veil .fmrc-load-core {
  border-radius: 20px;
  background: radial-gradient(ellipse at 50% 38%, #fffdf8, #fffdf800 56%), #fdfaf6;
  box-shadow: 0 20px 64px #382c2a24, inset 0 0 0 1px #b2956526;
}

/* Authentication transitions explicitly request the same opaque presentation
   as Admin/Staff navigation. Other customer actions keep their compact card. */
html.fmrc-admin-portal .fmrc-load-veil,
.fmrc-load-veil.is-fullscreen {
  background: var(
    --fmrc-admin-transition-field,
    radial-gradient(ellipse at 50% 38%, #fffdf8, #fffdf800 56%), #fdfaf6
  );
}

html.fmrc-admin-portal .fmrc-load-veil .fmrc-load-core,
.fmrc-load-veil.is-fullscreen .fmrc-load-core {
  background: transparent;
  box-shadow: none;
  border-radius: 0;
}

html:has(.fmrc-load-veil.is-on.is-fullscreen),
html:has(.fmrc-load-veil.is-on.is-fullscreen) body {
  overflow: hidden;
}

/* Small waits use the same artwork, gold orbit and tilting face, with fewer
   layers so thumbnail grids do not animate dozens of full medallions. */
.fmrc-load-inline {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: var(--fmrc-inline-size, 24px);
  height: var(--fmrc-inline-size, 24px);
  min-width: var(--fmrc-inline-size, 24px);
  padding: 0;
  border: 0;
  vertical-align: middle;
  line-height: 1;
  perspective: 180px;
}

.fmrc-load-inline--panel { --fmrc-inline-size: 52px; }

.fmrc-load-inline::before {
  content: "";
  position: absolute;
  inset: 15%;
  border: 1px solid #bfa16e;
  border-radius: 50%;
  background: url("../images/FMRC%20Brand%20Logo.png") center / 94% 94% no-repeat, #fdfaf6;
  box-shadow: .5px 1px 0 #a0845980;
  transform: rotateX(8deg) rotateY(-10deg);
  animation: fmrcLoadCompact 6s ease-in-out infinite;
}

.fmrc-load-inline::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(#b2956526 0deg 170deg, #b295653d 240deg, #a58650 320deg, #ddc79d 358deg, #b2956526 360deg);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 1.5px), #000 calc(100% - 1px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 1.5px), #000 calc(100% - 1px));
  animation: fmrcLoadOrbit 3.6s linear infinite;
}

@keyframes fmrcLoadFloat {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, calc(-1 * var(--fmrc-float)), 0); }
}

@keyframes fmrcLoadTilt {
  0%, 100% { transform: rotateX(8deg) rotateY(calc(-1 * var(--fmrc-tilt))); }
  50% { transform: rotateX(8deg) rotateY(var(--fmrc-tilt)); }
}

@keyframes fmrcLoadCompact {
  0%, 100% { transform: rotateX(8deg) rotateY(-10deg); }
  50% { transform: rotateX(8deg) rotateY(10deg); }
}

@keyframes fmrcLoadShadow {
  0%, 100% { transform: scaleX(1); opacity: .72; }
  50% { transform: scaleX(.9); opacity: .5; }
}

@keyframes fmrcLoadLight {
  0%, 12% { transform: translateX(-110%); opacity: 0; }
  28% { opacity: .35; }
  52%, 100% { transform: translateX(110%); opacity: 0; }
}

@keyframes fmrcLoadOrbit { to { transform: rotateZ(360deg); } }
@keyframes fmrcLoadRail {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

@media (max-height: 600px) {
  .fmrc-load-core { --fmrc-seal-size: clamp(64px, 19vh, 104px); padding: 12px 18px 18px; }
  .fmrc-load-caption { margin-top: 16px; }
  .fmrc-load-boot, .fmrc-load-veil { --fmrc-overlay-padding: 12px; }
}

@media (max-height: 380px) {
  .fmrc-load-core { --fmrc-seal-size: 54px; }
  .fmrc-load-name { display: none; }
  .fmrc-load-caption { margin-top: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .fmrc-load-core *,
  .fmrc-load-core *::before,
  .fmrc-load-core *::after,
  .fmrc-load-inline::before,
  .fmrc-load-inline::after { animation: none; }
  .fmrc-load-assembly,
  .fmrc-load-inline::before { transform: rotateX(8deg) rotateY(-6deg); }
  .fmrc-load-rail > span { transform: scaleX(.4); }
  .fmrc-load-boot, .fmrc-load-veil, .fmrc-load-veil.is-on { transition: none; }
}

/* Pause at the current frame during dismissal so the emblem does not snap
   back mid-fade. Hidden overlays do no animation work; boot nodes are also
   removed by their page's cleanup handler after the fade. */
.fmrc-load-veil:not(.is-on) .fmrc-load-core *,
.fmrc-load-veil:not(.is-on) .fmrc-load-core *::before,
.fmrc-load-veil:not(.is-on) .fmrc-load-core *::after,
html:not(.fmrc-booting) .fmrc-load-boot .fmrc-load-core *,
html:not(.fmrc-booting) .fmrc-load-boot .fmrc-load-core *::before,
html:not(.fmrc-booting) .fmrc-load-boot .fmrc-load-core *::after { animation-play-state: paused; }
