/* =====================================================
   ANIMATED LOGIN — split hero + panel layout
   Scoped entirely under .login-split / .ls-* so the legacy
   .login-container/.login-card rules (still used by the
   expired-password, license-activation, contact, privacy,
   about and startup-loader pages) are untouched.
   ===================================================== */

/* ---------- keyframes (ls- prefix avoids app.css collisions) ---------- */
@keyframes ls-kenburns {
  0% { transform: scale(1.06) translate(0, 0); }
  100% { transform: scale(1.14) translate(-1.2%, 0.8%); }
}

@keyframes ls-sweep {
  0% { transform: translateX(0) skewX(-14deg); opacity: 0; }
  5% { opacity: 0.85; }
  26% { transform: translateX(560%) skewX(-14deg); opacity: 0; }
  100% { transform: translateX(560%) skewX(-14deg); opacity: 0; }
}

@keyframes ls-bloom-a {
  0% { transform: translate(0, 0); }
  100% { transform: translate(70px, 40px); }
}

@keyframes ls-bloom-b {
  0% { transform: translate(0, 0); }
  100% { transform: translate(-60px, -36px); }
}

@keyframes ls-rise {
  0% { opacity: 0; transform: translateY(16px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes ls-fade {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes ls-pulse-soft {
  0%, 100% { box-shadow: 0 0 0 0 rgba(211, 47, 47, 0.35); }
  50% { box-shadow: 0 0 0 6px rgba(211, 47, 47, 0); }
}

/* ---------- layout ---------- */
.login-split {
  display: flex;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #0e1c2e;
}

.ls-hero {
  position: relative;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  display: none; /* shown >=960px below */
}

.ls-panel {
  width: 480px;
  flex: none;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  padding: 24px 44px 14px;
  overflow-y: auto;
  box-shadow: -8px 0 24px rgba(10, 24, 40, 0.18);
  position: relative;
  z-index: 1;
}

/* The panel scrolls when short on height — never let flexbox squish
   children (the status card would clip its tiles otherwise). */
.ls-panel > * {
  flex-shrink: 0;
}

/* ---------- hero layers ----------
   JS parallax translates the wrapper divs (.ls-hero-motion /
   .ls-hero-blooms); the CSS keyframes animate their children —
   the two transforms must never share an element. */
.ls-hero-motion {
  position: absolute;
  inset: -24px; /* oversized so kenburns + parallax never expose edges */
  animation: ls-fade 1.2s ease both;
  will-change: transform;
}

.ls-hero-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: ls-kenburns 48s ease-in-out alternate infinite;
  will-change: transform;
}

.ls-hero-blooms {
  position: absolute;
  inset: 0;
  pointer-events: none;
  will-change: transform;
}

.ls-bloom {
  position: absolute;
  border-radius: 50%;
}

.ls-bloom--a {
  top: 12%;
  left: 58%;
  width: 460px;
  height: 460px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0) 68%);
  animation: ls-bloom-a 70s ease-in-out alternate infinite;
}

.ls-bloom--b {
  top: 34%;
  left: 44%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0) 68%);
  animation: ls-bloom-b 90s ease-in-out alternate infinite;
}

.ls-hero-sweep {
  position: absolute;
  top: -20%;
  left: -30%;
  width: 26%;
  height: 140%;
  background: linear-gradient(105deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.30) 50%, rgba(255, 255, 255, 0) 100%);
  mix-blend-mode: screen;
  animation: ls-sweep 15s ease-in-out 2s infinite;
  pointer-events: none;
  will-change: transform;
}

.ls-hero-scrim {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 180px;
  background: linear-gradient(to top, rgba(10, 24, 40, 0.45), rgba(10, 24, 40, 0));
  pointer-events: none;
}

.ls-hero-caption {
  position: absolute;
  left: 56px;
  right: 56px;
  bottom: 48px;
  color: #ffffff;
  text-shadow: 0 2px 12px rgba(10, 24, 40, 0.5);
  animation: ls-rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.35s both;
}

.ls-hero-company {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.ls-hero-title {
  font-size: 32px;
  font-weight: 300;
  letter-spacing: 0.5px;
  line-height: 1.25;
}

/* ---------- entrance stagger utilities ---------- */
.ls-rise {
  animation: ls-rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.ls-d1 { animation-delay: 0.1s; }
.ls-d2 { animation-delay: 0.2s; }
.ls-d3 { animation-delay: 0.3s; }
.ls-d4 { animation-delay: 0.4s; }
.ls-d5 { animation-delay: 0.5s; }
.ls-d6 { animation-delay: 0.6s; }

/* ---------- panel content ---------- */
.ls-panel .login-logo {
  max-height: 120px;
}

.ls-panel .login-subtitle {
  margin-bottom: 16px;
}

.ls-panel .login-form {
  margin-bottom: 16px;
}

/* Field labels — the mock's 13px/600 */
.ls-panel .login-form .mud-typography-subtitle2 {
  font-size: 13px;
  font-weight: 600;
  color: #333;
}

/* Compact 40px inputs with a 6px radius. MudBlazor's slot is content-box with
   18.5px vertical padding (renders ~71px tall), so border-box + explicit
   padding is required for the height to actually stick. */
.ls-panel .login-form .mud-input-control input.mud-input-slot {
  box-sizing: border-box;
  height: 40px;
  padding-top: 8px;
  padding-bottom: 8px;
  font-size: 14px;
}

.ls-panel .login-form .mud-input.mud-input-outlined {
  border-radius: 6px;
}

.ls-panel .login-form .mud-input-outlined .mud-input-outlined-border {
  border-radius: 6px;
}

/* Soft focus ring instead of the legacy .login-card outline rule
   (which is scoped to .login-card and no longer applies here). */
.ls-panel .login-form .mud-input-root:focus-within {
  box-shadow: 0 0 0 3px rgba(29, 61, 95, 0.14);
  border-radius: 6px;
}

/* Autofill repaint — port of the .login-card-scoped rule in custom-styles.css */
.ls-panel input:-webkit-autofill,
.ls-panel input:-webkit-autofill:hover,
.ls-panel input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--cas-canvas) inset;
  -webkit-text-fill-color: var(--cas-ink);
  caret-color: var(--cas-ink);
}

/* LOGIN button: hover lift + shadow on top of the flat .navy-button */
.ls-panel .login-button {
  letter-spacing: 1.1px;
  transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.ls-panel .navy-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(13, 35, 60, 0.3) !important;
}

.ls-panel .navy-button:active:not(:disabled) {
  transform: translateY(0) scale(0.99);
  box-shadow: none !important;
}

/* ---------- system status card ---------- */
.login-split .login-component-status {
  margin-top: 10px;
  background: #ffffff;
  border-color: #e3e6ea;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(16, 32, 54, 0.06);
  animation: ls-rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.6s both;
}

/* Pulsing badge when components are offline (MudChip renders
   mud-chip-color-error exactly when SummaryColor == Error). */
.login-split .login-component-status-chip.mud-chip-color-error {
  animation: ls-pulse-soft 2.6s ease-in-out infinite;
}

.login-split .login-component-status-header {
  padding: 8px 12px;
}

/* Green/amber/red left borders come from the base tile styles;
   only the not-applicable tiles (e.g. SignalR pre-login) go gray. */
.login-split .login-component-status .sov-component-tile {
  min-height: 44px;
  box-shadow: 0 1px 2px rgba(16, 32, 54, 0.05);
}

.login-split .login-component-status .sov-component-tile--neutral {
  border-left-color: #c9ccd1;
}

/* Per-tile entrance stagger (also covers the 6 loading skeletons
   and the optional 7th Notification Relay tile). */
.login-split .login-component-status-grid > * {
  animation: ls-rise 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.login-split .login-component-status-grid > *:nth-child(1) { animation-delay: 0.65s; }
.login-split .login-component-status-grid > *:nth-child(2) { animation-delay: 0.72s; }
.login-split .login-component-status-grid > *:nth-child(3) { animation-delay: 0.79s; }
.login-split .login-component-status-grid > *:nth-child(4) { animation-delay: 0.86s; }
.login-split .login-component-status-grid > *:nth-child(5) { animation-delay: 0.93s; }
.login-split .login-component-status-grid > *:nth-child(6) { animation-delay: 1.0s; }
.login-split .login-component-status-grid > *:nth-child(7) { animation-delay: 1.07s; }

/* Refresh button rotates half a turn on hover */
.login-split .login-component-status-footer .mud-icon-button {
  transition: transform 0.4s ease;
}

.login-split .login-component-status-footer .mud-icon-button:hover {
  transform: rotate(180deg);
}

/* ---------- footer pinned to the panel bottom ---------- */
.ls-panel .login-footer {
  margin-top: auto;
  padding-top: 16px;
  animation: ls-fade 0.9s ease 0.85s both;
}

/* Keep some air between the status card and the footer when the
   panel is taller than its content. */
.ls-panel .login-component-status {
  margin-bottom: 16px;
}

/* Re-match the negative-margin hack to the 44px panel padding. */
.ls-panel .footer-bottom-row {
  margin-left: -44px;
  margin-right: -44px;
}

/* One-line fit depends on exact font metrics — wrap instead of clipping. */
.ls-panel .nav-links {
  flex-wrap: wrap;
}

/* ---------- responsive ---------- */
@media (min-width: 960px) {
  .ls-hero {
    display: block;
  }

  /* Company name renders in the hero caption — don't show it twice. */
  .ls-panel .login-header {
    display: none;
  }
}

@media (max-width: 959.98px) {
  .login-split {
    justify-content: center;
  }

  .ls-panel {
    width: 100%;
    max-width: 520px;
    box-shadow: none;
    padding: 40px 24px 20px;
  }

  .ls-panel .footer-bottom-row {
    margin-left: -24px;
    margin-right: -24px;
  }
}

@media (max-width: 480px) {
  .ls-panel {
    padding: 28px 18px 16px;
  }

  .ls-panel .footer-bottom-row {
    margin-left: 0;
    margin-right: 0;
  }
}

/* ---------- reduced motion ----------
   Every entrance animation uses fill-mode both with keyframes that
   own the from-state, and no element sets opacity:0 as a base style,
   so killing the animations leaves everything fully visible. */
@media (prefers-reduced-motion: reduce) {
  .login-split *,
  .login-split *::before,
  .login-split *::after {
    animation: none !important;
    transition: none !important;
  }
}
