/* Login modal + form — scoped so page CSS cannot flatten the layout */

.login-modal.modal {
  position: fixed;
  inset: 0;
  z-index: 210;
  background: rgba(6, 4, 20, 0.86);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-modal-card.modal-card {
  background: linear-gradient(165deg, #17124e, #0f0b34);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  width: min(420px, 100%);
  padding: 28px 26px 24px;
  position: relative;
  box-shadow: 0 40px 90px -30px #000;
  animation: login-pop 0.3s ease;
  max-height: min(92vh, 640px);
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
}

.login-modal-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  margin: 0 0 16px;
  padding-right: 24px;
}

.login-modal-brand img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  display: block;
}

.login-modal-brand .login-modal-title {
  margin: 0;
  font-family: "Chakra Petch", system-ui, sans-serif;
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  color: #fff;
  line-height: 1.15;
}

.login-modal-brand .login-modal-tag {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #a7afd8;
  font-weight: 600;
  font-family: "Chakra Petch", system-ui, sans-serif;
}

.login-modal-card h3 {
  font-family: "Chakra Petch", system-ui, sans-serif;
  font-size: 1.45rem;
  color: #fff;
  font-weight: 700;
  margin: 0 0 6px;
  text-align: center;
}

.login-modal-card .msub {
  color: #a7afd8;
  font-size: 0.92rem;
  margin: 0 0 20px;
  text-align: center;
  line-height: 1.45;
}

.login-modal-card .m-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 0;
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
  transition: background 0.2s;
  z-index: 2;
}

.login-modal-card .m-close:hover {
  background: var(--rubber, #ec1740);
}

.login-modal .login-form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  max-width: none;
}

.login-modal .login-form .login-lead {
  display: none;
}

.login-modal .login-form label {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  width: 100%;
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: "Chakra Petch", system-ui, sans-serif;
  color: #c2c9ef;
}

.login-modal .login-form input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: 46px;
  margin: 0;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(13, 9, 41, 0.85);
  color: #e9ecff;
  padding: 0 14px;
  font: inherit;
  font-size: 0.98rem;
}

.login-modal .login-form input:focus {
  outline: 2px solid #ff5a1f;
  outline-offset: 2px;
  border-color: transparent;
}

.login-modal .login-form .login-err {
  margin: 0;
  color: #ff8fa3;
  font-weight: 600;
  font-size: 0.92rem;
  text-align: center;
}

.login-modal .login-submit {
  box-sizing: border-box;
  width: 100%;
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "Chakra Petch", system-ui, sans-serif;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.92em 1.7em;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  background: var(--rubber, #ec1740);
  color: #fff;
  box-shadow: 0 10px 30px -8px rgba(236, 23, 64, 0.6);
}

.login-modal .login-submit:disabled {
  opacity: 0.6;
  cursor: wait;
}

.login-modal .login-submit:hover:not(:disabled) {
  transform: translateY(-2px);
}

@keyframes login-pop {
  from {
    transform: scale(0.94);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Backdrop when /login is opened directly (e.g. from /admin redirect) */
.login-route {
  min-height: calc(100svh - 120px);
  background: radial-gradient(120% 80% at 50% 0%, #1a1550 0%, #07060f 55%, #05040c 100%);
}
