/* NephScola login experience. Intentionally isolated from authenticated screens. */
body:has(#loginScreen:not(.hidden)) {
  overflow: hidden;
}

#loginScreen.login-screen {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  overflow: hidden;
  background: var(--neph-cloud, #f3f5f8);
}

#loginScreen .login-showcase {
  position: relative;
  display: block;
  min-width: 0;
  min-height: 0;
  height: 100%;
  padding: 0;
  overflow: hidden;
  isolation: isolate;
  background: #07284c;
}

#loginScreen .login-showcase::before {
  content: none;
}

#loginScreen .login-showcase-logo {
  position: absolute;
  z-index: 6;
  top: clamp(28px, 4vh, 40px);
  left: clamp(32px, 4vw, 44px);
  width: clamp(150px, 11vw, 188px);
  max-height: 68px;
  margin: 0;
  object-fit: contain;
  object-position: left center;
  filter: drop-shadow(0 1px 2px rgba(255, 255, 255, .82)) drop-shadow(0 4px 12px rgba(7, 40, 76, .16));
}

#loginScreen .login-carousel,
#loginScreen .login-slides {
  position: absolute;
  inset: 0;
  z-index: auto;
  width: 100%;
  min-height: 0;
}

#loginScreen .login-carousel {
  display: block;
}

#loginScreen .login-slide {
  position: absolute;
  inset: 0;
  display: block;
  padding: 0;
  visibility: hidden;
  opacity: 0;
  transform: translateX(28px);
  text-align: left;
  transition: opacity .45s ease, transform .45s ease, visibility .45s ease;
}

#loginScreen .login-slide::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to top,
    rgba(9, 93, 195, .99) 0%,
    rgba(9, 93, 195, .94) 18%,
    rgba(9, 93, 195, .76) 32%,
    rgba(9, 93, 195, .4) 47%,
    rgba(9, 93, 195, .08) 58%,
    rgba(9, 93, 195, 0) 68%);
}

#loginScreen .login-slide.active {
  visibility: visible;
  opacity: 1;
  transform: translateX(0);
}

#loginScreen .login-slide-photo {
  position: relative;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
}

#loginScreen .login-slide-one .login-slide-photo { object-position: center 35%; }
#loginScreen .login-slide-two .login-slide-photo { object-position: center 34%; }
#loginScreen .login-slide-three .login-slide-photo { object-position: center 30%; }
#loginScreen .login-slide-four .login-slide-photo { object-position: center 30%; }
#loginScreen .login-slide-five .login-slide-photo { object-position: center 27%; }

#loginScreen .login-slide-copy {
  position: absolute;
  z-index: 2;
  right: 8%;
  bottom: clamp(116px, 15.5vh, 174px);
  left: 9%;
  color: #fff;
  text-align: center;
}

#loginScreen .login-slide h2 {
  max-width: 680px;
  margin: 0 auto;
  color: #fff;
  font-family: "Montserrat", "Segoe UI", Arial, sans-serif;
  font-size: clamp(30px, calc(2.7vw - 2px), 46px);
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -.025em;
  text-shadow: 0 2px 16px rgba(7, 40, 76, .22);
}

#loginScreen .login-slide p {
  max-width: 650px;
  margin: 12px auto 0;
  color: rgba(255, 255, 255, .98);
  font-size: clamp(16px, calc(1.25vw - 1px), 20px);
  line-height: 1.45;
  font-weight: 500;
  text-shadow: 0 2px 12px rgba(7, 40, 76, .18);
}

#loginScreen .login-carousel-controls {
  position: absolute;
  z-index: 7;
  right: 8%;
  bottom: clamp(38px, 5.5vh, 60px);
  left: 9%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

#loginScreen .login-carousel-controls > button {
  width: 44px;
  height: 44px;
  border-color: rgba(255, 255, 255, .68);
  color: #fff;
  background: rgba(7, 40, 76, .14);
  backdrop-filter: blur(4px);
}

#loginScreen .login-carousel-controls > button:hover,
#loginScreen .login-carousel-controls > button:focus-visible {
  background: rgba(255, 255, 255, .2);
  outline: 2px solid #fff;
  outline-offset: 2px;
}

#loginScreen .login-carousel-dots {
  border: 0 !important;
  background: transparent !important;
}

#loginScreen .login-carousel-dots button {
  width: 10px;
  height: 10px;
  color: transparent !important;
  border: 0 !important;
  background: rgba(255, 255, 255, .36) !important;
}

#loginScreen .login-carousel-dots button.active {
  width: 10px;
  border-radius: 50%;
  background: #fff !important;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .16);
}

#loginScreen .login-carousel-dots button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

#loginScreen .login-access-area {
  position: relative;
  display: grid;
  grid-template-rows: 62px minmax(0, 1fr) auto;
  place-items: stretch;
  min-width: 0;
  min-height: 0;
  height: 100%;
  padding: 18px clamp(24px, 3.2vw, 58px) 14px;
  overflow: hidden;
  background: var(--neph-cloud, #f3f5f8);
}

#loginScreen .login-language {
  position: static;
  z-index: 5;
  justify-self: end;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  width: 136px;
  min-width: 0;
  height: 46px;
  padding: 3px;
  border-color: var(--neph-border, #dce3ec);
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 8px 20px rgba(7, 40, 76, .08);
}

#loginScreen .login-language button {
  min-width: 0;
  height: 38px;
  border-radius: 999px;
  color: var(--neph-ink, #17253a);
  transition: color .18s ease, background .18s ease;
}

#loginScreen .login-language button.active {
  color: #fff;
  background: var(--neph-blue, #0c6ee5);
}

#loginScreen .login-language button:focus-visible {
  outline: 2px solid var(--neph-blue, #0c6ee5);
  outline-offset: 2px;
}

#loginScreen .login-card-stage {
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 6px 0 10px;
}

#loginScreen .login-card {
  width: min(calc(536px - 2cm), 100%);
  max-height: 100%;
  padding: 26px clamp(28px, 3vw, 40px) 24px;
  border: 1px solid var(--neph-border, #dce3ec);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(7, 40, 76, .11);
  text-align: center;
}

#loginScreen .login-product-logo {
  width: 82px;
  height: 82px;
  margin: 0 auto 8px;
  object-fit: contain;
}

#loginScreen .login-card h1 {
  margin: 0;
  color: var(--neph-ink, #17253a);
  font-size: 30px;
  line-height: 1.12;
}

#loginScreen .login-subtitle {
  margin: 7px 0 20px;
  color: var(--neph-slate, #66758a);
  font-size: 14px;
}

#loginScreen .login-form {
  gap: 12px;
}

#loginScreen .demo-account-selector {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--neph-border, #dce3ec) !important;
  border-radius: 10px;
  background: #fff !important;
}

#loginScreen .demo-account-selector button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  min-height: 44px;
  padding: 7px 9px;
  border: 0;
  border-radius: 0;
  color: var(--neph-slate, #66758a) !important;
  border-color: var(--neph-border, #dce3ec) !important;
  background: #fff !important;
  font-size: 13px;
  font-weight: 700;
  transition: color .18s ease, background .18s ease;
}

#loginScreen .demo-account-selector button + button {
  border-left: 1px solid var(--neph-border, #dce3ec);
}

#loginScreen .demo-account-selector button:hover {
  color: var(--neph-blue, #0c6ee5) !important;
  background: #eef6ff !important;
}

#loginScreen .demo-account-selector button.active {
  color: #fff !important;
  border-bottom-color: var(--neph-blue, #0c6ee5) !important;
  background: var(--neph-blue, #0c6ee5) !important;
  box-shadow: none;
}

#loginScreen .demo-account-selector button:focus-visible {
  z-index: 2;
  outline: 2px solid var(--neph-blue, #0c6ee5);
  outline-offset: -3px;
}

#loginScreen .demo-account-selector svg,
#loginScreen .login-submit > svg {
  flex: 0 0 auto;
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#loginScreen .login-form-fields {
  display: grid;
  gap: 11px;
}

#loginScreen .login-form label {
  gap: 6px;
  color: var(--neph-ink, #17253a);
  font-size: 13px;
}

#loginScreen .login-form .login-input-wrap input {
  height: 46px;
  padding: 9px 46px;
  border-color: var(--neph-border, #dce3ec);
  border-radius: 9px;
  color: var(--neph-ink, #17253a);
  background: #fff;
  font-size: 14px;
}

#loginScreen .login-form .login-input-wrap input:focus {
  border-color: var(--neph-blue, #0c6ee5);
  box-shadow: 0 0 0 3px rgba(12, 110, 229, .12);
}

#loginScreen .login-input-wrap > svg {
  left: 14px;
  width: 19px;
  height: 19px;
}

#loginScreen .password-toggle {
  right: 4px;
  width: 40px;
  height: 40px;
}

#loginScreen .password-toggle:focus-visible {
  border-radius: 7px;
  outline: 2px solid var(--neph-blue, #0c6ee5);
  outline-offset: -3px;
}

#loginScreen .login-options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 24px;
}

#loginScreen .remember-login {
  display: inline-flex;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  color: var(--neph-slate, #66758a);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

#loginScreen .remember-login input {
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  accent-color: var(--neph-blue, #0c6ee5);
}

#loginScreen .forgot-password {
  justify-self: auto;
  min-height: 24px;
  margin: 0;
  padding: 2px 0;
  color: var(--neph-blue, #0c6ee5);
  font-size: 13px;
  text-decoration: none;
}

#loginScreen .forgot-password:hover { text-decoration: underline; }
#loginScreen .forgot-password:focus-visible { outline: 2px solid var(--neph-blue, #0c6ee5); outline-offset: 2px; }

#loginScreen .login-submit {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 46px;
  margin: 0;
  border-radius: 9px;
  background: linear-gradient(100deg, #0c6ee5 0%, #0c6ee5 75%, #3b91f7 88%, #6159fc 100%);
  box-shadow: 0 12px 24px rgba(12, 110, 229, .22);
  font-size: 15px;
}

#loginScreen .login-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 15px 28px rgba(12, 110, 229, .28);
}

#loginScreen .login-submit:focus-visible {
  outline: 3px solid rgba(12, 110, 229, .3);
  outline-offset: 3px;
}

#loginScreen .login-submit:disabled { cursor: wait; opacity: .82; }
#loginScreen .login-submit-spinner { display: none; width: 17px; height: 17px; border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff; border-radius: 50%; animation: nephscola-login-spin .75s linear infinite; }
#loginScreen .login-submit.is-loading > svg { display: none; }
#loginScreen .login-submit.is-loading .login-submit-spinner { display: block; }

@keyframes nephscola-login-spin { to { transform: rotate(360deg); } }

#loginScreen .login-demo-box {
  grid-template-columns: 21px minmax(0, 1fr);
  gap: 10px;
  margin: 0;
  padding: 10px 12px;
  border-color: #cfe2f7;
  border-radius: 8px;
  color: #245b9b;
  background: #f2f7fe;
}

#loginScreen .login-demo-box svg { width: 19px; height: 19px; }
#loginScreen .login-demo-box p { gap: 2px; font-size: 12px; line-height: 1.3; }
#loginScreen .login-demo-box strong { color: #0c58bc; }
#loginScreen .login-demo-box.is-unavailable { border-color: #f0d7a3; color: #765414; background: #fff9ec; }
#loginScreen .login-demo-box.is-unavailable svg { stroke: #b87508; }
#loginScreen .login-demo-box.is-unavailable strong { color: #8b5a08; }

#loginScreen .login-error {
  min-height: 0;
  margin: 0;
  font-size: 12px;
  line-height: 1.25;
}

#loginScreen .login-error:empty { display: none; }

#loginScreen .login-footer {
  position: static;
  justify-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: 30px;
  transform: none;
  color: var(--neph-slate, #66758a);
  font-size: 11px;
  white-space: nowrap;
}

#loginScreen .login-footer i {
  flex: 0 0 1px;
  width: 1px;
  height: 14px;
  background: #cbd3de;
}

#loginScreen .login-footer a:focus-visible {
  color: var(--neph-blue, #0c6ee5);
  outline: 2px solid var(--neph-blue, #0c6ee5);
  outline-offset: 2px;
}

/* Give the desktop card room to breathe while preserving an approximately
   2 cm visual gap from the language switch and the legal footer. */
@media (min-width: 901px) and (min-height: 801px) {
  #loginScreen .login-card {
    padding-top: 48px;
    padding-bottom: 46px;
  }

  #loginScreen .login-subtitle { margin-bottom: 28px; }
  #loginScreen .login-form { gap: 15px; }
  #loginScreen .login-form-fields { gap: 14px; }
}

@media (min-width: 901px) and (max-height: 800px) {
  #loginScreen .login-access-area { grid-template-rows: 48px minmax(0, 1fr) auto; padding-top: 10px; padding-bottom: 8px; }
  #loginScreen .login-language { width: 126px; height: 40px; }
  #loginScreen .login-language button { height: 32px; font-size: 12px; }
  #loginScreen .login-card-stage { padding: 2px 0 6px; }
  #loginScreen .login-card { width: min(calc(510px - 2cm), 100%); padding: 25px 30px 23px; border-radius: 18px; }
  #loginScreen .login-product-logo { width: 58px; height: 58px; margin-bottom: 4px; }
  #loginScreen .login-card h1 { font-size: 25px; }
  #loginScreen .login-subtitle { margin: 4px 0 12px; font-size: 12px; }
  #loginScreen .login-form { gap: 8px; }
  #loginScreen .demo-account-selector button { min-height: 38px; padding-block: 5px; font-size: 12px; }
  #loginScreen .demo-account-selector svg { width: 17px; height: 17px; }
  #loginScreen .login-form-fields { gap: 8px; }
  #loginScreen .login-form label { gap: 4px; font-size: 12px; }
  #loginScreen .login-form .login-input-wrap input { height: 40px; }
  #loginScreen .password-toggle { height: 36px; }
  #loginScreen .login-options-row { min-height: 20px; }
  #loginScreen .login-submit { height: 40px; }
  #loginScreen .login-demo-box { padding: 7px 10px; }
  #loginScreen .login-footer { min-height: 22px; gap: 9px; font-size: 10px; }
  #loginScreen .login-slide-copy { bottom: 110px; }
  #loginScreen .login-slide h2 { font-size: clamp(27px, calc(2.6vw - 2px), 37px); }
  #loginScreen .login-slide p { margin-top: 8px; font-size: clamp(14px, calc(1.15vw - 1px), 17px); }
  #loginScreen .login-carousel-controls { bottom: 34px; }
}

@media (min-width: 901px) and (max-width: 1280px) {
  #loginScreen.login-screen { grid-template-columns: 48% 52%; }
  #loginScreen .login-access-area { padding-inline: 24px; }
  #loginScreen .login-footer { gap: 8px; font-size: 9.5px; }
  #loginScreen .login-slide-copy { right: 7%; left: 7%; }
  #loginScreen .login-carousel-controls { right: 7%; left: 7%; }
}

@media (min-width: 901px) {
  #loginScreen .login-access-area {
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  #loginScreen .login-card-stage {
    place-items: stretch center;
    padding: 0.8cm 0 1.1cm;
  }

  #loginScreen .login-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
  }

  #loginScreen .login-demo-box {
    align-items: center;
    height: 112px;
    min-height: 112px;
  }
}

@media (max-width: 900px) {
  body:has(#loginScreen:not(.hidden)) { overflow: auto; }
  #loginScreen.login-screen { display: flex; min-height: 100vh; height: auto; overflow: visible; }
  #loginScreen .login-showcase { display: none; }
  #loginScreen .login-access-area { flex: 1; grid-template-rows: 54px minmax(0, 1fr) auto; min-height: 100vh; height: auto; padding: 14px 20px 18px; overflow: visible; }
  #loginScreen .login-card-stage { padding: 12px 0 18px; }
  #loginScreen .login-card { max-height: none; }
  #loginScreen .login-language { width: 124px; height: 40px; }
  #loginScreen .login-language button { height: 32px; }
  #loginScreen .login-footer { flex-wrap: wrap; white-space: normal; }
}

@media (max-width: 620px) {
  body:has(#loginScreen:not(.hidden)) { overflow: hidden; }
  #loginScreen.login-screen { height: 100dvh; min-height: 0; overflow: hidden; }
  #loginScreen .login-access-area {
    grid-template-rows: 34px minmax(0, 1fr) auto;
    align-content: stretch;
    row-gap: 8px;
    height: 100dvh;
    min-height: 0;
    padding: .5cm .35cm;
    overflow: hidden;
  }
  #loginScreen .login-language { width: 108px; height: 34px; }
  #loginScreen .login-language button { height: 28px; font-size: 11px; }
  #loginScreen .login-card-stage { min-height: 0; padding: 0; }
  #loginScreen .login-card { display: flex; flex-direction: column; justify-content: center; height: 100%; padding: 15px 16px; border-radius: 18px; box-shadow: 0 8px 24px rgba(7, 40, 76, .07); }
  #loginScreen .login-product-logo { width: 56px; height: 56px; margin-bottom: 2px; }
  #loginScreen .login-card h1 { font-size: 25px; line-height: 1.1; }
  #loginScreen .login-subtitle { margin: 4px 0 9px; font-size: 11px; }
  #loginScreen .login-form { flex: none; align-content: normal; gap: 8px; }
  #loginScreen .login-form-fields { gap: 8px; }
  #loginScreen .demo-account-selector button { min-height: 36px; gap: 3px; padding-inline: 4px; font-size: 10px; }
  #loginScreen .demo-account-selector svg { width: 15px; height: 15px; }
  #loginScreen .demo-account-selector button.active { border-bottom-color: var(--neph-navy, #07284c) !important; background: var(--neph-navy, #07284c) !important; }
  #loginScreen .login-form label { gap: 3px; font-size: 11px; }
  #loginScreen .login-form .login-input-wrap input { height: 40px; border-color: #b9cada !important; background-color: #eef3f8 !important; font-size: 13px; }
  #loginScreen .login-input-wrap > svg { width: 17px; height: 17px; }
  #loginScreen .password-toggle { width: 34px; height: 34px; }
  #loginScreen .login-options-row { min-height: 20px; align-items: center; gap: 8px; }
  #loginScreen .remember-login, #loginScreen .forgot-password { font-size: 10.5px; }
  #loginScreen .remember-login input { width: 16px; height: 16px; }
  #loginScreen .login-submit { height: 41px; margin-block: 2px 3px; font-size: 13px; }
  #loginScreen .login-demo-box { display: grid; min-height: 56px; padding: 7px 9px; }
  #loginScreen .login-demo-box svg { width: 17px; height: 17px; }
  #loginScreen .login-demo-box p { font-size: 10.5px; line-height: 1.22; }
  #loginScreen .login-footer {
    display: grid;
    grid-template-columns: repeat(4, auto);
    align-content: center;
    justify-content: center;
    gap: 1px 7px;
    min-height: 36px;
    font-size: 10.5px;
    line-height: 1.2;
  }
  #loginScreen .login-footer i { display: none; }
  #loginScreen .login-footer span { grid-column: 1 / -1; text-align: center; }
  #loginScreen .login-footer a { white-space: nowrap; }
}

@media (max-width: 620px) and (max-height: 600px) {
  #loginScreen .login-access-area { padding-block: 6px; }
  #loginScreen .login-card { height: auto; padding: 14px 16px 12px; }
  #loginScreen .login-product-logo { width: 54px; height: 54px; }
  #loginScreen .login-card h1 { font-size: 24px; }
  #loginScreen .login-subtitle { margin: 3px 0 7px; }
  #loginScreen .login-form { flex: none; align-content: normal; gap: 7px; }
  #loginScreen .login-form-fields { gap: 7px; }
  #loginScreen .login-form .login-input-wrap input { height: 39px; }
  #loginScreen .login-submit { height: 40px; margin-block: 1px 2px; }
  #loginScreen .login-demo-box { min-height: 56px; }
  #loginScreen .login-footer { min-height: 42px; font-size: 11px; }
}

/* When the mobile keyboard reduces the visual viewport, keep the credentials
   and submit action directly above it instead of letting the keyboard overlap. */
@media (max-width: 620px) and (max-height: 500px) {
  #loginScreen .login-access-area {
    grid-template-rows: minmax(0, 1fr);
    padding: 4px .35cm;
  }
  #loginScreen .login-language,
  #loginScreen .login-footer,
  #loginScreen .login-demo-box { display: none; }
  #loginScreen .login-card-stage { place-items: end center; overflow-y: auto; scroll-padding-block: 8px; scrollbar-width: none; }
  #loginScreen .login-card-stage::-webkit-scrollbar { display: none; }
  #loginScreen .login-card { flex: none; height: auto; padding: 7px 16px 8px; border-radius: 14px; }
  #loginScreen .login-product-logo { display: block; width: 56px; height: 56px; margin-bottom: 2px; }
  #loginScreen .login-card h1 { display: block; font-size: 25px; line-height: 1.1; }
  #loginScreen .login-subtitle { display: block; margin: 4px 0 9px; font-size: 11px; line-height: normal; }
  #loginScreen .login-form { flex: none; align-content: normal; gap: 8px; }
  #loginScreen .login-form-fields { gap: 8px; }
  #loginScreen .login-form label { gap: 3px; font-size: 11px; }
  #loginScreen .demo-account-selector button { min-height: 36px; }
  #loginScreen .login-form .login-input-wrap input { height: 40px; }
  #loginScreen .login-options-row { min-height: 20px; }
  #loginScreen .login-submit { height: 41px; margin: 2px 0 3px; }
}

@media (prefers-reduced-motion: reduce) {
  #loginScreen .login-slide { transition-duration: .01ms; }
  #loginScreen .login-submit-spinner { animation-duration: 1.5s; }
}

/* Phase 1 runtime login capabilities remain reversible, but hidden controls must not be revived by component display rules. */
#loginScreen .demo-account-selector[hidden],
#loginScreen .login-demo-box[hidden],
#loginScreen .forgot-password[hidden] {
  display: none !important;
}