/*
 * EEIS sign-in workspace
 * Scoped to #screen-login so the authenticated application remains untouched.
 */

#screen-login.login-screen {
  position: absolute;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  color: var(--ink);
  background: #fff;
}

#screen-login.login-screen::before {
  content: none;
}

#screen-login .login-wrap {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: center;
  justify-items: center;
  min-height: 100%;
  padding: max(28px, env(safe-area-inset-top, 0px)) max(18px, env(safe-area-inset-right, 0px)) max(22px, env(safe-area-inset-bottom, 0px)) max(18px, env(safe-area-inset-left, 0px));
}

#screen-login .login-container {
  position: relative;
  width: min(100%, 470px);
  max-width: 470px;
  padding: clamp(28px, 5vw, 44px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 30px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 24px 52px rgba(53, 83, 111, .14), 0 2px 4px rgba(53, 83, 111, .04);
  backdrop-filter: blur(18px);
}

#screen-login .login-container::before {
  top: 0;
  right: 38px;
  left: 38px;
  height: 4px;
  border-radius: 0 0 999px 999px;
  opacity: 1;
  background: linear-gradient(90deg, var(--coral), #ff9a8c);
}

#screen-login .login-container__heading {
  display: grid;
  justify-items: center;
  text-align: center;
}

#screen-login .login-logo-wrap {
  position: relative;
  display: grid;
  width: 76px;
  height: 76px;
  margin: 0 0 19px;
  place-items: center;
}

#screen-login .login-logo-ring {
  position: absolute;
  inset: -7px;
  display: block;
  border: 1px solid rgba(66, 100, 130, .14);
  border-radius: 24px;
  transform: rotate(12deg);
}

#screen-login .login-logo {
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(66, 100, 130, .10);
  border-radius: 22px;
  background: linear-gradient(145deg, #ffffff, #edf4fa);
  box-shadow: 0 10px 20px rgba(53, 83, 111, .11);
}

#screen-login .login-logo img {
  width: 57px;
  height: 57px;
  object-fit: contain;
  border-radius: 14px;
}

#screen-login .login-kicker,
#screen-login .login-showcase__eyebrow {
  display: block;
  color: var(--coral);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .14em;
  line-height: 1.3;
  text-transform: uppercase;
}

#screen-login .login-title {
  margin: 7px 0 0;
  color: var(--navy-dark);
  font-size: clamp(25px, 5vw, 32px);
  font-weight: 800;
  letter-spacing: -.035em;
  line-height: 1.15;
}

#screen-login .login-subtitle {
  max-width: 285px;
  margin: 9px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.6;
}

/* Decorative fingerprint flourish — a subtle scan-line sweeps up and down
   over the icon on a loop. Purely visual, no biometric prompt behind it. */
#screen-login .login-fingerprint {
  position: relative;
  width: 46px;
  height: 46px;
  margin: 16px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--coral-soft, rgba(255, 107, 87, .12));
  color: var(--coral, #ff6b57);
  overflow: hidden;
}
#screen-login .login-fingerprint svg {
  width: 26px;
  height: 26px;
  animation: loginFingerprintPulse 2.6s ease-in-out infinite;
}
#screen-login .login-fingerprint__scanline {
  position: absolute;
  left: 6px;
  right: 6px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--coral, #ff6b57), transparent);
  opacity: .85;
  animation: loginFingerprintScan 2.6s ease-in-out infinite;
}
@keyframes loginFingerprintPulse {
  0%, 100% { opacity: .75; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.06); }
}
@keyframes loginFingerprintScan {
  0% { top: 8px; opacity: 0; }
  15% { opacity: .85; }
  50% { top: 38px; opacity: .85; }
  85% { opacity: 0; }
  100% { top: 8px; opacity: 0; }
}

#screen-login .login-version {
  margin: 10px 0 0;
  color: var(--ink-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  line-height: 1.4;
  text-align: center;
  text-transform: uppercase;
}

#screen-login .login-form {
  display: grid;
  gap: 18px;
  margin: 29px 0 0;
}

#screen-login .login-form .form-group {
  display: grid;
  gap: 8px;
  margin: 0;
}

#screen-login .login-form .form-group label {
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

#screen-login .login-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 56px;
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

#screen-login .login-input-wrap:focus-within {
  border-color: var(--coral);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(255, 107, 87, .13);
}

#screen-login .login-input-icon {
  position: absolute;
  left: 17px;
  z-index: 1;
  width: 19px;
  height: 19px;
  color: var(--blue-gray);
  pointer-events: none;
}

#screen-login .login-input-wrap input {
  width: 100%;
  min-height: 54px;
  padding: 14px 52px 14px 49px;
  border: 0;
  border-radius: 15px;
  outline: 0;
  color: var(--ink);
  background: transparent;
  box-shadow: none;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  text-align: start;
}

#screen-login .login-input-wrap input:focus {
  border: 0;
  box-shadow: none;
}

#screen-login .login-input-wrap input::placeholder {
  color: var(--ink-muted);
  font-weight: 500;
}

#screen-login .login-pw-toggle {
  position: absolute;
  right: 9px;
  z-index: 2;
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  border-radius: 11px;
  color: var(--blue-gray);
  transition: background 160ms ease, color 160ms ease;
}

#screen-login .login-pw-toggle:hover {
  color: var(--navy);
  background: var(--surface-blue);
}

#screen-login .login-pw-toggle:focus-visible {
  outline: 3px solid rgba(255, 107, 87, .45);
  outline-offset: 1px;
}

#screen-login .login-pw-toggle svg {
  width: 19px;
  height: 19px;
}

#screen-login .login-error {
  margin: -2px 0 0;
  padding: 11px 13px;
  border: 1px solid rgba(214, 76, 76, .24);
  border-radius: 13px;
  color: #b84242;
  background: #fff1f0;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}

#screen-login .login-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  margin: 3px 0 0;
  border: 1px solid var(--coral);
  border-radius: 16px;
  background: var(--coral);
  box-shadow: 0 12px 22px rgba(255, 107, 87, .24);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

#screen-login .login-btn:hover:not(:disabled) {
  border-color: var(--coral-hover);
  background: var(--coral-hover);
  box-shadow: 0 15px 25px rgba(255, 107, 87, .30);
  transform: translateY(-1px);
}

#screen-login .login-btn:active:not(:disabled) {
  box-shadow: 0 8px 16px rgba(255, 107, 87, .22);
  transform: translateY(0);
}

#screen-login .login-btn:disabled {
  cursor: progress;
  opacity: .72;
  transform: none;
}

#screen-login .login-btn.is-loading {
  gap: 10px;
  pointer-events: none;
}

#screen-login .login-btn__spinner {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  border: 2px solid rgba(255, 255, 255, .38);
  border-top-color: #fff;
  border-radius: 50%;
  animation: login-button-spin .7s linear infinite;
}

@keyframes login-button-spin {
  to { transform: rotate(360deg); }
}

#screen-login .login-btn svg {
  width: 20px;
  height: 20px;
}

#screen-login .login-brand {
  align-self: end;
  margin: 22px 0 0;
  color: var(--ink-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  line-height: 1.3;
  text-align: center;
  text-transform: uppercase;
}

html[dir='rtl'] #screen-login .login-input-icon {
  right: 17px;
  left: auto;
}

html[dir='rtl'] #screen-login .login-input-wrap input {
  padding-right: 49px;
  padding-left: 52px;
}

html[dir='rtl'] #screen-login .login-pw-toggle {
  right: auto;
  left: 9px;
}

@media (max-width: 480px) {
  #screen-login .login-wrap {
    padding: max(20px, env(safe-area-inset-top, 0px)) 15px max(16px, env(safe-area-inset-bottom, 0px));
  }

  #screen-login .login-container {
    padding: 27px 20px 23px;
    border-radius: 24px;
  }

  #screen-login .login-container::before {
    right: 30px;
    left: 30px;
    height: 3px;
  }

  #screen-login .login-logo-wrap,
  #screen-login .login-logo {
    width: 66px;
    height: 66px;
  }

  #screen-login .login-logo-wrap { margin-bottom: 16px; }
  #screen-login .login-logo { border-radius: 19px; }
  #screen-login .login-logo img { width: 49px; height: 49px; }
  #screen-login .login-logo-ring { inset: -6px; border-radius: 21px; }
  #screen-login .login-title { font-size: 25px; }
  #screen-login .login-subtitle { font-size: 12px; }
  #screen-login .login-form { gap: 15px; margin-top: 24px; }
  #screen-login .login-input-wrap { min-height: 53px; border-radius: 15px; }
  #screen-login .login-input-wrap input { min-height: 51px; padding-top: 12px; padding-bottom: 12px; font-size: 13px; }
  #screen-login .login-btn { min-height: 53px; border-radius: 15px; }
  #screen-login .login-brand { margin-top: 16px; }
}

@media (max-height: 650px) and (max-width: 859px) {
  #screen-login .login-wrap { align-items: start; }
  #screen-login .login-container { margin-top: 0; }
  #screen-login .login-logo-wrap { margin-bottom: 12px; transform: scale(.88); transform-origin: bottom center; }
  #screen-login .login-form { margin-top: 19px; gap: 13px; }
  #screen-login .login-brand { margin-top: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  #screen-login .login-input-wrap,
  #screen-login .login-pw-toggle,
  #screen-login .login-btn {
    transition: none;
  }
  #screen-login .login-btn__spinner { animation-duration: 1ms; animation-iteration-count: 1; }
}
