/* Global reset removed to avoid conflicts with Bootstrap */

body {
  font-family: 'Inter', sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  position: relative;
  overflow-x: hidden; /* Fixed: Prevent horizontal scroll */
  overflow-y: auto; /* Allow vertical scrolling if needed */
}

/* Animated background blobs */
body::before,
body::after {
  content: '';
  position: fixed; /* Changed from absolute to fixed */
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.3;
  animation: float 20s ease-in-out infinite;
  z-index: 0;
}

body::before {
  width: 300px;
  height: 300px;
  background: #ff7a00;
  top: -80px;
  left: -80px;
  animation-delay: -5s;
}

body::after {
  width: 350px;
  height: 350px;
  background: #ffd700;
  bottom: -100px;
  right: -100px;
}

@keyframes float {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  33% {
    transform: translate(50px, -50px) scale(1.1);
  }

  66% {
    transform: translate(-30px, 30px) scale(0.9);
  }
}

.login-container {
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 1;
}

.login-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 30px 30px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.5);
  animation: slideUp 0.6s ease-out;
  width: 100%; /* Ensure card doesn't overflow */
  max-width: 100%; /* Prevent overflow */
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.logo-container {
  text-align: center;
  margin-bottom: 20px;
}

.logo {
  width: 65px;
  height: 65px;
  background: linear-gradient(135deg, #ff7b002b, #ff9500b3);
  border-radius: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  box-shadow: 0 8px 24px rgba(255, 122, 0, 0.4);
  animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

.logo img {
  height: 55px;
  margin-left: 1px;
  filter: brightness(0) invert(-1);
  max-width: 100%; /* Prevent image overflow */
  object-fit: contain; /* Maintain aspect ratio */
}

.logo-container h1 {
  font-size: 25px;
  font-weight: 700;
  color: #f87218ea;
  margin-bottom: 6px;
  word-wrap: break-word; /* Prevent text overflow */
}

.form-label {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
}

.form-control {
  padding: 10px 14px;
  font-size: 15px;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  background: #f9fafb;
  transition: all 0.3s ease;
  width: 100%;
  max-width: 100%; /* Prevent input overflow */
  box-sizing: border-box; /* Include padding in width calculation */
}

.form-control:focus {
  border-color: #ff7a00;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(255, 122, 0, 0.1);
  transform: translateY(-2px);
}

.input-wrapper {
  position: relative;
  width: 100%;
}

#password {
  padding-right: 45px;
}

.password-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  opacity: 0.5;
  transition: opacity 0.3s;
  padding: 4px;
  z-index: 10;
}

.password-toggle:hover {
  opacity: 1;
}

.remember-forgot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  margin-bottom: 20px;
  gap: 10px; /* Add gap for small screens */
  flex-wrap: wrap; /* Allow wrapping on very small screens */
}

.form-check-label {
  color: #6b7280;
  font-size: 14px;
}

.form-check-input:checked {
  background-color: #ff7a00;
  border-color: #ff7a00;
}

.submit-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #ff7a00, #ff9500);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(255, 122, 0, 0.4);
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255, 122, 0, 0.5);
}

.submit-btn:active {
  transform: translateY(0);
}

/* Floating particles */
.particle {
  position: fixed; /* Changed from absolute to fixed */
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  animation: rise 15s ease-in infinite;
  z-index: 0;
  pointer-events: none; /* Prevent particles from blocking interactions */
}

.particle:nth-child(1) {
  width: 80px;
  height: 80px;
  left: 10%;
  animation-delay: 0s;
}

.particle:nth-child(2) {
  width: 60px;
  height: 60px;
  left: 20%;
  animation-delay: 2s;
}

.particle:nth-child(3) {
  width: 40px;
  height: 40px;
  left: 80%;
  animation-delay: 4s;
}

.particle:nth-child(4) {
  width: 100px;
  height: 100px;
  left: 70%;
  animation-delay: 1s;
}

.particle:nth-child(5) {
  width: 50px;
  height: 50px;
  left: 40%;
  animation-delay: 3s;
}

.particle:nth-child(6) {
  width: 70px;
  height: 70px;
  left: 60%;
  animation-delay: 5s;
}

.particle:nth-child(7) {
  width: 100px;
  height: 100px;
  left: 90%;
  bottom: 20%;
  animation-delay: 5s;
}

.particle:nth-child(8) {
  width: 100px;
  height: 100px;
  bottom: 20%;
  right: 80%;
  animation-delay: 5s;
}

@keyframes rise {
  0% {
    transform: translateY(0) scale(1);
    opacity: 0;
  }

  10% {
    opacity: 1;
  }

  90% {
    opacity: 1;
  }

  100% {
    transform: translateY(-70vh) scale(0);
    opacity: 0;
  }
}

/* Responsive design for small devices */
@media (max-width: 576px) {
  body {
    min-height: 100vh;
    padding: 20px 15px; /* Reduced padding for small screens */
    overflow-x: hidden;
  }

  .login-container {
    max-width: 100%; /* Use full width on mobile */
    padding: 0 5px; /* Add small horizontal padding */
  }

  .login-card {
    padding: 25px 20px; /* Reduced padding for small screens */
    border-radius: 16px; /* Slightly smaller radius */
  }

  .logo {
    width: 55px;
    height: 55px;
  }

  .logo img {
    height: 45px;
  }

  .logo-container h1 {
    font-size: 22px; /* Smaller heading on mobile */
  }

  .form-label {
    font-size: 13px;
  }

  .form-control {
    padding: 10px 12px;
    font-size: 14px; /* Slightly smaller font */
  }

  #password {
    padding-right: 40px; /* Less padding for toggle button */
  }

  .password-toggle {
    right: 10px;
    font-size: 16px;
  }

  .remember-forgot {
    font-size: 12px; /* Smaller font */
  }

  .submit-btn {
    padding: 12px;
    font-size: 15px;
  }

  /* Make particles smaller on mobile */
  .particle:nth-child(1) {
    width: 50px;
    height: 50px;
  }

  .particle:nth-child(2) {
    width: 40px;
    height: 40px;
  }

  .particle:nth-child(3) {
    width: 30px;
    height: 30px;
  }

  .particle:nth-child(4) {
    width: 60px;
    height: 60px;
  }

  .particle:nth-child(5) {
    width: 35px;
    height: 35px;
  }

  .particle:nth-child(6) {
    width: 45px;
    height: 45px;
  }

  .particle:nth-child(7) {
    width: 55px;
    height: 55px;
  }

  .particle:nth-child(8) {
    width: 55px;
    height: 55px;
  }

  /* Hide some particles on very small screens to reduce clutter */
  body::before,
  body::after {
    width: 200px;
    height: 200px;
  }
}

/* Extra small devices (phones in portrait, less than 400px) */
@media (max-width: 400px) {
  body {
    padding: 15px 10px;
  }

  .login-card {
    padding: 20px 18px;
  }

  .logo-container h1 {
    font-size: 20px;
  }

  .form-control {
    font-size: 14px;
    padding: 9px 10px;
  }

  .remember-forgot {
    font-size: 11px;
  }
}

/* Landscape orientation fix for mobile devices */
@media (max-height: 600px) and (orientation: landscape) {
  body {
    padding: 15px 20px;
    min-height: auto;
  }

  .login-card {
    padding: 20px 25px;
  }

  .logo-container {
    margin-bottom: 15px;
  }

  .logo {
    width: 50px;
    height: 50px;
  }

  .logo img {
    height: 40px;
  }
}