/* AccMaster login, FMCG Distributors design (Nov 2026).
   Tenant login (.fm): form + animated distribution stage, inside a centred frame.
   Super Admin login (.sa): white platform layout with tenant console preview.
   Shared form pieces use the .lg-* classes from registration/partials/login_form.html. */

/* ================================================================
   Page shell
   ================================================================ */

.login-v2 {
  --fm-g-950: #052e22;
  --fm-g-800: #075c43;
  --fm-g-700: #0b6b4f;
  --fm-g-600: #0e8a63;
  --fm-g-400: #34c38f;
  --fm-g-100: #dcf5ea;
  --fm-o-500: #f5841f;
  --fm-o-100: #fff0de;
  --fm-lemon: #f4e36b;
  --lg-ink: #0d1d17;
  --lg-muted: #61716b;
  --lg-line: #e6ece9;
  --lg-danger: #d63939;
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  font-family: "Plus Jakarta Sans", "Inter", "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  color: var(--lg-ink);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

.login-v2 .login-shell {
  display: block;
  place-items: normal;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 0;
}

.login-v2 *,
.login-v2 *::before,
.login-v2 *::after {
  box-sizing: border-box;
}

/* ================================================================
   Shared form (.lg-*)
   ================================================================ */

.lg-form {
  margin: 0;
}

.lg-field {
  margin-bottom: 16px;
}

.lg-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.lg-label {
  display: block;
  margin: 0 0 8px;
  color: var(--lg-ink);
  font-size: 13px;
  font-weight: 600;
}

.lg-link,
.lg-link:hover,
.lg-link:focus {
  color: var(--lg-link, var(--fm-g-700));
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.lg-link:hover,
.lg-link:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.lg-input {
  display: flex;
  align-items: center;
  height: var(--lg-input-h, 54px);
  border: 1.5px solid var(--lg-input-border, transparent);
  border-radius: var(--lg-input-radius, 16px);
  background: var(--lg-input-bg, #f4f7f5);
  transition: background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.lg-input:hover {
  background: var(--lg-input-hover, #eef3f0);
}

.lg-input:focus-within {
  border-color: var(--lg-accent, var(--fm-g-600));
  background: #fff;
  box-shadow: 0 0 0 5px var(--lg-ring, rgba(14, 138, 99, 0.12));
}

.lg-input.is-invalid {
  border-color: var(--lg-danger);
  background: #fff6f6;
}

.lg-icon {
  flex: none;
  width: 19px;
  height: 19px;
  margin: 0 2px 0 16px;
  color: #87978f;
  transition: color 0.2s;
}

.lg-input:focus-within .lg-icon {
  color: var(--lg-accent, var(--fm-g-600));
}

.lg-input input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 12px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--lg-ink);
  font: inherit;
  font-size: 15px;
}

.lg-input input::placeholder {
  color: #a2afa9;
}

.lg-input input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 40px transparent inset;
  transition: background-color 9999s ease-out;
}

.lg-eye {
  display: grid;
  place-items: center;
  height: 100%;
  padding: 0 16px 0 6px;
  border: 0;
  background: none;
  color: #6c7c75;
  cursor: pointer;
}

.lg-eye:hover {
  color: var(--lg-ink);
}

.lg-eye svg {
  width: 19px;
  height: 19px;
}

.lg-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: var(--lg-btn-h, 56px);
  margin-top: 10px;
  overflow: hidden;
  border: 0;
  border-radius: var(--lg-input-radius, 16px);
  background: var(--lg-btn-bg, linear-gradient(135deg, var(--fm-g-700), var(--fm-g-950)));
  box-shadow: var(--lg-btn-shadow, 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 14px 30px -14px rgba(7, 92, 67, 0.85));
  color: #fff;
  font: inherit;
  font-size: 15.5px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.lg-btn:hover {
  transform: translateY(-1px);
}

.lg-btn:focus-visible {
  outline: 3px solid var(--lg-ring-strong, rgba(14, 138, 99, 0.45));
  outline-offset: 3px;
}

.lg-btn:disabled {
  cursor: progress;
  opacity: 0.85;
  transform: none;
}

.lg-arrow {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--lg-arrow-bg, rgba(255, 255, 255, 0.14));
  color: var(--lg-arrow-color, #fff);
  transition: transform 0.2s;
}

.lg-btn:hover .lg-arrow {
  transform: translateX(3px);
}

.lg-arrow svg {
  width: 16px;
  height: 16px;
}

.lg-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid #f6caca;
  border-radius: 12px;
  background: #fff4f4;
  color: #8a1f1f;
  font-size: 13.5px;
  line-height: 1.45;
}

.lg-alert svg {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  color: var(--lg-danger);
}

.login-v2 .field-error {
  margin-top: 6px;
  color: var(--lg-danger);
  font-size: 12.5px;
}

/* ================================================================
   Tenant login (.fm) in a centred frame
   Same design as before (form | animated distribution stage), sized to a
   ~1040 x ~615 frame in the middle of the page with margins all round.
   ================================================================ */

.lf-page {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  padding: 32px 24px;
  background: linear-gradient(135deg, #f6faf8 0%, #eaf4f0 55%, #e2f0ea 100%);
}

.lf-page::before,
.lf-page::after {
  content: "";
  position: absolute;
  z-index: 0;
  border-radius: 50%;
  pointer-events: none;
}

.lf-page::before { top: -60px; left: 3%; width: 270px; height: 270px; background: rgba(255, 255, 255, 0.85); }
.lf-page::after { right: -130px; bottom: -170px; width: 400px; height: 400px; background: rgba(140, 198, 63, 0.16); }

.fm {
  position: relative;
  z-index: 1;
  display: grid;
  width: 100%;
  max-width: 1040px;
  height: clamp(560px, calc(100vh - 64px), 615px);
  height: clamp(560px, calc(100dvh - 64px), 615px);
  grid-template-columns: 392px minmax(0, 1fr);
  overflow: hidden;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(7, 63, 58, 0.05), 0 24px 60px -28px rgba(7, 63, 58, 0.3);
}

/* ---------- left: form ---------- */

.fm-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 22px 34px 16px;
}

.fm-brand {
  display: flex;
  align-self: flex-start;
  align-items: center;
  gap: 11px;
}

.fm-brand-mark {
  display: block;
  flex: none;
  width: auto;
  height: 44px;
  object-fit: contain;
}

.fm-brand-text { display: flex; flex-direction: column; line-height: 1; }

.fm-brand-text strong {
  color: #0b3b33;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.fm-brand-text span {
  margin-top: 5px;
  color: #556a63;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.fm-form-wrap {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  min-height: 0;
  padding: 10px 0;
}

.fm-eyebrow {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 7px;
  padding: 4px 11px 4px 4px;
  border: 1px solid var(--lg-line);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 6px 18px -12px rgba(13, 29, 23, 0.35);
  color: var(--fm-g-800);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.fm-eyebrow b {
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--fm-g-600), var(--fm-o-500));
  color: #fff;
}

.fm-eyebrow svg { width: 12px; height: 12px; }

.fm-title {
  margin: 14px 0 8px;
  color: var(--lg-ink);
  font-family: "Bricolage Grotesque", "Plus Jakarta Sans", sans-serif;
  font-size: 40px;
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.fm-rotator { display: inline-block; }

.fm-rotator [data-login-rotator] {
  display: inline-block;
  padding-bottom: 0.08em;
  background: linear-gradient(100deg, var(--fm-g-600) 0%, #1fb37f 45%, var(--fm-o-500) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.5s, filter 0.5s;
}

.fm-rotator [data-login-rotator].is-out { opacity: 0; filter: blur(6px); transform: translateY(-40%); }
.fm-rotator [data-login-rotator].is-in { opacity: 0; filter: blur(6px); transform: translateY(40%); transition: none; }

.fm-sub {
  max-width: 320px;
  margin: 0 0 16px;
  color: var(--lg-muted);
  font-size: 13.5px;
  line-height: 1.5;
}

.fm .lg-field { margin-bottom: 11px; }
.fm .lg-label { margin-bottom: 6px; font-size: 12.5px; }
.fm .lg-link { font-size: 12.5px; }
.fm { --lg-input-h: 44px; --lg-input-radius: 13px; --lg-btn-h: 48px; }
.fm .lg-input input { font-size: 14px; }
.fm .lg-btn { margin-top: 6px; font-size: 14.5px; }

.fm .lg-btn::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -60%;
  width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  transform: skewX(-20deg);
  animation: fm-shine 4.5s ease-in-out infinite;
}

.fm .lg-btn:hover {
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 18px 34px -14px rgba(7, 92, 67, 0.9);
}

.fm-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.fm-trust span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #f4f7f5;
  color: var(--lg-muted);
  font-size: 11px;
  font-weight: 500;
}

.fm-trust svg { width: 12px; height: 12px; color: var(--fm-g-600); }

.fm-foot {
  margin: 0;
  color: #8e9c96;
  font-size: 11px;
}

/* ---------- right: stage ---------- */

.fm-stage {
  --s: 62px;
  --mx: 60%;
  --my: 40%;
  position: relative;
  min-width: 0;
  margin: 10px 10px 10px 0;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid #edf2ef;
  border-radius: 14px;
  background:
    radial-gradient(40% 45% at 18% 20%, rgba(52, 195, 143, 0.3), transparent 70%),
    radial-gradient(38% 40% at 85% 18%, rgba(255, 184, 107, 0.38), transparent 70%),
    radial-gradient(45% 45% at 80% 85%, rgba(244, 227, 107, 0.3), transparent 70%),
    radial-gradient(40% 40% at 15% 85%, rgba(120, 200, 255, 0.2), transparent 70%),
    #fbfdfc;
}

.fm-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(rgba(13, 29, 23, 0.1) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(70% 60% at 50% 50%, #000, transparent);
  mask-image: radial-gradient(70% 60% at 50% 50%, #000, transparent);
}

.fm-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(220px circle at var(--mx) var(--my), rgba(255, 255, 255, 0.5), transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.05'/%3E%3C/svg%3E");
}

.fm-blob {
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  filter: blur(50px);
  opacity: 0.55;
  animation: fm-drift 18s ease-in-out infinite alternate;
}

.fm-blob.is-a { top: 30%; left: 8%; width: 240px; height: 240px; background: #9be7c6; }
.fm-blob.is-b { top: 8%; right: 6%; width: 210px; height: 210px; background: #ffd2a1; animation-delay: -6s; }
.fm-blob.is-c { right: 22%; bottom: 8%; width: 190px; height: 190px; background: #fff3a6; animation-delay: -12s; }

.fm-stage-head {
  position: absolute;
  top: 22px;
  right: 22px;
  left: 24px;
  z-index: 3;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.fm-stage-head p {
  max-width: 300px;
  margin: 0;
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 23px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.fm-stage-head em { color: var(--fm-g-600); font-style: normal; }

.fm-live {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 20px -14px rgba(13, 29, 23, 0.4);
  font-size: 11px;
  font-weight: 700;
}

.fm-live i { width: 6px; height: 6px; border-radius: 50%; background: #ef4444; animation: fm-ping-red 1.6s infinite; }

/* carton stack position inside the stage */
.fm-stage .fm-scene { top: 54%; left: 44%; }
.fm-stage .fm-ground { top: 60px; left: -150px; width: 300px; height: 80px; }

/* 3D carton stack */
.fm-scene {
  position: absolute;
  top: 55%;
  left: 45%;
  z-index: 1;
  width: 0;
  height: 0;
}

.fm-ground {
  position: absolute;
  top: 90px;
  left: -210px;
  width: 420px;
  height: 120px;
  background: radial-gradient(closest-side, rgba(13, 29, 23, 0.22), transparent);
  filter: blur(6px);
  transform: scaleY(0.8);
  animation: fm-shadow 6s ease-in-out infinite;
}

.fm-stack {
  position: absolute;
  transform: rotateX(-24deg) rotateY(-38deg);
  transform-style: preserve-3d;
  animation: fm-float 6s ease-in-out infinite;
}

.fm-box {
  --top: #f2d6ab;
  --front: #e4bb87;
  --side: #d2a36b;
  --dark: #c2925a;
  --tape: rgba(150, 98, 40, 0.35);
  --print: #0e8a63;
  position: absolute;
  width: var(--s);
  height: var(--s);
  margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2);
  transform: translate3d(calc(var(--x) * var(--s)), calc(var(--y) * var(--s) * -1), calc(var(--z) * var(--s)));
  transform-style: preserve-3d;
}

.fm-box.is-green { --top: #7fdcb6; --front: #17a777; --side: #0e8460; --dark: #0b6b4f; --tape: rgba(255, 255, 255, 0.35); --print: #fff; }
.fm-box.is-orange { --top: #ffc98f; --front: #f8933a; --side: #df7616; --dark: #c86512; --tape: rgba(255, 255, 255, 0.35); --print: #fff; }
.fm-box.is-lemon { --top: #fbf0a8; --front: #f1dc5c; --side: #dcc540; --dark: #c9b231; --tape: rgba(120, 100, 10, 0.25); --print: #0b6b4f; }

.fm-box i {
  position: absolute;
  inset: 0;
  border-radius: 3px;
}

.fm-box .f-front { background: var(--front); transform: translateZ(calc(var(--s) / 2)); }
.fm-box .f-back { background: var(--dark); transform: rotateY(180deg) translateZ(calc(var(--s) / 2)); }
.fm-box .f-right { background: var(--side); transform: rotateY(90deg) translateZ(calc(var(--s) / 2)); }
.fm-box .f-left { background: var(--side); filter: brightness(1.06); transform: rotateY(-90deg) translateZ(calc(var(--s) / 2)); }
.fm-box .f-bottom { background: var(--dark); transform: rotateX(-90deg) translateZ(calc(var(--s) / 2)); }
.fm-box .f-top {
  background: linear-gradient(90deg, transparent 43%, var(--tape) 43% 57%, transparent 57%), var(--top);
  transform: rotateX(90deg) translateZ(calc(var(--s) / 2));
}

.fm-box .f-front::before {
  content: "";
  position: absolute;
  top: 0;
  left: 43%;
  width: 14%;
  height: 22%;
  background: var(--tape);
}

.fm-box .f-front::after {
  content: "";
  position: absolute;
  right: 18%;
  bottom: 18%;
  left: 18%;
  height: 20%;
  border: 2px solid var(--print);
  border-radius: 4px;
  background: linear-gradient(90deg, var(--print) 0 30%, transparent 30%);
  opacity: 0.85;
}

.fm-box .f-right::after {
  content: "\2191\2191";
  position: absolute;
  top: 10%;
  right: 12%;
  color: var(--print);
  font: 700 14px/1 "Plus Jakarta Sans", sans-serif;
  letter-spacing: -2px;
  opacity: 0.55;
}

/* glass cards */
.fm-glass {
  position: absolute;
  z-index: 2;
  padding: 11px 13px;
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.74);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: 0 1px 0 #fff inset, 0 20px 40px -24px rgba(13, 29, 23, 0.45);
  animation: fm-bob 7s ease-in-out infinite;
}

.fm-glass small { display: block; color: var(--lg-muted); font-size: 10.5px; font-weight: 600; }

.fm-big {
  margin-top: 2px;
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.fm-big span { margin-right: 2px; color: var(--lg-muted); font-size: 11.5px; font-weight: 600; }

.fm-up {
  display: inline-flex;
  align-items: center;
  margin-left: 5px;
  padding: 1px 6px;
  border-radius: 99px;
  background: var(--fm-g-100);
  color: var(--fm-g-600);
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 10.5px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0;
  vertical-align: middle;
}

.fm-c-sales { top: 92px; left: 22px; width: 196px; }
.fm-c-sales svg { display: block; width: 100%; height: 30px; margin-top: 5px; }

.fm-c-low { bottom: 62px; left: 22px; width: 178px; animation-delay: -3s; }
.fm-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.fm-ico { display: grid; flex: none; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: var(--fm-o-100); color: var(--fm-o-500); }
.fm-ico svg { width: 16px; height: 16px; }
.fm-c-low b { display: block; font-size: 12px; }
.fm-c-low em { color: #b35d06; font-size: 10.5px; font-style: normal; font-weight: 600; }
.fm-meter { height: 5px; margin-top: 8px; overflow: hidden; border-radius: 99px; background: rgba(13, 29, 23, 0.07); }
.fm-meter i { display: block; width: 14%; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #ef4444, var(--fm-o-500)); }

.fm-c-recv { right: 22px; bottom: 66px; width: 176px; animation-delay: -5s; }
.fm-ring { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.fm-ring svg { flex: none; width: 44px; height: 44px; transform: rotate(-90deg); }
.fm-ring b { font-family: "Bricolage Grotesque", sans-serif; font-size: 16px; letter-spacing: -0.02em; }
.fm-ring p { margin: 1px 0 0; color: var(--lg-muted); font-size: 10.5px; line-height: 1.3; }

/* live activity feed (two toasts visible in the frame) */
.fm-feed {
  position: absolute;
  top: 84px;
  right: 22px;
  z-index: 3;
  width: 236px;
  height: 110px;
}

.fm-toast {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid #fff;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 14px 30px -22px rgba(13, 29, 23, 0.5);
  opacity: 0;
  transform: translateY(-20px) scale(0.96);
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.6s;
}

.fm-toast-icon { display: grid; flex: none; place-items: center; width: 28px; height: 28px; border-radius: 8px; }
.fm-toast-icon svg { width: 15px; height: 15px; }
.fm-toast > div { flex: 1; min-width: 0; }
.fm-toast b,
.fm-toast > div > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fm-toast b { font-size: 11.5px; }
.fm-toast > div > span { color: var(--lg-muted); font-size: 10.5px; }
.fm-toast time { align-self: flex-start; margin-left: auto; color: #9aa7a1; font-size: 10px; white-space: nowrap; }
.fm-toast.is-green .fm-toast-icon { background: var(--fm-g-100); color: var(--fm-g-600); }
.fm-toast.is-orange .fm-toast-icon { background: var(--fm-o-100); color: var(--fm-o-500); }
.fm-toast.is-blue .fm-toast-icon { background: #e3eefe; color: #2f6fe4; }

/* category marquee */
.fm-marquee {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 3;
  padding: 11px 0;
  overflow: hidden;
  border-top: 1px solid rgba(13, 29, 23, 0.06);
  background: rgba(255, 255, 255, 0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}

.fm-track { display: flex; gap: 26px; width: max-content; animation: fm-scroll 32s linear infinite; }

.fm-track span {
  display: inline-flex;
  align-items: center;
  gap: 26px;
  color: rgba(13, 29, 23, 0.75);
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.fm-track span::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--fm-o-500); }
.fm-track span:nth-child(3n + 2)::after { background: var(--fm-g-600); }
.fm-track span:nth-child(3n)::after { background: var(--fm-lemon); }

/* ================================================================
   Super Admin login (.sa)
   ================================================================ */

.login-v2--platform {
  --lg-ink: #121a2b;
  --lg-muted: #64708a;
  --lg-line: #e6e9f0;
  --sa-ink-2: #1e293b;
  --sa-soft: #f5f7fa;
  --sa-amber: #e39a1f;
  --sa-amber-100: #fdf1dc;
  --sa-green: #0e8a63;
  --sa-green-100: #dff3ea;
  --sa-blue: #2f6fe4;
  --sa-blue-100: #e5eefd;
  /* shared form theme */
  --lg-accent: #e39a1f;
  --lg-ring: rgba(227, 154, 31, 0.15);
  --lg-ring-strong: rgba(227, 154, 31, 0.5);
  --lg-link: #1e293b;
  --lg-input-h: 50px;
  --lg-input-radius: 12px;
  --lg-input-bg: #fff;
  --lg-input-hover: #fff;
  --lg-input-border: #e6e9f0;
  --lg-btn-h: 52px;
  --lg-btn-bg: #121a2b;
  --lg-btn-shadow: 0 12px 24px -14px rgba(18, 26, 43, 0.8);
  --lg-arrow-bg: transparent;
  --lg-arrow-color: #e39a1f;
}

.sa {
  position: relative;
  display: flex;
  width: 100%;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

.sa::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--lg-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--lg-line) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse at 30% 40%, rgba(0, 0, 0, 0.55), transparent 70%);
  mask-image: radial-gradient(ellipse at 30% 40%, rgba(0, 0, 0, 0.55), transparent 70%);
}

.sa-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 56px;
}

.sa-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.sa-logo {
  display: block;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  height: 42px;
  mix-blend-mode: multiply;
}

.sa-tag {
  padding: 5px 12px;
  border: 1px solid var(--lg-line);
  border-radius: 999px;
  background: #fff;
  color: var(--sa-ink-2);
  font-size: 12px;
  font-weight: 700;
}

.sa-head-link,
.sa-head-link:hover {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--lg-muted);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}

.sa-head-link:hover {
  color: var(--lg-ink);
}

.sa-head-link svg {
  width: 16px;
  height: 16px;
}

.sa-body {
  position: relative;
  display: grid;
  flex: 1;
  grid-template-columns: 1.15fr 1fr;
  align-items: center;
  gap: 64px;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 12px 56px 48px;
}

.sa-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--sa-amber-100);
  color: #9a5d00;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sa-badge svg {
  width: 15px;
  height: 15px;
}

.sa-title {
  margin: 18px 0 12px;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 46px;
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -0.035em;
}

.sa-title em {
  color: var(--sa-amber);
  font-style: normal;
}

.sa-lead {
  max-width: 480px;
  margin: 0 0 30px;
  color: var(--lg-muted);
  font-size: 15.5px;
  line-height: 1.6;
}

.sa-console {
  max-width: 560px;
  overflow: hidden;
  border: 1px solid var(--lg-line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(18, 26, 43, 0.04), 0 24px 48px -28px rgba(18, 26, 43, 0.35);
}

.sa-console-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--lg-line);
  background: var(--sa-soft);
}

.sa-dots {
  display: flex;
  gap: 6px;
}

.sa-dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #d5dae4;
}

.sa-console-title {
  font-size: 12.5px;
  font-weight: 700;
}

.sa-console-meta {
  color: var(--lg-muted);
  font-size: 11.5px;
}

.sa-console table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.sa-console th {
  padding: 10px 18px;
  color: var(--lg-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
}

.sa-console td {
  padding: 11px 18px;
  border-top: 1px solid var(--lg-line);
}

.sa-mono {
  font-family: "JetBrains Mono", ui-monospace, Consolas, monospace;
  font-size: 12.5px;
}

.sa-code {
  font-weight: 700;
}

.sa-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
}

.sa-status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.sa-status.is-ok { background: var(--sa-green-100); color: var(--sa-green); }
.sa-status.is-run { background: var(--sa-blue-100); color: var(--sa-blue); }

.sa-console-foot {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--lg-line);
}

.sa-cf {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
}

.sa-cf + .sa-cf {
  border-left: 1px solid var(--lg-line);
}

.sa-cf svg {
  flex: none;
  width: 18px;
  height: 18px;
  color: var(--sa-amber);
}

.sa-cf b {
  display: block;
  font-size: 12.5px;
}

.sa-cf span {
  color: var(--lg-muted);
  font-size: 11.5px;
}

.sa-card {
  justify-self: end;
  width: 100%;
  max-width: 440px;
  padding: 36px 36px 28px;
  border: 1px solid var(--lg-line);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(18, 26, 43, 0.04), 0 30px 60px -32px rgba(18, 26, 43, 0.4);
}

.sa-card-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 18px;
  border-radius: 12px;
  background: var(--lg-ink);
  color: #fff;
}

.sa-card-icon svg {
  width: 22px;
  height: 22px;
}

.sa-card-title {
  margin: 0;
  color: var(--lg-ink);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.sa-sub {
  margin: 6px 0 26px;
  color: var(--lg-muted);
  font-size: 14px;
}

.sa .lg-icon { color: #8b95a9; }
.sa .lg-input input::placeholder { color: #a6aec0; }
.sa .lg-btn:hover { background: #000; }
.sa .lg-link { border-bottom: 1px dashed #b7bfcf; }
.sa .lg-link:hover { border-bottom-style: solid; text-decoration: none; }

.sa-audit {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 22px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--sa-amber-100);
  color: #6b4a12;
  font-size: 12.5px;
  line-height: 1.5;
}

.sa-audit svg {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  color: var(--sa-amber);
}

.sa-foot {
  position: relative;
  padding: 0 16px 24px;
  color: #8b95a9;
  font-size: 12px;
  text-align: center;
}

/* Super Admin page in a centred frame (same spacing idea as the tenant login) */
.sa-page { background: linear-gradient(135deg, #f5f7fa 0%, #eceff5 55%, #e4e8f0 100%); }
.sa-page::after { background: rgba(227, 154, 31, 0.12); }

.sa-page .sa {
  z-index: 1;
  width: 100%;
  max-width: 1080px;
  min-height: 0;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(18, 26, 43, 0.05), 0 24px 60px -28px rgba(18, 26, 43, 0.3);
}

.sa-page .sa-header { padding: 20px 36px; }
.sa-page .sa-body { gap: 40px; padding: 4px 36px 22px; }
.sa-page .sa-title { margin: 14px 0 10px; font-size: 40px; }
.sa-page .sa-card { padding: 30px 30px 24px; }
.sa-page .sa-foot { padding: 0 16px 16px; }

/* Short laptop screens: tighten spacing so the frame keeps its margins. */
@media (min-width: 1101px) and (max-height: 800px) {
  .sa-page .sa-header { padding: 14px 32px; }
  .sa-page .sa-body { padding: 0 32px 14px; }
  .sa-page .sa-title { margin: 10px 0 8px; font-size: 34px; }
  .sa-page .sa-lead { margin-bottom: 14px; }
  .sa-page .sa-console td,
  .sa-page .sa-console th { padding-top: 7px; padding-bottom: 7px; }
  .sa-page .sa-card { padding: 22px 26px 18px; }
  .sa-page .sa-card-icon { margin-bottom: 10px; }
  .sa-page .sa { --lg-input-h: 44px; --lg-btn-h: 46px; }
  .sa-page .sa-foot { padding-bottom: 12px; }
}

/* ================================================================
   Animations
   ================================================================ */

@keyframes fm-shine { 0%, 60% { left: -60%; } 100% { left: 130%; } }
@keyframes fm-ping-red { 0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); } 80%, 100% { box-shadow: 0 0 0 7px rgba(239, 68, 68, 0); } }
@keyframes fm-drift { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(30px, -22px) scale(1.08); } 100% { transform: translate(-22px, 18px) scale(0.95); } }
@keyframes fm-shadow { 50% { opacity: 0.75; transform: scaleY(0.8) scale(0.9); } }
@keyframes fm-float {
  0%, 100% { transform: translateY(0) rotateX(-24deg) rotateY(-38deg); }
  50% { transform: translateY(-12px) rotateX(-24deg) rotateY(-30deg); }
}
@keyframes fm-bob { 50% { transform: translateY(-6px); } }
@keyframes fm-scroll { to { transform: translateX(-50%); } }

/* ================================================================
   Responsive
   ================================================================ */

@media (max-width: 1100px) {
  .sa-header,
  .sa-page .sa-header { padding: 20px 16px; }
  .sa-body,
  .sa-page .sa-body { grid-template-columns: minmax(0, 1fr); gap: 32px; padding: 8px 16px 32px; }
  .sa-intro { order: 2; }
  .sa-card { justify-self: center; }
  .sa-console { max-width: none; }
}

/* Tablet: frame narrows to the form; the stage hides. */
@media (max-width: 991.98px) {
  .fm { max-width: 440px; height: auto; grid-template-columns: minmax(0, 1fr); }
  .fm-stage { display: none; }
  .fm-main { padding: 26px 30px 18px; }
}

/* Phone: frame fills the screen. */
@media (max-width: 639.98px) {
  .lf-page { padding: 0; align-items: stretch; }
  .lf-page::before,
  .lf-page::after { display: none; }
  .fm { max-width: none; min-height: 100vh; min-height: 100dvh; border-radius: 0; box-shadow: none; }
  .fm-main { padding: 20px 16px 16px; }
  .fm-title { font-size: 38px; }
}

@media (max-width: 639.98px) {
  .sa-page .sa { min-height: 100vh; min-height: 100dvh; border-radius: 0; box-shadow: none; }
}

@media (max-width: 640px) {
  .sa-title,
  .sa-page .sa-title { font-size: 34px; }
  .sa-console { display: none; }
  .sa-card { padding: 28px 20px 22px; }
  .sa-head-link span { display: none; }
}

@media (max-width: 480px) {
  .sa-logo { height: 34px; }
  .fm-brand-mark { height: 38px; }
  .fm-brand-text strong { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .login-v2 *,
  .login-v2 *::before,
  .login-v2 *::after {
    animation: none !important;
    transition: none !important;
  }
}
