/* ---------------------------------------------------------------------------
 * Sign-in screen. Ported from the reference design `OLT Login.dc.html`
 * (Claude Design project 2ca26750-1482-4158-a36e-1556ae1f990c).
 *
 * Pushed only by auth/login.blade.php — it is not part of the app shell.
 *
 * Deviations from the reference, and why:
 *   - the reference's stat strip (3,482 ONU / 42.6G / 99.98%) is omitted.
 *     Those are design placeholders. Real figures cannot be shown before
 *     authentication, and inventing figures violates the product's
 *     "never invent a value" rule.
 *   - the LDAP/AD and SSO buttons are omitted: neither provider exists in this
 *     product, and a dead control is worse than no control.
 * ------------------------------------------------------------------------- */

/* The guest shell already centres and pads its child. Without this the page
   adds a second viewport height on top of that padding and the layout
   overflows by exactly 48px, leaving dead background below the card. */
.app-main--guest:has(.login-page) { padding: 0; }

.login-page {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 24px;
  /* Starfield dust over the canvas, plus two soft indigo glows. */
  background:
    radial-gradient(1px 1px at 12% 22%, rgba(99, 102, 241, .30) 50%, transparent 50%),
    radial-gradient(1px 1px at 28% 68%, rgba(99, 102, 241, .22) 50%, transparent 50%),
    radial-gradient(1.4px 1.4px at 44% 14%, rgba(99, 102, 241, .24) 50%, transparent 50%),
    radial-gradient(1px 1px at 62% 78%, rgba(99, 102, 241, .20) 50%, transparent 50%),
    radial-gradient(1.6px 1.6px at 78% 34%, rgba(99, 102, 241, .26) 50%, transparent 50%),
    radial-gradient(1px 1px at 88% 62%, rgba(99, 102, 241, .20) 50%, transparent 50%),
    radial-gradient(1px 1px at 8% 88%, rgba(99, 102, 241, .18) 50%, transparent 50%),
    radial-gradient(1200px 620px at 78% -10%, rgba(129, 140, 248, .16), transparent 62%),
    radial-gradient(900px 520px at 6% 108%, rgba(99, 102, 241, .12), transparent 60%),
    var(--canvas);
  background-size:
    240px 240px, 240px 240px, 240px 240px, 240px 240px,
    240px 240px, 240px 240px, 240px 240px, auto, auto, auto;
}

.login-card {
  width: 100%;
  max-width: 752px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 30px 70px rgba(15, 23, 42, .14);
  display: grid;
  grid-template-columns: 1.02fr .98fr;
  overflow: hidden;
  animation: oltRise .45s ease-out both;
}

/* ------------------------------- left pane ------------------------------ */

.login-form-pane {
  padding: 34px 34px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.login-brand { display: flex; align-items: center; gap: 11px; }
.login-brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 13px;
  background: linear-gradient(145deg, var(--accent-bright), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  box-shadow: var(--sh-accent);
  font: 800 15px/1 var(--font);
  color: var(--paper);
  letter-spacing: -.5px;
}
.login-brand-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.login-brand-name { font: 800 15px/1 var(--font); color: var(--ink); letter-spacing: -.3px; white-space: nowrap; }
.login-brand-sub { font: 500 9.5px/1 var(--mono); color: var(--muted); letter-spacing: .1em; white-space: nowrap; }

.login-heading { display: flex; flex-direction: column; gap: 7px; }
.login-heading h1 { margin: 0; font: 800 25px/1.1 var(--font); color: var(--ink); letter-spacing: -.9px; }
.login-heading p { margin: 0; font: 500 12.5px/1.6 var(--font); color: var(--muted); text-wrap: pretty; }

.login-form { display: flex; flex-direction: column; gap: 13px; }
.login-field { display: flex; flex-direction: column; gap: 7px; }
.login-field-label { font: 700 11px/1 var(--font); color: var(--ink-3); }
.login-field-labelrow { display: flex; align-items: center; }
.login-field-labelrow .login-field-label { flex: 1; }
.login-field-link { font: 700 10.5px/1 var(--font); }

/* The control is a bordered row; the native input sits inside it borderless so
   the icon, the input and the reveal toggle share one focus ring. */
.login-control {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 42px;
  padding: 0 11px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--sunken);
  transition: border-color var(--t), background var(--t), box-shadow var(--t);
}
.login-control:focus-within {
  border-color: var(--accent-line-strong);
  background: var(--paper);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.login-control svg { flex: none; }
.login-control input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  outline: none;
  font: 600 12.5px var(--font);
  color: var(--ink);
}
.login-control input[type="password"] { letter-spacing: .04em; }
.login-reveal {
  width: 24px;
  height: 24px;
  border: 0;
  padding: 0;
  border-radius: var(--r-sm);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: none;
  transition: background var(--t-fast);
}
.login-reveal:hover { background: var(--accent-soft); }

.login-caps {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border-radius: var(--r-md);
  background: var(--warn-wash);
  border: 1px solid var(--warn-line);
  margin-top: -4px;
  font: 600 11px/1.3 var(--font);
  color: #8a6410;
}
.login-caps[hidden] { display: none; }

.login-remember { display: flex; align-items: center; gap: 9px; }
.login-remember-text { font: 600 11.5px/1 var(--font); color: var(--ink-2); }
.login-remember-note { margin-left: auto; font: 600 10px/1 var(--mono); color: var(--muted-2); white-space: nowrap; }

.login-submit {
  height: 42px;
  border-radius: var(--r-lg);
  border: 1px solid var(--accent-dark);
  background: linear-gradient(145deg, var(--accent-grad-a), var(--accent));
  color: var(--paper);
  font: 800 13px var(--font);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  box-shadow: var(--sh-accent);
  transition: transform var(--t), filter var(--t), box-shadow var(--t);
}
.login-submit:hover { transform: translateY(-1px); filter: brightness(1.06); box-shadow: var(--sh-accent-lift); }
.login-submit[disabled] { cursor: progress; }
.login-submit-spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: var(--paper);
  animation: oltSpin .8s linear infinite;
  flex: none;
}
.login-submit-spinner[hidden] { display: none; }

.login-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 4px; }
.login-foot-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
  flex: none;
  animation: oltPulse 2.4s ease-in-out infinite;
}
.login-foot-text {
  font: 500 10.5px/1 var(--mono);
  color: var(--muted-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ------------------------------ right pane ------------------------------ */

.login-visual {
  position: relative;
  overflow: hidden;
  background: radial-gradient(120% 100% at 20% 0%, #1e1b4b 0%, #312e81 45%, #0f172a 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 32px;
  min-height: 480px;
}
.login-visual-glow,
.login-visual-glow--alt { position: absolute; filter: blur(8px); }
.login-visual-glow {
  top: -24%; left: -18%; width: 150%; height: 150%;
  background: radial-gradient(closest-side, rgba(129, 140, 248, .42), transparent 70%);
  animation: loginDrift 14s ease-in-out infinite;
}
.login-visual-glow--alt {
  bottom: -30%; right: -24%; width: 120%; height: 120%;
  background: radial-gradient(closest-side, rgba(56, 189, 248, .22), transparent 70%);
  filter: blur(10px);
  animation: loginDrift 18s ease-in-out 2s infinite reverse;
}

/* Stars are emitted by ui/login.js from a fixed seed, so the field is stable
   between renders rather than flickering on every reload. */
.login-star { position: absolute; border-radius: 50%; }

.login-shoot {
  position: absolute;
  border-radius: 9px;
  opacity: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), #ffffff);
}
.login-shoot--a { top: 16%; left: 6%; width: 52px; height: 2px; animation: loginShoot 6s ease-in 1.5s infinite; }
.login-shoot--b {
  top: 44%; left: 22%; width: 38px; height: 1.6px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(199, 210, 254, .9));
  animation: loginShoot 8s ease-in 4s infinite;
}

.login-orbit {
  position: absolute;
  top: 46px;
  left: 50%;
  width: 250px;
  height: 250px;
  margin-left: -125px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .5s cubic-bezier(.22, .61, .36, 1);
}
.login-orbit-ring { position: absolute; border-radius: 50%; }
.login-orbit-ring--1 { inset: 0; border: 1px dashed rgba(199, 210, 254, .28); animation: loginOrbit 34s linear infinite; }
.login-orbit-ring--2 { inset: 34px; border: 1px solid rgba(199, 210, 254, .2); animation: loginOrbitRev 22s linear infinite; }
.login-orbit-ring--3 { inset: 66px; border: 1px dashed rgba(255, 255, 255, .22); animation: loginOrbit 15s linear infinite; }
.login-orbit-sat {
  position: absolute;
  border-radius: 50%;
  background: #ffffff;
}
.login-orbit-sat--1 {
  top: 0; left: 50%; width: 9px; height: 9px; margin-left: -4.5px;
  box-shadow: 0 0 12px rgba(255, 255, 255, .9);
  transform-origin: 4.5px 125px;
  animation: loginOrbit 34s linear infinite;
}
.login-orbit-sat--2 {
  top: 34px; left: 50%; width: 7px; height: 7px; margin-left: -3.5px;
  background: #a5b4fc;
  box-shadow: 0 0 12px rgba(165, 180, 252, .9);
  transform-origin: 3.5px 91px;
  animation: loginOrbitRev 22s linear infinite;
}
.login-orbit-wave { position: absolute; inset: 98px; border-radius: 50%; border: 1px solid rgba(165, 180, 252, .5); animation: oltWave 3.4s ease-out infinite; }
.login-orbit-wave--delayed { border-color: rgba(165, 180, 252, .4); animation-delay: 1.7s; }
.login-orbit-core {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, .06));
  border: 1px solid rgba(255, 255, 255, .28);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}
.login-orbit-core circle[data-wave] { transform-origin: 12px 12px; animation: oltWave 2.4s ease-out infinite; }
.login-orbit-core circle[data-wave="2"] { animation-delay: .8s; }

.login-visual-copy { position: relative; display: flex; flex-direction: column; gap: 11px; }
.login-visual-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 25px;
  padding: 0 10px;
  border-radius: var(--r);
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .2);
  align-self: flex-start;
  backdrop-filter: blur(6px);
  font: 700 9.5px/1 var(--mono);
  color: #ffffff;
  letter-spacing: .08em;
  white-space: nowrap;
}
.login-visual-badge span[data-dot] {
  width: 6px; height: 6px; border-radius: 50%;
  background: #4bdc9c;
  animation: oltPulse 2.4s ease-in-out infinite;
}
.login-visual-title { font: 800 21px/1.25 var(--font); color: #ffffff; letter-spacing: -.6px; text-wrap: pretty; }
.login-visual-body { font: 500 12px/1.6 var(--font); color: rgba(255, 255, 255, .62); text-wrap: pretty; max-width: 330px; }

@keyframes loginDrift { 0%, 100% { transform: translate3d(0, 0, 0); } 50% { transform: translate3d(-16px, 12px, 0); } }
@keyframes loginOrbit { to { transform: rotate(360deg); } }
@keyframes loginOrbitRev { to { transform: rotate(-360deg); } }
@keyframes loginTwinkle { 0%, 100% { opacity: .16; transform: scale(.7); } 50% { opacity: 1; transform: scale(1); } }
@keyframes loginShoot {
  0% { transform: translate3d(-40px, -30px, 0) scaleX(.4); opacity: 0; }
  12% { opacity: 1; }
  55% { opacity: 1; }
  100% { transform: translate3d(240px, 180px, 0) scaleX(1); opacity: 0; }
}

/* Below the split's comfortable width the visual pane stops earning its space. */
@media (max-width: 820px) {
  .login-card { grid-template-columns: 1fr; max-width: 460px; }
  .login-visual { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .login-card,
  .login-star,
  .login-shoot,
  .login-orbit-ring,
  .login-orbit-sat,
  .login-orbit-wave,
  .login-visual-glow,
  .login-visual-glow--alt,
  .login-submit-spinner,
  .login-foot-dot { animation: none !important; }
  .login-orbit { transition: none !important; }
}
