:root { color-scheme: light; }
/* ── Base reset ──────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, sans-serif;
  background: linear-gradient(135deg, #eef2ff 0%, #f0fdf4 100%);
  min-height: 100vh;
}

/* ── Root container ─────────────────────────────────────────────── */
.login-root {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  gap: 1.5rem;
}

/* ── Loading spinner ────────────────────────────────────────────── */
.portal-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #d1d9ff;
  border-top-color: #4f6ef7;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ── Login card ─────────────────────────────────────────────────── */
.login-card {
  background: #fff;
  border-radius: 24px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 8px 40px rgba(79, 110, 247, 0.12), 0 2px 8px rgba(0,0,0,.06);
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

/* ── Brand header ───────────────────────────────────────────────── */
.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  text-align: center;
}

.login-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
}

.login-institute-name {
  font-size: 1.6rem;
  font-weight: 700;
  color: #1a1f36;
  letter-spacing: -0.4px;
}

.login-tagline {
  font-size: 0.9rem;
  color: #6b7280;
}

/* ── Form ───────────────────────────────────────────────────────── */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.login-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #374151;
  letter-spacing: 0.02em;
}

.login-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.login-input {
  width: 100%;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  padding: 0.7rem 1rem;
  font-size: 0.97rem;
  color: #1a1f36;
  background: #f9fafb;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}

.login-input:focus {
  border-color: #4f6ef7;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(79, 110, 247, 0.12);
}

.login-input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* password field — make room for the eye button */
.login-input-wrap .login-input {
  padding-right: 2.8rem;
}

.login-eye {
  position: absolute;
  right: 0.75rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  line-height: 0;
  color: #9ca3af;
  transition: color 0.15s;
}

.login-eye:hover { color: #4f6ef7; }

.login-eye svg {
  width: 18px;
  height: 18px;
}

/* ── Error banner ───────────────────────────────────────────────── */
.login-error {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #fff1f2;
  border: 1px solid #fecdd3;
  border-radius: 8px;
  padding: 0.65rem 0.9rem;
  font-size: 0.87rem;
  color: #be123c;
  line-height: 1.4;
}

.login-error svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  stroke: #be123c;
}

/* ── Submit button ──────────────────────────────────────────────── */
.login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.8rem 1rem;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #4f6ef7 0%, #7c3aed 100%);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.18s, transform 0.15s;
  margin-top: 0.25rem;
}

.login-btn:hover:not(:disabled) {
  opacity: 0.92;
  transform: translateY(-1px);
}

.login-btn:active:not(:disabled) {
  transform: translateY(0);
}

.login-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* inline spinner inside the button */
.login-btn-spinner {
  width: 16px;
  height: 16px;
  border: 2.5px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

/* ── Footer note inside card ────────────────────────────────────── */
.login-footer-note {
  font-size: 0.78rem;
  color: #9ca3af;
  text-align: center;
  line-height: 1.5;
}

/* ── Page footer ────────────────────────────────────────────────── */
.portal-footer {
  font-size: 0.8rem;
  color: #9ca3af;
}

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .login-card {
    padding: 2rem 1.4rem;
    border-radius: 18px;
  }

  .login-institute-name { font-size: 1.35rem; }
}

