/* ============================================================
   NSD — Ultra-Premium Executive Login Portal
   Higher Education Authority of Zambia (HEA)
   Theme: Deep Imperial Sapphire, Lusaka Gold & Frosted Crystal Glass
   ============================================================ */

/* ── Full Viewport Canvas ──────────────────────────────────── */
.nsd-login-viewport {
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 3vh, 36px) clamp(12px, 3vw, 24px);
  background: radial-gradient(circle at 20% 25%, #0e4c9f 0%, #083477 45%, #031c44 85%);
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  color: #0f172a;
  -webkit-overflow-scrolling: touch;
}

/* ── Animated Background Glow Meshes ───────────────────────── */
.nsd-login-mesh-1 {
  position: absolute;
  top: -100px;
  left: -80px;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.35) 0%, rgba(30, 64, 175, 0.1) 50%, transparent 70%);
  filter: blur(60px);
  pointer-events: none;
  animation: nsdPulseGlow 10s ease-in-out infinite alternate;
}

.nsd-login-mesh-2 {
  position: absolute;
  bottom: -120px;
  right: -80px;
  width: 580px;
  height: 580px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.22) 0%, rgba(217, 119, 6, 0.08) 50%, transparent 70%);
  filter: blur(70px);
  pointer-events: none;
  animation: nsdPulseGlow 12s ease-in-out infinite alternate-reverse;
}

.nsd-login-stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: 
    radial-gradient(1.5px 1.5px at 20% 30%, rgba(245, 158, 11, 0.5) 100%, transparent),
    radial-gradient(1.5px 1.5px at 80% 20%, rgba(255, 255, 255, 0.4) 100%, transparent),
    radial-gradient(2px 2px at 40% 80%, rgba(147, 197, 253, 0.45) 100%, transparent),
    radial-gradient(1px 1px at 70% 75%, rgba(245, 158, 11, 0.4) 100%, transparent),
    radial-gradient(2px 2px at 90% 60%, rgba(255, 255, 255, 0.35) 100%, transparent),
    radial-gradient(1.5px 1.5px at 10% 70%, rgba(255, 255, 255, 0.3) 100%, transparent);
}

@keyframes nsdPulseGlow {
  0%   { transform: scale(1) translate(0, 0); opacity: 0.85; }
  100% { transform: scale(1.15) translate(30px, 20px); opacity: 1; }
}

/* ── Dual-Panel Executive Container ────────────────────────── */
.nsd-login-container {
  width: 100%;
  max-width: 1060px;
  margin: auto;
  min-height: auto;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border-radius: clamp(18px, 2.5vw, 28px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 
    0 25px 60px -15px rgba(0, 0, 0, 0.6),
    0 0 50px rgba(14, 76, 159, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  overflow: hidden;
  position: relative;
  z-index: 10;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

/* ── LEFT PANEL: Institutional Branding ────────────────────── */
.nsd-brand-panel {
  position: relative;
  background: linear-gradient(145deg, rgba(7, 43, 98, 0.95) 0%, rgba(3, 28, 68, 0.98) 100%);
  padding: clamp(24px, 3.5vw, 44px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  box-sizing: border-box;
}

.nsd-brand-panel::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -80px;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.16), transparent 70%);
  filter: blur(40px);
  pointer-events: none;
}

.nsd-brand-panel-inner {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: clamp(16px, 2.5vh, 28px);
  box-sizing: border-box;
}

/* National Badge */
.nsd-national-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 999px;
  padding: 6px 14px;
  width: fit-content;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.zambia-flag { font-size: 14px; }
.zambia-pill-text {
  color: #f59e0b;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}
.zambia-dot { color: rgba(255, 255, 255, 0.3); font-size: 10px; }
.zambia-sub { color: rgba(255, 255, 255, 0.75); font-size: 10.5px; font-weight: 500; }

/* Hero Orbital Emblem */
.nsd-hero-emblem-wrap {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 4px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nsd-hero-orbit-outer {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  border-top-color: #f59e0b;
  border-right-color: #3b82f6;
  animation: nsdSpinOrbit 8s linear infinite;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.25);
}

.nsd-hero-orbit-badge {
  position: absolute;
  top: 50%;
  left: -8px;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  background: #f59e0b;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px #f59e0b;
}

.nsd-hero-orbit-badge svg {
  width: 9px;
  height: 9px;
  color: #031c44;
}

.nsd-hero-orbit-inner {
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  animation: nsdSpinOrbitRev 12s linear infinite;
}

.nsd-hero-logo-disc {
  position: relative;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffffff 0%, #f8fafc 85%, #e2e8f0 100%);
  border: 3px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 35px rgba(30, 64, 175, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.nsd-hero-logo-disc img {
  width: 84%;
  height: 84%;
  object-fit: contain;
  border-radius: 50%;
}

@keyframes nsdSpinOrbit {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes nsdSpinOrbitRev {
  0%   { transform: rotate(360deg); }
  100% { transform: rotate(0deg); }
}

/* Brand Meta */
.nsd-brand-meta {
  margin-top: -6px;
}

.nsd-authority-title {
  display: block;
  color: #f59e0b;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.nsd-system-name {
  color: #ffffff;
  font-family: 'Outfit', sans-serif;
  font-size: 27px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.4px;
  margin-bottom: 6px;
}

.nsd-system-tagline {
  color: #93c5fd;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.2px;
  opacity: 0.95;
}

/* Feature Showcase Grid */
.nsd-feature-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nsd-feature-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 10px 14px;
  transition: all 0.25s ease;
}

.nsd-feature-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(245, 158, 11, 0.3);
  transform: translateX(4px);
}

.nsd-feat-icon {
  font-size: 18px;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nsd-feat-text {
  display: flex;
  flex-direction: column;
}

.nsd-feat-text strong {
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.nsd-feat-text span {
  color: rgba(255, 255, 255, 0.65);
  font-size: 11px;
  line-height: 1.3;
}

/* Legal Quote */
.nsd-legal-quote {
  border-left: 2px solid #f59e0b;
  padding-left: 14px;
  margin-top: 4px;
}

.nsd-legal-quote p {
  color: rgba(255, 255, 255, 0.85);
  font-size: 11.5px;
  font-style: italic;
  line-height: 1.45;
  margin-bottom: 4px;
}

.quote-cite {
  color: #f59e0b;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

/* ── RIGHT PANEL: Authentication Form ─────────────────────── */
.nsd-auth-panel {
  background: rgba(255, 255, 255, 0.98);
  padding: clamp(24px, 3.5vw, 44px) clamp(20px, 3.2vw, 40px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-radius: 0 clamp(18px, 2.5vw, 28px) clamp(18px, 2.5vw, 28px) 0;
  box-sizing: border-box;
}

.nsd-auth-panel-inner {
  width: 100%;
  max-width: 390px;
  margin: 0 auto;
  box-sizing: border-box;
}

.nsd-auth-header {
  margin-bottom: 24px;
}

.nsd-security-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 4px 10px;
  color: #475569;
  font-size: 10.5px;
  font-weight: 600;
  margin-bottom: 12px;
}

.sec-dot {
  width: 6px;
  height: 6px;
  background: #10b981;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}

.nsd-auth-header h2 {
  color: #0f172a;
  font-family: 'Outfit', sans-serif;
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -0.4px;
  margin-bottom: 6px;
}

.nsd-auth-subtitle {
  color: #64748b;
  font-size: 12.5px;
  line-height: 1.45;
}

/* Form Fields */
.nsd-auth-form {
  display: flex;
  flex-direction: column;
}

.nsd-field-group {
  margin-bottom: 18px;
}

.nsd-field-group label {
  display: block;
  color: #1e293b;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
  margin-bottom: 6px;
}

.nsd-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.nsd-label-row label {
  margin-bottom: 0;
}

.nsd-forgot-link {
  color: #2563eb;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s;
}

.nsd-forgot-link:hover {
  color: #1e40af;
  text-decoration: underline;
}

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

.nsd-input-icon {
  position: absolute;
  left: 14px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  pointer-events: none;
  transition: color 0.2s;
}

.nsd-input-wrap input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  font-size: 13px;
  font-family: inherit;
  color: #0f172a;
  background: #ffffff;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nsd-input-wrap input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3.5px rgba(37, 99, 235, 0.12);
}

.nsd-input-wrap:focus-within .nsd-input-icon {
  color: #2563eb;
}

.nsd-input-wrap input::placeholder {
  color: #94a3b8;
  font-size: 12.5px;
}

.nsd-toggle-pw {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  padding: 4px;
  color: #94a3b8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: color 0.2s;
}

.nsd-toggle-pw:hover {
  color: #0f172a;
}

.nsd-input-hint {
  display: block;
  color: #94a3b8;
  font-size: 10.5px;
  margin-top: 4px;
}

/* Submit Button */
.nsd-btn-signin {
  width: 100%;
  padding: 13px 20px;
  background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 10px 24px -4px rgba(37, 99, 235, 0.45);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  margin-top: 4px;
}

.nsd-btn-signin:hover {
  background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 100%);
  box-shadow: 0 14px 28px -4px rgba(37, 99, 235, 0.55);
  transform: translateY(-1.5px);
}

.nsd-btn-signin:active {
  transform: translateY(0);
}

.nsd-btn-signin:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.nsd-arrow-icon {
  transition: transform 0.2s ease;
}

.nsd-btn-signin:hover .nsd-arrow-icon {
  transform: translateX(3px);
}

/* Error Notice */
.login-error {
  margin-top: 12px;
  padding: 10px 14px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 10px;
  color: #dc2626;
  font-size: 11.5px;
  font-weight: 600;
  display: none;
  animation: nsdShake 0.3s ease;
}

@keyframes nsdShake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-4px); }
  75%      { transform: translateX(4px); }
}

/* Footer Support Box */
.nsd-auth-footer {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid #f1f5f9;
}

.nsd-support-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 14px;
}

.nsd-support-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.nsd-support-text {
  display: flex;
  flex-direction: column;
}

.nsd-support-text span {
  color: #64748b;
  font-size: 11px;
}

.nsd-contact-email {
  color: #1e40af;
  font-weight: 700;
  font-size: 11px;
  text-decoration: none;
}

.nsd-contact-email:hover {
  text-decoration: underline;
}

.nsd-footer-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 500;
  text-align: center;
}

.nsd-sep { opacity: 0.5; }

/* ── Responsive Adaptations across all devices ──────────────── */

/* Low-height screens (Laptops 1366x768, landscape tablets & phones, browser zoom) */
@media (max-height: 780px) {
  .nsd-login-viewport {
    padding: 14px 12px;
    align-items: flex-start;
  }
  .nsd-login-container {
    margin: 8px auto 20px;
  }
  .nsd-brand-panel, .nsd-auth-panel {
    padding: clamp(16px, 2.5vh, 28px) clamp(18px, 2.5vw, 32px);
  }
  .nsd-brand-panel-inner {
    gap: 12px;
  }
  .nsd-hero-emblem-wrap {
    width: 76px;
    height: 76px;
    margin: 0;
  }
  .nsd-hero-logo-disc {
    width: 56px;
    height: 56px;
  }
  .nsd-system-name {
    font-size: 20px;
    margin: 4px 0 2px;
  }
  .nsd-feature-grid {
    gap: 8px;
  }
  .nsd-feature-item {
    padding: 6px 10px;
  }
  .nsd-legal-quote {
    display: none; /* Hide quote on low-height screens to prevent pushing sign-in button down */
  }
  .nsd-auth-header {
    margin-bottom: 14px;
  }
  .nsd-field-group {
    margin-bottom: 12px;
  }
  .nsd-auth-footer {
    margin-top: 16px;
    padding-top: 12px;
  }
  .nsd-support-box {
    margin-bottom: 8px;
    padding: 8px 10px;
  }
}

/* Tablets and small laptops (max-width: 960px) */
@media (max-width: 960px) {
  .nsd-login-viewport {
    padding: 16px 12px;
    align-items: flex-start;
  }
  .nsd-login-container {
    grid-template-columns: 1fr;
    max-width: 540px;
    border-radius: 20px;
    margin: 10px auto 24px;
  }
  .nsd-brand-panel {
    border-radius: 20px 20px 0 0;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 24px 22px;
  }
  .nsd-brand-panel-inner {
    gap: 16px;
  }
  .nsd-feature-grid {
    display: none; /* Keep stacked view compact & focused */
  }
  .nsd-legal-quote {
    display: none;
  }
  .nsd-hero-emblem-wrap {
    width: 80px;
    height: 80px;
    margin: 0;
  }
  .nsd-hero-logo-disc {
    width: 60px;
    height: 60px;
  }
  .nsd-system-name {
    font-size: 22px;
  }
  .nsd-auth-panel {
    border-radius: 0 0 20px 20px;
    padding: 28px 24px;
  }
}

/* Mobile phones (max-width: 480px) */
@media (max-width: 480px) {
  .nsd-login-viewport {
    padding: 8px 8px 24px;
    align-items: flex-start;
  }
  .nsd-login-container {
    max-width: 100%;
    border-radius: 16px;
    margin: 6px auto 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  }
  .nsd-brand-panel {
    border-radius: 16px 16px 0 0;
    padding: 18px 16px;
  }
  .nsd-auth-panel {
    border-radius: 0 0 16px 16px;
    padding: 22px 16px;
  }
  .nsd-auth-header h2 {
    font-size: 21px;
  }
  .nsd-btn-signin {
    padding: 12px 14px;
    font-size: 14px;
  }
  .nsd-support-box {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}
