/* Login — Amanah Jeddah branded entry */

.is-login-page .app-main,
body.is-login-page {
  margin: 0;
  min-height: 100dvh;
  font-family: "Almarai", Tahoma, sans-serif;
}

.login-page {
  position: relative;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.25rem, 4vw, 2.5rem);
  color: #1e3a5f;
  overflow: hidden;
}

.login-atmosphere {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 85% 10%, rgba(70, 102, 145, 0.28), transparent 55%),
    radial-gradient(ellipse 70% 50% at 10% 90%, rgba(13, 110, 110, 0.22), transparent 50%),
    linear-gradient(160deg, #e8eef5 0%, #f4f7fa 45%, #e6f0f0 100%);
  z-index: 0;
}

.login-atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(30, 58, 95, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30, 58, 95, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 45%, #000 20%, transparent 75%);
  pointer-events: none;
}

.login-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 440px);
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  animation: loginIn 0.45s ease both;
}

@keyframes loginIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.login-brand {
  text-align: center;
}

.login-logo {
  width: min(72vw, 168px);
  height: auto;
  display: block;
  margin: 0 auto 0.85rem;
  filter: drop-shadow(0 8px 20px rgba(30, 58, 95, 0.12));
}

.login-brand-name {
  margin: 0;
  font-size: clamp(1.35rem, 3.5vw, 1.75rem);
  font-weight: 800;
  color: #1e3a5f;
  letter-spacing: -0.02em;
}

.login-brand-tag {
  margin: 0.35rem 0 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #64748b;
}

.login-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #d7e3ee;
  border-radius: 18px;
  padding: 1.45rem 1.35rem 1.5rem;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.1);
  backdrop-filter: blur(8px);
}

.login-card-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  color: #1e3a5f;
  text-align: center;
}

.login-card-lead {
  margin: 0.35rem 0 1.15rem;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 700;
  color: #64748b;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0;
}

.login-field > span:first-child {
  font-size: 0.84rem;
  font-weight: 800;
  color: #466691;
}

.login-field input {
  width: 100%;
  min-height: 46px;
  border: 1px solid #d5dee6;
  border-radius: 12px;
  padding: 0.65rem 0.9rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: #1e3a5f;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.login-field input:focus {
  outline: none;
  border-color: #466691;
  box-shadow: 0 0 0 3px rgba(70, 102, 145, 0.18);
}

.login-field input::placeholder {
  color: #94a3b8;
  font-weight: 600;
}

.login-field-err {
  font-size: 0.78rem;
  font-weight: 700;
  color: #dc2626;
  min-height: 1em;
}

.login-remember {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.15rem 0 0;
  font-size: 0.86rem;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
}

.login-remember input {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: #466691;
}

.login-submit {
  margin-top: 0.35rem;
  min-height: 48px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #5476a3 0%, #466691 100%);
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(70, 102, 145, 0.28);
  transition: filter 0.15s ease, transform 0.15s ease;
}

.login-submit:hover {
  filter: brightness(1.05);
}

.login-submit:active {
  transform: translateY(1px);
}

.login-alert {
  margin: 0;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 0.86rem;
  font-weight: 700;
  list-style: none;
}

.login-alert:empty {
  display: none;
}

.login-alert ul {
  margin: 0;
  padding: 0 1rem 0 0;
}

@media (max-width: 480px) {
  .login-card {
    padding: 1.2rem 1rem 1.25rem;
  }
}

.login-loader {
  position: fixed;
  inset: 0;
  z-index: 6000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(3px);
}

.login-loader.d-none { display: none !important; }

.login-loader-card {
  min-width: min(92vw, 300px);
  background: #fff;
  border-radius: 16px;
  padding: 1.5rem 1.35rem;
  text-align: center;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.22);
  direction: rtl;
}

.login-loader-spinner {
  width: 48px;
  height: 48px;
  margin: 0 auto 0.9rem;
  border: 4px solid #e2e8f0;
  border-top-color: #466691;
  border-radius: 50%;
  animation: loginSpin 0.75s linear infinite;
}

.login-loader-card strong {
  display: block;
  font-size: 1.05rem;
  font-weight: 800;
  color: #1e3a5f;
  margin-bottom: 0.3rem;
}

.login-loader-card p {
  margin: 0;
  color: #64748b;
  font-weight: 700;
  font-size: 0.88rem;
}

@keyframes loginSpin {
  to { transform: rotate(360deg); }
}

.login-toast {
  position: fixed;
  z-index: 6100;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  width: min(92vw, 420px);
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.85rem 0.95rem;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #fecaca;
  box-shadow: 0 14px 36px rgba(185, 28, 28, 0.18);
  direction: rtl;
  animation: loginToastIn 0.25s ease;
}

.login-toast.d-none { display: none !important; }

@keyframes loginToastIn {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.login-toast-ico {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fef2f2;
  color: #dc2626;
  font-weight: 800;
  font-size: 1.1rem;
}

.login-toast-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.login-toast-body strong {
  font-size: 0.92rem;
  font-weight: 800;
  color: #991b1b;
}

.login-toast-body span {
  font-size: 0.84rem;
  font-weight: 700;
  color: #7f1d1d;
  line-height: 1.45;
}

.login-toast-close {
  border: 0;
  background: transparent;
  color: #94a3b8;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.15rem;
}

.login-toast-close:hover { color: #475569; }
