:root {
  --msr-blue: #2e9af5;
  --msr-blue-soft: #8bc9ff;
  --msr-blue-deep: #0c7ad8;
  --panel-bg: rgba(9, 20, 35, 0.68);
  --panel-border: rgba(123, 160, 200, 0.26);
  --panel-glass: rgba(11, 24, 38, 0.82);
  --text: #edf5ff;
  --muted: rgba(213, 226, 240, 0.76);
  --space-1: #010812;
  --space-2: #061a29;
  --space-3: #0b2240;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background: var(--space-1);
  color: var(--text);
}

body.login-page {
  font-family: "DM Sans", Arial, sans-serif;
  overflow-x: hidden;
}

.login-scene {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background-image: url('Background_image.png');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}

.login-scene::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(2, 9, 17, 0.20), rgba(2, 9, 17, 0.34) 42%, rgba(1, 7, 14, 0.58));
  z-index: 0;
}

.login-header,
.login-content,
.login-footer {
  position: relative;
  z-index: 3;
  width: min(1260px, calc(100% - 96px));
  margin: 0 auto;
}

.login-header {
  display: flex;
  align-items: center;
  padding-top: 24px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  text-decoration: none;
  filter: drop-shadow(0 4px 12px rgba(58, 120, 206, 0.12));
}

.brand-mark img {
  display: block;
  width: 170px;
  height: 60px;
  object-fit: contain;
  filter: brightness(1.08) saturate(1.05);
}

.brand-tagline {
  margin: 52px 0 0 -172px;
  font-size: 10px;
  line-height: 1;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(220, 233, 245, 0.76);
}

.header-values {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(223, 233, 245, 0.86);
  white-space: nowrap;
}

.header-values b {
  color: var(--msr-blue-soft);
  font-weight: 500;
}

.login-content {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(310px, 410px);
  gap: 90px;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 170px);
  padding: 10px 0 72px;
}

.login-intro {
  position: relative;
  z-index: 4;
  padding-top: 0;
  align-self: start;
}

.hero-box {
  position: relative;
  display: block;
  width: 100%;
  min-height: 1px;
}

.login-intro h1 em {
  display: inline-block;
  color: var(--msr-blue-soft);
  font-style: normal;
}

.login-card {
  position: relative;
  z-index: 4;
  width: min(100%, 430px);
  margin-left: auto;
  margin-right: 0;
  justify-self: end;
  align-self: center;
  padding: 30px 28px 28px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(10, 20, 32, 0.78), rgba(8, 18, 29, 0.72));
  border: 1px solid rgba(143, 184, 224, 0.22);
  box-shadow: 0 26px 48px rgba(1, 9, 18, 0.56), inset 0 1px 0 rgba(255,255,255,.04);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: cardReveal .75s ease-out both;
}

.login-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent 32%, rgba(8,20,30,.22));
  pointer-events: none;
}

.login-card h2,
.login-card p.sub,
.err,
.form,
.form-options,
.submit-button {
  position: relative;
  z-index: 1;
}

.login-card h2 {
  margin: 0 0 8px;
  font-size: 30px;
  line-height: 1.1;
  font-weight: 700;
  color: #f3f8ff;
}

.login-card p.sub {
  margin: 0 0 24px;
  color: rgba(198, 214, 226, 0.86);
  font-size: 14px;
}

.err {
  margin: -2px 0 18px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(158, 90, 90, 0.36);
  background: rgba(71, 18, 28, 0.38);
  color: #ffd6d6;
  font-size: 12px;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  height: 52px;
  margin-top: 12px;
  border-radius: 12px;
  background: rgba(17, 35, 50, 0.72);
  border: 1px solid rgba(122, 154, 184, 0.22);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.input-wrap:focus-within {
  border-color: rgba(94, 169, 255, 0.9);
  box-shadow: 0 0 0 3px rgba(55, 146, 255, 0.1);
  transform: translateY(-1px);
}

.input-wrap input {
  width: 100%;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: 14px "DM Sans", Arial, sans-serif;
  padding: 0 16px;
}

.input-wrap input::placeholder {
  color: rgba(212, 223, 234, 0.74);
}


.form-options {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 18px;
  font-size: 12px;
}

.remember-me {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: rgba(223, 233, 245, 0.88);
  cursor: pointer;
}

.remember-me input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.checkmark {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1px solid rgba(142, 180, 220, 0.5);
  background: rgba(14, 28, 40, 0.9);
  display: inline-block;
  position: relative;
}

.remember-me input:checked + .checkmark {
  background: linear-gradient(180deg, #3ca9ff, #1d87e5);
  border-color: rgba(118, 193, 255, 0.8);
}

.remember-me input:checked + .checkmark::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.forgot-link {
  background: transparent;
  border: 0;
  padding: 0;
  color: rgba(175, 219, 255, 0.9);
  text-decoration: none;
  font: 12px "DM Sans", Arial, sans-serif;
  cursor: pointer;
  transition: opacity .18s ease;
}

.forgot-link:hover {
  opacity: 0.85;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(1, 7, 14, 0.7);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .2s ease, visibility .2s ease;
  z-index: 999;
}

.modal-backdrop.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal {
  position: relative;
  width: min(420px, calc(100% - 24px));
  background: linear-gradient(180deg, rgba(10, 20, 32, 0.96), rgba(8, 18, 29, 0.94));
  border: 1px solid rgba(143, 184, 224, 0.26);
  border-radius: 18px;
  box-shadow: 0 26px 54px rgba(1, 9, 18, 0.56);
  padding: 28px 24px 22px;
  color: var(--text);
  text-align: left;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: #dfeaf7;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.modal h3 {
  margin: 0 0 12px;
  font-size: 28px;
  line-height: 1.2;
  font-weight: 700;
}

.modal p {
  margin: 0 0 18px;
  color: rgba(213, 226, 240, 0.82);
  font-size: 15px;
  line-height: 1.6;
}

.modal-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  padding: 11px 18px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(180deg, #2ea5ff, #1b88ea);
  color: #f3f9ff;
  font: 700 14px/1 "DM Sans", Arial, sans-serif;
  cursor: pointer;
}

.form-options a {
  color: rgba(175, 219, 255, 0.9);
  text-decoration: none;
  font-size: 12px;
  transition: opacity .18s ease;
}

.form-options a:hover {
  opacity: 0.85;
}

.submit-button {
  width: 100%;
  margin-top: 22px;
  padding: 18px 18px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #2ea5ff, #1b88ea);
  color: #f3f9ff;
  font: 700 17px/1 "DM Sans", Arial, sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease, opacity .18s ease;
  box-shadow: 0 14px 24px rgba(25, 126, 217, 0.24);
}

.submit-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 28px rgba(27, 136, 234, 0.30);
  filter: saturate(1.08);
}

.submit-button:active {
  transform: translateY(0);
}

.submit-button .btn-label,
.submit-button .btn-arrow {
  display: inline-block;
  line-height: 1;
}

.submit-button .btn-arrow {
  margin-left: 2px;
  transition: transform .2s ease;
}

.submit-button:hover .btn-arrow {
  transform: translateX(4px);
}

.login-footer {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: min(1260px, calc(100% - 96px));
  color: rgba(222, 232, 242, 0.7);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.login-footer > span:nth-child(1) {
  grid-column: 2;
  justify-self: center;
  text-align: center;
  font-size: 8px;
  letter-spacing: 0.08em;
  color: rgba(224, 234, 244, 0.72);
}

.footer-company {
  grid-column: 3;
  justify-self: end;
  text-align: right;
  line-height: 1.4;
  color: rgba(224, 234, 244, 0.8);
}

.footer-company small {
  display: block;
  font-size: 7px;
  letter-spacing: 0.14em;
  color: rgba(224, 234, 244, 0.75);
}

@keyframes cardReveal {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1180px) {
  .login-content {
    gap: 44px;
  }

  .brand-tagline {
    margin-left: -126px;
  }
}

@media (max-width: 980px) {
  .login-header,
  .login-content,
  .login-footer {
    width: min(100% - 44px, 760px);
  }

  .login-content {
    grid-template-columns: 1fr;
    gap: 26px;
    padding-top: 28px;
  }

  .login-card {
    margin: 0 auto;
    width: min(100%, 430px);
  }

  .login-intro {
    text-align: left;
  }

  .brand-tagline {
    display: none;
  }

  .header-values {
    display: none;
  }
}

@media (max-width: 620px) {
  .login-header,
  .login-content,
  .login-footer {
    width: calc(100% - 28px);
  }

  .brand-mark strong {
    font-size: 40px;
  }

  .brand-mark i {
    height: 39px;
    width: 12px;
  }

  .login-content {
    padding-top: 12px;
    padding-bottom: 110px;
  }

  .login-intro h1 {
    font-size: clamp(34px, 10vw, 52px);
  }

  .intro-copy {
    letter-spacing: 0.2em;
  }

  .intro-stats {
    gap: 16px;
    flex-wrap: wrap;
  }

  .login-card {
    padding: 24px 18px 22px;
  }

  .login-footer {
    grid-template-columns: 1fr 1fr;
    bottom: 18px;
  }

  .login-footer > span:nth-child(2) {
    display: none;
  }

  .footer-company {
    grid-column: 2;
    justify-self: end;
  }
}
/* ============================================================
   Post-login transition screen
   Shown once, immediately after a successful sign-in, before
   handing off to the dashboard. Reuses .login-scene (same
   background image) with an extra darkening layer so the text
   stays readable while Earth/network/glow remain visible.
   ============================================================ */

.login-page--transitioning .login-scene::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(2, 8, 15, 0.42);
}

.msr-transition {
  position: relative;
  z-index: 3;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  gap: 6px;
}

.msr-transition__mark {
  margin-bottom: 22px;
  animation: msrFadeUp .5s ease both;
}
.msr-transition__mark img {
  display: block;
  width: 150px;
  height: auto;
  object-fit: contain;
  filter: brightness(1.08) saturate(1.05);
}

.msr-transition__check {
  width: 54px;
  height: 54px;
  margin-bottom: 22px;
  animation: msrFadeUp .5s ease .1s both;
}
.msr-transition__check svg {
  width: 100%;
  height: 100%;
}
.msr-transition__check-ring {
  fill: none;
  stroke: rgba(94, 169, 255, 0.9);
  stroke-width: 2.5;
  stroke-dasharray: 145;
  stroke-dashoffset: 145;
  animation: msrRingDraw .5s ease-out .1s forwards;
}
.msr-transition__check-mark {
  fill: none;
  stroke: #6fc0ff;
  stroke-width: 3.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 28;
  stroke-dashoffset: 28;
  animation: msrCheckDraw .35s ease-out .42s forwards;
}

.msr-transition__title {
  margin: 0 0 8px;
  font-family: "DM Sans", Arial, sans-serif;
  font-weight: 700;
  font-size: clamp(19px, 2.6vw, 25px);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #f3f8ff;
  transition: opacity .18s ease, transform .18s ease;
  min-height: 1.3em;
}

.msr-transition__subtitle {
  margin: 0 0 30px;
  font-size: 13.5px;
  color: rgba(213, 226, 240, 0.78);
  transition: opacity .18s ease, transform .18s ease;
  min-height: 1.4em;
}

.msr-transition__title.is-swapping,
.msr-transition__subtitle.is-swapping {
  opacity: 0;
  transform: translateY(4px);
}

.msr-transition__bar {
  width: min(340px, 70vw);
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
.msr-transition__bar-fill {
  width: 0%;
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--msr-blue-deep), var(--msr-blue), var(--msr-blue-soft));
  transition: width linear; /* duration is set inline by JS to match TOTAL_MS exactly */
}

@keyframes msrFadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes msrRingDraw {
  to { stroke-dashoffset: 0; }
}
@keyframes msrCheckDraw {
  to { stroke-dashoffset: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .msr-transition__mark,
  .msr-transition__check,
  .msr-transition__check-ring,
  .msr-transition__check-mark {
    animation: none;
  }
  .msr-transition__check-ring,
  .msr-transition__check-mark {
    stroke-dashoffset: 0;
  }
  .msr-transition__title,
  .msr-transition__subtitle {
    transition: none;
  }
}
