/* CLMS 2.0 — premium login styling for installed mobile Home Screen app only.
   Every selector is scoped to the standalone/mobile marker set in index.html.
   Desktop and ordinary mobile-browser portal styles remain unchanged. */

html.clms-mobile-installed-app,
html.clms-mobile-installed-app body {
  min-height: 100%;
  background: #f4f7fc;
}

html.clms-mobile-installed-app body {
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse at 50% -8%, rgba(35, 103, 210, .11), transparent 48%),
    linear-gradient(180deg, #f8faff 0%, #f1f5fb 100%);
}

html.clms-mobile-installed-app .login-shell {
  display: block;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  height: auto;
  overflow: visible;
  padding: 0;
  background: transparent;
}

html.clms-mobile-installed-app .login-panel {
  width: 100%;
  height: auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(26px + env(safe-area-inset-top, 0px)) 22px calc(18px + env(safe-area-inset-bottom, 0px));
  background: transparent;
  animation: clmsMobileLoginEnter .55s cubic-bezier(.2,.75,.25,1) both;
}

html.clms-mobile-installed-app .brand {
  width: 100%;
  min-height: 58px;
  justify-content: center;
  gap: 13px;
  margin: 2px auto 25px;
}

html.clms-mobile-installed-app .brand-logo {
  width: clamp(112px, 31vw, 145px);
  max-width: 42%;
  max-height: 48px;
  object-fit: contain;
  object-position: center;
}

html.clms-mobile-installed-app .brand-divider {
  height: 38px;
  background: #d5dfed;
}

html.clms-mobile-installed-app .brand-product {
  min-width: 0;
  gap: 4px;
}

html.clms-mobile-installed-app .brand-product strong {
  color: #082b70;
  font-size: 24px;
  letter-spacing: -1px;
}

html.clms-mobile-installed-app .brand-product small {
  max-width: 150px;
  color: #71809a;
  font-size: 6px;
  line-height: 1.5;
  letter-spacing: .65px;
  white-space: normal;
}

html.clms-mobile-installed-app .login-content {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: 26px 22px 23px;
  border: 1px solid rgba(214, 224, 239, .92);
  border-radius: 22px;
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 16px 42px rgba(20, 49, 95, .085), 0 2px 7px rgba(20, 49, 95, .035);
  animation: clmsLoginCardEnter .65s cubic-bezier(.2,.75,.25,1) .06s both;
}

html.clms-mobile-installed-app .eyebrow {
  gap: 8px;
  margin-bottom: 12px;
  color: #62738f;
  font-size: 9px;
  letter-spacing: 1.65px;
}

html.clms-mobile-installed-app .eyebrow > span {
  width: 22px;
  height: 3px;
  border-radius: 8px;
}

html.clms-mobile-installed-app .login-content h1 {
  color: #10264b;
  font-size: clamp(29px, 8vw, 35px);
  line-height: 1.15;
  letter-spacing: -1.45px;
}

html.clms-mobile-installed-app .login-description {
  margin: 10px 0 23px;
  color: #73819a;
  font-size: 12px;
  line-height: 1.7;
}

html.clms-mobile-installed-app #loginForm > label {
  margin-bottom: 7px;
  color: #273956;
  font-size: 11px;
  font-weight: 700;
}

html.clms-mobile-installed-app .input-wrap {
  height: 49px;
  gap: 11px;
  margin-bottom: 17px;
  padding: 0 13px;
  border-color: #dce5f1;
  border-radius: 12px;
  background: #fbfcff;
  box-shadow: inset 0 1px 1px rgba(18, 42, 81, .015);
}

html.clms-mobile-installed-app .input-wrap:focus-within {
  border-color: #397ce4;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(35, 104, 220, .09);
  transform: none;
}

html.clms-mobile-installed-app .input-wrap input {
  font-size: 16px;
  color: #14284a;
}

html.clms-mobile-installed-app .input-wrap input::placeholder {
  font-size: 12px;
  color: #9aa8bb;
}

html.clms-mobile-installed-app .input-wrap > svg,
html.clms-mobile-installed-app .password-toggle svg {
  width: 19px;
  height: 19px;
  stroke: #6b7e9e;
}

html.clms-mobile-installed-app .password-toggle {
  width: 34px;
  height: 36px;
  border-radius: 9px;
}

html.clms-mobile-installed-app .form-options {
  gap: 10px;
  margin: 1px 0 20px;
}

html.clms-mobile-installed-app .remember-option {
  gap: 8px;
  color: #52627c;
  font-size: 11px;
}

html.clms-mobile-installed-app .custom-check {
  width: 17px;
  height: 17px;
  border-radius: 5px;
}

html.clms-mobile-installed-app .text-button {
  font-size: 11px;
  white-space: nowrap;
}

html.clms-mobile-installed-app .login-button {
  min-height: 50px;
  height: 50px;
  border-radius: 12px;
  background: linear-gradient(105deg, #082d78 0%, #0758d7 58%, #1671ed 100%);
  box-shadow: 0 9px 20px rgba(7, 72, 177, .2);
  font-size: 13px;
  letter-spacing: .1px;
  touch-action: manipulation;
}

html.clms-mobile-installed-app .login-button:active {
  transform: scale(.985);
  box-shadow: 0 4px 10px rgba(7, 72, 177, .16);
}

html.clms-mobile-installed-app .login-message {
  font-size: 11px;
}

html.clms-mobile-installed-app .social-login-divider {
  gap: 10px;
  margin: 19px 0 12px;
}

html.clms-mobile-installed-app .social-login-divider small {
  font-size: 8px;
  letter-spacing: .8px;
}

html.clms-mobile-installed-app .social-login-btn {
  min-height: 43px;
  border-color: #e0e7f1;
  border-radius: 11px;
  background: #fff;
  font-size: 11px;
  touch-action: manipulation;
}

html.clms-mobile-installed-app .security-note {
  gap: 7px;
  margin-top: 20px;
  color: #7b8aa2;
  font-size: 10px;
  line-height: 1.5;
}

html.clms-mobile-installed-app .login-footer {
  width: 100%;
  max-width: 440px;
  margin: 20px auto 0;
  padding: 0 3px;
  color: #8390a5;
  font-size: 9px;
}

html.clms-mobile-installed-app .footer-status {
  white-space: nowrap;
}

html.clms-mobile-installed-app .developer-credit {
  max-width: 440px;
  margin: 15px auto 0;
  padding: 12px 0 0;
  border-top-color: rgba(210, 221, 237, .8);
}

html.clms-mobile-installed-app .developer-label {
  font-size: 8px;
  letter-spacing: 1.3px;
}

html.clms-mobile-installed-app .developer-details strong {
  color: #344b70;
}

@keyframes clmsMobileLoginEnter {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@media (max-width: 390px) {
  html.clms-mobile-installed-app .login-panel {
    padding-left: 16px;
    padding-right: 16px;
  }
  html.clms-mobile-installed-app .login-content {
    padding: 23px 17px 20px;
    border-radius: 20px;
  }
  html.clms-mobile-installed-app .brand {
    gap: 10px;
    margin-bottom: 20px;
  }
  html.clms-mobile-installed-app .brand-logo {
    width: 104px;
  }
  html.clms-mobile-installed-app .brand-product strong {
    font-size: 22px;
  }
  html.clms-mobile-installed-app .brand-product small {
    font-size: 5.5px;
  }
  html.clms-mobile-installed-app .login-content h1 {
    font-size: 29px;
  }
  html.clms-mobile-installed-app .form-options {
    gap: 6px;
  }
  html.clms-mobile-installed-app .remember-option,
  html.clms-mobile-installed-app .text-button {
    font-size: 10px;
  }
}

@media (max-height: 740px) {
  html.clms-mobile-installed-app .login-panel {
    padding-top: calc(16px + env(safe-area-inset-top, 0px));
  }
  html.clms-mobile-installed-app .brand {
    margin-bottom: 15px;
  }
  html.clms-mobile-installed-app .login-content {
    padding-top: 21px;
    padding-bottom: 19px;
  }
  html.clms-mobile-installed-app .login-description {
    margin-bottom: 17px;
  }
  html.clms-mobile-installed-app .input-wrap {
    margin-bottom: 13px;
  }
  html.clms-mobile-installed-app .security-note {
    margin-top: 14px;
  }
  html.clms-mobile-installed-app .login-footer {
    margin-top: 14px;
  }
  html.clms-mobile-installed-app .developer-credit {
    margin-top: 10px;
    padding-top: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.clms-mobile-installed-app .login-panel,
  html.clms-mobile-installed-app .login-content {
    animation: none;
  }
}

/* FIX: Prevent login screen movement in installed app */
@media (max-width: 768px) {
    html.clms-mobile-installed-app:has(.login-shell) {
        height: 100% !important;
        overflow: hidden !important;
        overscroll-behavior: none !important;
    }

    html.clms-mobile-installed-app:has(.login-shell) body {
        position: fixed !important;
        inset: 0 !important;
        width: 100% !important;
        height: 100% !important;
        overflow: hidden !important;
        overscroll-behavior: none !important;
    }

    html.clms-mobile-installed-app:has(.login-shell) .login-shell {
        height: 100% !important;
        min-height: 100dvh !important;
        overflow: hidden !important;
        overscroll-behavior: none !important;
    }
}
