/* UCN-FMRC signature loader v2 — approved 3D hero-logo medallion.
   Shared by customer pages, customer 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, 27vw, 154px);
  --fmrc-depth: calc(var(--fmrc-seal-size) / 154);
  --fmrc-cycle: 4.8s;
  --fmrc-tilt: 24deg;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: min(360px, 100%);
  padding: 24px 20px 30px;
  color: #382c2a;
  font-family: "Montserrat", "Segoe UI", system-ui, sans-serif;
  text-align: center;
}

.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) * 280 / 154);
  height: calc(var(--fmrc-seal-size) * 270 / 154);
  perspective: 850px;
}

.fmrc-load-shadow {
  position: absolute;
  left: 25%;
  bottom: 9.26%;
  width: 50%;
  height: 7.04%;
  border-radius: 50%;
  background: radial-gradient(ellipse, #66452d36, #66452d12 46%, #66452d00 73%);
  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: 14.444%;
  left: 22.5%;
  width: var(--fmrc-seal-size);
  height: var(--fmrc-seal-size);
  transform-style: preserve-3d;
  transform: rotateX(12deg) rotateY(-24deg) rotateZ(-5deg);
  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(130deg, #eed6a0 2%, #c7a366 24%, #86612e 48%, #d6b97d 72%, #72502c);
  border: 1px solid #9e773d;
}

.fmrc-load-face {
  display: grid;
  place-items: center;
  padding: 3.896%;
  transform: translateZ(calc(8 * var(--fmrc-depth)));
  backface-visibility: hidden;
  overflow: hidden;
  background: linear-gradient(140deg, #fbebc5, #c59b53 27%, #8b602d 52%, #e5cc93 77%, #ae803e);
  box-shadow: inset 0 0 0 1px #f9e5b4;
}

.fmrc-load-face::after {
  content: "";
  position: absolute;
  inset: -25%;
  pointer-events: none;
  background: linear-gradient(110deg, #fff7e900 31%, #fff7e914 42%, #fff7e970 49%, #fff7e914 55%, #fff7e900 66%);
  transform: translateX(-110%);
  animation: fmrcLoadLight var(--fmrc-cycle) ease-in-out infinite;
}

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

.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: -16.234%;
  border: 1px solid #b38b4930;
  border-radius: 50%;
  transform: translateZ(calc(3 * var(--fmrc-depth)));
  transform-style: preserve-3d;
}

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

.fmrc-load-orbit-track::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(#b38b4900 175deg, #bc914946 228deg, #a87933 305deg, #e0bd7c 349deg, #b38b4900 350deg);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1.5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1.5px));
}

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

.fmrc-load-satellite {
  position: absolute;
  inset: -28.571%;
  border: 1px solid #6b202b16;
  border-radius: 50%;
  transform: rotateX(62deg) rotateY(-12deg) translateZ(calc(-4 * var(--fmrc-depth)));
  transform-style: preserve-3d;
}

.fmrc-load-satellite > span {
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  animation: fmrcLoadOrbit 5.2s linear infinite reverse;
}

.fmrc-load-satellite > span::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #6b202b8c;
}

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

.fmrc-load-name {
  margin: 9px 0 0;
  max-width: 290px;
  color: #76665e;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.7;
  letter-spacing: 0.04em;
}

.fmrc-load-caption {
  margin: 28px 0 0;
  max-width: 30ch;
  color: #76665e;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
}

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

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

.fmrc-load-rail {
  position: relative;
  width: 104px;
  height: 2px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 2px;
  background: #6b202b12;
}

.fmrc-load-rail > span {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #6b202b00, #6b202b 45%, #bd944c 70%, #bd944c00);
  animation: fmrcLoadRail 2s 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 {
  box-sizing: border-box;
  position: fixed;
  inset: 0;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  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: 18px;
  background: radial-gradient(ellipse at 50% 38%, #fffdf8, #fffdf800 56%), #fdfaf6;
  box-shadow: 0 24px 64px #382c2a29;
}

/* 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: 16%;
  border: 1px solid #c19c59;
  border-radius: 50%;
  background: url("../images/FMRC%20Brand%20Logo.png") center / auto 88% no-repeat, #fdfaf6;
  box-shadow: 1px 1px 0 #af894e, 2px 2px 0 #96713d;
  transform: rotateX(12deg) rotateY(-24deg) rotateZ(-5deg);
  animation: fmrcLoadCompact 4.8s ease-in-out infinite;
}

.fmrc-load-inline::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(#b38b4926 0deg 180deg, #bc914960 230deg, #a87933 305deg, #e0bd7c 349deg, #b38b4926 350deg);
  -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 2.6s linear infinite;
}

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

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

@keyframes fmrcLoadCompact {
  0%, 100% { transform: rotateX(12deg) rotateY(-24deg) rotateZ(-5deg); }
  50% { transform: rotateX(18deg) rotateY(24deg) rotateZ(5deg); }
}

@keyframes fmrcLoadShadow {
  0%, 100% { transform: scaleX(1); opacity: .85; }
  50% { transform: scaleX(.77); opacity: .48; }
}

@keyframes fmrcLoadLight {
  0%, 8% { transform: translateX(-110%); opacity: 0; }
  18% { opacity: .7; }
  48%, 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, 110px); padding: 12px 18px 18px; }
  .fmrc-load-caption { margin-top: 16px; }
  .fmrc-load-boot, .fmrc-load-veil { 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 { transform: rotateX(8deg) rotateY(-12deg); }
  .fmrc-load-rail > span { transform: scaleX(.4); }
  .fmrc-load-boot, .fmrc-load-veil, .fmrc-load-veil.is-on { transition: none; }
}

/* Reusable overlays stop every descendant loop while hidden. 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: none; }
