body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #4f76e8, #9fa2f7);
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.login-container {
  background: white;
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  width: 90%;
  max-width: 420px;
  box-sizing: border-box;
  transition: all 0.3s ease-in-out;
  display: flex;
  flex-direction: column;
  align-items: center;
}

h2 {
  color: #304ffe;
  margin-bottom: 1.5rem;
  text-align: center;
  font-size: 1.8rem;
  letter-spacing: 0.5px;
}

form {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.form-group {
  width: 100%;
  margin-bottom: 1rem;
}

/* --- Standard Inputs --- */
input[type=email],
input[type=password] {
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 1rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
  background: #fff;
  color: #333;
  box-sizing: border-box;
}

input[type=email]:focus,
input[type=password]:focus {
  border-color: #304ffe;
  outline: none;
}

input.invalid {
  border-color: #d32f2f;
  background-color: #fff5f5;
}

/* --- Submit Button --- */
input[type=submit] {
  margin-top: 1rem;
  background: #304ffe;
  color: white;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s ease-in-out;
  width: 100%;
  padding: 14px 16px;
  border-radius: 8px;
  font-size: 1rem;
  box-sizing: border-box;
}

input[type=submit]:hover {
  background: #1a3ef1;
}

/* --- Messages & Footer --- */
.error {
  color: #d32f2f;
  font-size: 0.9rem;
  margin-bottom: 10px;
  text-align: center;
}

.footer {
  margin-top: 1.5rem;
  text-align: center;
  color: #777;
  font-size: 0.85rem;
}

/* --- Bulletproof Password Eye Icon Styling --- */
.password-wrapper {
  position: relative;
  display: block; 
  width: 100%;
  margin-bottom: 15px;
}

.password-wrapper input {
  width: 100% !important;
  /* Top(14px), Right(45px - makes room for eye), Bottom(14px), Left(14px) */
  padding: 14px 45px 14px 14px !important; 
  margin: 0 !important; 
  box-sizing: border-box !important;
  
  /* Lock the height so toggling text/password NEVER resizes the box */
  height: 48px !important; 
  line-height: normal !important;
}

.toggle-password {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.toggle-password svg {
  width: 20px;
  height: 20px;
  stroke: #888;
  transition: stroke 0.2s ease;
}

.toggle-password:hover svg {
  stroke: #0d8abc; 
}

/* --- Mobile Responsiveness --- */
@media (max-width: 480px) {
  .login-container {
    padding: 1.5rem;
    border-radius: 0.75rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  input[type=email],
  input[type=password],
  input[type=submit] {
    font-size: 0.95rem;
    padding: 12px;
  }
  
  /* Keep password box height locked on mobile to prevent jump */
  .password-wrapper input {
    height: 44px !important;
  }
}